/[jscoverage]/trunk/util.h
ViewVC logotype

Diff of /trunk/util.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 106 by siliconforks, Sat May 31 07:37:39 2008 UTC revision 505 by siliconforks, Sat Jan 2 04:55:54 2010 UTC
# Line 1  Line 1 
1  /*  /*
2      util.h - general purpose utility routines      util.h - general purpose utility routines
3      Copyright (C) 2007, 2008 siliconforks.com      Copyright (C) 2007, 2008, 2009, 2010 siliconforks.com
4    
5      This program is free software; you can redistribute it and/or modify      This program is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published by      it under the terms of the GNU General Public License as published by
# Line 29  Line 29 
29    
30  #include <sys/stat.h>  #include <sys/stat.h>
31    
32    #ifdef __cplusplus
33    extern "C" {
34    #endif
35    
36  extern const char * program;  extern const char * program;
37    
38  void fatal(const char * format, ...)  void fatal(const char * format, ...)
39    __attribute__((__noreturn__))    __attribute__((__noreturn__))
40    __attribute__((__format__(printf, 1, 2)));    __attribute__((__format__(printf, 1, 2)));
41    
42    void fatal_command_line(const char * format, ...)
43      __attribute__((__noreturn__))
44      __attribute__((__format__(printf, 1, 2)));
45    
46    void fatal_source(const char * source_file, unsigned int line_number, const char * format, ...)
47      __attribute__((__noreturn__))
48      __attribute__((__format__(printf, 3, 4)));
49    
50    void warn_source(const char * source_file, unsigned int line_number, const char * format, ...)
51      __attribute__((__format__(printf, 3, 4)));
52    
53    void version(void)
54      __attribute__((__noreturn__));
55    
56  size_t addst(size_t x, size_t y);  size_t addst(size_t x, size_t y);
57    
58  size_t mulst(size_t x, size_t y);  size_t mulst(size_t x, size_t y);
# Line 49  Line 67 
67    
68  char * xstrndup(const char * s, size_t size);  char * xstrndup(const char * s, size_t size);
69    
70  int xasprintf(char ** s, const char * template, ...) __attribute__((__format__(printf, 2, 3)));  int xasprintf(char ** s, const char * format, ...) __attribute__((__format__(printf, 2, 3)));
71    
72  char * xgetcwd(void);  char * xgetcwd(void);
73    
# Line 96  Line 114 
114    
115  void free_dir_list(struct DirListEntry * list);  void free_dir_list(struct DirListEntry * list);
116    
117  #ifndef HAVE_CLOSESOCKET  #ifndef HAVE_STRNDUP
118  int closesocket(int s);  char * strndup(const char * s, size_t size);
119  #endif  #endif
120    
121  #ifndef HAVE_VASPRINTF  #ifndef HAVE_VASPRINTF
122  int vasprintf(char ** s, const char * template, va_list a);  int vasprintf(char ** s, const char * format, va_list a);
123  #endif  #endif
124    
125  #ifndef HAVE_ASPRINTF  #ifndef HAVE_ASPRINTF
126  int asprintf(char ** s, const char * template, ...) __attribute__((__format__(printf, 2, 3)));  int asprintf(char ** s, const char * format, ...) __attribute__((__format__(printf, 2, 3)));
127  #endif  #endif
128    
129    #ifdef __cplusplus
130    }
131  #endif  #endif
132    
133    #endif /* UTIL_H_ */

Legend:
Removed from v.106  
changed lines
  Added in v.505

  ViewVC Help
Powered by ViewVC 1.1.24