Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
util.h
Go to the documentation of this file.
1
27#ifndef RW_UTIL_H
28#define RW_UTIL_H
29
35void warn (const char* const format, ...);
36
43void terminate (const int state, const char* const format, ...);
44
45/* Note: RW_MALLOC should be used rather than malloc within the runall
46 utility. This macro calls the guarded_malloc function which performs
47 validation on inputs and outputs. guarded_malloc shouldn't be called
48 directly, as it needs file and line information, provided by RW_MALLOC.
49*/
50
51#define RW_MALLOC(size) \
52 guarded_malloc(size, __FILE__, __LINE__)
61void* guarded_malloc (const size_t size, const char* const file,
62 const unsigned line);
63
64#define RW_REALLOC(source, size) \
65 guarded_realloc(source, size, __FILE__, __LINE__)
75void* guarded_realloc (void* source, const size_t size,
76 const char* const file, const unsigned line);
77
88char* reference_name (const char* data_dir, const char* subdir,
89 const char* mode);
90
108char* input_name (const char* data_dir, const char* target);
109
110
119char* output_name (const char* target);
120
121
127void rw_sleep (int seconds);
128
129
138#ifdef __cplusplus
139extern "C" {
140#endif
141
142int rw_signal (int signo, void (*func)(int));
143
144#ifdef __cplusplus
145} /* extern "C" */
146#endif
147
148#endif /* RW_UTIL_H */
#define line
Definition 17.names.cpp:490
#define mode
Definition 17.names.cpp:497
void terminate()
void warn(const char *const format,...)
Definition util.cpp:58
char * input_name(const char *data_dir, const char *target)
Definition util.cpp:190
char * reference_name(const char *data_dir, const char *subdir, const char *mode)
Definition util.cpp:132
void * guarded_realloc(void *source, const size_t size, const char *const file, const unsigned line)
Definition util.cpp:114
char * output_name(const char *target)
Definition util.cpp:227
void * guarded_malloc(const size_t size, const char *const file, const unsigned line)
Definition util.cpp:97
int rw_signal(int signo, void(*func)(int))
Definition util.cpp:259
void rw_sleep(int seconds)
Definition util.cpp:244