VIS

src/vm/vmVers.c File Reference

#include "vmInt.h"
Include dependency graph for vmVers.c:

Go to the source code of this file.

Defines

#define CUR_DATE   "<compile date not supplied>"
#define CUR_VER   "UC Berkeley, VIS Release 1.0"
#define LIBRARY   "/projects/vis/vis/common/vis_lib"

Functions

static char * DateReadFromDateString (char *datestr)
char * Vm_VisReadVersion (void)
char * Vm_VisObtainLibrary (void)
void Vm_VisInitPrintMore (void)
int Vm_VisEndPrintMore (void)

Variables

static char rcsid[] UNUSED = "$Id: vmVers.c,v 1.3 2002/09/08 21:47:31 fabio Exp $"

Define Documentation

#define CUR_DATE   "<compile date not supplied>"

Definition at line 40 of file vmVers.c.

#define CUR_VER   "UC Berkeley, VIS Release 1.0"

Definition at line 44 of file vmVers.c.

#define LIBRARY   "/projects/vis/vis/common/vis_lib"

Definition at line 48 of file vmVers.c.


Function Documentation

static char * DateReadFromDateString ( char *  datestr) [static]

AutomaticStart

Function********************************************************************

Synopsis [Returns the date in a brief format assuming its coming from the program `date'.]

Description [optional]

SideEffects []

Definition at line 182 of file vmVers.c.

{
  static char result[25];
  char        day[10];
  char        month[10];
  char        zone[10];
  char       *at;
  int         date;
  int         hour;
  int         minute;
  int         second;
  int         year;

  if (sscanf(datestr, "%s %s %2d %2d:%2d:%2d %s %4d",
             day, month, &date, &hour, &minute, &second, zone, &year) == 8) {
    if (hour >= 12) {
      if (hour >= 13) hour -= 12;
      at = "PM";
    }
    else {
      if (hour == 0) hour = 12;
      at = "AM";
    }
    (void) sprintf(result, "%d-%3s-%02d at %d:%02d %s", 
                   date, month, year % 100, hour, minute, at);
    return result;
  }
  else {
    return datestr;
  }
}

Here is the caller graph for this function:

int Vm_VisEndPrintMore ( void  )

Function********************************************************************

Synopsis [Stop piping stdout through the "more" command]

Description [This function is called to terminate piping stdout through "more". It is important to call Vm_VisEndPrintMore before exiting your function (preferably at the end of your printing; failing to do so will cause the stdin lines not to appear). The function returns a 0 if it fails.]

SideEffects []

SeeAlso [ Vm_VisInitPrintMore]

Definition at line 153 of file vmVers.c.

{
    if (vis_stdpipe != NIL(FILE)) {  
    (void) pclose(vis_stdpipe);
    return 1;
    }
    return 0;
}
void Vm_VisInitPrintMore ( void  )

Function********************************************************************

Synopsis [Start piping stdout through the "more" command]

Description [This function is called to initialize piping stdout through "more". It is important to call Vm_VisEndPrintMore before returning from your function and after calling Vm_VisInitPrintMore (preferably at the end of your printing; failing to do so will cause the stdin lines not to appear).]

SideEffects []

SeeAlso [ Vm_VisEndPrintMore]

Definition at line 133 of file vmVers.c.

{
    fflush(vis_stdout);
    vis_stdpipe = popen("more","w"); 
}
char* Vm_VisObtainLibrary ( void  )

Function********************************************************************

Synopsis [Returns the VIS library path.]

Description [Returns a string giving the directory which contains the standard VIS library. Used to find things like the default .visrc, the on-line help files, etc. It is the responsibility of the user to free the returned string.]

SideEffects []

SeeAlso [Vm_VisReadVersion]

Definition at line 105 of file vmVers.c.

{
  char * vis_lib_path;

  vis_lib_path = getenv("VIS_LIBRARY_PATH");
  if (vis_lib_path) {
    return util_tilde_expand(vis_lib_path);
  } else {
    return util_tilde_expand(LIBRARY);
  }
}

Here is the caller graph for this function:

char* Vm_VisReadVersion ( void  )

AutomaticEnd Function********************************************************************

Synopsis [Returns the current VIS version.]

Description [Returns a static string giving the VIS version and compile timestamp. The user should not free this string.]

SideEffects []

SeeAlso [Vm_VisObtainLibrary]

Definition at line 81 of file vmVers.c.

{
  static char version[1024];

  (void) sprintf(version, "%s (compiled %s)", CUR_VER, DateReadFromDateString(CUR_DATE));
  return version;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char rcsid [] UNUSED = "$Id: vmVers.c,v 1.3 2002/09/08 21:47:31 fabio Exp $" [static]

CFile***********************************************************************

FileName [vmVers.c]

PackageName [vm]

Synopsis [Supplies the compile date and version information.]

Author [Originated from SIS]

Copyright [Copyright (c) 1994-1996 The Regents of the Univ. of California. All rights reserved.

Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software.

IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.]

Definition at line 34 of file vmVers.c.