]> granicus.if.org Git - postgresql/blob - src/include/c.h
Add:
[postgresql] / src / include / c.h
1 /*-------------------------------------------------------------------------
2  *
3  * c.h
4  *        Fundamental C definitions.  This is included by every .c file in
5  *        postgres.
6  *
7  *
8  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
9  * Portions Copyright (c) 1994, Regents of the University of California
10  *
11  * $Id: c.h,v 1.64 2000/01/26 05:57:46 momjian Exp $
12  *
13  *-------------------------------------------------------------------------
14  */
15 /*
16  *       TABLE OF CONTENTS
17  *
18  *              When adding stuff to this file, please try and put stuff
19  *              into the relevant section, or add new sections as appropriate.
20  *
21  *        section       description
22  *        -------       ------------------------------------------------
23  *              1)              bool, true, false, TRUE, FALSE, NULL
24  *              2)              non-ansi C definitions:
25  *                              type prefixes: const, signed, volatile, inline
26  *                              cpp magic macros
27  *              3)              standard system types
28  *              4)              datum type
29  *              5)              IsValid macros for system types
30  *              6)              offsetof, lengthof, endof
31  *              7)              exception handling definitions, Assert, Trap, etc macros
32  *              8)              Min, Max, Abs, StrNCpy macros
33  *              9)              externs
34  *              10)             Berkeley-specific defs
35  *              11)             system-specific hacks
36  *
37  *       NOTES
38  *
39  *              This file is MACHINE AND COMPILER dependent!!!  (For now.)
40  *
41  * ----------------------------------------------------------------
42  */
43 #ifndef C_H
44 #define C_H
45
46 /* We have to include stdlib.h here because it defines many of these macros
47    on some platforms, and we only want our definitions used if stdlib.h doesn't
48    have its own.  The same goes for stddef and stdarg if present.
49 */
50
51 #include "config.h"
52
53
54 #include <stdio.h>
55 #include <stdlib.h>
56 #include <string.h>
57 #ifdef STDC_HEADERS
58 #include <stddef.h>
59 #include <stdarg.h>
60 #endif
61
62 #ifdef __CYGWIN32__
63 #include <errno.h>
64 #endif
65
66 /* ----------------------------------------------------------------
67  *                              Section 1:      bool, true, false, TRUE, FALSE, NULL
68  * ----------------------------------------------------------------
69  */
70 /*
71  * bool
72  *              Boolean value, either true or false.
73  *
74  */
75 #ifndef __cplusplus
76 #ifndef bool
77 typedef char bool;
78
79 #endif   /* ndef bool */
80 #endif   /* not C++ */
81 #ifndef true
82 #define true    ((bool) 1)
83 #endif
84 #ifndef false
85 #define false   ((bool) 0)
86 #endif
87 typedef bool *BoolPtr;
88
89 #ifndef TRUE
90 #define TRUE    1
91 #endif   /* TRUE */
92
93 #ifndef FALSE
94 #define FALSE   0
95 #endif   /* FALSE */
96
97 /*
98  * NULL
99  *              Null pointer.
100  */
101 #ifndef NULL
102 #define NULL    ((void *) 0)
103 #endif   /* !defined(NULL) */
104
105 /* ----------------------------------------------------------------
106  *                              Section 2: non-ansi C definitions:
107  *
108  *                              type prefixes: const, signed, volatile, inline
109  *                              cpp magic macros
110  * ----------------------------------------------------------------
111  */
112
113 /*
114  * CppAsString
115  *              Convert the argument to a string, using the C preprocessor.
116  * CppConcat
117  *              Concatenate two arguments together, using the C preprocessor.
118  *
119  * Note: the standard Autoconf macro AC_C_STRINGIZE actually only checks
120  * whether #identifier works, but if we have that we likely have ## too.
121  */
122 #if defined(HAVE_STRINGIZE)
123
124 #define CppAsString(identifier) #identifier
125 #define CppConcat(x, y)                 x##y
126
127 #else                                                   /* !HAVE_STRINGIZE */
128
129 #define CppAsString(identifier) "identifier"
130
131 /*
132  * CppIdentity -- On Reiser based cpp's this is used to concatenate
133  *              two tokens.  That is
134  *                              CppIdentity(A)B ==> AB
135  *              We renamed it to _private_CppIdentity because it should not
136  *              be referenced outside this file.  On other cpp's it
137  *              produces  A  B.
138  */
139 #define _priv_CppIdentity(x)x
140 #define CppConcat(x, y)                 _priv_CppIdentity(x)y
141
142 #endif   /* !HAVE_STRINGIZE */
143
144 /*
145  * dummyret is used to set return values in macros that use ?: to make
146  * assignments.  gcc wants these to be void, other compilers like char
147  */
148 #ifdef __GNUC__                                 /* GNU cc */
149 #define dummyret        void
150 #else
151 #define dummyret        char
152 #endif
153
154 /* ----------------------------------------------------------------
155  *                              Section 3:      standard system types
156  * ----------------------------------------------------------------
157  */
158
159 /*
160  * Pointer
161  *              Variable holding address of any memory resident object.
162  *
163  *              XXX Pointer arithmetic is done with this, so it can't be void *
164  *              under "true" ANSI compilers.
165  */
166 typedef char *Pointer;
167
168 /*
169  * intN
170  *              Signed integer, EXACTLY N BITS IN SIZE,
171  *              used for numerical computations and the
172  *              frontend/backend protocol.
173  */
174 typedef signed char int8;               /* == 8 bits */
175 typedef signed short int16;             /* == 16 bits */
176 typedef signed int int32;               /* == 32 bits */
177
178 /*
179  * uintN
180  *              Unsigned integer, EXACTLY N BITS IN SIZE,
181  *              used for numerical computations and the
182  *              frontend/backend protocol.
183  */
184 typedef unsigned char uint8;    /* == 8 bits */
185 typedef unsigned short uint16;  /* == 16 bits */
186 typedef unsigned int uint32;    /* == 32 bits */
187
188 /*
189  * floatN
190  *              Floating point number, AT LEAST N BITS IN SIZE,
191  *              used for numerical computations.
192  *
193  *              Since sizeof(floatN) may be > sizeof(char *), always pass
194  *              floatN by reference.
195  */
196 typedef float float32data;
197 typedef double float64data;
198 typedef float *float32;
199 typedef double *float64;
200
201 /*
202  * boolN
203  *              Boolean value, AT LEAST N BITS IN SIZE.
204  */
205 typedef uint8 bool8;                    /* >= 8 bits */
206 typedef uint16 bool16;                  /* >= 16 bits */
207 typedef uint32 bool32;                  /* >= 32 bits */
208
209 /*
210  * bitsN
211  *              Unit of bitwise operation, AT LEAST N BITS IN SIZE.
212  */
213 typedef uint8 bits8;                    /* >= 8 bits */
214 typedef uint16 bits16;                  /* >= 16 bits */
215 typedef uint32 bits32;                  /* >= 32 bits */
216
217 /*
218  * wordN
219  *              Unit of storage, AT LEAST N BITS IN SIZE,
220  *              used to fetch/store data.
221  */
222 typedef uint8 word8;                    /* >= 8 bits */
223 typedef uint16 word16;                  /* >= 16 bits */
224 typedef uint32 word32;                  /* >= 32 bits */
225
226 /*
227  * Size
228  *              Size of any memory resident object, as returned by sizeof.
229  */
230 typedef size_t Size;
231
232 /*
233  * Index
234  *              Index into any memory resident array.
235  *
236  * Note:
237  *              Indices are non negative.
238  */
239 typedef unsigned int Index;
240
241 #define MAXDIM 6
242 typedef struct
243 {
244         int                     indx[MAXDIM];
245 } IntArray;
246
247 /*
248  * Offset
249  *              Offset into any memory resident array.
250  *
251  * Note:
252  *              This differs from an Index in that an Index is always
253  *              non negative, whereas Offset may be negative.
254  */
255 typedef signed int Offset;
256
257 /* ----------------------------------------------------------------
258  *                              Section 4:      datum type + support macros
259  * ----------------------------------------------------------------
260  */
261 /*
262  * datum.h
263  *              POSTGRES abstract data type datum representation definitions.
264  *
265  * Note:
266  *
267  * Port Notes:
268  *      Postgres makes the following assumption about machines:
269  *
270  *      sizeof(Datum) == sizeof(long) >= sizeof(void *) >= 4
271  *
272  *      Postgres also assumes that
273  *
274  *      sizeof(char) == 1
275  *
276  *      and that
277  *
278  *      sizeof(short) == 2
279  *
280  *      If your machine meets these requirements, Datums should also be checked
281  *      to see if the positioning is correct.
282  *
283  *              This file is MACHINE AND COMPILER dependent!!!
284  */
285
286 typedef unsigned long Datum;    /* XXX sizeof(long) >= sizeof(void *) */
287 typedef Datum *DatumPtr;
288
289 #define GET_1_BYTE(datum)       (((Datum) (datum)) & 0x000000ff)
290 #define GET_2_BYTES(datum)      (((Datum) (datum)) & 0x0000ffff)
291 #define GET_4_BYTES(datum)      (((Datum) (datum)) & 0xffffffff)
292 #define SET_1_BYTE(value)       (((Datum) (value)) & 0x000000ff)
293 #define SET_2_BYTES(value)      (((Datum) (value)) & 0x0000ffff)
294 #define SET_4_BYTES(value)      (((Datum) (value)) & 0xffffffff)
295
296 /*
297  * DatumGetChar
298  *              Returns character value of a datum.
299  */
300
301 #define DatumGetChar(X) ((char) GET_1_BYTE(X))
302
303 /*
304  * CharGetDatum
305  *              Returns datum representation for a character.
306  */
307
308 #define CharGetDatum(X) ((Datum) SET_1_BYTE(X))
309
310 /*
311  * Int8GetDatum
312  *              Returns datum representation for an 8-bit integer.
313  */
314
315 #define Int8GetDatum(X) ((Datum) SET_1_BYTE(X))
316
317 /*
318  * DatumGetUInt8
319  *              Returns 8-bit unsigned integer value of a datum.
320  */
321
322 #define DatumGetUInt8(X) ((uint8) GET_1_BYTE(X))
323
324 /*
325  * UInt8GetDatum
326  *              Returns datum representation for an 8-bit unsigned integer.
327  */
328
329 #define UInt8GetDatum(X) ((Datum) SET_1_BYTE(X))
330
331 /*
332  * DatumGetInt16
333  *              Returns 16-bit integer value of a datum.
334  */
335
336 #define DatumGetInt16(X) ((int16) GET_2_BYTES(X))
337
338 /*
339  * Int16GetDatum
340  *              Returns datum representation for a 16-bit integer.
341  */
342
343 #define Int16GetDatum(X) ((Datum) SET_2_BYTES(X))
344
345 /*
346  * DatumGetUInt16
347  *              Returns 16-bit unsigned integer value of a datum.
348  */
349
350 #define DatumGetUInt16(X) ((uint16) GET_2_BYTES(X))
351
352 /*
353  * UInt16GetDatum
354  *              Returns datum representation for a 16-bit unsigned integer.
355  */
356
357 #define UInt16GetDatum(X) ((Datum) SET_2_BYTES(X))
358
359 /*
360  * DatumGetInt32
361  *              Returns 32-bit integer value of a datum.
362  */
363
364 #define DatumGetInt32(X) ((int32) GET_4_BYTES(X))
365
366 /*
367  * Int32GetDatum
368  *              Returns datum representation for a 32-bit integer.
369  */
370
371 #define Int32GetDatum(X) ((Datum) SET_4_BYTES(X))
372
373 /*
374  * DatumGetUInt32
375  *              Returns 32-bit unsigned integer value of a datum.
376  */
377
378 #define DatumGetUInt32(X) ((uint32) GET_4_BYTES(X))
379
380 /*
381  * UInt32GetDatum
382  *              Returns datum representation for a 32-bit unsigned integer.
383  */
384
385 #define UInt32GetDatum(X) ((Datum) SET_4_BYTES(X))
386
387 /*
388  * DatumGetObjectId
389  *              Returns object identifier value of a datum.
390  */
391
392 #define DatumGetObjectId(X) ((Oid) GET_4_BYTES(X))
393
394 /*
395  * ObjectIdGetDatum
396  *              Returns datum representation for an object identifier.
397  */
398
399 #define ObjectIdGetDatum(X) ((Datum) SET_4_BYTES(X))
400
401 /*
402  * DatumGetPointer
403  *              Returns pointer value of a datum.
404  */
405
406 #define DatumGetPointer(X) ((Pointer) X)
407
408 /*
409  * PointerGetDatum
410  *              Returns datum representation for a pointer.
411  */
412
413 #define PointerGetDatum(X) ((Datum) X)
414
415 /*
416  * DatumGetName
417  *              Returns name value of a datum.
418  */
419
420 #define DatumGetName(X) ((Name) DatumGetPointer((Datum) X))
421
422 /*
423  * NameGetDatum
424  *              Returns datum representation for a name.
425  */
426
427 #define NameGetDatum(X) PointerGetDatum((Pointer) X)
428
429
430 /*
431  * DatumGetFloat32
432  *              Returns 32-bit floating point value of a datum.
433  *              This is really a pointer, of course.
434  */
435
436 #define DatumGetFloat32(X) ((float32) DatumGetPointer((Datum) X))
437
438 /*
439  * Float32GetDatum
440  *              Returns datum representation for a 32-bit floating point number.
441  *              This is really a pointer, of course.
442  */
443
444 #define Float32GetDatum(X) PointerGetDatum((Pointer) X)
445
446 /*
447  * DatumGetFloat64
448  *              Returns 64-bit floating point value of a datum.
449  *              This is really a pointer, of course.
450  */
451
452 #define DatumGetFloat64(X) ((float64) DatumGetPointer(X))
453
454 /*
455  * Float64GetDatum
456  *              Returns datum representation for a 64-bit floating point number.
457  *              This is really a pointer, of course.
458  */
459
460 #define Float64GetDatum(X) PointerGetDatum((Pointer) X)
461
462 /* ----------------------------------------------------------------
463  *                              Section 5:      IsValid macros for system types
464  * ----------------------------------------------------------------
465  */
466 /*
467  * BoolIsValid
468  *              True iff bool is valid.
469  */
470 #define BoolIsValid(boolean)    ((boolean) == false || (boolean) == true)
471
472 /*
473  * PointerIsValid
474  *              True iff pointer is valid.
475  */
476 #define PointerIsValid(pointer) (bool)((void*)(pointer) != NULL)
477
478 /*
479  * PointerIsInBounds
480  *              True iff pointer is within given bounds.
481  *
482  * Note:
483  *              Assumes the bounded interval to be [min,max),
484  *              i.e. closed on the left and open on the right.
485  */
486 #define PointerIsInBounds(pointer, min, max) \
487                 ((min) <= (pointer) && (pointer) < (max))
488
489 /*
490  * PointerIsAligned
491  *              True iff pointer is properly aligned to point to the given type.
492  */
493 #define PointerIsAligned(pointer, type) \
494                 (((long)(pointer) % (sizeof (type))) == 0)
495
496 /* ----------------------------------------------------------------
497  *                              Section 6:      offsetof, lengthof, endof
498  * ----------------------------------------------------------------
499  */
500 /*
501  * offsetof
502  *              Offset of a structure/union field within that structure/union.
503  *
504  *              XXX This is supposed to be part of stddef.h, but isn't on
505  *              some systems (like SunOS 4).
506  */
507 #ifndef offsetof
508 #define offsetof(type, field)   ((long) &((type *)0)->field)
509 #endif   /* offsetof */
510
511 /*
512  * lengthof
513  *              Number of elements in an array.
514  */
515 #define lengthof(array) (sizeof (array) / sizeof ((array)[0]))
516
517 /*
518  * endof
519  *              Address of the element one past the last in an array.
520  */
521 #define endof(array)    (&array[lengthof(array)])
522
523 /* ----------------------------------------------------------------
524  *                              Section 7:      exception handling definitions
525  *                                                      Assert, Trap, etc macros
526  * ----------------------------------------------------------------
527  */
528 /*
529  * Exception Handling definitions
530  */
531
532 typedef char *ExcMessage;
533 typedef struct Exception
534 {
535         ExcMessage      message;
536 } Exception;
537
538 /*
539  * USE_ASSERT_CHECKING, if defined, turns on all the assertions.
540  * - plai  9/5/90
541  *
542  * It should _NOT_ be defined in releases or in benchmark copies
543  */
544
545 /*
546  * Trap
547  *              Generates an exception if the given condition is true.
548  *
549  */
550 #define Trap(condition, exception) \
551                 { if ((assert_enabled) && (condition)) \
552                                 ExceptionalCondition(CppAsString(condition), &(exception), \
553                                                 (char*)NULL, __FILE__, __LINE__); }
554
555 /*
556  *      TrapMacro is the same as Trap but it's intended for use in macros:
557  *
558  *              #define foo(x) (AssertM(x != 0) && bar(x))
559  *
560  *      Isn't CPP fun?
561  */
562 #define TrapMacro(condition, exception) \
563         ((bool) ((! assert_enabled) || (! condition) || \
564                          (ExceptionalCondition(CppAsString(condition), \
565                                                                   &(exception), \
566                                                                   (char*) NULL, __FILE__, __LINE__))))
567
568 #ifndef USE_ASSERT_CHECKING
569 #define Assert(condition)
570 #define AssertMacro(condition)  (void)true
571 #define AssertArg(condition)
572 #define AssertState(condition)
573 #define assert_enabled 0
574 #else
575 #define Assert(condition) \
576                 Trap(!(condition), FailedAssertion)
577
578 #define AssertMacro(condition) \
579                 (void)TrapMacro(!(condition), FailedAssertion)
580
581 #define AssertArg(condition) \
582                 Trap(!(condition), BadArg)
583
584 #define AssertState(condition) \
585                 Trap(!(condition), BadState)
586
587 extern int      assert_enabled;
588
589 #endif   /* USE_ASSERT_CHECKING */
590
591 /*
592  * LogTrap
593  *              Generates an exception with a message if the given condition is true.
594  *
595  */
596 #define LogTrap(condition, exception, printArgs) \
597                 { if ((assert_enabled) && (condition)) \
598                                 ExceptionalCondition(CppAsString(condition), &(exception), \
599                                                 vararg_format printArgs, __FILE__, __LINE__); }
600
601 /*
602  *      LogTrapMacro is the same as LogTrap but it's intended for use in macros:
603  *
604  *              #define foo(x) (LogAssertMacro(x != 0, "yow!") && bar(x))
605  */
606 #define LogTrapMacro(condition, exception, printArgs) \
607         ((bool) ((! assert_enabled) || (! condition) || \
608                          (ExceptionalCondition(CppAsString(condition), \
609                                                                    &(exception), \
610                                                                    vararg_format printArgs, __FILE__, __LINE__))))
611
612 #ifndef USE_ASSERT_CHECKING
613 #define LogAssert(condition, printArgs)
614 #define LogAssertMacro(condition, printArgs) true
615 #define LogAssertArg(condition, printArgs)
616 #define LogAssertState(condition, printArgs)
617 #else
618 #define LogAssert(condition, printArgs) \
619                 LogTrap(!(condition), FailedAssertion, printArgs)
620
621 #define LogAssertMacro(condition, printArgs) \
622                 LogTrapMacro(!(condition), FailedAssertion, printArgs)
623
624 #define LogAssertArg(condition, printArgs) \
625                 LogTrap(!(condition), BadArg, printArgs)
626
627 #define LogAssertState(condition, printArgs) \
628                 LogTrap(!(condition), BadState, printArgs)
629
630 extern int      assertEnable(int val);
631
632 #ifdef ASSERT_CHECKING_TEST
633 extern int      assertTest(int val);
634
635 #endif
636 #endif   /* USE_ASSERT_CHECKING */
637
638 /* ----------------------------------------------------------------
639  *                              Section 8:      Min, Max, Abs macros
640  * ----------------------------------------------------------------
641  */
642 /*
643  * Max
644  *              Return the maximum of two numbers.
645  */
646 #define Max(x, y)               ((x) > (y) ? (x) : (y))
647
648 /*
649  * Min
650  *              Return the minimum of two numbers.
651  */
652 #define Min(x, y)               ((x) < (y) ? (x) : (y))
653
654 /*
655  * Abs
656  *              Return the absolute value of the argument.
657  */
658 #define Abs(x)                  ((x) >= 0 ? (x) : -(x))
659
660 /*
661  * StrNCpy
662  *              Does string copy, and forces terminating NULL
663  */
664 /* we do this so if the macro is used in an if action, it will work */
665 #define StrNCpy(dst,src,len)    \
666 ( \
667         ((len) > 0) ? \
668         ( \
669                 strncpy((dst),(src),(len)-1), \
670                 *((dst)+(len)-1)='\0' \
671         ) \
672         : \
673                 (dummyret)NULL,(void)(dst) \
674 )
675
676 /* Get a bit mask of the bits set in non-int32 aligned addresses */
677 #define INT_ALIGN_MASK (sizeof(int32) - 1)
678
679 /*
680  *      This function gets call too often, so we inline it if we can.
681  *      Are we aligned for int32?
682  *      We have to cast the pointer to int so we can do the AND
683  *      We got the 64 number by testing this against the stock memset() on
684  *      BSD/OS 3.0. Larger values were slower.
685  */
686 #define MemSet(start, val, len) do \
687                                                                 { \
688                                                                         if (((long)(start) & INT_ALIGN_MASK) == 0 && \
689                                                                                 ((len) & INT_ALIGN_MASK) == 0 && \
690                                                                                 (val) == 0 && \
691                                                                                 (len) <= 64) \
692                                                                         { \
693                                                                                 int32 *_i = (int32 *)(start); \
694                                                                                 int32 *_stop = (int32 *)((char *)(start) + (len)); \
695                                                                                 \
696                                                                                 while (_i < _stop) \
697                                                                                         *_i++ = 0; \
698                                                                         } \
699                                                                         else \
700                                                                                 memset((start), (val), (len)); \
701                                                                 } while (0)
702
703 /* ----------------------------------------------------------------
704  *                              Section 9: externs
705  * ----------------------------------------------------------------
706  */
707
708 extern Exception FailedAssertion;
709 extern Exception BadArg;
710 extern Exception BadState;
711
712 /* in utils/error/assert.c */
713 extern int ExceptionalCondition(char *conditionName,
714                                          Exception *exceptionP, char *details,
715                                          char *fileName, int lineNumber);
716
717
718 /* ----------------
719  *              vararg_format is used by assert and the exception handling stuff
720  * ----------------
721  */
722 extern char *vararg_format(const char *fmt,...);
723
724
725
726 /* ----------------------------------------------------------------
727  *                              Section 10: berkeley-specific configuration
728  *
729  * this section contains settings which are only relevant to the UC Berkeley
730  * sites.  Other sites can ignore this
731  * ----------------------------------------------------------------
732  */
733
734 /* ----------------
735  *              storage managers
736  *
737  *              These are experimental and are not supported in the code that
738  *              we distribute to other sites.
739  * ----------------
740  */
741 #ifdef NOT_USED
742 #define STABLE_MEMORY_STORAGE
743 #endif
744
745
746
747 /* ----------------------------------------------------------------
748  *                              Section 11: system-specific hacks
749  *
750  *              This should be limited to things that absolutely have to be
751  *              included in every source file.  The changes should be factored
752  *              into a separate file so that changes to one port don't require
753  *              changes to c.h (and everyone recompiling their whole system).
754  * ----------------------------------------------------------------
755  */
756
757 #ifdef FIXADE
758 #if defined(hpux)
759 #include "port/hpux/fixade.h"   /* for unaligned access fixup */
760 #endif   /* hpux */
761 #endif
762
763 #if defined(sun) && defined(__sparc__) && !defined(__SVR4)
764 #define memmove(d, s, l)                bcopy(s, d, l)
765 #include <unistd.h>
766 #include <varargs.h>
767 #endif
768
769 /* These are for things that are one way on Unix and another on NT */
770 #define NULL_DEV                "/dev/null"
771 #define SEP_CHAR                '/'
772
773 /* defines for dynamic linking on Win32 platform */
774 #ifdef __CYGWIN32__
775 #if __GNUC__ && ! defined (__declspec)
776 #error You need egcs 1.1 or newer for compiling!
777 #endif
778 #ifdef BUILDING_DLL
779 #define DLLIMPORT __declspec (dllexport)
780 #else                                                   /* not BUILDING_DLL */
781 #define DLLIMPORT __declspec (dllimport)
782 #endif
783 #else                                                   /* not CYGWIN */
784 #define DLLIMPORT
785 #endif
786
787 /* Provide prototypes for routines not present in a particular machine's
788  * standard C library.  It'd be better to put these in config.h, but
789  * in config.h we haven't yet included anything that defines size_t...
790  */
791
792 #ifndef HAVE_SNPRINTF_DECL
793 extern int      snprintf(char *str, size_t count, const char *fmt,...);
794 #endif
795
796 #ifndef HAVE_VSNPRINTF_DECL
797 extern int      vsnprintf(char *str, size_t count, const char *fmt, va_list args);
798 #endif
799
800 #ifndef HAVE_MEMMOVE
801 #include <regex/utils.h>
802 #endif
803
804 /* ----------------
805  *              end of c.h
806  * ----------------
807  */
808 #endif   /* C_H */