Compare commits
5 commits
Author | SHA1 | Date | |
---|---|---|---|
643985ee60 | |||
5e3601243d | |||
|
c38e901619 | ||
|
033c847b60 | ||
|
c29b1690d7 |
8 changed files with 60340 additions and 60030 deletions
34
Build.PL
34
Build.PL
|
@ -12,8 +12,6 @@ use utf8;
|
|||
use Module::Build;
|
||||
use File::Basename;
|
||||
use File::Spec;
|
||||
use CPAN::Meta;
|
||||
use CPAN::Meta::Prereqs;
|
||||
|
||||
my %args = (
|
||||
license => 'perl',
|
||||
|
@ -29,9 +27,12 @@ my %args = (
|
|||
|
||||
script_files => [glob('script/*'), glob('bin/*')],
|
||||
c_source => [qw(unqlite)],
|
||||
PL_files => {},
|
||||
|
||||
test_files => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/',
|
||||
recursive_test_files => 1,
|
||||
|
||||
|
||||
);
|
||||
if (-d 'share') {
|
||||
$args{share_dir} = 'share';
|
||||
|
@ -50,20 +51,15 @@ my $builder = Module::Build->subclass(
|
|||
)->new(%args);
|
||||
$builder->create_build_script();
|
||||
|
||||
my $mbmeta = CPAN::Meta->load_file('MYMETA.json');
|
||||
my $meta = CPAN::Meta->load_file('META.json');
|
||||
my $prereqs_hash = CPAN::Meta::Prereqs->new(
|
||||
$meta->prereqs
|
||||
)->with_merged_prereqs(
|
||||
CPAN::Meta::Prereqs->new($mbmeta->prereqs)
|
||||
)->as_string_hash;
|
||||
my $mymeta = CPAN::Meta->new(
|
||||
{
|
||||
%{$meta->as_struct},
|
||||
prereqs => $prereqs_hash
|
||||
}
|
||||
);
|
||||
print "Merging cpanfile prereqs to MYMETA.yml\n";
|
||||
$mymeta->save('MYMETA.yml', { version => 1.4 });
|
||||
print "Merging cpanfile prereqs to MYMETA.json\n";
|
||||
$mymeta->save('MYMETA.json', { version => 2 });
|
||||
use File::Copy;
|
||||
|
||||
print "cp META.json MYMETA.json\n";
|
||||
copy("META.json","MYMETA.json") or die "Copy failed(META.json): $!";
|
||||
|
||||
if (-f 'META.yml') {
|
||||
print "cp META.yml MYMETA.yml\n";
|
||||
copy("META.yml","MYMETA.yml") or die "Copy failed(META.yml): $!";
|
||||
} else {
|
||||
print "There is no META.yml... You may install this module from the repository...\n";
|
||||
}
|
||||
|
||||
|
|
8
Changes
8
Changes
|
@ -2,6 +2,14 @@ Revision history for Perl extension Unqlite
|
|||
|
||||
{{$NEXT}}
|
||||
|
||||
0.05 2014-12-23T22:55:15Z
|
||||
|
||||
- Doc fix
|
||||
|
||||
0.04 2014-08-30T09:33:52Z
|
||||
|
||||
- Fixed packaging issue.
|
||||
|
||||
0.03 2013-07-18T03:14:07Z
|
||||
|
||||
- more OPEN consts as mode argument
|
||||
|
|
12
META.json
12
META.json
|
@ -4,7 +4,7 @@
|
|||
"tokuhirom <tokuhirom@gmail.com>"
|
||||
],
|
||||
"dynamic_config" : 0,
|
||||
"generated_by" : "Minilla/v0.5.5, CPAN::Meta::Converter version 2.130880",
|
||||
"generated_by" : "Minilla/v2.2.0, CPAN::Meta::Converter version 2.141520",
|
||||
"license" : [
|
||||
"perl_5"
|
||||
],
|
||||
|
@ -21,21 +21,21 @@
|
|||
"share",
|
||||
"eg",
|
||||
"examples",
|
||||
"author"
|
||||
"author",
|
||||
"builder"
|
||||
]
|
||||
},
|
||||
"prereqs" : {
|
||||
"configure" : {
|
||||
"requires" : {
|
||||
"CPAN::Meta" : "0",
|
||||
"CPAN::Meta::Prereqs" : "0",
|
||||
"Module::Build" : "0.38"
|
||||
}
|
||||
},
|
||||
"develop" : {
|
||||
"requires" : {
|
||||
"Test::CPAN::Meta" : "0",
|
||||
"Test::MinimumVersion" : "0.10108",
|
||||
"Test::MinimumVersion::Fast" : "0.04",
|
||||
"Test::PAUSE::Permissions" : "0.04",
|
||||
"Test::Pod" : "1.41",
|
||||
"Test::Spellunker" : "v0.2.7"
|
||||
}
|
||||
|
@ -63,7 +63,7 @@
|
|||
"web" : "https://github.com/tokuhirom/UnQLite"
|
||||
}
|
||||
},
|
||||
"version" : "0.03",
|
||||
"version" : "0.05",
|
||||
"x_contributors" : [
|
||||
"Kenichi Ishigaki <ishigaki@cpan.org>",
|
||||
"Reini Urban <rurban@cpanel.net>"
|
||||
|
|
28
README.md
28
README.md
|
@ -6,14 +6,14 @@ UnQLite - Perl bindings for UnQLite
|
|||
|
||||
use UnQLite;
|
||||
|
||||
my $db = UnQLite->open('foo.db', UNQLITE_OPEN_READWRITE|UNQLITE_OPEN_CREATE);
|
||||
my $db = UnQLite->open('foo.db', UnQLite::UNQLITE_OPEN_READWRITE|UnQLite::UNQLITE_OPEN_CREATE);
|
||||
$db->kv_store('foo', 'bar');
|
||||
say $db->kv_fetch('foo'); # => bar
|
||||
$db->kv_delete('foo');
|
||||
undef $db; # close database
|
||||
|
||||
# tie interface
|
||||
tie my %hash, 'UnQLite', 'foo.db', UNQLITE_OPEN_READWRITE;
|
||||
tie my %hash, 'UnQLite', 'foo.db', UnQLite::UNQLITE_OPEN_READWRITE;
|
||||
$hash{foo} = 'bar';
|
||||
say $hash{foo}; # => bar
|
||||
|
||||
|
@ -23,11 +23,11 @@ UnQLite is a in-process software library which implements a self-contained, serv
|
|||
|
||||
This module is Perl5 binding for UnQLite.
|
||||
|
||||
If you want to know more information about UnQLite, see [http://unqlite.org/](http://unqlite.org/).
|
||||
If you want to know more information about UnQLite, see [https://unqlite.symisc.net/](https://unqlite.symisc.net/).
|
||||
|
||||
This version of UnQLite.pm does not provides document store feature. Patches welcome.
|
||||
|
||||
__You can use UnQLite.pm as DBM__.
|
||||
**You can use UnQLite.pm as DBM**.
|
||||
|
||||
# METHODS
|
||||
|
||||
|
@ -37,14 +37,14 @@ __You can use UnQLite.pm as DBM__.
|
|||
|
||||
Modes:
|
||||
|
||||
UNQLITE_OPEN_CREATE (Default)
|
||||
UNQLITE_OPEN_READONLY
|
||||
UNQLITE_OPEN_READWRITE
|
||||
UNQLITE_OPEN_EXCLUSIVE
|
||||
UNQLITE_OPEN_TEMP_DB
|
||||
UNQLITE_OPEN_OMIT_JOURNALING
|
||||
UNQLITE_OPEN_IN_MEMORY
|
||||
UNQLITE_OPEN_MMAP
|
||||
UnQLite::UNQLITE_OPEN_CREATE (Default)
|
||||
UnQLite::UNQLITE_OPEN_READONLY
|
||||
UnQLite::UNQLITE_OPEN_READWRITE
|
||||
UnQLite::UNQLITE_OPEN_EXCLUSIVE
|
||||
UnQLite::UNQLITE_OPEN_TEMP_DB
|
||||
UnQLite::UNQLITE_OPEN_OMIT_JOURNALING
|
||||
UnQLite::UNQLITE_OPEN_IN_MEMORY
|
||||
UnQLite::UNQLITE_OPEN_MMAP
|
||||
|
||||
- `$db->kv_store($key, $value);`
|
||||
|
||||
|
@ -118,11 +118,11 @@ Here is example code:
|
|||
|
||||
Return true if succeeded, false otherwise.
|
||||
|
||||
- `$cursor->seek($key, $opt=UNQLITE_CURSOR_MATCH_EXACT)`
|
||||
- `$cursor->seek($key, $opt=UnQLite::UNQLITE_CURSOR_MATCH_EXACT)`
|
||||
|
||||
Seek cursor to ` $key `.
|
||||
|
||||
You can specify the option as ` $opt `. Please see [http://unqlite.org/c\_api/unqlite\_kv\_cursor.html](http://unqlite.org/c\_api/unqlite\_kv\_cursor.html) for more details.
|
||||
You can specify the option as ` $opt `. Please see [http://unqlite.org/c\_api/unqlite\_kv\_cursor.html](http://unqlite.org/c_api/unqlite_kv_cursor.html) for more details.
|
||||
|
||||
Return true if succeeded, false otherwise.
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ use strict;
|
|||
use warnings;
|
||||
use Carp ();
|
||||
|
||||
our $VERSION = "0.03";
|
||||
our $VERSION = "0.05";
|
||||
our $rc = 0;
|
||||
|
||||
use XSLoader;
|
||||
|
@ -185,14 +185,14 @@ UnQLite - Perl bindings for UnQLite
|
|||
|
||||
use UnQLite;
|
||||
|
||||
my $db = UnQLite->open('foo.db', UNQLITE_OPEN_READWRITE|UNQLITE_OPEN_CREATE);
|
||||
my $db = UnQLite->open('foo.db', UnQLite::UNQLITE_OPEN_READWRITE|UnQLite::UNQLITE_OPEN_CREATE);
|
||||
$db->kv_store('foo', 'bar');
|
||||
say $db->kv_fetch('foo'); # => bar
|
||||
$db->kv_delete('foo');
|
||||
undef $db; # close database
|
||||
|
||||
# tie interface
|
||||
tie my %hash, 'UnQLite', 'foo.db', UNQLITE_OPEN_READWRITE;
|
||||
tie my %hash, 'UnQLite', 'foo.db', UnQLite::UNQLITE_OPEN_READWRITE;
|
||||
$hash{foo} = 'bar';
|
||||
say $hash{foo}; # => bar
|
||||
|
||||
|
@ -218,14 +218,14 @@ Open the database.
|
|||
|
||||
Modes:
|
||||
|
||||
UNQLITE_OPEN_CREATE (Default)
|
||||
UNQLITE_OPEN_READONLY
|
||||
UNQLITE_OPEN_READWRITE
|
||||
UNQLITE_OPEN_EXCLUSIVE
|
||||
UNQLITE_OPEN_TEMP_DB
|
||||
UNQLITE_OPEN_OMIT_JOURNALING
|
||||
UNQLITE_OPEN_IN_MEMORY
|
||||
UNQLITE_OPEN_MMAP
|
||||
UnQLite::UNQLITE_OPEN_CREATE (Default)
|
||||
UnQLite::UNQLITE_OPEN_READONLY
|
||||
UnQLite::UNQLITE_OPEN_READWRITE
|
||||
UnQLite::UNQLITE_OPEN_EXCLUSIVE
|
||||
UnQLite::UNQLITE_OPEN_TEMP_DB
|
||||
UnQLite::UNQLITE_OPEN_OMIT_JOURNALING
|
||||
UnQLite::UNQLITE_OPEN_IN_MEMORY
|
||||
UnQLite::UNQLITE_OPEN_MMAP
|
||||
|
||||
=item C<< $db->kv_store($key, $value); >>
|
||||
|
||||
|
@ -303,7 +303,7 @@ Seek cursor to previous entry.
|
|||
|
||||
Return true if succeeded, false otherwise.
|
||||
|
||||
=item C<< $cursor->seek($key, $opt=UNQLITE_CURSOR_MATCH_EXACT) >>
|
||||
=item C<< $cursor->seek($key, $opt=UnQLite::UNQLITE_CURSOR_MATCH_EXACT) >>
|
||||
|
||||
Seek cursor to C< $key >.
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/*
|
||||
* Copyright (C) 2012, 2013 Symisc Systems, S.U.A.R.L [M.I.A.G Mrad Chems Eddine <chm@symisc.net>].
|
||||
* Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Symisc Systems, S.U.A.R.L [M.I.A.G Mrad Chems Eddine <chm@symisc.net>].
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -22,4 +21,3 @@
|
|||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
|
120219
unqlite/unqlite.c
120219
unqlite/unqlite.c
File diff suppressed because it is too large
Load diff
|
@ -1,10 +1,14 @@
|
|||
/* This file was automatically generated. Do not edit (Except for compile time directives)! */
|
||||
#ifndef _UNQLITE_H_
|
||||
#define _UNQLITE_H_
|
||||
/* Make sure we can call this stuff from C++ */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Symisc UnQLite: An Embeddable NoSQL (Post Modern) Database Engine.
|
||||
* Copyright (C) 2012-2013, Symisc Systems http://unqlite.org/
|
||||
* Version 1.1.6
|
||||
* Copyright (C) 2012-2019, Symisc Systems http://unqlite.org/
|
||||
* Version 1.1.9
|
||||
* For information on licensing, redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES
|
||||
* please contact Symisc Systems via:
|
||||
* legal@symisc.net
|
||||
|
@ -14,7 +18,7 @@
|
|||
* http://unqlite.org/licensing.html
|
||||
*/
|
||||
/*
|
||||
* Copyright (C) 2012, 2013 Symisc Systems, S.U.A.R.L [M.I.A.G Mrad Chems Eddine <chm@symisc.net>].
|
||||
* Copyright (C) 2012, 2019 Symisc Systems, S.U.A.R.L [M.I.A.G Mrad Chems Eddine <chm@symisc.net>].
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -38,7 +42,7 @@
|
|||
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
/* $SymiscID: unqlite.h v1.1 UNIX|WIN32/64 2012-11-02 02:10 stable <chm@symisc.net> $ */
|
||||
/* $SymiscID: unqlite.h v1.3 Win10 2108-04-27 02:35:11 stable <chm@symisc.net> $ */
|
||||
#include <stdarg.h> /* needed for the definition of va_list */
|
||||
/*
|
||||
* Compile time engine version, signature, identification in the symisc source tree
|
||||
|
@ -49,18 +53,18 @@
|
|||
* [unqlite_lib_copyright()] for more information.
|
||||
*/
|
||||
/*
|
||||
* The UNQLITE_VERSION C preprocessor macroevaluates to a string literal
|
||||
* The UNQLITE_VERSION C preprocessor macro evaluates to a string literal
|
||||
* that is the unqlite version in the format "X.Y.Z" where X is the major
|
||||
* version number and Y is the minor version number and Z is the release
|
||||
* number.
|
||||
*/
|
||||
#define UNQLITE_VERSION "1.1.6"
|
||||
#define UNQLITE_VERSION "1.1.9"
|
||||
/*
|
||||
* The UNQLITE_VERSION_NUMBER C preprocessor macro resolves to an integer
|
||||
* with the value (X*1000000 + Y*1000 + Z) where X, Y, and Z are the same
|
||||
* numbers used in [UNQLITE_VERSION].
|
||||
*/
|
||||
#define UNQLITE_VERSION_NUMBER 1001006
|
||||
#define UNQLITE_VERSION_NUMBER 1001009
|
||||
/*
|
||||
* The UNQLITE_SIG C preprocessor macro evaluates to a string
|
||||
* literal which is the public signature of the unqlite engine.
|
||||
|
@ -68,14 +72,14 @@
|
|||
* generated Server MIME header as follows:
|
||||
* Server: YourWebServer/x.x unqlite/x.x.x \r\n
|
||||
*/
|
||||
#define UNQLITE_SIG "unqlite/1.1.6"
|
||||
#define UNQLITE_SIG "unqlite/1.1.9"
|
||||
/*
|
||||
* UnQLite identification in the Symisc source tree:
|
||||
* Each particular check-in of a particular software released
|
||||
* by symisc systems have an unique identifier associated with it.
|
||||
* This macro hold the one associated with unqlite.
|
||||
*/
|
||||
#define UNQLITE_IDENT "unqlite:b172a1e2c3f62fb35c8e1fb2795121f82356cad6"
|
||||
#define UNQLITE_IDENT "unqlite:29c173b1-ac2c-4b49-93ba-e600619e304e"
|
||||
/*
|
||||
* Copyright notice.
|
||||
* If you have any questions about the licensing situation, please
|
||||
|
@ -85,7 +89,7 @@
|
|||
* licensing@symisc.net
|
||||
* contact@symisc.net
|
||||
*/
|
||||
#define UNQLITE_COPYRIGHT "Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine <chm@symisc.net>] 2012-2013, http://unqlite.org/"
|
||||
#define UNQLITE_COPYRIGHT "Copyright (C) Symisc Systems, S.U.A.R.L [Mrad Chems Eddine <chm@symisc.net>] 2012-2019, http://unqlite.org/"
|
||||
|
||||
/* Forward declaration to public objects */
|
||||
typedef struct unqlite_io_methods unqlite_io_methods;
|
||||
|
@ -399,7 +403,7 @@ typedef sxi64 unqlite_int64;
|
|||
* Each options require a variable number of arguments.
|
||||
* The [unqlite_vm_config()] interface will return UNQLITE_OK on success, any other return
|
||||
* value indicates failure.
|
||||
* There are many options but the most importants are: UNQLITE_VM_CONFIG_OUTPUT which install
|
||||
* There are many options but the most important are: UNQLITE_VM_CONFIG_OUTPUT which install
|
||||
* a VM output consumer callback, UNQLITE_VM_CONFIG_HTTP_REQUEST which parse and register
|
||||
* a HTTP request and UNQLITE_VM_CONFIG_ARGV_ENTRY which populate the $argv array.
|
||||
* For a full discussion on the configuration verbs and their expected parameters, please
|
||||
|
@ -651,14 +655,14 @@ struct unqlite_vfs {
|
|||
typedef sxu64 pgno;
|
||||
/*
|
||||
* A database disk page is represented by an instance
|
||||
* of the follwoing structure.
|
||||
* of the following structure.
|
||||
*/
|
||||
typedef struct unqlite_page unqlite_page;
|
||||
struct unqlite_page
|
||||
{
|
||||
unsigned char *zData; /* Content of this page */
|
||||
void *pUserData; /* Extra content */
|
||||
pgno pgno; /* Page number for this page */
|
||||
pgno iPage; /* Page number for this page */
|
||||
};
|
||||
/*
|
||||
* UnQLite handle to the underlying Key/Value Storage Engine (See below).
|
||||
|
@ -783,9 +787,9 @@ struct unqlite_kv_methods
|
|||
#define UNQLITE_JOURNAL_FILE_SUFFIX "_unqlite_journal"
|
||||
#endif
|
||||
/*
|
||||
* Call Context - Error Message Serverity Level.
|
||||
* Call Context - Error Message Severity Level.
|
||||
*
|
||||
* The following constans are the allowed severity level that can
|
||||
* The following constants are the allowed severity level that can
|
||||
* passed as the second argument to the [unqlite_context_throw_error()] or
|
||||
* [unqlite_context_throw_error_format()] interfaces.
|
||||
* Refer to the official documentation for additional information.
|
||||
|
@ -803,6 +807,7 @@ UNQLITE_APIEXPORT int unqlite_open(unqlite **ppDB,const char *zFilename,unsigned
|
|||
UNQLITE_APIEXPORT int unqlite_config(unqlite *pDb,int nOp,...);
|
||||
UNQLITE_APIEXPORT int unqlite_close(unqlite *pDb);
|
||||
|
||||
|
||||
/* Key/Value (KV) Store Interfaces */
|
||||
UNQLITE_APIEXPORT int unqlite_kv_store(unqlite *pDb,const void *pKey,int nKeyLen,const void *pData,unqlite_int64 nDataLen);
|
||||
UNQLITE_APIEXPORT int unqlite_kv_append(unqlite *pDb,const void *pKey,int nKeyLen,const void *pData,unqlite_int64 nDataLen);
|
||||
|
@ -945,5 +950,7 @@ UNQLITE_APIEXPORT const char * unqlite_lib_version(void);
|
|||
UNQLITE_APIEXPORT const char * unqlite_lib_signature(void);
|
||||
UNQLITE_APIEXPORT const char * unqlite_lib_ident(void);
|
||||
UNQLITE_APIEXPORT const char * unqlite_lib_copyright(void);
|
||||
|
||||
#endif /* _UNQLITE_H_ */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* _UNQLITE_H_ */
|
||||
|
|
Loading…
Add table
Reference in a new issue