MALOC  0.1
vnm.h
Go to the documentation of this file.
1 
33 #ifndef _VNM_H_
34 #define _VNM_H_
35 
36 #include <maloc/maloc_base.h>
37 
38 
46 int Vnm_sigInt(void);
47 
55 void Vnm_sigIntSet(void);
56 
64 void Vnm_sigIntClear(void);
65 
73 int Vnm_jmpOk(void);
74 
82 void Vnm_jmpOkSet(void);
83 
91 void Vnm_jmpOkClear(void);
92 
100 jmp_buf *Vnm_signalInit(void);
101 
109 void Vnm_regHand(void);
110 
119 void Vnm_sigHand(int num);
120 
125 #define VPOW_SAFE(x,y) (Vnm_powsafe(x,y))
126 
136 double Vnm_powsafe(double x, double y);
137 
145 void Vnm_typeChk(void);
146 
160 double Vnm_epsmac(void);
161 
196 int Vnm_gentokens(char *buf, char **argv,
197  const int argvmax, const char *white, const char *comment);
198 
203 #define VTIMERS 100
204 
214 void Vnm_tstart(int timer, const char *name);
215 
225 void Vnm_tstop(int timer, const char *name);
226 
236 char *Vnm_getuser(char *user, int usermax);
237 
247 char *Vnm_getos(char *os, int osmax);
248 
258 char *Vnm_gethost(char *host, int hostmax);
259 
279 char *Vnm_gethome(char *path, int pathmax);
280 
297 char *Vnm_getcwd(char *path, int pathmax);
298 
307 int Vnm_chdir(const char *path);
308 
317 int Vnm_mkdir(const char *path);
318 
327 int Vnm_system(const char *cmd);
328 
337 int Vnm_systemBack(const char *cmd);
338 
347 int Vnm_systemKill(const char *cmd);
348 
359 int Vnm_exec(int argc, char **argv);
360 
371 void Vnm_sleep(int nusecs);
372 
380 int Vnm_ioTag(void);
381 
389 int Vnm_nTags(void);
390 
400 void Vnm_setIoTag(int myTag, int numTags);
401 
429 FILE *Vnm_open(const int unit);
430 
440 int Vnm_close(const int unit);
441 
451 void Vnm_flush(const int unit);
452 
463 void Vnm_redirect(const int flag);
464 
475 void Vnm_print(const int unit, const char *format, ...);
476 
490 void Vnm_tprint(const int unit, const char *format, ...);
491 
501 void Vnm_qsort(int *u, int size);
502 
513 void Vnm_qsortOrd(int *u, int *ord, int size);
514 
524 void Vnm_dqsort(double *u, int size);
525 
536 void Vnm_dqsortOrd(double *u, int *ord, int size);
537 
538 #endif /* _VNM_H_ */
539 
The base (or foundation) header for MALOC.
int Vnm_mkdir(const char *path)
Interact with the system to make a new directory.
void Vnm_sigHand(int num)
Handle events such as SIGINT. We must have first been registered with "Vnm_signalInit".
int Vnm_close(const int unit)
Close an I/O console. We MUST NOT use VASSERT (or Vnm_print!) in this routine.
int Vnm_ioTag(void)
Return my I/O tag.
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!...
void Vnm_setIoTag(int myTag, int numTags)
Set my id.
char * Vnm_getcwd(char *path, int pathmax)
Ask the system for the current working directory.
double Vnm_powsafe(double x, double y)
A safe VPOW function (avoids division by zero).
void Vnm_qsortOrd(int *u, int *ord, int size)
Front-end to quick sort integer array from [-large] to [+large].
int Vnm_nTags(void)
Return the total number of tags.
char * Vnm_getos(char *os, int osmax)
Ask the system for the operating system name.
char * Vnm_getuser(char *user, int usermax)
Ask the system for the username.
void Vnm_sigIntClear(void)
Signal and setjmp handling routine. Clear the signal interrupt flag.
FILE * Vnm_open(const int unit)
Open an I/O console.
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.
int Vnm_sigInt(void)
Signal and setjmp handling routine. Return the signal interrupt flag.
int Vnm_system(const char *cmd)
An improved ANSI-C "system" call.
int Vnm_exec(int argc, char **argv)
An improved UNIX "exec" call. This routine does not return except on error.
void Vnm_dqsortOrd(double *u, int *ord, int size)
Front-end to quick sort integer array from [-large] to [+large].
void Vnm_jmpOkSet(void)
Signal and setjmp handling routine. Set the "okay-to-jump" flag.
void Vnm_tstart(int timer, const char *name)
Starts the timer on the particular machine.
char * Vnm_gethome(char *path, int pathmax)
Ask the system for the home directory.
void Vnm_sleep(int nusecs)
Implement a sleep function with microsecond resolution.
void Vnm_jmpOkClear(void)
Signal and setjmp handling routine. Clear the "okay-to-jump" flag.
jmp_buf * Vnm_signalInit(void)
Initialize the signal handling data structures.
int Vnm_chdir(const char *path)
Interact with the system to change the working directory.
void Vnm_typeChk(void)
Check out the sizes of various datatypes.
int Vnm_jmpOk(void)
Signal and setjmp handling routine. Return the "ok-to-jump" flag.
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.
double Vnm_epsmac(void)
Computes the unit roundoff of the machine in single precision. This is defined as the smallest posi...
int Vnm_systemBack(const char *cmd)
A background variant of the ANSI-C "system" call.
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 ...
int Vnm_systemKill(const char *cmd)
Something like a UNIX "killall" call.
void Vnm_qsort(int *u, int size)
Front-end to quick sort integer array from [-large] to [+large].
void Vnm_sigIntSet(void)
Signal and setjmp handling routine. Set the signal interrupt flag.
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....
void Vnm_regHand(void)
Register the signal handler with the operating system.
void Vnm_dqsort(double *u, int size)
Front-end to quick sort integer array from [-large] to [+large].
void Vnm_tstop(int timer, const char *name)
Stops the timer on the particular machine.
char * Vnm_gethost(char *host, int hostmax)
Ask the system for the hostname.