cdb-full 0.5a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/COPYING +6 -0
  2. data/FILES +88 -0
  3. data/README +163 -0
  4. data/VERSION +1 -0
  5. data/cdb-0.75/CHANGES +16 -0
  6. data/cdb-0.75/FILES +78 -0
  7. data/cdb-0.75/Makefile +320 -0
  8. data/cdb-0.75/README +7 -0
  9. data/cdb-0.75/SYSDEPS +3 -0
  10. data/cdb-0.75/TARGETS +66 -0
  11. data/cdb-0.75/TODO +1 -0
  12. data/cdb-0.75/VERSION +1 -0
  13. data/cdb-0.75/alloc.c +32 -0
  14. data/cdb-0.75/alloc.h +8 -0
  15. data/cdb-0.75/auto-str.c +44 -0
  16. data/cdb-0.75/auto_home.h +6 -0
  17. data/cdb-0.75/buffer.c +10 -0
  18. data/cdb-0.75/buffer.h +56 -0
  19. data/cdb-0.75/buffer_0.c +12 -0
  20. data/cdb-0.75/buffer_1.c +6 -0
  21. data/cdb-0.75/buffer_1s.c +6 -0
  22. data/cdb-0.75/buffer_2.c +6 -0
  23. data/cdb-0.75/buffer_copy.c +16 -0
  24. data/cdb-0.75/buffer_get.c +67 -0
  25. data/cdb-0.75/buffer_put.c +88 -0
  26. data/cdb-0.75/byte.h +13 -0
  27. data/cdb-0.75/byte_copy.c +14 -0
  28. data/cdb-0.75/byte_cr.c +16 -0
  29. data/cdb-0.75/byte_diff.c +16 -0
  30. data/cdb-0.75/cdb.c +136 -0
  31. data/cdb-0.75/cdb.h +37 -0
  32. data/cdb-0.75/cdb_hash.c +21 -0
  33. data/cdb-0.75/cdb_make.c +153 -0
  34. data/cdb-0.75/cdb_make.h +39 -0
  35. data/cdb-0.75/cdbdump.c +83 -0
  36. data/cdb-0.75/cdbget.c +67 -0
  37. data/cdb-0.75/cdbmake-12.sh +8 -0
  38. data/cdb-0.75/cdbmake-sv.sh +22 -0
  39. data/cdb-0.75/cdbmake.c +110 -0
  40. data/cdb-0.75/cdbstats.c +125 -0
  41. data/cdb-0.75/cdbtest.c +119 -0
  42. data/cdb-0.75/choose.sh +18 -0
  43. data/cdb-0.75/conf-cc +3 -0
  44. data/cdb-0.75/conf-home +3 -0
  45. data/cdb-0.75/conf-ld +3 -0
  46. data/cdb-0.75/error.c +109 -0
  47. data/cdb-0.75/error.h +25 -0
  48. data/cdb-0.75/error_str.c +271 -0
  49. data/cdb-0.75/exit.h +6 -0
  50. data/cdb-0.75/find-systype.sh +159 -0
  51. data/cdb-0.75/fmt.h +25 -0
  52. data/cdb-0.75/fmt_ulong.c +13 -0
  53. data/cdb-0.75/hier.c +15 -0
  54. data/cdb-0.75/install.c +149 -0
  55. data/cdb-0.75/instcheck.c +108 -0
  56. data/cdb-0.75/open.h +10 -0
  57. data/cdb-0.75/open_read.c +6 -0
  58. data/cdb-0.75/open_trunc.c +6 -0
  59. data/cdb-0.75/random.cdb +0 -0
  60. data/cdb-0.75/readwrite.h +7 -0
  61. data/cdb-0.75/rts.exp +251 -0
  62. data/cdb-0.75/rts.sh +1 -0
  63. data/cdb-0.75/rts.tests +210 -0
  64. data/cdb-0.75/scan.h +28 -0
  65. data/cdb-0.75/scan_ulong.c +11 -0
  66. data/cdb-0.75/seek.h +15 -0
  67. data/cdb-0.75/seek_cur.c +7 -0
  68. data/cdb-0.75/seek_set.c +7 -0
  69. data/cdb-0.75/str.h +14 -0
  70. data/cdb-0.75/str_len.c +14 -0
  71. data/cdb-0.75/strerr.h +78 -0
  72. data/cdb-0.75/strerr_die.c +31 -0
  73. data/cdb-0.75/strerr_sys.c +12 -0
  74. data/cdb-0.75/testzero.c +35 -0
  75. data/cdb-0.75/trycpp.c +7 -0
  76. data/cdb-0.75/tryulong32.c +11 -0
  77. data/cdb-0.75/uint32.h1 +11 -0
  78. data/cdb-0.75/uint32.h2 +11 -0
  79. data/cdb-0.75/uint32_pack.c +21 -0
  80. data/cdb-0.75/uint32_unpack.c +31 -0
  81. data/cdb-0.75/warn-auto.sh +2 -0
  82. data/cdb-0.75/x86cpuid.c +38 -0
  83. data/cdb.c +372 -0
  84. data/depend +1 -0
  85. data/extconf.rb +11 -0
  86. data/lib/cdb.rb +90 -0
  87. data/sample/sample.rb +35 -0
  88. metadata +152 -0
