This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ext/ consting
[perl5.git] / ext / SDBM_File / sdbm / sdbm.h
index 4921de7..53fc366 100644 (file)
@@ -47,7 +47,7 @@ typedef struct {
 #define sdbm_pagfno(db)        ((db)->pagf)
 
 typedef struct {
-       char *dptr;
+       const char *dptr;
        int dsize;
 } datum;
 
@@ -79,12 +79,13 @@ extern int sdbm_delete proto((DBM *, datum));
 extern int sdbm_store proto((DBM *, datum, datum, int));
 extern datum sdbm_firstkey proto((DBM *));
 extern datum sdbm_nextkey proto((DBM *));
+extern int sdbm_exists proto((DBM *, datum));
 
 /*
  * other
  */
 extern DBM *sdbm_prep proto((char *, char *, int, int));
-extern long sdbm_hash proto((char *, int));
+extern long sdbm_hash proto((const char *, int));
 
 #ifndef SDBM_ONLY
 #define dbm_open sdbm_open
@@ -98,8 +99,12 @@ extern long sdbm_hash proto((char *, int));
 #define dbm_clearerr sdbm_clearerr
 #endif
 
-/* Most of the following is stolen from perl.h. */
+/* Most of the following is stolen from perl.h.  We don't include
+   perl.h here because we just want the portability parts of perl.h,
+   not everything else.
+*/
 #ifndef H_PERL  /* Include guard */
+#include "embed.h"  /* Follow all the global renamings. */
 
 /*
  * The following contortions are brought to you on behalf of all the
@@ -168,8 +173,7 @@ extern long sdbm_hash proto((char *, int));
 /* This comes after <stdlib.h> so we don't try to change the standard
  * library prototypes; we'll use our own instead. */
 
-#if defined(MYMALLOC)
-
+#if defined(MYMALLOC) && !defined(PERL_POLLUTE_MALLOC)
 #  define malloc  Perl_malloc
 #  define calloc  Perl_calloc
 #  define realloc Perl_realloc
@@ -179,13 +183,14 @@ Malloc_t Perl_malloc proto((MEM_SIZE nbytes));
 Malloc_t Perl_calloc proto((MEM_SIZE elements, MEM_SIZE size));
 Malloc_t Perl_realloc proto((Malloc_t where, MEM_SIZE nbytes));
 Free_t   Perl_mfree proto((Malloc_t where));
-
 #endif /* MYMALLOC */
 
 #ifdef I_STRING
-#include <string.h>
+# ifndef __ultrix__
+#  include <string.h>
+# endif
 #else
-#include <strings.h>
+# include <strings.h>
 #endif
 
 #ifdef I_MEMORY
@@ -240,7 +245,7 @@ Free_t   Perl_mfree proto((Malloc_t where));
 #    endif
 #  endif
 #  ifdef BUGGY_MSC
-  #  pragma function(memcmp)
+#    pragma function(memcmp)
 #  endif
 #else
 #   ifndef memcmp