cmEngine  0.1.1
A library for interpreting CMake code.
cmHost.h
1 #ifndef cmEngine_Include_cmEngine_cmHost_h
2 #define cmEngine_Include_cmEngine_cmHost_h
3 
4 #include <cmEngine/cmPublic.h>
5 
6 #include <stddef.h>
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 struct cmDiagnostic;
13 struct cmHostFile;
14 struct cmMessage;
15 struct cmStat;
16 
23 struct cmHost
24 {
26  void* impl;
28  void (*release)(void* impl);
30  void (*report_message)(void* impl, const struct cmMessage* message);
32  void (*report_diagnostic)(void* impl, const struct cmDiagnostic* diagnostic);
38  int (*open_for_reading)(void* impl, struct cmHostFile* host_file, const char* filename);
40  void* (*malloc_override)(void* impl, size_t size);
42  void* (*realloc_override)(void* impl, void* addr, size_t size);
44  void (*free_override)(void* impl, void* addr);
46  const char* (*getenv_override)(void* impl, const char* key, size_t key_size);
48  int (*stat_override)(void* impl, const char* path, struct cmStat* stat);
49 };
50 
56 CM_PUBLIC void
57 cmInitHost(struct cmHost* host);
58 
65 CM_PUBLIC void*
66 cmMallocFromHost(struct cmHost* host, size_t size);
67 
75 CM_PUBLIC void*
76 cmReallocFromHost(struct cmHost* host, void* addr, size_t size);
77 
83 CM_PUBLIC void
84 cmFreeFromHost(struct cmHost* host, void* addr);
85 
94 CM_PUBLIC int
95 cmOpenForReadingFromHost(struct cmHost* host, struct cmHostFile* host_file, const char* filename);
96 
105 CM_PUBLIC const char*
106 cmGetEnvFromHost(struct cmHost* host, const char* key, size_t key_size);
107 
115 CM_PUBLIC int
116 cmStatFromHost(struct cmHost* host, const char* path, struct cmStat* stat);
117 
118 #ifdef __cplusplus
119 } /* extern "C" */
120 #endif
121 
122 #endif /* cmEngine_Include_cmEngine_cmHost_h */
int(* stat_override)(void *impl, const char *path, struct cmStat *stat)
Definition: cmHost.h:48
CM_PUBLIC void * cmReallocFromHost(struct cmHost *host, void *addr, size_t size)
Definition: cmHost.c:133
void(* report_message)(void *impl, const struct cmMessage *message)
Definition: cmHost.h:30
CM_PUBLIC void cmInitHost(struct cmHost *host)
Definition: cmHost.c:57
CM_PUBLIC const char * cmGetEnvFromHost(struct cmHost *host, const char *key, size_t key_size)
Definition: cmHost.c:159
CM_PUBLIC int cmOpenForReadingFromHost(struct cmHost *host, struct cmHostFile *host_file, const char *filename)
Definition: cmHost.c:83
Definition: cmStat.h:31
void(* report_diagnostic)(void *impl, const struct cmDiagnostic *diagnostic)
Definition: cmHost.h:32
CM_PUBLIC void cmFreeFromHost(struct cmHost *host, void *addr)
Definition: cmHost.c:149
void * impl
Definition: cmHost.h:26
Definition: cmDiagnostic.c:13
int(* open_for_reading)(void *impl, struct cmHostFile *host_file, const char *filename)
Definition: cmHost.h:38
CM_PUBLIC int cmStatFromHost(struct cmHost *host, const char *path, struct cmStat *stat)
Definition: cmHost.c:169
Definition: cmHost.h:23
Definition: cmHostFile.h:16
Definition: cmMessageFunction.c:17
void(* free_override)(void *impl, void *addr)
Definition: cmHost.h:44
void(* release)(void *impl)
Definition: cmHost.h:28
CM_PUBLIC void * cmMallocFromHost(struct cmHost *host, size_t size)
Definition: cmHost.c:115
unsigned long long int size
Definition: cmStat.h:44