GDBM_File.xs revision 7c478bd95313f5f23a4c958a745db2134aa03244
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <gdbm.h>
#include <fcntl.h>
typedef struct {
SV * filter_fetch_key ;
SV * filter_store_key ;
SV * filter_fetch_value ;
SV * filter_store_value ;
int filtering ;
typedef GDBM_File_type * GDBM_File ;
typedef datum datum_value ;
SV * save_defsv ; \
/* printf("filtering %s\n", name) ;*/ \
SvREFCNT_dec(save_defsv) ; \
/*printf("end of filtering %s\n", name) ;*/ \
}
#define GDBM_BLOCKSIZE 0 /* gdbm defaults to stat blocksize */
typedef void (*FATALFUNC)();
#ifndef GDBM_FAST
static int
not_here(char *s)
{
croak("GDBM_File::%s not implemented on this architecture", s);
return -1;
}
#endif
/* GDBM allocates the datum with system malloc() and expects the user
* to free() it. So we either have to free() it immediately, or have
* perl free() it when it deallocates the SV, depending on whether
* perl uses malloc()/free() or not. */
static void
{
#else
#endif
}
/* Versions of gdbm prior to 1.7x might not have the gdbm_sync,
gdbm_exists, and gdbm_setopt functions. Apparently Slackware
(Linux) 2.1 contains gdbm-1.5 (which dates back to 1991).
*/
#ifndef GDBM_FAST
#endif
static double
{
errno = 0;
switch (*name) {
case 'A':
break;
case 'B':
break;
case 'C':
break;
case 'D':
break;
case 'E':
break;
case 'F':
break;
case 'G':
#ifdef GDBM_CACHESIZE
return GDBM_CACHESIZE;
#else
goto not_there;
#endif
#ifdef GDBM_FAST
return GDBM_FAST;
#else
goto not_there;
#endif
#ifdef GDBM_FASTMODE
return GDBM_FASTMODE;
#else
goto not_there;
#endif
#ifdef GDBM_INSERT
return GDBM_INSERT;
#else
goto not_there;
#endif
#ifdef GDBM_NEWDB
return GDBM_NEWDB;
#else
goto not_there;
#endif
#ifdef GDBM_NOLOCK
return GDBM_NOLOCK;
#else
goto not_there;
#endif
#ifdef GDBM_READER
return GDBM_READER;
#else
goto not_there;
#endif
#ifdef GDBM_REPLACE
return GDBM_REPLACE;
#else
goto not_there;
#endif
#ifdef GDBM_WRCREAT
return GDBM_WRCREAT;
#else
goto not_there;
#endif
#ifdef GDBM_WRITER
return GDBM_WRITER;
#else
goto not_there;
#endif
break;
case 'H':
break;
case 'I':
break;
case 'J':
break;
case 'K':
break;
case 'L':
break;
case 'M':
break;
case 'N':
break;
case 'O':
break;
case 'P':
break;
case 'Q':
break;
case 'R':
break;
case 'S':
break;
case 'T':
break;
case 'U':
break;
case 'V':
break;
case 'W':
break;
case 'X':
break;
case 'Y':
break;
case 'Z':
break;
}
return 0;
return 0;
}
double
char * name
int arg
char * dbtype
char * name
int read_write
int mode
CODE:
{
}
}
void
void
CODE:
gdbm_close(db);
int
int flags
if (RETVAL) {
croak("No write permission to gdbm file");
croak("gdbm store returned %d, errno %d, key \"%.*s\"",
}
int
int
void
int
int
int optflag
int &optval
int optlen
{ \
} \
else if (code) { \
else \
} \
}
SV *
CODE:
SV *
CODE:
SV *
CODE:
SV *
CODE: