English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Diff of /branches/common-nfo/tools/sqlite/nfohelpr.h

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

branches/common-nfo/tools/sqlite/dbif.h revision 3453 by tg, Thu Aug 9 11:51:36 2007 UTC branches/common-nfo/tools/sqlite/nfohelpr.h revision 3456 by tg, Thu Aug 9 13:18:23 2007 UTC
# Line 29  Line 29 
29   * of said person's immediate fault when using the work as intended.   * of said person's immediate fault when using the work as intended.
30   */   */
31    
32  #ifndef DBIF_H  #ifndef NFOHELPR_H
33  #define DBIF_H  #define NFOHELPR_H
   
 #include "sqlite3.h"  
34    
35  /* stolen from mksh's sh.h */  /* stolen from mksh's sh.h */
36  #ifdef EXTERN  #ifdef EXTERN
# Line 51  Line 49 
49    
50  __BEGIN_DECLS  __BEGIN_DECLS
51  EXTERN int debug I__(0);  EXTERN int debug I__(0);
 EXTERN sqlite3 *db I__(NULL);  
   
 /* dbif.c */  
 void dberr(int, const char *, ...)  
     __attribute__((format (printf, 2, 3)))  
     __attribute__((noreturn));  
 #define dbexecv(cb, cbarg, sqlfmt, ...) dbexecv_(__FILE__, __LINE__, \  
             __func__, (cb), (cbarg), (sqlfmt), __VA_ARGS__)  
 int dbexecv_(const char *, unsigned, const char *, sqlite3_callback,  
     void *, const char *, ...)  
     __attribute__((nonnull (6)))  
     __attribute__((format (printf, 6, 7)));  
   
 #define xdbexecv(et, cb, cbarg, sqlfmt, ...) do {               \  
         if (dbexecv_(__FILE__, __LINE__, __func__,              \  
             (cb), (cbarg), (sqlfmt), __VA_ARGS__))              \  
                 dberr(1, et ? et : "processing SQL stmt");      \  
 } while (0)  
52    
53  #ifdef NFOTISER  #ifdef NFOTISER
54  #ifdef __GLIBC__  #ifdef __GLIBC__
# Line 114  __END_DECLS Line 94  __END_DECLS
94          size_t str_nsave_sz = (n);                      \          size_t str_nsave_sz = (n);                      \
95                                                          \                                                          \
96          str_nsave_ptr = xmalloc(str_nsave_sz + 1);      \          str_nsave_ptr = xmalloc(str_nsave_sz + 1);      \
97          memcpy(str_nsave_sz, (s), str_nsave_sz);        \          memcpy(str_nsave_ptr, (s), str_nsave_sz);       \
98          str_nsave_ptr[str_nsave_sz] = '\0';             \          str_nsave_ptr[str_nsave_sz] = '\0';             \
99          (str_nsave_ptr);                                \          (str_nsave_ptr);                                \
100  })  })

Legend:
Removed from v.3453  
changed lines
  Added in v.3456

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20