MALOC  0.1
vnm.h
1 /*
2  * ***************************************************************************
3  * MALOC = < Minimal Abstraction Layer for Object-oriented C >
4  * Copyright (C) 1994--2000 Michael Holst
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the
8  * Free Software Foundation; either version 2 of the License, or (at your
9  * option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 675 Mass Ave, Cambridge, MA 02139, USA.
19  *
20  * rcsid="$Id: vnm.h,v 1.12 2002/10/01 21:29:45 mholst Exp $"
21  * ***************************************************************************
22  */
23 
24 /*
25  * ***************************************************************************
26  * File: vnm.h < vnm.c >
27  *
28  * Purpose: Header file for an ISO C [V]irtual [N]umerical [M]achine.
29  *
30  * Author: Michael Holst
31  * ***************************************************************************
32  */
33 
34 #ifndef _VNM_H_
35 #define _VNM_H_
36 
37 #include <maloc/maloc_base.h>
38 
39 /*
40  * ***************************************************************************
41  * Useful constants and functions (timers, epsilon, token generators, i/o)
42  * ***************************************************************************
43  */
44 
45 int Vnm_sigInt(void);
46 void Vnm_sigIntSet(void);
47 void Vnm_sigIntClear(void);
48 
49 int Vnm_jmpOk(void);
50 void Vnm_jmpOkSet(void);
51 void Vnm_jmpOkClear(void);
52 
53 jmp_buf *Vnm_signalInit(void);
54 void Vnm_regHand(void);
55 void Vnm_sigHand(int num);
56 
57 #define VPOW_SAFE(x,y) (Vnm_powsafe(x,y))
58 double Vnm_powsafe(double x, double y);
59 void Vnm_typeChk(void);
60 double Vnm_epsmac(void);
61 int Vnm_gentokens(char *buf, char **argv,
62  const int argvmax, const char *white, const char *comment);
63 
64 #define VTIMERS 100
65 void Vnm_tstart(int timer, const char *name);
66 void Vnm_tstop(int timer, const char *name);
67 
68 char *Vnm_getuser(char *user, int usermax);
69 char *Vnm_getos(char *os, int osmax);
70 char *Vnm_gethost(char *host, int hostmax);
71 char *Vnm_gethome(char *path, int pathmax);
72 char *Vnm_getcwd(char *path, int pathmax);
73 int Vnm_chdir(const char *path);
74 int Vnm_mkdir(const char *path);
75 
76 int Vnm_system(const char *cmd);
77 int Vnm_systemBack(const char *cmd);
78 int Vnm_systemKill(const char *cmd);
79 int Vnm_exec(int argc, char **argv);
80 void Vnm_sleep(int nusecs);
81 
82 int Vnm_ioTag(void);
83 int Vnm_nTags(void);
84 void Vnm_setIoTag(int myTag, int numTags);
85 FILE *Vnm_open(const int unit);
86 int Vnm_close(const int unit);
87 void Vnm_flush(const int unit);
88 void Vnm_redirect(const int flag);
89 void Vnm_print(const int unit, const char *format, ...);
90 void Vnm_tprint(const int unit, const char *format, ...);
91 
92 void Vnm_qsort(int *u, int size);
93 void Vnm_qsortOrd(int *u, int *ord, int size);
94 void Vnm_dqsort(double *u, int size);
95 void Vnm_dqsortOrd(double *u, int *ord, int size);
96 
97 #endif /* _VNM_H_ */
98