-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Masatake YAMATO <[email protected]>
- Loading branch information
Showing
10 changed files
with
723 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--sort=no | ||
--extras=+g | ||
--extras=+r | ||
--fields=+rS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
SDBM_File input.xs /^MODULE = SDBM_File PACKAGE = SDBM_File PREFIX = sdbm_$/;" m roles:def | ||
SDBM_File input.xs /^MODULE = SDBM_File PACKAGE = SDBM_File PREFIX = sdbm_$/;" p module:SDBM_File roles:def | ||
sdbm_TIEHASH input.xs /^sdbm_TIEHASH(dbtype, filename, flags, mode, pagname=NULL)$/;" f package:SDBM_File.SDBM_File typeref:typename:SDBM_File signature:(char * dbtype,char * filename,int flags,int mode,char * pagname) roles:def | ||
TIEHASH input.xs /^sdbm_TIEHASH(dbtype, filename, flags, mode, pagname=NULL)$/;" f package:SDBM_File.SDBM_File typeref:typename:SDBM_File signature:(char * dbtype,char * filename,int flags,int mode,char * pagname) roles:def | ||
sdbm_DESTROY input.xs /^sdbm_DESTROY(db)$/;" f package:SDBM_File.SDBM_File typeref:typename:void signature:(SDBM_File db) roles:def | ||
DESTROY input.xs /^sdbm_DESTROY(db)$/;" f package:SDBM_File.SDBM_File typeref:typename:void signature:(SDBM_File db) roles:def | ||
sdbm_FETCH input.xs /^sdbm_FETCH(db, key)$/;" f package:SDBM_File.SDBM_File typeref:typename:datum_value signature:(SDBM_File db,datum_key key) roles:def | ||
FETCH input.xs /^sdbm_FETCH(db, key)$/;" f package:SDBM_File.SDBM_File typeref:typename:datum_value signature:(SDBM_File db,datum_key key) roles:def | ||
sdbm_STORE input.xs /^sdbm_STORE(db, key, value, flags = DBM_REPLACE)$/;" f package:SDBM_File.SDBM_File typeref:typename:int signature:(SDBM_File db,datum_key key,datum_value value,int flags) roles:def | ||
STORE input.xs /^sdbm_STORE(db, key, value, flags = DBM_REPLACE)$/;" f package:SDBM_File.SDBM_File typeref:typename:int signature:(SDBM_File db,datum_key key,datum_value value,int flags) roles:def | ||
sdbm_DELETE input.xs /^sdbm_DELETE(db, key)$/;" f package:SDBM_File.SDBM_File typeref:typename:int signature:(SDBM_File db,datum_key key) roles:def | ||
DELETE input.xs /^sdbm_DELETE(db, key)$/;" f package:SDBM_File.SDBM_File typeref:typename:int signature:(SDBM_File db,datum_key key) roles:def | ||
sdbm_EXISTS input.xs /^sdbm_EXISTS(db,key)$/;" f package:SDBM_File.SDBM_File typeref:typename:int signature:(SDBM_File db,datum_key key) roles:def | ||
EXISTS input.xs /^sdbm_EXISTS(db,key)$/;" f package:SDBM_File.SDBM_File typeref:typename:int signature:(SDBM_File db,datum_key key) roles:def | ||
sdbm_FIRSTKEY input.xs /^sdbm_FIRSTKEY(db)$/;" f package:SDBM_File.SDBM_File typeref:typename:datum_key signature:(SDBM_File db) roles:def | ||
FIRSTKEY input.xs /^sdbm_FIRSTKEY(db)$/;" f package:SDBM_File.SDBM_File typeref:typename:datum_key signature:(SDBM_File db) roles:def | ||
sdbm_NEXTKEY input.xs /^sdbm_NEXTKEY(db, key)$/;" f package:SDBM_File.SDBM_File typeref:typename:datum_key signature:(SDBM_File db) roles:def | ||
NEXTKEY input.xs /^sdbm_NEXTKEY(db, key)$/;" f package:SDBM_File.SDBM_File typeref:typename:datum_key signature:(SDBM_File db) roles:def | ||
sdbm_error input.xs /^sdbm_error(db)$/;" f package:SDBM_File.SDBM_File typeref:typename:int signature:(SDBM_File db) roles:def | ||
error input.xs /^sdbm_error(db)$/;" f package:SDBM_File.SDBM_File typeref:typename:int signature:(SDBM_File db) roles:def | ||
sdbm_clearerr input.xs /^ sdbm_clearerr = 1$/;" a function:SDBM_File.SDBM_File.sdbm_error roles:def | ||
filter_fetch_key input.xs /^filter_fetch_key(db, code)$/;" f package:SDBM_File.SDBM_File typeref:typename:SV * signature:(SDBM_File db,SV * code,SV * RETVAL) roles:def | ||
SDBM_File::filter_fetch_key input.xs /^ SDBM_File::filter_fetch_key = fetch_key$/;" a function:SDBM_File.SDBM_File.filter_fetch_key roles:def | ||
SDBM_File::filter_store_key input.xs /^ SDBM_File::filter_store_key = store_key$/;" a function:SDBM_File.SDBM_File.filter_fetch_key roles:def | ||
SDBM_File::filter_fetch_value input.xs /^ SDBM_File::filter_fetch_value = fetch_value$/;" a function:SDBM_File.SDBM_File.filter_fetch_key roles:def | ||
SDBM_File::filter_store_value input.xs /^ SDBM_File::filter_store_value = store_value$/;" a function:SDBM_File.SDBM_File.filter_fetch_key roles:def | ||
SDBM_File input.xs /^MODULE = SDBM_File PACKAGE = SDBM_X PREFIX = sdbm_X_$/;" m roles:def | ||
SDBM_X input.xs /^MODULE = SDBM_File PACKAGE = SDBM_X PREFIX = sdbm_X_$/;" p module:SDBM_File roles:def | ||
constants.xs input.xs /^INCLUDE: constants.xs$/;" M roles:included | ||
sdbm_X_DELETE0 input.xs /^sdbm_X_DELETE0(db, key)$/;" f package:SDBM_File.SDBM_X typeref:typename:int signature:(SDBM_File db,datum_key key) roles:def | ||
DELETE0 input.xs /^sdbm_X_DELETE0(db, key)$/;" f package:SDBM_File.SDBM_X typeref:typename:int signature:(SDBM_File db,datum_key key) roles:def | ||
sdbm_X_DELETE1 input.xs /^sdbm_X_DELETE1(db, key)$/;" f package:SDBM_File.SDBM_X typeref:typename:int signature:(SDBM_File db,datum_key key) roles:def | ||
DELETE1 input.xs /^sdbm_X_DELETE1(db, key)$/;" f package:SDBM_File.SDBM_X typeref:typename:int signature:(SDBM_File db,datum_key key) roles:def | ||
sin0 input.xs /^sin0()$/;" f package:SDBM_File.SDBM_X typeref:typename:double signature:() roles:def | ||
sin1 input.xs /^sin1();$/;" f package:SDBM_File.SDBM_X typeref:typename:double signature:() roles:def | ||
PERL_NO_GET_CONTEXT input.xs /^#define PERL_NO_GET_CONTEXT$/;" d file: roles:def | ||
EXTERN.h input.xs /^#include "EXTERN.h"/;" h roles:local | ||
perl.h input.xs /^#include "perl.h"/;" h roles:local | ||
XSUB.h input.xs /^#include "XSUB.h"/;" h roles:local | ||
sdbm.h input.xs /^#include "sdbm.h"/;" h roles:local | ||
fetch_key input.xs /^#define fetch_key /;" d file: roles:def | ||
store_key input.xs /^#define store_key /;" d file: roles:def | ||
fetch_value input.xs /^#define fetch_value /;" d file: roles:def | ||
store_value input.xs /^#define store_value /;" d file: roles:def | ||
__anoned1397e40108 input.xs /^typedef struct {$/;" s file: roles:def | ||
dbp input.xs /^ DBM * dbp ;$/;" m struct:__anoned1397e40108 typeref:typename:DBM * file: roles:def | ||
filter input.xs /^ SV * filter[4];$/;" m struct:__anoned1397e40108 typeref:typename:SV * [4] file: roles:def | ||
filtering input.xs /^ int filtering ;$/;" m struct:__anoned1397e40108 typeref:typename:int file: roles:def | ||
SDBM_File_type input.xs /^ } SDBM_File_type;$/;" t typeref:struct:__anoned1397e40108 file: roles:def | ||
SDBM_File input.xs /^typedef SDBM_File_type * SDBM_File ;$/;" t typeref:typename:SDBM_File_type * file: roles:def | ||
datum_key input.xs /^typedef datum datum_key ;$/;" t typeref:typename:datum file: roles:def | ||
datum_value input.xs /^typedef datum datum_value ;$/;" t typeref:typename:datum file: roles:def | ||
sdbm_FETCH input.xs /^#define sdbm_FETCH(/;" d file: signature:(db,key) roles:def | ||
sdbm_STORE input.xs /^#define sdbm_STORE(/;" d file: signature:(db,key,value,flags) roles:def | ||
sdbm_DELETE input.xs /^#define sdbm_DELETE(/;" d file: signature:(db,key) roles:def | ||
sdbm_EXISTS input.xs /^#define sdbm_EXISTS(/;" d file: signature:(db,key) roles:def | ||
sdbm_FIRSTKEY input.xs /^#define sdbm_FIRSTKEY(/;" d file: signature:(db) roles:def | ||
sdbm_NEXTKEY input.xs /^#define sdbm_NEXTKEY(/;" d file: signature:(db,key) roles:def | ||
X input.xs /^#define X "X"/;" d file: roles:def | ||
Y input.xs /^#define Y "Y"/;" d file: roles:def |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pcre2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
/* Derrive from perl5/ext/SDBM_File/SDBM_File.xs */ | ||
#define PERL_NO_GET_CONTEXT | ||
#include "EXTERN.h" | ||
#include "perl.h" | ||
#include "XSUB.h" | ||
#include "sdbm.h" | ||
|
||
#define fetch_key 0 | ||
#define store_key 1 | ||
#define fetch_value 2 | ||
#define store_value 3 | ||
|
||
typedef struct { | ||
DBM * dbp ; | ||
SV * filter[4]; | ||
int filtering ; | ||
} SDBM_File_type; | ||
|
||
typedef SDBM_File_type * SDBM_File ; | ||
typedef datum datum_key ; | ||
typedef datum datum_value ; | ||
|
||
#define sdbm_FETCH(db,key) sdbm_fetch(db->dbp,key) | ||
#define sdbm_STORE(db,key,value,flags) sdbm_store(db->dbp,key,value,flags) | ||
#define sdbm_DELETE(db,key) sdbm_delete(db->dbp,key) | ||
#define sdbm_EXISTS(db,key) sdbm_exists(db->dbp,key) | ||
#define sdbm_FIRSTKEY(db) sdbm_firstkey(db->dbp) | ||
#define sdbm_NEXTKEY(db,key) sdbm_nextkey(db->dbp) | ||
|
||
|
||
MODULE = SDBM_File PACKAGE = SDBM_File PREFIX = sdbm_ | ||
|
||
PROTOTYPES: DISABLE | ||
|
||
SDBM_File | ||
sdbm_TIEHASH(dbtype, filename, flags, mode, pagname=NULL) | ||
char * dbtype | ||
char * filename | ||
int flags | ||
int mode | ||
char * pagname | ||
CODE: | ||
{ | ||
DBM * dbp ; | ||
|
||
RETVAL = NULL ; | ||
if (pagname == NULL) { | ||
dbp = sdbm_open(filename, flags, mode); | ||
} | ||
else { | ||
dbp = sdbm_prep(filename, pagname, flags, mode); | ||
} | ||
if (dbp) { | ||
RETVAL = (SDBM_File)safecalloc(1, sizeof(SDBM_File_type)); | ||
RETVAL->dbp = dbp ; | ||
} | ||
|
||
} | ||
OUTPUT: | ||
RETVAL | ||
|
||
void | ||
sdbm_DESTROY(db) | ||
SDBM_File db | ||
CODE: | ||
if (db) { | ||
int i = store_value; | ||
sdbm_close(db->dbp); | ||
do { | ||
if (db->filter[i]) | ||
SvREFCNT_dec_NN(db->filter[i]); | ||
} while (i-- > 0); | ||
safefree(db) ; | ||
} | ||
|
||
datum_value | ||
sdbm_FETCH(db, key) | ||
SDBM_File db | ||
datum_key key | ||
|
||
int | ||
sdbm_STORE(db, key, value, flags = DBM_REPLACE) | ||
SDBM_File db | ||
datum_key key | ||
datum_value value | ||
int flags | ||
CLEANUP: | ||
if (RETVAL) { | ||
if (RETVAL < 0 && errno == EPERM) | ||
croak("No write permission to sdbm file"); | ||
croak("sdbm store returned %d, errno %d, key \"%s\"", | ||
RETVAL,errno,key.dptr); | ||
sdbm_clearerr(db->dbp); | ||
} | ||
|
||
int | ||
sdbm_DELETE(db, key) | ||
SDBM_File db | ||
datum_key key | ||
|
||
int | ||
sdbm_EXISTS(db,key) | ||
SDBM_File db | ||
datum_key key | ||
|
||
datum_key | ||
sdbm_FIRSTKEY(db) | ||
SDBM_File db | ||
|
||
datum_key | ||
sdbm_NEXTKEY(db, key) | ||
SDBM_File db | ||
|
||
int | ||
sdbm_error(db) | ||
SDBM_File db | ||
ALIAS: | ||
sdbm_clearerr = 1 | ||
CODE: | ||
RETVAL = ix ? sdbm_clearerr(db->dbp) : sdbm_error(db->dbp); | ||
OUTPUT: | ||
RETVAL | ||
|
||
SV * | ||
filter_fetch_key(db, code) | ||
SDBM_File db | ||
SV * code | ||
SV * RETVAL = &PL_sv_undef ; | ||
ALIAS: | ||
SDBM_File::filter_fetch_key = fetch_key | ||
SDBM_File::filter_store_key = store_key | ||
SDBM_File::filter_fetch_value = fetch_value | ||
SDBM_File::filter_store_value = store_value | ||
CODE: | ||
DBM_setFilter(db->filter[ix], code); | ||
|
||
BOOT: | ||
{ | ||
HV *stash = gv_stashpvs("SDBM_File", 1); | ||
newCONSTSUB(stash, "PAGFEXT", newSVpvs(PAGFEXT)); | ||
newCONSTSUB(stash, "DIRFEXT", newSVpvs(DIRFEXT)); | ||
newCONSTSUB(stash, "PAIRMAX", newSVuv(PAIRMAX)); | ||
} | ||
|
||
MODULE = SDBM_File PACKAGE = SDBM_X PREFIX = sdbm_X_ | ||
|
||
INCLUDE: constants.xs | ||
|
||
int | ||
sdbm_X_DELETE0(db, key) | ||
SDBM_File db | ||
datum_key key | ||
|
||
#define X "X" | ||
|
||
int | ||
sdbm_X_DELETE1(db, key) | ||
SDBM_File db | ||
datum_key key | ||
|
||
#define Y "Y" | ||
|
||
double | ||
sin0() | ||
|
||
double | ||
sin1(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.