home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Online / Samba / source / amiga_rcs / Assert.h < prev    next >
C/C++ Source or Header  |  2000-08-17  |  5KB  |  249 lines

  1. head    1.7;
  2. access;
  3. symbols
  4.     V1_15:1.7
  5.     V1_12:1.6
  6.     V1_11:1.6
  7.     V1_10:1.6
  8.     V1_9:1.6
  9.     V1_8:1.6
  10.     V1_7:1.6
  11.     V1_6:1.6
  12.     V1_5:1.5
  13.     V1_4:1.3
  14.     V1_3:1.3
  15.     V1_2:1.2
  16.     V1_1:1.1;
  17. locks
  18.     olsen:1.7; strict;
  19. comment    @ * @;
  20.  
  21.  
  22. 1.7
  23. date    2000.05.22.19.10.30;    author olsen;    state Exp;
  24. branches;
  25. next    1.6;
  26.  
  27. 1.6
  28. date    99.03.06.21.02.08;    author olsen;    state Exp;
  29. branches;
  30. next    1.5;
  31.  
  32. 1.5
  33. date    99.02.22.15.44.52;    author olsen;    state Exp;
  34. branches;
  35. next    1.4;
  36.  
  37. 1.4
  38. date    99.02.22.15.14.19;    author olsen;    state Exp;
  39. branches;
  40. next    1.3;
  41.  
  42. 1.3
  43. date    99.02.20.17.43.05;    author olsen;    state Exp;
  44. branches;
  45. next    1.2;
  46.  
  47. 1.2
  48. date    99.02.20.14.44.54;    author olsen;    state Exp;
  49. branches;
  50. next    1.1;
  51.  
  52. 1.1
  53. date    99.02.12.12.18.01;    author olsen;    state Exp;
  54. branches;
  55. next    ;
  56.  
  57.  
  58. desc
  59. @.
  60. @
  61.  
  62.  
  63. 1.7
  64. log
  65. @.
  66. @
  67. text
  68. @/*
  69.  * $Id: Assert.h 1.6 1999/03/06 21:02:08 olsen Exp olsen $
  70.  *
  71.  * :ts=8
  72.  *
  73.  * AmigaOS wrapper routines for Samba 2.0.0, using the AmiTCP V4 API
  74.  * and the SAS/C V6.58 compiler.
  75.  *
  76.  * Copyright (C) 1999-2000 by Olaf `Olsen' Barthel <olsen@@sourcery.han.de>
  77.  *
  78.  * This program is free software; you can redistribute it and/or modify
  79.  * it under the terms of the GNU General Public License as published by
  80.  * the Free Software Foundation; either version 2 of the License, or
  81.  * (at your option) any later version.
  82.  * 
  83.  * This program is distributed in the hope that it will be useful,
  84.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  85.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  86.  * GNU General Public License for more details.
  87.  * 
  88.  * You should have received a copy of the GNU General Public License
  89.  * along with this program; if not, write to the Free Software
  90.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  91.  */
  92.  
  93. /****************************************************************************/
  94.  
  95. /* IMPORTANT: If DEBUG is redefined, it must happen only here. This
  96.  *            will cause all modules to depend upon it to be rebuilt
  97.  *            by the smakefile (that is, provided the smakefile has
  98.  *            all the necessary dependency lines in place).
  99.  */
  100.  
  101. /*#define DEBUG*/
  102.  
  103. /****************************************************************************/
  104.  
  105. #ifdef ASSERT
  106. #undef ASSERT
  107. #endif    /* ASSERT */
  108.  
  109. #define PUSH_ASSERTS()    PUSHDEBUGLEVEL(0)
  110. #define PUSH_REPORTS()    PUSHDEBUGLEVEL(1)
  111. #define PUSH_CALLS()    PUSHDEBUGLEVEL(2)
  112. #define PUSH_ALL()    PUSHDEBUGLEVEL(2)
  113. #define POP()        POPDEBUGLEVEL()
  114.  
  115. #if defined(DEBUG) && defined(__SASC)
  116.  void _ASSERT(int x,const char *xs,const char *file,int line,const char *function);
  117.  void _SHOWVALUE(unsigned long value,int size,const char *name,const char *file,int line);
  118.  void _SHOWSTRING(const char *string,const char *name,const char *file,int line);
  119.  void _SHOWMSG(const char *msg,const char *file,int line);
  120.  void _ENTER(const char *file,int line,const char *function);
  121.  void _LEAVE(const char *file,int line,const char *function);
  122.  void _RETURN(const char *file,int line,const char *function,unsigned long result);
  123.  void _DPRINTF_HEADER(const char *file,int line);
  124.  void _DPRINTF(const char *format,...);
  125.  int  _SETDEBUGLEVEL(int level);
  126.  void _PUSHDEBUGLEVEL(int level);
  127.  void _POPDEBUGLEVEL(void);
  128.  void _SETPROGRAMNAME(char *name);
  129.  
  130.  #define ASSERT(x)        _ASSERT((int)(x),#x,__FILE__,__LINE__,__FUNC__)
  131.  #define ENTER()        _ENTER(__FILE__,__LINE__,__FUNC__)
  132.  #define LEAVE()        _LEAVE(__FILE__,__LINE__,__FUNC__)
  133.  #define RETURN(r)        _RETURN(__FILE__,__LINE__,__FUNC__,(unsigned long)r)
  134.  #define SHOWVALUE(v)        _SHOWVALUE((unsigned long)(v),sizeof(v),#v,__FILE__,__LINE__)
  135.  #define SHOWSTRING(s)        _SHOWSTRING((const char *)(s),#s,__FILE__,__LINE__)
  136.  #define SHOWMSG(s)        _SHOWMSG((const char *)(s),__FILE__,__LINE__)
  137.  #define D(s)            do { _DPRINTF_HEADER(__FILE__,__LINE__); _DPRINTF s; } while(0)
  138.  #define SETDEBUGLEVEL(l)    _SETDEBUGLEVEL(l)
  139.  #define PUSHDEBUGLEVEL(l)    _PUSHDEBUGLEVEL(l)
  140.  #define POPDEBUGLEVEL()    _POPDEBUGLEVEL()
  141.  #define SETPROGRAMNAME(n)    _SETPROGRAMNAME(n)
  142.  
  143.  #undef DEBUG
  144.  #define DEBUG 1
  145. #else
  146.  #define ASSERT(x)        ((void)0)
  147.  #define ENTER()        ((void)0)
  148.  #define LEAVE()        ((void)0)
  149.  #define RETURN(r)        ((void)0)
  150.  #define SHOWVALUE(v)        ((void)0)
  151.  #define SHOWSTRING(s)        ((void)0)
  152.  #define SHOWMSG(s)        ((void)0)
  153.  #define D(s)            ((void)0)
  154.  #define SETDEBUGLEVEL(l)    ((void)0)
  155.  #define PUSHDEBUGLEVEL(l)    ((void)0)
  156.  #define POPDEBUGLEVEL()    ((void)0)
  157.  #define SETPROGRAMNAME(n)    ((void)0)
  158.  
  159.  #ifdef DEBUG
  160.  #undef DEBUG
  161.  #endif /* DEBUG */
  162.  
  163.  #define DEBUG 0
  164. #endif /* DEBUG */
  165.  
  166. /****************************************************************************/
  167. @
  168.  
  169.  
  170. 1.6
  171. log
  172. @.
  173. @
  174. text
  175. @d2 1
  176. a2 1
  177.  * $Id: Assert.h 1.5 1999/02/22 15:44:52 olsen Exp olsen $
  178. d9 1
  179. a9 1
  180.  * Copyright (C) 1999 by Olaf `Olsen' Barthel <olsen@@sourcery.han.de>
  181. @
  182.  
  183.  
  184. 1.5
  185. log
  186. @.
  187. @
  188. text
  189. @d2 1
  190. a2 1
  191.  * $Id: Assert.h 1.4 1999/02/22 15:14:19 olsen Exp olsen $
  192. d87 1
  193. a87 1
  194.  #define SETDEBUGLEVEL(l)    (0)
  195. @
  196.  
  197.  
  198. 1.4
  199. log
  200. @.
  201. @
  202. text
  203. @d2 1
  204. a2 1
  205.  * $Id: Assert.h 1.3 1999/02/20 17:43:05 olsen Exp olsen $
  206. d34 1
  207. a34 1
  208. #define DEBUG
  209. @
  210.  
  211.  
  212. 1.3
  213. log
  214. @.
  215. @
  216. text
  217. @d2 1
  218. a2 1
  219.  * $Id: Assert.h 1.2 1999/02/20 14:44:54 olsen Exp olsen $
  220. d34 1
  221. a34 1
  222. /*#define DEBUG*/
  223. @
  224.  
  225.  
  226. 1.2
  227. log
  228. @.
  229. @
  230. text
  231. @d2 1
  232. a2 1
  233.  * $Id: Assert.h 1.1 1999/02/12 12:18:01 olsen Exp olsen $
  234. d34 1
  235. a34 1
  236. #define DEBUG
  237. @
  238.  
  239.  
  240. 1.1
  241. log
  242. @.
  243. @
  244. text
  245. @d34 1
  246. a34 1
  247. /*#define DEBUG*/
  248. @
  249.