00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _EYEDBLIB_PROBE_H
00025 #define _EYEDBLIB_PROBE_H
00026
00027 #include <stdio.h>
00028
00029 typedef struct p_ProbeHandle p_ProbeHandle;
00030
00031 typedef enum {
00032 p_ProbeCHAIN = 0x1,
00033 p_ProbeAVERAGE = 0x2,
00034 p_ProbeINFO = 0x4,
00035 p_ProbeLOCS = 0x8,
00036 p_ProbeMARKS = 0x10,
00037 p_ProbeWHOLE = p_ProbeCHAIN | p_ProbeAVERAGE | p_ProbeINFO |
00038 p_ProbeLOCS | p_ProbeMARKS
00039 } p_ProbeProfileType;
00040
00041 enum {
00042 P_PROBE_FILE = 64,
00043 P_PROBE_INFO = 80,
00044 P_PROBE_PNAME = 128
00045 };
00046
00047 typedef struct {
00048 char _not;
00049 int sm, em;
00050 } p_ProbeProfileMark;
00051
00052 typedef struct {
00053 char _not;
00054 int line;
00055 const char *file;
00056 } p_ProbeProfileLoc;
00057
00058 typedef struct {
00059 p_ProbeProfileType type;
00060 int c_marks;
00061 p_ProbeProfileMark *marks;
00062 int c_locs;
00063 p_ProbeProfileLoc *locs;
00064 } p_ProbeProfileDesc;
00065
00066 extern p_ProbeHandle
00067 *p_probeInit(const char *pname);
00068
00069 extern void
00070 p_probeBegin(const char *pname),
00071 p_probeEnd(const char *file);
00072
00073 extern void
00074 p_probeRecord(p_ProbeHandle *ph, const char *file, int line,
00075 int mark, const char *info),
00076 p_probeProfile(p_ProbeHandle *ph, FILE *fd, p_ProbeProfileDesc *desc),
00077 p_probeSave(p_ProbeHandle *ph, const char *file),
00078 p_probeRestore(p_ProbeHandle **ph, const char *file);
00079
00080 extern int
00081 p_probeActiveSet(p_ProbeHandle *ph, int act);
00082
00083 extern p_ProbeHandle
00084 *p_probeGlobalSet(p_ProbeHandle *ph),
00085 *p_probeGlobalGet(void);
00086
00087 #ifdef P_NO_PROBE
00088
00089 #define p_probe(ph)
00090 #define p_probeI(ph, i)
00091 #define p_probeM(ph, m)
00092 #define p_probeMI(ph, m, i)
00093
00094 #define p_probeX
00095 #define p_probeXI(i)
00096 #define p_probeXM(m)
00097 #define p_probeXMI(m, i)
00098
00099 #else
00100
00101 #define p_probe(ph) p_probeRecord(ph, __FILE__, __LINE__, 0, 0)
00102 #define p_probeI(ph, i) p_probeRecord(ph, __FILE__, __LINE__, 0, i)
00103 #define p_probeM(ph, m) p_probeRecord(ph, __FILE__, __LINE__, m, 0)
00104 #define p_probeMI(ph, m, i) p_probeRecord(ph, __FILE__, __LINE__, m, i)
00105
00106 #define p_probeX p_probeRecord(p_probeGlobalGet(), __FILE__,\
00107 __LINE__, 0, 0)
00108 #define p_probeXI(i) p_probeRecord(p_probeGlobalGet(), __FILE__,\
00109 __LINE__, 0, i)
00110 #define p_probeXM(m) p_probeRecord(p_probeGlobalGet(), __FILE__,\
00111 __LINE__, m, 0)
00112 #define p_probeXMI(m, i) p_probeRecord(p_probeGlobalGet(), __FILE__,\
00113 __LINE__, m, i)
00114 #endif
00115
00116 #endif