@@ -0,0 +1,18 @@
1
+
2
+ result="$4"
3
+
4
+ case "$1" in
5
+ *c*) ./compile $2.c >/dev/null 2>&1 || result="$3" ;;
6
+ esac
7
+
8
+ case "$1" in
9
+ *l*) ./load $2 >/dev/null 2>&1 || result="$3" ;;
10
+ esac
11
+
12
+ case "$1" in
13
+ *r*) ./$2 >/dev/null 2>&1 || result="$3" ;;
14
+ esac
15
+
16
+ rm -f $2.o $2
17
+
18
+ exec cat "$result"
@@ -0,0 +1,3 @@
1
+ gcc -O2 -fpic -g
2
+
3
+ This will be used to compile .c files.
@@ -0,0 +1,3 @@
1
+ /usr/local
2
+
3
+ This is the cdb home directory. Programs will be installed in .../bin.
@@ -0,0 +1,3 @@
1
+ gcc -s -fpic
2
+
3
+ This will be used to link .o files into an executable.
@@ -0,0 +1,109 @@
1
+ #include <errno.h>
2
+ #include "error.h"
3
+
4
+ /* warning: as coverage improves here, should update error_{str,temp} */
5
+
6
+ int error_intr =
7
+ #ifdef EINTR
8
+ EINTR;
9
+ #else
10
+ -1;
11
+ #endif
12
+
13
+ int error_nomem =
14
+ #ifdef ENOMEM
15
+ ENOMEM;
16
+ #else
17
+ -2;
18
+ #endif
19
+
20
+ int error_noent =
21
+ #ifdef ENOENT
22
+ ENOENT;
23
+ #else
24
+ -3;
25
+ #endif
26
+
27
+ int error_txtbsy =
28
+ #ifdef ETXTBSY
29
+ ETXTBSY;
30
+ #else
31
+ -4;
32
+ #endif
33
+
34
+ int error_io =
35
+ #ifdef EIO
36
+ EIO;
37
+ #else
38
+ -5;
39
+ #endif
40
+
41
+ int error_exist =
42
+ #ifdef EEXIST
43
+ EEXIST;
44
+ #else
45
+ -6;
46
+ #endif
47
+
48
+ int error_timeout =
49
+ #ifdef ETIMEDOUT
50
+ ETIMEDOUT;
51
+ #else
52
+ -7;
53
+ #endif
54
+
55
+ int error_inprogress =
56
+ #ifdef EINPROGRESS
57
+ EINPROGRESS;
58
+ #else
59
+ -8;
60
+ #endif
61
+
62
+ int error_wouldblock =
63
+ #ifdef EWOULDBLOCK
64
+ EWOULDBLOCK;
65
+ #else
66
+ -9;
67
+ #endif
68
+
69
+ int error_again =
70
+ #ifdef EAGAIN
71
+ EAGAIN;
72
+ #else
73
+ -10;
74
+ #endif
75
+
76
+ int error_pipe =
77
+ #ifdef EPIPE
78
+ EPIPE;
79
+ #else
80
+ -11;
81
+ #endif
82
+
83
+ int error_perm =
84
+ #ifdef EPERM
85
+ EPERM;
86
+ #else
87
+ -12;
88
+ #endif
89
+
90
+ int error_acces =
91
+ #ifdef EACCES
92
+ EACCES;
93
+ #else
94
+ -13;
95
+ #endif
96
+
97
+ int error_nodevice =
98
+ #ifdef ENXIO
99
+ ENXIO;
100
+ #else
101
+ -14;
102
+ #endif
103
+
104
+ int error_proto =
105
+ #ifdef EPROTO
106
+ EPROTO;
107
+ #else
108
+ -15;
109
+ #endif
@@ -0,0 +1,25 @@
1
+ #ifndef ERROR_H
2
+ #define ERROR_H
3
+
4
+ #include <errno.h>
5
+
6
+ extern int error_intr;
7
+ extern int error_nomem;
8
+ extern int error_noent;
9
+ extern int error_txtbsy;
10
+ extern int error_io;
11
+ extern int error_exist;
12
+ extern int error_timeout;
13
+ extern int error_inprogress;
14
+ extern int error_wouldblock;
15
+ extern int error_again;
16
+ extern int error_pipe;
17
+ extern int error_perm;
18
+ extern int error_acces;
19
+ extern int error_nodevice;
20
+ extern int error_proto;
21
+
22
+ extern char *error_str(int);
23
+ extern int error_temp(int);
24
+
25
+ #endif
@@ -0,0 +1,271 @@
1
+ #include <errno.h>
2
+ #include "error.h"
3
+
4
+ #define X(e,s) if (i == e) return s;
5
+
6
+ char *error_str(int i)
7
+ {
8
+ X(0,"no error")
9
+ X(error_intr,"interrupted system call")
10
+ X(error_nomem,"out of memory")
11
+ X(error_noent,"file does not exist")
12
+ X(error_txtbsy,"text busy")
13
+ X(error_io,"input/output error")
14
+ X(error_exist,"file already exists")
15
+ X(error_timeout,"timed out")
16
+ X(error_inprogress,"operation in progress")
17
+ X(error_again,"temporary failure")
18
+ X(error_wouldblock,"input/output would block")
19
+ X(error_pipe,"broken pipe")
20
+ X(error_perm,"permission denied")
21
+ X(error_acces,"access denied")
22
+ X(error_nodevice,"device not configured")
23
+ X(error_proto,"protocol error")
24
+ #ifdef ESRCH
25
+ X(ESRCH,"no such process")
26
+ #endif
27
+ #ifdef E2BIG
28
+ X(E2BIG,"argument list too long")
29
+ #endif
30
+ #ifdef ENOEXEC
31
+ X(ENOEXEC,"exec format error")
32
+ #endif
33
+ #ifdef EBADF
34
+ X(EBADF,"file descriptor not open")
35
+ #endif
36
+ #ifdef ECHILD
37
+ X(ECHILD,"no child processes")
38
+ #endif
39
+ #ifdef EDEADLK
40
+ X(EDEADLK,"operation would cause deadlock")
41
+ #endif
42
+ #ifdef EFAULT
43
+ X(EFAULT,"bad address")
44
+ #endif
45
+ #ifdef ENOTBLK
46
+ X(ENOTBLK,"not a block device")
47
+ #endif
48
+ #ifdef EBUSY
49
+ X(EBUSY,"device busy")
50
+ #endif
51
+ #ifdef EXDEV
52
+ X(EXDEV,"cross-device link")
53
+ #endif
54
+ #ifdef ENODEV
55
+ X(ENODEV,"device does not support operation")
56
+ #endif
57
+ #ifdef ENOTDIR
58
+ X(ENOTDIR,"not a directory")
59
+ #endif
60
+ #ifdef EISDIR
61
+ X(EISDIR,"is a directory")
62
+ #endif
63
+ #ifdef EINVAL
64
+ X(EINVAL,"invalid argument")
65
+ #endif
66
+ #ifdef ENFILE
67
+ X(ENFILE,"system cannot open more files")
68
+ #endif
69
+ #ifdef EMFILE
70
+ X(EMFILE,"process cannot open more files")
71
+ #endif
72
+ #ifdef ENOTTY
73
+ X(ENOTTY,"not a tty")
74
+ #endif
75
+ #ifdef EFBIG
76
+ X(EFBIG,"file too big")
77
+ #endif
78
+ #ifdef ENOSPC
79
+ X(ENOSPC,"out of disk space")
80
+ #endif
81
+ #ifdef ESPIPE
82
+ X(ESPIPE,"unseekable descriptor")
83
+ #endif
84
+ #ifdef EROFS
85
+ X(EROFS,"read-only file system")
86
+ #endif
87
+ #ifdef EMLINK
88
+ X(EMLINK,"too many links")
89
+ #endif
90
+ #ifdef EDOM
91
+ X(EDOM,"input out of range")
92
+ #endif
93
+ #ifdef ERANGE
94
+ X(ERANGE,"output out of range")
95
+ #endif
96
+ #ifdef EALREADY
97
+ X(EALREADY,"operation already in progress")
98
+ #endif
99
+ #ifdef ENOTSOCK
100
+ X(ENOTSOCK,"not a socket")
101
+ #endif
102
+ #ifdef EDESTADDRREQ
103
+ X(EDESTADDRREQ,"destination address required")
104
+ #endif
105
+ #ifdef EMSGSIZE
106
+ X(EMSGSIZE,"message too long")
107
+ #endif
108
+ #ifdef EPROTOTYPE
109
+ X(EPROTOTYPE,"incorrect protocol type")
110
+ #endif
111
+ #ifdef ENOPROTOOPT
112
+ X(ENOPROTOOPT,"protocol not available")
113
+ #endif
114
+ #ifdef EPROTONOSUPPORT
115
+ X(EPROTONOSUPPORT,"protocol not supported")
116
+ #endif
117
+ #ifdef ESOCKTNOSUPPORT
118
+ X(ESOCKTNOSUPPORT,"socket type not supported")
119
+ #endif
120
+ #ifdef EOPNOTSUPP
121
+ X(EOPNOTSUPP,"operation not supported")
122
+ #endif
123
+ #ifdef EPFNOSUPPORT
124
+ X(EPFNOSUPPORT,"protocol family not supported")
125
+ #endif
126
+ #ifdef EAFNOSUPPORT
127
+ X(EAFNOSUPPORT,"address family not supported")
128
+ #endif
129
+ #ifdef EADDRINUSE
130
+ X(EADDRINUSE,"address already used")
131
+ #endif
132
+ #ifdef EADDRNOTAVAIL
133
+ X(EADDRNOTAVAIL,"address not available")
134
+ #endif
135
+ #ifdef ENETDOWN
136
+ X(ENETDOWN,"network down")
137
+ #endif
138
+ #ifdef ENETUNREACH
139
+ X(ENETUNREACH,"network unreachable")
140
+ #endif
141
+ #ifdef ENETRESET
142
+ X(ENETRESET,"network reset")
143
+ #endif
144
+ #ifdef ECONNABORTED
145
+ X(ECONNABORTED,"connection aborted")
146
+ #endif
147
+ #ifdef ECONNRESET
148
+ X(ECONNRESET,"connection reset")
149
+ #endif
150
+ #ifdef ENOBUFS
151
+ X(ENOBUFS,"out of buffer space")
152
+ #endif
153
+ #ifdef EISCONN
154
+ X(EISCONN,"already connected")
155
+ #endif
156
+ #ifdef ENOTCONN
157
+ X(ENOTCONN,"not connected")
158
+ #endif
159
+ #ifdef ESHUTDOWN
160
+ X(ESHUTDOWN,"socket shut down")
161
+ #endif
162
+ #ifdef ETOOMANYREFS
163
+ X(ETOOMANYREFS,"too many references")
164
+ #endif
165
+ #ifdef ECONNREFUSED
166
+ X(ECONNREFUSED,"connection refused")
167
+ #endif
168
+ #ifdef ELOOP
169
+ X(ELOOP,"symbolic link loop")
170
+ #endif
171
+ #ifdef ENAMETOOLONG
172
+ X(ENAMETOOLONG,"file name too long")
173
+ #endif
174
+ #ifdef EHOSTDOWN
175
+ X(EHOSTDOWN,"host down")
176
+ #endif
177
+ #ifdef EHOSTUNREACH
178
+ X(EHOSTUNREACH,"host unreachable")
179
+ #endif
180
+ #ifdef ENOTEMPTY
181
+ X(ENOTEMPTY,"directory not empty")
182
+ #endif
183
+ #ifdef EPROCLIM
184
+ X(EPROCLIM,"too many processes")
185
+ #endif
186
+ #ifdef EUSERS
187
+ X(EUSERS,"too many users")
188
+ #endif
189
+ #ifdef EDQUOT
190
+ X(EDQUOT,"disk quota exceeded")
191
+ #endif
192
+ #ifdef ESTALE
193
+ X(ESTALE,"stale NFS file handle")
194
+ #endif
195
+ #ifdef EREMOTE
196
+ X(EREMOTE,"too many levels of remote in path")
197
+ #endif
198
+ #ifdef EBADRPC
199
+ X(EBADRPC,"RPC structure is bad")
200
+ #endif
201
+ #ifdef ERPCMISMATCH
202
+ X(ERPCMISMATCH,"RPC version mismatch")
203
+ #endif
204
+ #ifdef EPROGUNAVAIL
205
+ X(EPROGUNAVAIL,"RPC program unavailable")
206
+ #endif
207
+ #ifdef EPROGMISMATCH
208
+ X(EPROGMISMATCH,"program version mismatch")
209
+ #endif
210
+ #ifdef EPROCUNAVAIL
211
+ X(EPROCUNAVAIL,"bad procedure for program")
212
+ #endif
213
+ #ifdef ENOLCK
214
+ X(ENOLCK,"no locks available")
215
+ #endif
216
+ #ifdef ENOSYS
217
+ X(ENOSYS,"system call not available")
218
+ #endif
219
+ #ifdef EFTYPE
220
+ X(EFTYPE,"bad file type")
221
+ #endif
222
+ #ifdef EAUTH
223
+ X(EAUTH,"authentication error")
224
+ #endif
225
+ #ifdef ENEEDAUTH
226
+ X(ENEEDAUTH,"not authenticated")
227
+ #endif
228
+ #ifdef ENOSTR
229
+ X(ENOSTR,"not a stream device")
230
+ #endif
231
+ #ifdef ETIME
232
+ X(ETIME,"timer expired")
233
+ #endif
234
+ #ifdef ENOSR
235
+ X(ENOSR,"out of stream resources")
236
+ #endif
237
+ #ifdef ENOMSG
238
+ X(ENOMSG,"no message of desired type")
239
+ #endif
240
+ #ifdef EBADMSG
241
+ X(EBADMSG,"bad message type")
242
+ #endif
243
+ #ifdef EIDRM
244
+ X(EIDRM,"identifier removed")
245
+ #endif
246
+ #ifdef ENONET
247
+ X(ENONET,"machine not on network")
248
+ #endif
249
+ #ifdef ERREMOTE
250
+ X(ERREMOTE,"object not local")
251
+ #endif
252
+ #ifdef ENOLINK
253
+ X(ENOLINK,"link severed")
254
+ #endif
255
+ #ifdef EADV
256
+ X(EADV,"advertise error")
257
+ #endif
258
+ #ifdef ESRMNT
259
+ X(ESRMNT,"srmount error")
260
+ #endif
261
+ #ifdef ECOMM
262
+ X(ECOMM,"communication error")
263
+ #endif
264
+ #ifdef EMULTIHOP
265
+ X(EMULTIHOP,"multihop attempted")
266
+ #endif
267
+ #ifdef EREMCHG
268
+ X(EREMCHG,"remote address changed")
269
+ #endif
270
+ return "unknown error";
271
+ }
@@ -0,0 +1,6 @@
1
+ #ifndef EXIT_H
2
+ #define EXIT_H
3
+
4
+ extern void _exit();
5
+
6
+ #endif