1 /************************************************/
4 /* Jean-Marc Pigeon <jmp@safe.ca> 2009 */
6 /************************************************/
7 /* This program is free software; you can */
8 /* redistribute it and/or modify it under the */
9 /* terms of the GNU General Public License as */
10 /* published by the Free Software Foundation */
11 /* version 2 of the License */
13 /* This program is distributed in the hope that */
14 /* it will be useful, but WITHOUT ANY WARRANTY; */
15 /* without even the implied warranty of */
16 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR */
17 /* PURPOSE. See the GNU General Public License */
18 /* for more details. */
20 /* You should have received a copy of the GNU */
21 /* General Public License along with this */
22 /* program; if not, write to the Free Software */
23 /* Foundation, Inc., 51 Franklin Street, */
24 /* Fifth Floor, Boston, MA 02110-1301, USA. */
25 /************************************************/
27 /* Define sub level procedure needed by */
28 /* the application. */
30 /************************************************/
35 #include <sys/types.h>
39 /*vzboot application name */
41 /*vzboot current application revision level */
42 #define VZBVERS "$Revision: 0.84.0.0 $"
45 /*transit subdirectory name */
48 /*defining application directory */
50 d_tmp, /*directory /tmp */
51 d_crash, /*the crash directory */
52 d_etc, /*directory is /etc */
53 d_ubin, /*directory /usr/bin */
54 d_usbin, /*directory /usr/sbin */
55 d_usrlib, /*directory /usr/lib */
56 d_varlib, /*directory /var/lib */
57 d_spool, /*spool directory */
58 d_log, /*logs directory */
59 d_lock, /*locking directory */
60 d_vzgot, /*application main dir */
61 d_null /*no directoy specified */
64 typedef struct { /*vocable table type */
65 int code; /*code value */
66 const char *key;/*key code */
67 const void *ptr;/*pay load */
70 /*Signal flag definition */
75 /*application current version number */
76 extern const char *curvers;
77 /*application working base directory */
81 /*application debug level */
83 /*application verbosity level */
85 /*application working mode foreground/background*/
86 extern int apl_foreground;
88 extern int apl_isdir(char *dirpath);
89 extern char *apl_freestr(char *str);
90 extern char *apl_getvers();
91 extern u_long apl_getmillisec();
92 extern char *apl_uniquename(unsigned int seq);
93 extern u_long apl_date(time_t curtime);
94 extern char *apl_ascsystime(time_t curtime);
95 extern char *apl_ascsysdate(time_t curtime);
96 extern char *apl_ascsysdatetime(time_t curtime);
97 extern char *apl_ascsysstamp(time_t curtime);
98 extern time_t apl_datetimesysasc(char *strdate,char *strtime);
99 extern void apl_alert(const int dlevel,const char *fmt,...);
100 extern void apl_argvtrace(const int dlevel,const char *fmt,char *argv[]);
101 extern char *apl_mkbase(char *newbase);
102 extern char *apl_appdir(DIRENUM dir);
103 extern void apl_trapsegv(int onoff);
104 extern void apl_core_dump(char *frmt, ...);
105 extern void apl_settrap(int set);
106 extern char *apl_strtolower(char *str);
107 extern char *apl_getstr(FILE *fichier,char *str,u_int taille,char carcom);
108 extern int apl_createdirs(char *dirname);
109 extern char *apl_getapvers();
110 extern VOCTYP *apl_getvoca(const VOCTYP *table,char *str);
111 extern char *apl_cleanstring(char *str);