convert line ends
[canaan.git] / prj / cam / src / framewrk / report.h
blob4cbdef4b0de8dfa38a1296b89479f1b3fb31239b
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 // $Header: r:/t2repos/thief2/src/framewrk/report.h,v 1.8 1999/06/02 16:56:10 XEMU Exp $
7 // report system
9 #pragma once
11 #ifndef __REPORT_H
12 #define __REPORT_H
14 #include <reputil.h>
15 #include <objtype.h>
17 // types of report function
18 enum eReportType
20 kReportHeader = (1<<0), // basic "info" about level
21 kReportPerObj = (1<<1), // per object reporting
22 kReportAllObj = (1<<2), // report on all objs - for props, really
23 kReportWorldDB = (1<<3), // world database reporting
24 kReportRoom = (1<<4), // room database reporting
25 kReportAIPath = (1<<5), // AI Pathfind database reporting
26 kReportScript = (1<<6), // send script report gen messages
27 kReportDebug = (1<<7), // debugging report gen, debugging memory/system issues
28 kReportModels = (1<<8), // model usage
29 kReportGame = (1<<9), // game specific info
30 kReportPrivate = (1<<16), // beginning of private internal flags
31 kReport_IntMax = 0xffffffff,
34 #define kReportFirstType kReportHeader
35 #define kReportLastType kReportGame
37 enum eReportFlags
39 kReportFlg_HotRegion = (1<<0), // hotregion as filter \ if none of these
40 kReportFlg_Select = (1<<1), // just use current selection > we assume all
41 kReportFlg_Hilight = (1<<2), // highlighting as filter / objs
42 kReportFlg_AllObjs = (1<<3), // just go do all objects
43 kReportFlg_Concrete = (1<<4), // concrete only \ if neither of these
44 kReportFlg_Abstract = (1<<5), // abstract only / then defaults to concrete only
45 kReportFlg_ToFile = (1<<6), // send output to named file \ xxx (avoid \ at end of line)
46 kReportFlg_ToMono = (1<<7), // send output to mono > output control
47 kReportFlg_ToScr = (1<<8), // send output to screen / xxx
50 enum eReportPhase
52 kReportPhase_Init,
53 kReportPhase_Loop,
54 kReportPhase_Term
57 // suggested warn levels - should become an enum, i think
58 #define kReportLevel_Errors 0 // only tell me about things which are wrong
59 #define kReportLevel_Warning 1 // add in info about things which are suspicious
60 #define kReportLevel_Info 2 // also add "useful info" summaries
61 #define kReportLevel_DumpAll 3 // dump all possible everything you can think of
63 ////////////////////////////////////
64 // callback management, types, setup
66 // callback types
67 typedef void (*ReportObjCallback)(ObjID obj, int WarnLevel, void *data, char *buffer, enum eReportPhase phase);
68 typedef void (*ReportGenCallback)(int WarnLevel, void *data, char *buffer);
70 #ifdef REPORT
71 // register a callback into the report system
72 EXTERN BOOL ReportRegisterObjCallback(ReportObjCallback cb, char *name, void *data);
73 EXTERN BOOL ReportRegisterGenCallback(ReportGenCallback cb, enum eReportType type, char *name, void *data);
75 // unregister a callback from the report system
76 // (is it ok to just use name/cb for identity, or do we need data too?)
77 EXTERN BOOL ReportUnRegisterObjCallback(ReportObjCallback cb, void *data);
78 EXTERN BOOL ReportUnRegisterGenCallback(ReportGenCallback cb, enum eReportType type, void *data);
80 // return whether this obj is an active element of current report
81 EXTERN BOOL ReportCheckObjActive(ObjID obj);
82 #else
83 #define ReportRegisterObjCallback(cb,name,data)
84 #define ReportRegisterGenCallback(cb,type,name,data)
85 #define ReportUnRegisterObjCallback(cb,data)
86 #define ReportUnRegisterGenCallback(cb,type,data)
87 #define ReportCheckObjActive(o)
88 #endif
90 ////////////////////////////////////
91 // actually get reports
93 // does a report with flags/obj specified
94 EXTERN void ReportDoSpecifiedReport(int types, int flags, int WarnLevel, ObjID obj);
96 // brings up the "report configuration" dialog
97 EXTERN void ReportConfigureReport(void);
99 // goes and does the current report
100 EXTERN void ReportDoCurrentReport(void);
102 ////////////////////////////////////
103 // misc
105 // set output file name, erase clears it out, else append
106 EXTERN void ReportSetOutputFile(char *fname, BOOL erase);
108 ////////////////////////////////////
109 // setup/closedown
110 #ifdef REPORT
111 EXTERN void ReportInit(void);
112 EXTERN void ReportTerm(void);
113 #else
114 #define ReportInit()
115 #define ReportTerm()
116 #endif // REPORT
118 #endif