1 | /***************************************
2 | $Revision: 1.2 $
3 |
4 | stubs.h - header file with things defined just to provisionally fix the TBDs.
5 |
6 | Status: NOT REVUED, TESTED, INCOMPLETE
7 |
8 | Design and implementation by: Marek Bukowy
9 |
10 | ******************/ /******************
11 | Copyright (c) 1999 RIPE NCC
12 |
13 | All Rights Reserved
14 |
15 | Permission to use, copy, modify, and distribute this software and its
16 | documentation for any purpose and without fee is hereby granted,
17 | provided that the above copyright notice appear in all copies and that
18 | both that copyright notice and this permission notice appear in
19 | supporting documentation, and that the name of the author not be
20 | used in advertising or publicity pertaining to distribution of the
21 | software without specific, written prior permission.
22 |
23 | THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
24 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
25 | AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
26 | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
27 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
28 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
29 | ***************************************/
30 |
31 |
32 |
33 | /* stubs: just defined to let the other thing compile. Use #define
34 | NOSTUBS to disable it. */
35 |
36 | #ifndef _STUBS_H
37 | #define _STUBS_H
38 |
39 | /* this is to allow user stubs in the code */
40 | /* it will trigger an error when NOSTUBS is set */
41 |
42 | #ifndef NOSTUBS
43 | #define STUB(a) do{a;}while(0)
44 | #else
45 | #define STUB(a) hey_here_is_a_stub_left=1;
46 | #endif
47 |
48 | /* now these are predefined ones... */
49 |
50 | #ifndef NOSTUBS
51 |
52 | #include <stdlib.h>
53 |
54 | #define die do{ \
55 | fprintf(stderr,"died: +%d %s\n",__LINE__, __FILE__);\
56 | *((int*)NULL)=0; \
57 | }while(0)
58 |
59 | #define SQL_TBLNAM_MAX 32
60 |
61 |
62 | /* struct to hold the table name.
63 | Wrapped in a struct to make it behave like a normal object (ref by
64 | value)
65 |
66 | in fact, this type should be made engine-dependent.
67 | */
68 |
69 | typedef struct {
70 | char val[SQL_TBLNAM_MAX];
71 | } sql_tblnam_t;
72 |
73 | /* who knows what key type we will really have in other engines */
74 | typedef long sql_key_t;
75 |
76 | #define SQ_NOKEY 0L
77 |
78 | #endif /* NOSTUBS */
79 | #endif /* _STUBS_H */