Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve GDBM_File #18435

Merged
merged 2 commits into from
Jan 6, 2021
Merged

Improve GDBM_File #18435

merged 2 commits into from
Jan 6, 2021

Conversation

graygnuorg
Copy link
Contributor

This patch implements new functions and improves compatibility with new versions of GDBM.

  • ext/GDBM_File/GDBM_File.xs: Define interface methods for
    functions in newer GDBM versions.
    (GDBM_version): New static method. Return the version number
    (string in scalar, array of numbers in list context). Provide
    heurisics for determining the library version for GDBM prior
    to 1.9.
    (gdbm_close): Propagate return value from the library call.
    (gdbm_DESTROY): Croak if closing the database fails.
    (gdbm_UNTIE): New method.
    (gdbm_FETCH): Check database validity. Croak if gdbm_fetch returns
    error (except GDBM_ITEM_NOT_FOUND).
    (gdbm_STORE,gdbm_DELETE): Likewise.
    (gdbm_FIRSTKEY,gdbm_NEXTKEY): Likewise.
    (gdbm_EXISTS): Check database validity.
    (gdbm_errno): New function.
    (gdbm_syserrno): New function.
    (gdbm_strerror): New function.
    (gdbm_clear_error): New function.
    (gdbm_needs_recovery): New function.
    (gdbm_recover): New function.
    (gdbm_count): New function.

  • ext/GDBM_File/typemap (gdbm_count_t): Map to T_COUNT.

  • ext/GDBM_File/GDBM_File.pm: Document everything. Raise $VERSION.

  • MANIFEST: Update.

  • AUTHORS: Update.

This patch implements new functions and improves compatibility with
new versions of GDBM.

* ext/GDBM_File/GDBM_File.xs: Define interface methods for
functions in newer GDBM versions.
(GDBM_version): New static method.  Return the version number
(string in scalar, array of numbers in list context).  Provide
heurisics for determining the library version for GDBM prior
to 1.9.
(gdbm_close): Propagate return value from the library call.
(gdbm_DESTROY): Croak if closing the database fails.
(gdbm_UNTIE): New method.
(gdbm_FETCH): Check database validity. Croak if gdbm_fetch returns
error (except GDBM_ITEM_NOT_FOUND).
(gdbm_STORE,gdbm_DELETE): Likewise.
(gdbm_FIRSTKEY,gdbm_NEXTKEY): Likewise.
(gdbm_EXISTS): Check database validity.
(gdbm_errno): New function.
(gdbm_syserrno): New function.
(gdbm_strerror): New function.
(gdbm_clear_error): New function.
(gdbm_needs_recovery): New function.
(gdbm_recover): New function.
(gdbm_count): New function.
* ext/GDBM_File/typemap (gdbm_count_t): Map to T_COUNT.
* ext/GDBM_File/GDBM_File.pm: Document everything. Raise $VERSION.

* MANIFEST: Update.
* AUTHORS: Update.
* ext/GDBM_File/GDBM_File.xs (rcvr_errfun): Use dTHX
(gdbm_GDBM_version): Don't declare package.
* ext/GDBM_File/typemap: Map gdbm_count_t to T_UV.

* ext/GDBM_File/t/count.t: Use File::Temp to create db in
a temporary directory.
* ext/GDBM_File/t/fatal.t: Likewise.
* ext/GDBM_File/t/opt.t: Likewise.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants