home *** CD-ROM | disk | FTP | other *** search
- #ifndef __FLIB_H
- #define __FLIB_H
-
- #ifndef __STDLIB_H
- #include "stdlib.h"
- #endif
- #ifndef __STRING_H
- #include "string.h"
- #endif
- #ifndef __WINDOWS_H
- #include "windows.h"
- #endif
-
- class dstring /* dynamic string */
- {
- int l; /* length */
- char *p; /* asciiz */
-
- public:
- dstring();
- dstring(int *r, char s[]);
- ~dstring();
-
- int set(dstring &s) { return set(s.p); }
- int getlen() { return l; }
- int append(dstring &s) { return append(s.p); }
- int compare(char s[]) { return strcmp(p, s); }
- int compare(dstring &s) { return strcmp(p, s.p); }
- char &operator[](int i) { return p[i]; }
- char *operator+(int i) { return p+i; }
- char *getbuf() { return p; }
-
- int set(int n);
- int set(char s[]);
- int append(char s[]);
- void putbuf(char s[]);
- char *takbuf();
- };
-
- class dlgprog /* progress dialog */
- {
- int percent; /* current percentage */
- int *flag; /* point to the abort flag. set it when abort is pressed */
- HWND dlg; /* handle to the dialog box */
- HWND owner; /* owner of the dialog box */
- FARPROC p; /* procedure instance */
- COLORREF metercolor; /* color of the progress bar */
-
- public:
- dlgprog(int *r, HINSTANCE inst, HWND owner, int *flag, COLORREF metercolor);
- ~dlgprog();
-
- int chkdlgmsg(MSG FAR *msg) { return IsDialogMessage(dlg, msg); }
- HWND getdlg() { return dlg; }
- void cancel() { *flag = 1; }
- void settitle(char title[]) { SetWindowText(dlg, title); }
-
- int peekdispatchmsg();
- void settxt1(char txt[]);
- void settxt2(char txt[]);
- void settxt3(char txt[]);
- void show(int iscenter);
- void setpercent(int p);
- void drawmeter(DRAWITEMSTRUCT FAR *q);
- };
-
- struct binding /* binding of a macro */
- {
- dstring n; /* macro name */
- dstring v; /* macro value */
- };
-
- struct version /* version info of a file */
- {
- UINT lang; /* language id */
- UINT cset; /* character set */
- DWORD os; /* os */
- DWORD prmtype; /* primary type (exe, dll, etc) */
- DWORD subtype; /* sub type (display, keyboard, etc) */
- DWORD verhi32; /* high 32bit version no */
- DWORD verlo32; /* low 32bit version no */
- };
-
- class pmconv;
-
- class simpledde;
-
- class installer /* name space for installation routines */
- {
- public:
- installer(); /* set bufs to empty */
- ~installer(); /* del bufs */
-
- int init(HINSTANCE inst, HWND owner, char inffile[]);
-
- int nomacros; /* no of macros currently defined */
- int issupressmsg; /* should fatal or error msg be supressed? */
- char inffile[_MAX_PATH]; /* path of inf file */
- HWND owner; /* owner of dialogs */
- HINSTANCE inst;
- pmconv *c; /* conversation with program manager */
- binding *macros; /* macros */
- simpledde *d; /* dde wrapper */
-
- int copy(char srcpath[], char dstpath[], int ischeck, int iscompressed);
- int deldir(char dir[]);
- int delfile(char dir[], char file[]);
- int askdir(char dir[], char prompt[]);
- int askquitinstall();
- int askquitllatsni();
- int askretry(char msg[]);
- int askdrive(int *driveno, char prompt[]);
- int askinsertdisk(char diskdesc[]);
- int askoverwrite(char srcpath[], version &srcv, char dstpath[], version &dstv);
- int getpaths(char diskdesc[], char srcfile[], char srcpath[], char dstdir[], char dstfile[], char dstpath[]);
- int readmacroname(char s[], int *n, char r[]);
- int readmacroname(char s[], int *n, char file[], char sect[], char item[]);
- int msgbox(char txt[], char title[], UINT flags);
- int begddepm();
- int getversion(char path[], version *v);
- int delgrup(char grup[]);
- int delitem(char grup[], char item[]);
- int createitem(char grup[], char item[], char cmdl[], char icon[]);
- int getfreespace(int drive, double *f);
- int chkfreespace(int drive, double minf);
- int compareversion(char srcpath[], char dstpath[]);
- int evalmacro(char s[], int *n, char r[], int *m);
- int readfields(char s[], char specifiers[], ...);
- int evalstring(char s[], char r[]);
- int evalstring(char s[], int *n, char r[], int *m);
- int getgmacro(char gn[], char v[]);
- int getemacro(char file[], char sect[], char item[], char v[]);
- int getimacro(char n[], char v[]);
- int setgmacro(char gn[], char v[]);
- int setemacro(char file[], char sect[], char item[], char v[]);
- int setimacro(char n[], char v[]);
- int getnoentries(char sect[], char inifile[] = 0);
- void endddepm();
- void mergedirfile(char path[], char dir[], char file[]);
- void outofmem();
- void fatal(char msg[]);
- void error(char msg[]);
- void errorbadpath(char path[]);
- void fataldel(char path[]);
- void fatalren(char oldpath[], char newpath[]);
- void fatalread(char path[]);
- void fatalcopy(char srcpath[], char dstpath[]);
- void fatalwrite(char path[]);
- void fatalshare(char path[]);
- void fatalcreate(char path[]);
- void fatalaccess(char path[]);
- void fatalnofile(char path[]);
- void fatalsyntax(char s[]);
- void fataldelitem(char name[]);
- void fataldelgrup(char name[]);
- void fatalshowgrup(char name[]);
- void fatalfileinuse(char path[]);
- void fatalundefmacro(char name[]);
- void fatalcreateitem(char name[]);
- void fatalcreategrup(char name[]);
- void fatalreadverinfo();
- void changingcolor(HDC dc, RECT r1, RECT r2, COLORREF cs[], int blkw, int blkh);
- char *getimacro(char n[]);
- char *getentries(char sect[], char inifile[] = 0);
- binding *lookup(char n[]);
- };
-
- #endif
-