home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
smapp100.zip
/
sm10.zip
/
smg.h
< prev
next >
Wrap
Text File
|
2000-05-14
|
39KB
|
1,089 lines
/* ------------------------------------------------------------------------
*
* File: smg.h
* Project: Source Mapper.
* Created: Mai 28, 1992.
* Description: Project header.
*
* Copyright (C) 2000 Leif-Erik Larsen.
* This file is part of the Source Mapper source package.
* Source Mapper is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
* by the Free Software Foundation, in version 2 as it comes in the
* "COPYING" file of the XWorkplace main distribution.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* ------------------------------------------------------------------------ */
#ifndef __SMG_H__
#define __SMG_H__
#ifdef __OS2__
#define INCL_DOSERRORS /* NO_ERROR, ... */
#define INCL_DOS /* Dos API */
#define INCL_VIO /* Vio API */
#include <os2.h>
#endif
/* ------------------------------------------------------------------------ */
#if __IBMC__ || __IBMCPP__ /* If compiler is IBM Visual Age C++ */
#include <io.h>
#include <time.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
#include <conio.h>
#include <direct.h>
#define MAXPATH 256
#define MAXDRIVE 3
#define MAXDIR 256
#define MAXFILE 256
#define MAXEXT 256
#define WILDCARDS 0x01
#define EXTENSION 0x02
#define FILENAME 0x04
#define DRIVE 0x08
#define DIRECTORY 0x10
#define DIRSPLITCHR '\\'
#define DIRSPLITSTR "\\"
#define _cdecl
/* ------------------------------------------------------------------------ */
#elif __BORLANDC__ /* If compiler is Borland C++ */
#include <io.h>
#include <dir.h>
#include <dos.h>
#include <time.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
#include <conio.h>
#include <alloc.h>
#define DIRSPLITCHR '\\'
#define DIRSPLITSTR "\\"
/* ------------------------------------------------------------------------ */
#elif __GNUC__ /* If compiler is GNU C/C++ */
#include <io.h>
#include <dir.h>
#include <dos.h>
#include <time.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
#include <gppconio.h>
#ifdef __MSDOS__
# define MAXPATH 80
# define MAXDRIVE 3
# define MAXDIR 66
# define MAXFILE 9
# define MAXEXT 5
#else
# define MAXPATH 256
# define MAXDRIVE 3
# define MAXDIR 256
# define MAXFILE 256
# define MAXEXT 256
#endif
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
#define DIRSPLITCHR '/'
#define DIRSPLITSTR "/"
/* ------------------------------------------------------------------------ */
#else /* Unknown compiler */
# error Unknown compiler!
#endif
/* Source Mapper is FREEWARE, so make it legal to use
without registration!
*/
#define REGISTERED 1
#ifdef TRUE
#undef TRUE
#endif
#ifdef FALSE
#undef FALSE
#endif
#define TRUE 1
#define FALSE 0
#define YES TRUE
#define NO FALSE
#define OK TRUE
#ifdef ERROR
#undef ERROR
#endif
#define ERROR FALSE
#define VERTICALLIN '|' /* Vertikal skillelinje mellom info og kildekode */
#define TABWIDTH 8 /* Tabulatorbredde */
#define NPCHR 12 /* New Page CHaRacter */
#define EOFCHR 26 /* End Of File CHaRacter */
#define WHITECHR "\n\r\t " /* Hvite karakterer */
#define VERSION "1.0" /* Version number of Source Map Generator */
#ifdef __UNIX__
#define PLATFORM "UNIX"
#elif __GNUC__
#define PLATFORM "DOS-386"
#elif __WIN32__
#define PLATFORM "WIN32"
#elif __OS2__
#define PLATFORM "OS/2"
#elif __MSDOS__
#define PLATFORM "DOS"
#else
#error Unknown platform!
#endif
#define MAXINLIN 255 /* Maks antall tegn i linje som leses fra kildefil*/
#define MAXFUNCN 78 /* Maks antall tegn i navn til funksjon og id */
#define MAXLSTLEN 1500 /* Max length of string to specify selective list */
#define MAXNPSTRL 40 /* Max length of string to specifi new-page string */
#define MAXUSERPARAML 255 /* Maks lengde på parameter fra komandolinje */
#define O_NO 0
#define O_YES 1
#define O_NAME 1
#define O_LINENR 2
#define O_TABULAT 1
#define O_SPACE 2
#define O_LIST 1
#define O_FLOWCH 2
#define O_ALL 1
#define O_TEMP 2
#define O_MAP 3
#define O_LINK 1
#define O_MAKE 2
#define O_BUILD 3
#define PRJMAKE 0
#define PRJBUILD 1
#define PRJLINK 2
#define int8 char
#define uint8 unsigned char
#define int16 short
#define uint16 unsigned short
#define int32 long
#define uint32 unsigned long
#if defined (__OS2__) || defined (__GNUC__) || defined (__WIN32__)
# define far
# define huge
#endif
typedef struct timeSTRUCT
{
unsigned int hund : 7;
unsigned int sec : 6;
unsigned int min : 6;
unsigned int hour : 5;
unsigned int day : 5;
unsigned int month : 4;
unsigned int year : 12;
}
timeTYPE;
typedef struct /* Struktur for lagring av info om identifikatorbuffer */
{
uint16 cidb; /* Antall identifikatorblokker i buffer */
char *buff; /* Peker til buffer for lagring av identifikatorer */
}
idbuffTYPE;
typedef struct
{
int allinbuff; /* TRUE hvis alle elementer er lagret i buffer */
uint16 idsize; /* St¢rrelsen til hvert element (byte) */
uint16 cid; /* Antall e. som er lagret i buffer og fil */
uint16 cidbuff; /* Antall elementer som er lagret i bufferet */
uint16 cidfile; /* Antall elementer som er lagret i filen */
uint16 maxidbuff; /* Maks antall elemeneter i buffer */
char *buff_test; /* Buffer for lesing av enkle elementer */
char *buff; /* Selve bufferet */
FILE *file; /* Filen som er tilknyttet bufferet */
}
diffbTYPE;
typedef struct /* Totalinformasjon */
{
int incl; /* INCLude total info */
int lin_tot; /* LINes TOTal */
int lin_emp; /* LINes EMPty */
int lin_com; /* LINes with only COMment */
int lin_cod; /* LINes with CODe */
int func; /* FUNCtions */
int com; /* COMments */
}
o_totinfoTYPE;
typedef struct /* Funksjonsregister */
{
int incl; /* INCLude functionregister */
int sort; /* SORTing method for the func.reg. */
}
o_funcregTYPE;
typedef struct /* Liste over funksjons-kall */
{
int incl; /* INCLude list for functioncalls */
int riselnr; /* RISEing Line NumbeRs reference */
int sel; /* use SELective list for the list */
char list [MAXLSTLEN + 1]; /* storing witch func. in the LIST */
}
o_funcallTYPE;
typedef struct /* Liste over identifikatorer */
{
int incl; /* INCLude list for identifiers */
int riselnr; /* RISEing Line NumbeRs reference */
int sel; /* use SELective list for the list */
char list [MAXLSTLEN + 1]; /* storing witch id's in the LIST */
}
o_idlistTYPE;
typedef struct /* Liste over kall-sekvenser */
{
int incl; /* INCLude list for identifiers */
int iIncExternals; /* TRUE if include externals */
int graph; /* True if use graphic characters */
int format; /* 1=List, 2=Flowchart */
int indent; /* Width of each indent level */
int index; /* True if include index register */
char deftoplev [MAXFUNCN + 1]; /* DEFault TOP LEVel function */
}
o_flowTYPE;
typedef struct /* Linjeinformasjon */
{
int incl; /* INCLude lineinfo in the map */
int r_llin; /* Report Local LINenumbers */
int r_bloc; /* Report BLOCk */
int r_coml; /* Report COMent-Lines */
int r_func; /* Report FUNCtion-information */
int c_ltot; /* Count Lines TOTaly */
int c_empl; /* Count EMPty Lines */
int c_coml; /* Count COMent-Lines */
int c_lcod; /* Count Lines with CODe */
int c_com; /* Count COMent-blocks */
int calist; /* Report list for function-CALers */
}
o_lineinfoTYPE;
typedef struct /* Diverse */
{
int np_str; /* New Page when STRing for new page */
int np_fun; /* New Page before FUNction headers */
int np_sect; /* New Page between map sections */
int column; /* COLUMN-separator */
int del; /* DELete .smg-files after use */
int gencom; /* GENerate COMment-blocks */
int twidth; /* Width of tabulator */
char newpag [MAXNPSTRL + 1]; /* storing the string for NEW PAGe */
int iShowInfo; /* Level of display information on screen */
}
o_variousTYPE;
typedef struct /* Generer */
{
int gen; /* GENerate (O_ALL, O_TEMP, O_MAP) */
int met; /* METhod (O_LINK, O_MAKE, O_BUILD) */
char obj [MAXPATH]; /* path to OBJect files (mellomfiler) */
char map [MAXPATH]; /* path to MAP-file */
char tmp [MAXPATH]; /* path to TeMPorary files */
}
o_generateTYPE;
typedef struct
{
char funcal [MAXPATH + 1]; /* Temporary list of function calls */
char lininf [MAXPATH + 1]; /* Temporary list of line info */
char funreg [MAXPATH + 1]; /* Temporary list of functions */
char idlist [MAXPATH + 1]; /* Temporary list of items/identicators */
char projec [MAXPATH + 1]; /* Temporary projectfile */
char manobj [MAXPATH + 1]; /* Temporary main objectfile of whole project */
char sortfi [MAXPATH + 1]; /* Temporary file used when sorting data */
char indexf [MAXPATH + 1]; /* Temporary file used to index names */
}
tmpnTYPE;
typedef struct /* Scaninfo om aktiv linje */
{
unsigned int block : 4; /* Blokknivå (BLOCK). Maks is 15 */
unsigned int brack : 5; /* Parentesnivå (BRACKets). Maks 32 */
unsigned int comb : 1; /* Komentarblokk (COMment) */
unsigned int quot : 1; /* Gåse¢yne (= quotation marks) (") */
unsigned int drop : 1; /* Dråpetegn (') (= anf¢rseltegn) */
unsigned int com1 : 1; /* TRUE hvis 1 tegn i linje er innenfor kom.bl*/
unsigned int emp : 1; /* TRUE dersom aktiv linje var tom */
unsigned int code : 1; /* TRUE hvis kode i aktiv linje */
unsigned int ocom : 1; /* TRUE hvis hele linjen "Only COMment" */
unsigned int dirl : 1; /* TRUE hvis linjen er direktivlinje */
unsigned int intfc : 1; /* TRUE hvis aktiv INTERFACE-del (kun PASCAL) */
}
scanTYPE;
typedef struct /* Info om funksjonskall */
{
char name [MAXFUNCN + 1]; /* Navn til funksjon som kalles */
long lnr; /* Nummer til linje hvor kallet utf¢res */
}
fcalTYPE;
typedef struct /* Info om elementer i identifikatorliste */
{
char name [MAXFUNCN + 1]; /* Navn til aktuell identifikator */
long lnr; /* Linjenummer der identifikatoren brukes */
}
idlstTYPE;
typedef struct /* Scaninfo om aktiv potensiell funksjon */
{
char name [MAXFUNCN + 1]; /* Lagring av navn til potensiell funksjon */
uint8 fok; /* TRUE når potensiell funksjon er bekreftet */
long blin; /* Beginning LINenumber for function head */
long blin_block; /* Beginning LINenumber for first BLOCK */
long fcal; /* Count Function CALls in function */
uint16 lines; /* Count LINES in function */
uint16 empl; /* Count EMPty Lines in function */
uint16 coml; /* Count COMent Lines in function */
uint16 codl; /* Count Lines with CODe in function */
uint16 com; /* Count COMent blocks in function */
uint16 dirl; /* Count DIRective Lines i function */
}
funcTYPE;
/* Finn den st¢rste av strukturene som brukes for å lagre informasjons-
elementer i midlertidige filer under scanning av kildefil.
Makro for st¢rrelsen til den st¢rste strukturen vil brukes til å
definere st¢rrelsen til buffere som skal lese enkeltstående elementer
fra midlertidige filer hvor slik informasjon er lagret.
*/
#if __IBMC__ || __IBMCPP__
# define BIGGEST_SCANSTRUC sizeof (funcTYPE)
#elif __GNUC__
# define BIGGEST_SCANSTRUC sizeof (funcTYPE)
#else
# if sizeof (fcalTYPE) > sizeof (funcTYPE)
# if sizeof (idlstTYPE) > sizeof (fcalTYPE)
# define BIGGEST_SCANSTRUC sizeof (idlstTYPE)
# endif
# define BIGGEST_SCANSTRUC sizeof (fcalTYPE)
# endif
# define BIGGEST_SCANSTRUC sizeof (funcTYPE)
#endif
typedef struct /* Scaninfo om aktiv kildefil */
{
long ltot; /* Count Lines TOTal in sourcefile */
long elin; /* Count Empty LINes in sourcefile */
long coml; /* Count COMment Lines in sourcefile */
long codl; /* Count CODe Lines in sourcefile */
long com; /* Count COMment blocks in sourcefile */
long func; /* Count FUNCtions in sourcefile */
long dirl; /* Count DIRectiveLines in sourcefile */
long fcal; /* Count Function CALls in sourcefile */
long cid; /* Count IDentifiers in sourcefile */
}
finfTYPE;
typedef struct /* Filposisjoner til datagrupper i mellomfil */
{
long finf; /* Startposisjon til total kildefil-info */
long funreg; /* Startposisjon til funksjonsregister-data */
long funcal; /* Startposisjon til funksjonskall-data */
long idlst; /* Startposisjon til identifikatorliste-data */
long lininf; /* Startposisjon til linjeinformasjon-data */
}
fposTYPE;
typedef struct
{
char name [MAXPATH]; /* Navn til aktiv prosjektfil */
int filc; /* Antall filer i aktivt prosjekt */
int16 usrn; /* TRUE hvis bruker har definert navn til prjfil */
int16 temp; /* TRUE hvis aktiv prosjektfil er midlertidig */
int16 save; /* FALSE hvis prosjekt er forandret siden lagring*/
int16 prjon; /* FALSE dersom det ikke er noe aktivt prosjekt */
FILE *file; /* Filpeker til prosjektfil. NULL hvis ikke åpen */
}
prjstatTYPE;
typedef struct
{
char name [MAXPATH + 1]; /* Navn til kildefil */
char objn [MAXPATH + 1]; /* Navn til mellomfil */
uint8 dataok; /* TRUE hvis "finf" er lest og o.k. */
finfTYPE finf; /* Filinformasjon om kildefil */
fposTYPE fpos; /* Indekser til blokker av data i mellomfil */
}
prjfeTYPE; /* PRoJect File-Element type */
typedef struct
{
int iErr; /* Actual error code. 0 if no error */
int errno; /* Value of errno at error record time */
char cFName[MAXPATH]; /* Name of file which caused the error */
char* pSFileName; /* Name of source file where error occoured */
int iSFileLNr; /* Line number of source where error occoure*/
}
ErrorType; /* CB to maintain errors (smgerror.c) */
extern ErrorType Error;
extern diffbTYPE diffb; /* SMGDIFID.C */
extern char progdir[MAXPATH]; /* SM -programkatalog */
extern int stdwidth; /* Antall tegn i skillelinjer etc.: */
extern char linechr1; /* Karakter som utgj¢r skillelinjer: ──────────── */
extern char linechr2; /* Karakter som utgj¢r skillelinjer: ════════════ */
extern char *ptbl[]; /* Parametertabell (Parameter TaBLe) */
extern char *defoptcom[]; /* Komentarer til fil for standard brukervalg */
extern char *optblocks[]; /* Navnt til blokker av brukervalg */
extern char *errmsg[]; /* Feilmeldinger (ERRor MeSsaGes) */
extern char *fnames[]; /* Fil-navn og -endelser */
extern tmpnTYPE tmpn;
extern o_totinfoTYPE o_totinfo;
extern o_funcregTYPE o_funcreg;
extern o_funcallTYPE o_funcall;
extern o_idlistTYPE o_idlist;
extern o_flowTYPE o_flow;
extern o_lineinfoTYPE o_lineinfo;
extern o_variousTYPE o_various;
extern o_generateTYPE o_generate;
extern prjstatTYPE prjstat;
/*
** Filene nedenfor er gjordt globale for å slippe å oppgi dem som parameter
** til alle de funksjonene som skal bruke dem:
*/
extern FILE *tempf; /* For lagring av mellomfil */
extern FILE *sourcef; /* Aktiv kildefil */
extern FILE *funcalf; /* Fil for midlertidig funksjonskall-liste */
extern FILE *lininff; /* Fil for midlertidig linjeinfo/totalinfo */
extern FILE *funregf; /* Fil for midlertidig funksjonsregister */
extern FILE *idlistf; /* Fil for midlertidig identifikatorliste */
#define COMCHAR ';' /* For å skille kommentarer i valg-filer */
#define YESCHAR 'Y' /* Representerer ja ved ja/nei-spr¢rsmål */
#define NOCHAR 'N' /* Representerer nei ved ja/nei-sp¢rsmål */
#define GLOBLINCHR 'G' /* Forkortelse for global linje */
#define LOCLINCHR 'L' /* Forkortelse for lokal linje */
#define FUNCTIONCHR 'F' /* Forkortelse for funksjon */
#define FILECHR 'F' /* Forkortelse for fil */
#define BLOCKCHR 'B' /* Forkortelse for blokknivå */
typedef enum
{
D_NONSENSE = 0, /* Nonsense (Will NEVER be displayed :-) */
D_LOW, /* Line# process indicator of D_HEIGH */
D_HEIGH, /* Heigh (main action type). */
D_HEIGHEST, /* Heighest (Copyright, interrupt, warnings, etc.) */
D_WARNING, /* Warnings only */
}
DISP_PRIORITY; /* Priority level used by Display (); */
enum access_ptbl /* Aksess-makroer for parametertabell (Parameter TaBLe) */
{
/* ______ Totalinfo: ______ */
PT_iti, /* Include Total Information */
PT_ctl, /* Count Total Lines */
PT_cel, /* Count Empty Lines */
PT_coc, /* Count lines with Only Coments */
PT_clc, /* Count Lines with Code */
PT_cfu, /* Count FUnctions */
PT_cco, /* Count COments */
/* ______ Funksjonsregister: ______ */
PT_ifr, /* Include Function Register */
PT_fso, /* Functionregister-SOrting */
/* ______ Liste over funksjonskall: ______ */
PT_ilf, /* Include List for Functioncalls */
PT_slf, /* Selective List for Functincall */
PT_fln, /* Functioncall rising Line Numbers reference */
/* ______ Liste over identifikatorer: ______ */
PT_iil, /* Include Identifier List */
PT_sli, /* Selective List for Identifiers */
PT_iln, /* Identifier-list rising Line Number references */
/* ______ Kall-sekvenser: ______ */
PT_csi, /* Include */
PT_cie, /* Include external functions in list of calling sequences */
PT_csg, /* Use graphicals characters */
PT_csf, /* Format (1=List, 2=Flowchart) */
PT_cwi, /* Width of indents */
PT_cir, /* Include indexregister */
PT_cdt, /* Default top level function */
/* ______ Linjeinformasjon: ______ */
PT_ili, /* Include Line-Info */
PT_lll, /* Lineinfo-Lokal-Linenumber */
PT_rbi, /* Report Block-Indention */
PT_lcl, /* Lineinfo-Comment-Line */
PT_lfi, /* Lineinfo-Function-Information */
PT_LLF, /* Lineinfo-Linetotal-in-Function */
PT_LEF, /* Lineinfo-Empty-lines-in-Function */
PT_LCF, /* Lineinfo-CommentLines-in-function */
PT_LCO, /* Lineinfo-COdelines-in-function */
PT_LCC, /* Lineinfo-Count-Comentlines-in-function */
PT_LLC, /* Lineinfo-List-of-Callers */
/* ______ Diverse: ______ */
PT_NPs, /* New-Page-String */
PT_NPS, /* New-Page-when-String-for-new-page */
PT_NFU, /* New-page-when-new-FUnctions */
PT_NFI, /* New-page-when-new-FIles */
PT_cse, /* Column-SEparator */
PT_dtu, /* Delete Temporary files after Use */
PT_gcb, /* Generate-Coment-Blocks */
PT_tab, /* Width of tabulator */
PT_dis, /* Disp. info on screen (0=Nothing,1=Few,2=Normal,3=Detailed) */
/* ______ Generer: ______ */
PT_gen, /* GENerate */
PT_met, /* METhod for generator */
PT_pof, /* Path to Object File(s) */
PT_pmf, /* Path to Map File(s) */
PT_ptf, /* Path to Temporary Files */
PT_upf, /* Use Project-File */
PT_uof, /* Use Option-File */
/* ______ Brytere som bare utf¢res direkte, uten å lagres i valg-fil: */
PT_wof, /* Write Options to File */
PT_res, /* RESet options */
PT_hlp, /* HeLP user with the option */
PT_MAXNR,
PT_ILLEGAL,
};
enum access_defoptcom /* ACCESS-macros for accessing OPTion-BLOCK-nameS */
{
OB_TOTINFO, /* Totalinformasjon */
OB_FUNCREG, /* Funksjonsregister */
OB_FUNCALL, /* Liste over funksjons-kall */
OB_IDLIST, /* Liste over identifikatorer */
OB_CALSEQ, /* Kall-sekvenser */
OB_LINEINF, /* Linjeinformasjon */
OB_FUNCINFO, /* Informasjon om funksjoner */
OB_VARIOUS, /* Diverse */
OB_GENERATE, /* Generer */
};
enum access_fnames /* Makroer til å aksessere elementer i "fnames" */
{
CSOURCE_EXT, /* Endelse til C-kildetekster */
SMGTEMP_EXT, /* Endelse til midlertidige mellomfiler */
SMGOPTI_EXT, /* Endelse til valgfiler */
SMGPRJ_EXT, /* Endelse til prosjektfiler */
SMGOBJC_EXT, /* Endelse til endelig mellomfil */
SMGMAPF_EXT, /* Endelse til endelig kildekart */
SMGBACK_EXT, /* Endelse til reservekopier */
DEFOPT_FNAME, /* Navn til standard valgfil */
};
extern char _StrHlpOptions[];
extern char _StrHlpOptionsMore[];
extern char _StrErrWarning[];
extern char _StrErrUnknownOption[];
extern char _StrMSGCOPYRIGHT[];
extern char _StrMSGTEMPFILEID[];
extern char _StrMSGPRJFILEID[];
extern char _StrMSGUSAGE[];
extern char _StrMSGINTERPRETLIN[];
extern char _StrMSGSORTFUNCREG[];
extern char _StrMSGSORTIDLST[];
extern char _StrMSGSORTFCALLST[];
extern char _StrMSGINCLFUNDATA[];
extern char _StrMSGINCLLINEINFO[];
extern char _StrMSGINCLIDDATA[];
extern char _StrMSGINCLFCALDATA[];
extern char _StrMSGMAKEDIFIDF[];
extern char _StrMSGMAKEDIFFCALF[];
extern char _StrMSGMAKINDXFCAL[];
extern char _StrMSGMAKINDXIDLST[];
extern char _StrMSGTRYAGAIN[];
extern char _StrMSGTOTINF_SNAME[];
extern char _StrMSGTOTINF_LINTOT[];
extern char _StrMSGTOTINF_EMPLIN[];
extern char _StrMSGTOTINF_COMLIN[];
extern char _StrMSGTOTINF_CODLIN[];
extern char _StrMSGTOTINF_FUNTOT[];
extern char _StrMSGTOTINF_COMENT[];
extern char _StrMSGTOTALYSTR[];
extern char _StrMSGGENERATESOBJ[];
extern char _StrMSGGENERATESMAP[];
extern char _StrMSGINCLTOTINFO[];
extern char _StrMSGGLOBLINSTART[];
extern char _StrMSGINCLFUNCREG[];
extern char _StrMSGFUNCREGSTR[];
extern char _StrMSGNOFUNCTIONS[];
extern char _StrMSGTOTFUNCTIONS[];
extern char _StrMSGINCLFUNCALLST[];
extern char _StrMSGFUNCALLSTSTR[];
extern char _StrMSGSELFUNCALLSTSTR[];
extern char _StrMSGTOTFUNCCALS[];
extern char _StrMSGIDLSTSTR[];
extern char _StrMSGSELIDLSTSTR[];
extern char _StrMSGTOTIDS[];
extern char _StrMSGINCLIDLST[];
extern char _StrMSGINCLINEINFO[];
extern char _StrMSGSOURCECODEINF[];
extern char _StrMSGONLYCOMENT[];
extern char _StrMSGLISTOFCALLERS[];
extern char _StrMSGGENERALFUNCINF[];
extern char _StrMSGFUNCINF_LINTOT[];
extern char _StrMSGFUNCINF_LINEMP[];
extern char _StrMSGFUNCINF_LINCOM[];
extern char _StrMSGFUNCINF_LINCOD[];
extern char _StrMSGFUNCINF_CBLOCS[];
extern char _StrMSGNOBODYCALLFUNC[];
extern char _StrMSGSEEKTPLEVELF[];
extern char _StrMSGNOTOPLEVELFUNC[];
extern char _StrMSGFLOWCLSTSTR[];
extern char _StrMSGINCLFLOWC[];
extern char _StrMSGEXTERNAL[];
extern char _StrMSGFLOWGENSTRIP[];
extern char _StrMSGSORTFLOWIDXREG[];
extern char _StrMSGINCLFLOWIDXREG[];
extern char _StrMSGIDXREGFLOW[];
/* SMG.C */
int ErrorClear ( void );
void ErrorShow ( void );
int ErrorSet ( int iErrCode, const char *pFName, const char *pSFileName, int iSFileLNr );
void DoError ( const char *format, ... );
void DoWarning ( const char *format, ... );
void SMHelpCmd ( const char *pStrHelp );
void ClrLin ( void );
void ClrEOL ( void );
int Display ( DISP_PRIORITY iPriority, const char *format, ... );
void *Alloc ( long size );
void Free ( void *buff );
long MemLeft ( void );
char *Adress ( char *buff, long index, int esize );
void CallWhenExit ( void );
int CallWhenCtrlBrk ( void );
int MakeMapFiles ( int job, const char *path );
int RunCLineVer ( char *param );
int mainCLineVer ( int argc, char *argv[] );
int mainScreenVer ( int argc, char *argv[] );
int main ( int argc, char *argv[] );
/* SMGGENRL.C */
int ResetFNames ( FILE *stream );
void ResetAllFNames ( void );
int SetFNames ( const char *fname, FILE *stream );
char *GetFNames ( FILE *stream );
long FLength ( FILE *stream );
FILE *FOpen ( const char *filename, char *mode );
int FClose ( FILE *stream );
int FCloseAll ( void );
int FPrintF ( FILE *stream, const char *format, ... );
size_t FWrite ( const void *ptr, size_t size, size_t n, FILE *stream );
size_t FRead ( void *ptr, size_t size, size_t n, FILE *stream );
int FGetS ( char *string, int maxlen, FILE *stream );
int FGetS0 ( char *string, int maxlen, FILE *stream );
int Remove ( const char *filename );
long FTell ( FILE *stream );
int FSeek ( FILE *stream, long offset, int whence );
int Rewind ( FILE *stream );
int FPutC ( FILE *stream, char c );
int FGetC ( FILE *stream, char *c );
int FGetL ( FILE *stream, long *l );
int FPutL ( FILE *stream, long l );
int WritFLine ( FILE *file, int count, char chr );
int WritFLineLn ( FILE *file, int count, char chr );
int GetFileTime ( const char *filename, timeTYPE *_time );
int PrintStrTab ( FILE *file, const char *str, int tabw );
int CopyNBytes ( FILE *dest, FILE *source, long nr );
int CopyNBytesP ( FILE *dest, FILE *source, long spos, long nr );
int IsItemInFile ( FILE *file, const char *item, int itlen, long itnr, long *res );
int FAddDummy ( FILE *file, long chrnr, char value );
int FCreatePath ( const char *path );
char *BigStr ( int nr, ... );
char *GetFName ( const char *path );
char *GetPath ( const char *path );
int IsWild ( const char *path );
char *Slash ( char *dir );
char *CutFName ( char *path );
char *CutFExt ( char *path );
int StrPart ( int nr, int maxlen, char *dest, const char *src, const char *sep );
int IsExt ( const char *path );
int FNSplit ( const char *path, char *drive, char *dir, char *file, char *ext );
int StrLenSL ( long value );
int StrLenSI ( int value );
int GetDisk ( void );
void SetDisk ( int disk );
int GetCurDir ( int drive, char *directory );
void Randomize ( void );
/* SMGCONTF.C */
int MakeDiffIdF ( FILE *idf, int esize, uint32 count, char *userinf );
int ConnectTempFiles ( char *sfnam, finfTYPE *finf );
int ConnectIdLst ( uint32 count );
int ConnectIdLst_ ( FILE *diffidf );
int ConnectIdLstData ( char *id, idbuffTYPE *idbuff );
int ConnectFunCal ( uint32 count );
int ConnectFunCalData ( char *name );
int ConnectFunReg ( long count );
int ConnectLinInf ( long count );
int JoinObjFiles ( void );
int JoinObjFiles_ ( FILE *tmpf );
int JoinSourceInfo ( FILE *tmpf );
int JoinLineInfo ( FILE *tmpf );
int JoinFuncInfo ( FILE *tmpf );
int JoinFuncInfo_ ( FILE *tmpf, FILE *sortf, long fnr );
int JoinSortFuncInfo ( FILE *sortf, long *fnr );
int JoinSortFuncInfo_ ( FILE *sortf, FILE *objf, finfTYPE *finf, fposTYPE *fpos, long globlin );
int JoinFunCalInfo ( FILE *tmpf );
int JoinFunCalInfo_ ( FILE *tmpf, FILE *sortf, FILE *indxf, long fnr );
int JoinSortFunCalInfo ( FILE *sortf, long *fnr );
int JoinSortFunCalInfo_ ( FILE *sortf, FILE *objf, long *fnr, fposTYPE *fpos );
int JoinFunCalMakIndx ( FILE *sortf, FILE *indxf, long fnr );
int JoinFunCalMakIndx_ ( FILE *sortf, FILE *indxf, FILE *objf, long fnr, int objfnr, fposTYPE *fpos );
int JoinIdLstInfo ( FILE *tmpf );
int JoinIdLstInfo_ ( FILE *tmpf, FILE *sortf, FILE *indxf, long inr );
int JoinSortIdLstInfo ( FILE *sortf, long *inr );
int JoinSortIdLstInfo_ ( FILE *sortf, FILE *objf, long *inr, fposTYPE *fpos );
int JoinIdLstMakIndx ( FILE *sortf, FILE *indxf, long inr );
int JoinIdLstMakIndx_ ( FILE *sortf, FILE *indxf, FILE *objf, long inr, int objfnr, fposTYPE *fpos );
/* SMGCONV.C */
int MakeMapFile ( void );
int MakeMapFile_ ( FILE *mapf );
int MakeMapName ( char *mapname );
int WrtComStart ( FILE *file );
int WrtComStartLn ( FILE *file );
int WrtComEnd ( FILE *file );
int WrtComEndLn ( FILE *file );
int GetFPosTYPE ( FILE *objf, fposTYPE *fpos );
int GetFInfTYPE ( FILE *objf, finfTYPE *finf );
int TestObjFile ( const char *ofname );
int TestObjFile_ ( FILE *objf );
int TestObjFileHead ( FILE *objf );
int WrtStdLinComStart ( FILE *file, int linlen, int chr );
int WrtStdLinComEnd ( FILE *file, int linlen, int chr );
/* SMGDIFID.C */
int DiffBConstruct ( const char *fname, int idsize );
int DiffBClear ( void );
int DiffBDestruct ( void );
int DiffBAddId ( const char *id );
int DiffBIfId ( const char *id, uint16 *answ );
int DiffBGetId ( uint16 indx, char *id );
/* SMGFCAL.C */
int FCalIncludeToMap ( FILE *mapf );
int FCalNameInSelList ( const char *funcn );
int FCalIncludeToMap1 ( FILE *mapf, FILE *objf, fposTYPE *fpos );
int FCalIncludeToMap1_ ( FILE *mapf, FILE *objf );
int FCalIncludeToMap2 ( FILE *mapf, FILE *objf, fposTYPE *fpos );
/* SMGFLOW.C */
int FlowCIncludeToMap ( FILE *mapf );
int FlowCIncludeToMap_ ( FILE *mapf, FILE *objf, fposTYPE *fpos );
int FlowCIncludeToMap__ ( FILE *mapf, FILE *tmpf, const char *topl, long *lnr );
int IsFuncCalled ( FILE *objf, const char *funcn, fposTYPE *fpos, int *answ );
int FlowCSubLevels ( void );
int FlowCStripTmpf ( FILE *objf, FILE *tmpf, fposTYPE *fpos );
int FlowCDrawIndts ( FILE *mapf, int indent, char vertchr );
int FlowCDrawBox ( FILE *mapf, long lnr, int indent, const char *txt );
int FlowCDrawBox_ ( FILE *mapf, long lnr, int indent, const char *txt, const char chrs[] );
int FlowCInclIndx ( FILE *mapf, FILE *funcs );
/* SMGFUNCR.C */
int FuncRIncludeToMap ( FILE *mapf );
int FuncRBuffConstruct ( void );
int FuncRBuffDestruct ( void );
int FuncRBuffIndxGet ( long indx, funcTYPE *func );
long FuncRBuffGetFNr ( void );
int FuncRBuffLNrGet ( long lnr, funcTYPE *func );
int FuncRBuffIsFunc ( const char *fname );
int FuncRIncludeToMap1 ( FILE *mapf );
int FuncRIncludeToMap2 ( FILE *mapf );
/* SMGIDLST.C */
int IdLstIncludeToMap ( FILE *mapf );
int IdLstNameInSelList ( const char *idname );
int IdLstIncludeToMap1 ( FILE *mapf, FILE *objf, fposTYPE *fpos );
int IdLstIncludeToMap1_ ( FILE *mapf, FILE *objf );
int IdLstIncludeToMap2 ( FILE *mapf, FILE *objf, fposTYPE *fpos );
/* SMGLINF.C */
int LInfoIncToMap ( FILE *mapf );
int LInfo1 ( FILE *mapf );
int LInfo2 ( FILE *mapf );
int LInfoSourceHead ( FILE *mapf, int fnr );
int LInfoInclSource ( FILE *mapf, FILE *objf, FILE *srcf, long *glnr, long lines, fposTYPE *fpos );
int LInfoInclSource_ ( FILE *mapf, const char *line, scanTYPE *scan, long llnr, long glnr );
int LInfoEmpty ( FILE *mapf );
int LInfoFindNextFunc ( long curlnr, funcTYPE *func );
int LInfoInclFuncInfo ( FILE *mapf, FILE *objf, funcTYPE *func, fposTYPE *fpos );
/* SMGOPTFI.C */
char optchr_pm ( int opt );
char optchr_v ( int opt );
int save_options ( const char *fname );
int read_options ( const char *name );
void read_default_options ( void );
/* SMGOPTIO.C */
int SetDefaultOptions ( void );
int SetTmpFNames ( void );
int CreateUniqueFile ( const char *pcDir, char *pPath, int iMaxPath );
/* SMGPRJCT.C */
int GetFDataFromPrj ( int filenr, prjfeTYPE *fdata );
int PutFDataToPrj ( int filenr, prjfeTYPE *fdata );
void ResetPrjStat ( void );
int AddFDataToPrj ( prjfeTYPE *fdata );
int MakePrjF ( const char *fname );
void ResetPrjFETYPE ( prjfeTYPE *fdata );
void GetObjFileName ( char *ofname, const char *sfname );
int IsTime1NewerThanTime2 ( const timeTYPE *Time1, const timeTYPE *Time2 );
int ScanFilesInPrj ( int job );
int MakePrjDataOK ( void );
int GetFDataOfGLin ( long glin, long *slin, prjfeTYPE *fdata );
/* SMGPRTLK.C */
int interpret_switch ( const char *sw, int *code, const char *legal );
int UseOptionsFile ( const char *path );
int get_PT_macro ( const char *name);
int param_getnext ( int nr, int maxlen, char *dest, char *source );
int param_ishook ( const char *point );
int interpret_parameters ( char *param, int iEWarn );
/* SMGSCANF.C */
int ifkeyword ( char *word );
int scan_sourcef ( char *sfnam, char *tfnam );
int scan_sourcef_ ( char *sfnam );
void reset_scantype ( scanTYPE *scan );
void reset_functype ( funcTYPE *func );
void reset_fcaltype ( fcalTYPE *fcal );
void reset_finftype ( finfTYPE *finf );
void reset_idlsttype ( idlstTYPE *idlst );
int intpret_line ( char *line, scanTYPE *scan, funcTYPE *func, finfTYPE *finf, idlstTYPE *idlst );
void posnexttoken ( char **linep );
/* SMGSORTF.C */
int sortfile ( FILE *stream, uint16 size );
/* SMGTOTIN.C */
int wrt_totinfo ( FILE *mapf );
int wrt_totinfo1 ( FILE *file, int fnr );
int wrt_totinfo2 ( FILE *file );
int wrt_totinfo2_ ( FILE *file, finfTYPE *finf, int fnr, const char *sfname, int iLongestFName );
int max_totinf_strlen ( void );
int wrt_totinfo_ ( FILE *file, finfTYPE *finf, const char *sfname, int *cinf );
#if defined (__OS2__) || defined (__GNUC__)
# define ADRESS(buff,idx,esize) ((void *) (((char*)(buff))+((idx)*(esize))))
#else
# define ADRESS(buff,idx,esize) ((void *) Adress ((void*) buff, idx, esize))
#endif
#define ERRORSET(iErrCode, pFName) ErrorSet (iErrCode, pFName, __FILE__, __LINE__)
#define RETERR(iErrCode, pFName) { ERRORSET (iErrCode, pFName); return (ERROR); }
#define RETURN_ERR return (ERROR)
extern int _iErrNo; /* Shadow of errno value */
#endif /* #ifndef __SMG_H__ */