]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - gmqcc.h
Added tracing to strdup for allocations, fixed some memleaks, this isn't pretty ...
[xonotic/gmqcc.git] / gmqcc.h
diff --git a/gmqcc.h b/gmqcc.h
index 206688f4af0f87605d0b71b87c88094e783ef660..223e0d7559e2ce4e9bb80fedcc482b0a48e88109 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
@@ -300,7 +300,7 @@ void  util_meminfo       ();
 bool  util_filexists     (const char *);
 bool  util_strupper      (const char *);
 bool  util_strdigit      (const char *);
-char *util_strdup        (const char *);
+char *_util_Estrdup        (const char *, const char *, size_t);
 void  util_debug         (const char *, const char *, ...);
 void  util_endianswap    (void *,  size_t, unsigned int);
 
@@ -326,6 +326,8 @@ int util_asprintf (char **ret, const char *fmt, ...);
 #    define mem_r(x, n) util_memory_r((void*)(x), (n), __LINE__, __FILE__)
 #endif /*! NOTRACK */
 
+#define util_strdup(X)  _util_Estrdup((X), __FILE__, __LINE__)
+
 /*
  * A flexible vector implementation: all vector pointers contain some
  * data about themselfs exactly - sizeof(vector_t) behind the pointer
@@ -466,10 +468,8 @@ void        util_hsdel(hash_set_t *);
 void           fs_file_close  (FILE *);
 int            fs_file_error  (FILE *);
 int            fs_file_getc   (FILE *);
-int            fs_file_flush  (FILE *);
 int            fs_file_printf (FILE *, const char *, ...);
 int            fs_file_puts   (FILE *, const char *);
-int            fs_file_putc   (FILE *, int);
 int            fs_file_seek   (FILE *, long int, int);
 long int       fs_file_tell   (FILE *); 
 
@@ -480,11 +480,10 @@ FILE          *fs_file_open   (const char *, const char *);
 int            fs_file_getline(char  **, size_t *, FILE *);
 
 /* directory handling */
+int            fs_dir_make    (const char *);
 DIR           *fs_dir_open    (const char *);
 int            fs_dir_close   (DIR *);
 struct dirent *fs_dir_read    (DIR *);
-int            fs_dir_make    (const char *);
-int            fs_dir_change  (const char *);
 
 
 /*===================================================================*/
@@ -1192,6 +1191,7 @@ typedef struct {
     uint32_t     warn_backup  [1 + (COUNT_WARNINGS      / 32)];
     uint32_t     werror_backup[1 + (COUNT_WARNINGS      / 32)];
     uint32_t     optimization [1 + (COUNT_OPTIMIZATIONS / 32)];
+    bool         optimizeoff; /* True when -O0 */
 } opts_cmd_t;
 
 extern opts_cmd_t opts;