vnm.h
Go to the documentation of this file.
#ifndef _VNM_H_
#define _VNM_H_
#include <maloc/maloc_base.h>
int Vnm_sigInt(void);
void Vnm_sigIntSet(void);
void Vnm_sigIntClear(void);
int Vnm_jmpOk(void);
void Vnm_jmpOkSet(void);
void Vnm_jmpOkClear(void);
jmp_buf *Vnm_signalInit(void);
void Vnm_regHand(void);
void Vnm_sigHand(int num);
#define VPOW_SAFE(x,y) (Vnm_powsafe(x,y))
double Vnm_powsafe(double x, double y);
void Vnm_typeChk(void);
double Vnm_epsmac(void);
int Vnm_gentokens(char *buf, char **argv,
const int argvmax, const char *white, const char *comment);
#define VTIMERS 100
void Vnm_tstart(int timer, const char *name);
void Vnm_tstop(int timer, const char *name);
char *Vnm_getuser(char *user, int usermax);
char *Vnm_getos(char *os, int osmax);
char *Vnm_gethost(char *host, int hostmax);
char *Vnm_gethome(char *path, int pathmax);
char *Vnm_getcwd(char *path, int pathmax);
int Vnm_chdir(const char *path);
int Vnm_mkdir(const char *path);
int Vnm_system(const char *cmd);
int Vnm_systemBack(const char *cmd);
int Vnm_systemKill(const char *cmd);
int Vnm_exec(int argc, char **argv);
void Vnm_sleep(int nusecs);
int Vnm_ioTag(void);
int Vnm_nTags(void);
void Vnm_setIoTag(int myTag, int numTags);
FILE *Vnm_open(const int unit);
int Vnm_close(const int unit);
void Vnm_flush(const int unit);
void Vnm_redirect(const int flag);
void Vnm_print(const int unit, const char *format, ...);
void Vnm_tprint(const int unit, const char *format, ...);
void Vnm_qsort(int *u, int size);
void Vnm_qsortOrd(int *u, int *ord, int size);
void Vnm_dqsort(double *u, int size);
void Vnm_dqsortOrd(double *u, int *ord, int size);
#endif /* _VNM_H_ */
maloc_base.h
The base (or foundation) header for MALOC.
Vnm_mkdir
int Vnm_mkdir(const char *path)
Interact with the system to make a new directory.
Vnm_sigHand
void Vnm_sigHand(int num)
Handle events such as SIGINT. We must have first been registered with "Vnm_signalInit".
Vnm_close
int Vnm_close(const int unit)
Close an I/O console. We MUST NOT use VASSERT (or Vnm_print!) in this routine.
Vnm_getos
char * Vnm_getos(char *os, int osmax)
Ask the system for the operating system name.
Vnm_ioTag
int Vnm_ioTag(void)
Return my I/O tag.
Vnm_print
void Vnm_print(const int unit, const char *format,...)
External interface to the console i/o routine. We MUST NOT use VASSERT (or Vnm_print!...
Vnm_setIoTag
void Vnm_setIoTag(int myTag, int numTags)
Set my id.
Vnm_powsafe
double Vnm_powsafe(double x, double y)
A safe VPOW function (avoids division by zero).
Vnm_qsortOrd
void Vnm_qsortOrd(int *u, int *ord, int size)
Front-end to quick sort integer array from [-large] to [+large].
Vnm_nTags
int Vnm_nTags(void)
Return the total number of tags.
Vnm_sigIntClear
void Vnm_sigIntClear(void)
Signal and setjmp handling routine. Clear the signal interrupt flag.
Vnm_flush
void Vnm_flush(const int unit)
Attempt to flush the specified i/o stream. We MUST NOT use VASSERT (or Vnm_print!) in this routine.
Vnm_open
FILE * Vnm_open(const int unit)
Open an I/O console.
Vnm_sigInt
int Vnm_sigInt(void)
Signal and setjmp handling routine. Return the signal interrupt flag.
Vnm_system
int Vnm_system(const char *cmd)
An improved ANSI-C "system" call.
Vnm_exec
int Vnm_exec(int argc, char **argv)
An improved UNIX "exec" call. This routine does not return except on error.
Vnm_dqsortOrd
void Vnm_dqsortOrd(double *u, int *ord, int size)
Front-end to quick sort integer array from [-large] to [+large].
Vnm_jmpOkSet
void Vnm_jmpOkSet(void)
Signal and setjmp handling routine. Set the "okay-to-jump" flag.
Vnm_tstart
void Vnm_tstart(int timer, const char *name)
Starts the timer on the particular machine.
Vnm_gethost
char * Vnm_gethost(char *host, int hostmax)
Ask the system for the hostname.
Vnm_sleep
void Vnm_sleep(int nusecs)
Implement a sleep function with microsecond resolution.
Vnm_jmpOkClear
void Vnm_jmpOkClear(void)
Signal and setjmp handling routine. Clear the "okay-to-jump" flag.
Vnm_signalInit
jmp_buf * Vnm_signalInit(void)
Initialize the signal handling data structures.
Vnm_chdir
int Vnm_chdir(const char *path)
Interact with the system to change the working directory.
Vnm_typeChk
void Vnm_typeChk(void)
Check out the sizes of various datatypes.
Vnm_jmpOk
int Vnm_jmpOk(void)
Signal and setjmp handling routine. Return the "ok-to-jump" flag.
Vnm_tprint
void Vnm_tprint(const int unit, const char *format,...)
Add our ioTag to Vnm_print output. We MUST NOT use VASSERT (or Vnm_print!) in this routine.
Vnm_gethome
char * Vnm_gethome(char *path, int pathmax)
Ask the system for the home directory.
Vnm_epsmac
double Vnm_epsmac(void)
Computes the unit roundoff of the machine in single precision. This is defined as the smallest posi...
Vnm_systemBack
int Vnm_systemBack(const char *cmd)
A background variant of the ANSI-C "system" call.
Vnm_gentokens
int Vnm_gentokens(char *buf, char **argv, const int argvmax, const char *white, const char *comment)
Generate an [argv,argc] pair from a character string "buf" (assumed NULL-terminated) in which tokens ...
Vnm_systemKill
int Vnm_systemKill(const char *cmd)
Something like a UNIX "killall" call.
Vnm_qsort
void Vnm_qsort(int *u, int size)
Front-end to quick sort integer array from [-large] to [+large].
Vnm_sigIntSet
void Vnm_sigIntSet(void)
Signal and setjmp handling routine. Set the signal interrupt flag.
Vnm_redirect
void Vnm_redirect(const int flag)
Set/unset the redirect flag for UNIT zero. When redirected, I/O goes to the file: ${MCSH_HOME}/io....
Vnm_getcwd
char * Vnm_getcwd(char *path, int pathmax)
Ask the system for the current working directory.
Vnm_getuser
char * Vnm_getuser(char *user, int usermax)
Ask the system for the username.
Vnm_regHand
void Vnm_regHand(void)
Register the signal handler with the operating system.
Vnm_dqsort
void Vnm_dqsort(double *u, int size)
Front-end to quick sort integer array from [-large] to [+large].
Vnm_tstop
void Vnm_tstop(int timer, const char *name)
Stops the timer on the particular machine.