mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-22 20:59:50 +00:00
Update sdb to remove double include paths ##build
* Updated pkg-config paths
This commit is contained in:
parent
b05abf9578
commit
a79add6dff
2
.gitignore
vendored
2
.gitignore
vendored
@ -75,8 +75,10 @@ shlr/sdb/src/sdb
|
||||
shlr/sdb/src/.sdb
|
||||
shlr/sdb/src/sdb.exe
|
||||
shlr/sdb/src/.sdb.exe
|
||||
shlr/sdb/include/sdb/version.h
|
||||
shlr/sdb/src/sdb-version.h
|
||||
shlr/sdb/src/sdb_version.h
|
||||
shlr/sdb/include/sdb/version.h
|
||||
shlr/sdb/src/libsdb.so*
|
||||
shlr/spp/config.h
|
||||
shlr/.cs_tmp.zip
|
||||
|
11
Makefile
11
Makefile
@ -155,7 +155,7 @@ windist:
|
||||
mkdir -p "${WINDIST}/include/libr/r_util"
|
||||
mkdir -p "${WINDIST}/include/libr/r_anal"
|
||||
@echo "${C}[WINDIST] Copying development files${R}"
|
||||
cp -f shlr/sdb/src/*.h "${WINDIST}/include/libr/sdb/"
|
||||
cp -f shlr/sdb/include/*.h "${WINDIST}/include/libr/sdb/"
|
||||
cp -f libr/include/r_util/*.h "${WINDIST}/include/libr/r_util/"
|
||||
cp -f libr/include/r_anal/*.h "${WINDIST}/include/libr/r_anal/"
|
||||
cp -f libr/include/*.h "${WINDIST}/include/libr"
|
||||
@ -232,10 +232,8 @@ install: install-doc install-man install-www install-pkgconfig
|
||||
$(MAKE) -C binr install
|
||||
$(MAKE) -C shlr install
|
||||
for DIR in ${DATADIRS} ; do $(MAKE) -C "$$DIR" install ; done
|
||||
cd "$(DESTDIR)$(LIBDIR)/radare2/" ;\
|
||||
rm -f last ; ln -fs $(VERSION) last
|
||||
cd "$(DESTDIR)$(DATADIR)/radare2/" ;\
|
||||
rm -f last ; ln -fs $(VERSION) last
|
||||
cd "$(DESTDIR)$(LIBDIR)/radare2/" && rm -f last && ln -fs $(VERSION) last
|
||||
cd "$(DESTDIR)$(DATADIR)/radare2/" && rm -f last && ln -fs $(VERSION) last
|
||||
rm -rf "${DESTDIR}${DATADIR}/radare2/${VERSION}/hud"
|
||||
mkdir -p "${DESTDIR}${DATADIR}/radare2/${VERSION}/hud"
|
||||
mkdir -p "${DESTDIR}${BINDIR}"
|
||||
@ -410,6 +408,9 @@ osx-pkg:
|
||||
quality:
|
||||
./sys/shellcheck.sh
|
||||
|
||||
ctags:
|
||||
@ctags **/*.c **/*.h > /dev/null
|
||||
|
||||
menu nconfig:
|
||||
./sys/menu.sh || true
|
||||
|
||||
|
@ -15,7 +15,7 @@ endif
|
||||
ifeq ($(USE_PIE),1)
|
||||
CFLAGS+=-pie
|
||||
endif
|
||||
CFLAGS:=-I$(LTOP)/include -I$(LTOP)/include/sdb $(CFLAGS)
|
||||
CFLAGS:=-I$(LTOP)/include $(CFLAGS)
|
||||
|
||||
ifeq (${ANDROID},1)
|
||||
LDFLAGS+=-lm
|
||||
|
@ -186,7 +186,7 @@ install-includes:
|
||||
done ; \
|
||||
done)
|
||||
${INSTALL_DIR} "${DESTDIR}${INCLUDEDIR}/libr/sdb"
|
||||
(cd ../shlr/sdb/src && for FILE in *.h ; do \
|
||||
(cd ../shlr/sdb/include/sdb && for FILE in *.h ; do \
|
||||
${INSTALL_DATA} $$FILE "${DESTDIR}${INCLUDEDIR}/libr/sdb/$$FILE" ; \
|
||||
done)
|
||||
for a in r_util r_crypto r_anal ; do \
|
||||
@ -202,7 +202,7 @@ symstall install-symlink:
|
||||
"${DESTDIR}${LIBDIR}/pkgconfig" \
|
||||
"${DESTDIR}${LIBDIR}/radare2/${VERSION}" ; \
|
||||
rm -rf "${DESTDIR}${INCLUDEDIR}/libr" && ln -fs "${PWD}/include" "${DESTDIR}${INCLUDEDIR}/libr" ; \
|
||||
rm -rf "${DESTDIR}${INCLUDEDIR}/libr/sdb" && ln -fs "${PWD}/../shlr/sdb/src" "${DESTDIR}${INCLUDEDIR}/libr/sdb" ; \
|
||||
rm -rf "${DESTDIR}${INCLUDEDIR}/libr/sdb" && ln -fs "${PWD}/../shlr/sdb/include/sdb" "${DESTDIR}${INCLUDEDIR}/libr/sdb" ; \
|
||||
$(MAKE) install-pkgconfig-symlink ; \
|
||||
$(foreach lib,${LIBS}, \
|
||||
ln -fs "${PWD}/$(lib)/libr_$(lib).${EXT_SO}" \
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include <r_anal.h>
|
||||
#include <r_hash.h>
|
||||
#include <ht_uu.h>
|
||||
|
||||
#define unwrap(rbnode) container_of (rbnode, RAnalBlock, _rb)
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <r_anal.h>
|
||||
#include <r_lib.h>
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
#include <capstone/capstone.h>
|
||||
#include <capstone/arm.h>
|
||||
#include <r_util/r_assert.h>
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <r_anal.h>
|
||||
#include <r_lib.h>
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
#include <r_util/r_assert.h>
|
||||
#include "encodings_dec.h"
|
||||
#include "encodings_fmt.h"
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <r_anal.h>
|
||||
#include <string.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
#include "base_types.h"
|
||||
|
||||
#define KSZ 256
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* public headers */
|
||||
#include <r_util.h>
|
||||
#include <r_types.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
|
||||
/* private headers */
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <r_asm.h>
|
||||
#include <r_lib.h>
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
#include "cs_version.h"
|
||||
#include "../arch/arm/asm-arm.h"
|
||||
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include <r_util.h>
|
||||
#include <r_lib.h>
|
||||
#include <r_bin.h>
|
||||
#include <ht_up.h>
|
||||
|
||||
#define COFF_IS_BIG_ENDIAN 1
|
||||
#define COFF_IS_LITTLE_ENDIAN 0
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <r_hash.h>
|
||||
#include <r_util.h>
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
#include "pe.h"
|
||||
|
||||
#define PE_IMAGE_FILE_MACHINE_RPI2 452
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <r_util.h>
|
||||
#include <r_lib.h>
|
||||
#include <r_bin.h>
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
|
||||
#include "coff/coff.h"
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include <r_bin.h>
|
||||
#include <r_core.h>
|
||||
#include <r_io.h>
|
||||
#include <ht_pu.h>
|
||||
// #include "../format/mach0/mach0_defines.h"
|
||||
#define R_BIN_MACH064 1
|
||||
#include "../format/mach0/mach0.h"
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <r_cons.h>
|
||||
#include "../i/private.h"
|
||||
#include "elf/elf.h"
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
|
||||
static RBinInfo* info(RBinFile *bf);
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "../i/private.h"
|
||||
#include "mach0/mach0.h"
|
||||
#include "objc/mach0_classes.h"
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
|
||||
typedef struct {
|
||||
ut8 *buf;
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <r_util.h>
|
||||
#include <r_lib.h>
|
||||
#include <r_bin.h>
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
#include "../i/private.h"
|
||||
#include "mach0/coresymbolication.h"
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <r_cons.h>
|
||||
#include <r_util/r_print.h>
|
||||
#include <r_util/r_json.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
#define I(x) r_cons_singleton ()->x
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <r_flag.h>
|
||||
#include <r_core.h>
|
||||
#include <r_bin.h>
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
#include <r_util.h>
|
||||
|
||||
HEAPTYPE (ut64);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#define R_LOG_ORIGIN "cmdapi"
|
||||
#include <r_core.h>
|
||||
#include "ht_pp.h"
|
||||
#include <sdb/ht_pp.h>
|
||||
|
||||
#define NCMDS (sizeof (cmd->cmds) / sizeof (*cmd->cmds))
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#include <r_core.h>
|
||||
#include <r_debug.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
#define TN_KEY_LEN 32
|
||||
#define TN_KEY_FMT "%"PFMT64u
|
||||
#ifndef SIGKILL
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "r_core.h"
|
||||
#include "r_util.h"
|
||||
#include "r_types.h"
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
char *getcommapath(RCore *core);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* radare - LGPL - Copyright 2010-2022 - pancake */
|
||||
|
||||
#include <r_core.h>
|
||||
#include <ht_uu.h>
|
||||
#include <sdb/ht_uu.h>
|
||||
#include "cmd_search_rop.c"
|
||||
|
||||
static int cmd_search(void *data, const char *input);
|
||||
|
@ -4171,7 +4171,8 @@ R_API RBuffer *r_core_syscall(RCore *core, const char *name, const char *args) {
|
||||
}
|
||||
|
||||
R_API RCoreAutocomplete *r_core_autocomplete_add(RCoreAutocomplete *parent, const char* cmd, int type, bool lock) {
|
||||
if (!parent || !cmd || type < 0 || type >= R_CORE_AUTOCMPLT_END) {
|
||||
r_return_val_if_fail (parent && cmd, NULL);
|
||||
if (type < 0 || type >= R_CORE_AUTOCMPLT_END) {
|
||||
return NULL;
|
||||
}
|
||||
RCoreAutocomplete *autocmpl = R_NEW0 (RCoreAutocomplete);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <r_anal.h>
|
||||
#include <r_util.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
static bool _set_interrupt(REsil *esil, REsilHandler *intr, ut32 intr_num) {
|
||||
return intr_num ? dict_set (esil->interrupts, intr_num, intr_num, intr) : (esil->intr0 = intr, true);
|
||||
|
@ -17,10 +17,10 @@
|
||||
#include <r_util.h>
|
||||
#include <r_bind.h>
|
||||
#include <r_syscall.h>
|
||||
#include <set.h>
|
||||
#include <r_flag.h>
|
||||
#include <r_bin.h>
|
||||
#include <r_codemeta.h>
|
||||
#include <sdb/set.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -19,7 +19,7 @@ struct r_reg_t;
|
||||
|
||||
#include <r_reg.h>
|
||||
#include <r_io.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
enum {
|
||||
R_ARCH_SYNTAX_NONE = 0,
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <r_util.h>
|
||||
#include <r_types.h>
|
||||
#include <ht_pu.h>
|
||||
#include <sdb/ht_pu.h>
|
||||
#include <r_io.h>
|
||||
#include <r_cons.h>
|
||||
#include <r_list.h>
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include <r_util.h>
|
||||
#include <r_bind.h>
|
||||
#include "ht_pp.h"
|
||||
#include <sdb/ht_pp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -21,8 +21,8 @@ extern "C" {
|
||||
#include <r_util/r_sys.h>
|
||||
#include <r_util/r_file.h>
|
||||
#include <r_vector.h>
|
||||
#include <sdb.h>
|
||||
#include <ht_up.h>
|
||||
#include <sdb/sdb.h>
|
||||
#include <sdb/ht_up.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define R2_LIST_H
|
||||
|
||||
#include <r_types.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -9,7 +9,7 @@ extern "C" {
|
||||
|
||||
#include <r_types.h>
|
||||
#include <r_util.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
R_LIB_VERSION_HEADER (r_syscall);
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
typedef struct r_type_enum {
|
||||
char *name;
|
||||
|
@ -7,7 +7,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <ht_up.h>
|
||||
#include <sdb/ht_up.h>
|
||||
#include <r_vector.h>
|
||||
|
||||
typedef struct r_event_t {
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define R_STR_CONSTPOOL_H
|
||||
|
||||
#include <r_types.h>
|
||||
#include <sdbht.h>
|
||||
#include <sdb/ht.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
|
@ -9,7 +9,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include <r_util.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
typedef struct r_vc_blob_t {
|
||||
char *fname;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* radare2 - LGPL - Copyright 2008-2022 - condret, pancake, alvaro_fe */
|
||||
|
||||
#include <r_io.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
#include <config.h>
|
||||
|
||||
R_LIB_VERSION (r_io);
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#include <r_io.h>
|
||||
#include <stdlib.h>
|
||||
#include <sdb.h>
|
||||
#include <r_util.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
#define END_OF_MAP_IDS UT32_MAX
|
||||
R_IPI bool io_bank_has_map(RIO *io, const ut32 bankid, const ut32 mapid);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
#define _R_LIST_C_
|
||||
#include "r_util.h"
|
||||
#include <set.h>
|
||||
#include <sdb/set.h>
|
||||
|
||||
#define MERGE_LIMIT 24
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
SDBPATH=../../shlr/sdb/src/
|
||||
SDBPATH=$(SHLR)/sdb/src/
|
||||
SDBINCDIR=$(SHLR)/sdb/include
|
||||
SDBLIB=${SDBPATH}/libsdb.a
|
||||
EXTRA_TARGETS+=${SDBLIB}
|
||||
EXTRA_PRE+=$(SDBLIB)
|
||||
@ -16,7 +17,7 @@ SDB_OBJS+=ht_uu.o
|
||||
SDB_OBJS+=ht_up.o
|
||||
SDB_OBJS+=ht_pp.o
|
||||
SDB_OBJS+=ht_pu.o
|
||||
SDB_OBJS+=sdbht.o
|
||||
SDB_OBJS+=ht.o
|
||||
SDB_OBJS+=json.o
|
||||
SDB_OBJS+=text.o
|
||||
SDB_OBJS+=lock.o
|
||||
@ -39,7 +40,7 @@ SDBOBJS=$(addprefix ${SDBPATH},${SDB_OBJS})
|
||||
|
||||
OBJS+=$(SDBOBJS)
|
||||
|
||||
CFLAGS+=-I$(SDBPATH)
|
||||
CFLAGS+=-I$(SDBINCDIR)
|
||||
|
||||
$(SDBLIB):
|
||||
$(MAKE) -C ../../shlr sdbs
|
||||
|
41
meson.build
41
meson.build
@ -474,13 +474,14 @@ sdb_files = [
|
||||
'shlr/sdb/src/num.c',
|
||||
'shlr/sdb/src/query.c',
|
||||
'shlr/sdb/src/sdb.c',
|
||||
'shlr/sdb/src/sdbht.c',
|
||||
'shlr/sdb/src/ht.c',
|
||||
'shlr/sdb/src/util.c',
|
||||
'shlr/sdb/src/text.c'
|
||||
]
|
||||
|
||||
sdb_inc = [platform_inc, include_directories(join_paths('shlr','sdb','src'))]
|
||||
sdb_inc = [platform_inc, include_directories(join_paths('shlr','sdb','include'))]
|
||||
|
||||
# XXX we have sdb/meson.build for this!! dont dup
|
||||
# Create sdb_version.h
|
||||
r = run_command(py3_exe, join_paths('sys','sdb_version.py'), join_paths('shlr','sdb','config.mk'))
|
||||
if r.returncode() == 0
|
||||
@ -488,25 +489,25 @@ if r.returncode() == 0
|
||||
else
|
||||
sdb_version = 'unknown'
|
||||
endif
|
||||
run_command(py3_exe, '-c', 'with open("shlr/sdb/src/sdb_version.h", "w") as f: f.write("#define SDB_VERSION \"' + sdb_version + '\"")')
|
||||
run_command(py3_exe, '-c', 'with open("shlr/sdb/include/sdb/version.h", "w") as f: f.write("#define SDB_VERSION \"' + sdb_version + '\"")')
|
||||
|
||||
sdb_inc_files = [
|
||||
'shlr/sdb/src/buffer.h',
|
||||
'shlr/sdb/src/cdb.h',
|
||||
'shlr/sdb/src/set.h',
|
||||
'shlr/sdb/src/cdb_make.h',
|
||||
'shlr/sdb/src/config.h',
|
||||
'shlr/sdb/src/dict.h',
|
||||
'shlr/sdb/src/ht_inc.h',
|
||||
'shlr/sdb/src/ht_pp.h',
|
||||
'shlr/sdb/src/ht_up.h',
|
||||
'shlr/sdb/src/ht_uu.h',
|
||||
'shlr/sdb/src/ht_pu.h',
|
||||
'shlr/sdb/src/ls.h',
|
||||
'shlr/sdb/src/sdb.h',
|
||||
'shlr/sdb/src/sdbht.h',
|
||||
'shlr/sdb/src/sdb_version.h',
|
||||
'shlr/sdb/src/types.h'
|
||||
'shlr/sdb/include/sdb/buffer.h',
|
||||
'shlr/sdb/include/sdb/cdb.h',
|
||||
'shlr/sdb/include/sdb/set.h',
|
||||
'shlr/sdb/include/sdb/cdb_make.h',
|
||||
'shlr/sdb/include/sdb/config.h',
|
||||
'shlr/sdb/include/sdb/dict.h',
|
||||
'shlr/sdb/include/sdb/ht_inc.h',
|
||||
'shlr/sdb/include/sdb/ht_pp.h',
|
||||
'shlr/sdb/include/sdb/ht_up.h',
|
||||
'shlr/sdb/include/sdb/ht_uu.h',
|
||||
'shlr/sdb/include/sdb/ht_pu.h',
|
||||
'shlr/sdb/include/sdb/ls.h',
|
||||
'shlr/sdb/include/sdb/sdb.h',
|
||||
'shlr/sdb/include/sdb/ht.h',
|
||||
'shlr/sdb/include/sdb/version.h',
|
||||
'shlr/sdb/include/sdb/types.h'
|
||||
]
|
||||
install_headers(sdb_inc_files, install_dir: join_paths(r2_incdir, 'sdb'))
|
||||
|
||||
@ -523,7 +524,7 @@ sdb_dep = declare_dependency(
|
||||
|
||||
sdb_exe = executable('sdb', ['shlr/sdb/src/main.c'] + sdb_files,
|
||||
include_directories: [
|
||||
include_directories('shlr/sdb/src')
|
||||
include_directories('shlr/sdb/include')
|
||||
],
|
||||
implicit_include_directories: false,
|
||||
native: true,
|
||||
|
@ -8,4 +8,4 @@ Description: radare foundation libraries
|
||||
Version: @VERSION@
|
||||
Requires:
|
||||
Libs: -L${libdir} -lr_util @LIBZIP@ @DL_LIBS@
|
||||
Cflags: -I${includedir}/libr -I${includedir}/libr/sdb
|
||||
Cflags: -I${includedir}/libr
|
||||
|
@ -125,8 +125,8 @@ sdb-host:
|
||||
@echo "HOST SDB"
|
||||
@echo ">>>>>>>>"
|
||||
@echo
|
||||
$(MAKE) -C sdb clean ; rm -f sdb/src/*.o sdb/src/sdb_version.h
|
||||
$(MAKE) -C sdb/src "CC=${HOST_CC}" LDFLAGS='${HOST_LDFLAGS}' CPPFLAGS='' CFLAGS='${HOST_CFLAGS} ${PIC}' bin
|
||||
$(MAKE) -C sdb clean ; rm -f sdb/src/*.o sdb/include/sdb/version.h
|
||||
$(MAKE) -C sdb/src "CC=${HOST_CC}" LDFLAGS='${HOST_LDFLAGS}' CPPFLAGS='-I$(SHLR)/sdb/include' CFLAGS='${HOST_CFLAGS} ${PIC}' bin
|
||||
cp -f sdb/src/sdb${BUILD_EXT_EXE} sdb/src/.sdb${BUILD_EXT_EXE}
|
||||
cp -f sdb/src/sdb${BUILD_EXT_EXE} sdb/sdb$(BUILD_EXT_EXE)
|
||||
rm -f $(SDB_LIBA)
|
||||
@ -139,19 +139,21 @@ sdb-target:
|
||||
@echo ">>>>>>>>>>"
|
||||
@echo
|
||||
rm -f src/libsdb.$(EXT_AR)
|
||||
$(MAKE) -C sdb clean ; rm -f sdb/src/*.o sdb/src/sdb_version.h
|
||||
$(MAKE) -C sdb/src sdb_version.h
|
||||
$(MAKE) -C sdb clean ; rm -f sdb/src/*.o ../include/sdb/version.h
|
||||
$(MAKE) -C sdb/src ../include/sdb/version.h
|
||||
ifeq ($(EXT_EXE),.wasm)
|
||||
$(MAKE) -C sdb/src ARCH=xxx EXT_AR=.$(EXT_AR) RANLIB="${RANLIB}" CFLAGS_SHARED="${CFLAGS_SHARED} -DHAVE_MMAN=0" \
|
||||
$(MAKE) -C sdb/src ARCH=xxx EXT_AR=.$(EXT_AR) RANLIB="${RANLIB}" CPPFLAGS=-I$(SHLR)/sdb/include \
|
||||
CFLAGS_SHARED="${CFLAGS_SHARED} -DHAVE_MMAN=0" \
|
||||
CC="${CC}" AR="${AR}" ARCH=undefined CFLAGS='${CFLAGS} -DHAVE_MMAN=0' LDFLAGS='${LDFLAGS}' libsdb.$(EXT_AR)
|
||||
else
|
||||
$(MAKE) -C sdb/src ARCH=xxx EXT_AR=.$(EXT_AR) RANLIB="${RANLIB}" CFLAGS_SHARED="${CFLAGS_SHARED}" \
|
||||
$(MAKE) -C sdb/src ARCH=xxx EXT_AR=.$(EXT_AR) RANLIB="${RANLIB}" CPPFLAGS=-I$(SHLR)/sdb/include \
|
||||
CFLAGS_SHARED="${CFLAGS_SHARED}" \
|
||||
CC="${CC}" AR="${AR}" ARCH=undefined LDFLAGS='${LDFLAGS}' libsdb.$(EXT_AR)
|
||||
endif
|
||||
$(RANLIB) sdb/src/libsdb.$(EXT_AR)
|
||||
|
||||
.PHONY: sdb-sync sync-sdb sdbclean sdb-native sdb-target
|
||||
SDB_F=README.md config.mk src Makefile meson.build wasi.mk wasi.sh
|
||||
SDB_F=README.md config.mk src include Makefile meson.build wasi.mk wasi.sh
|
||||
SDB_SYNCFILES=$(addprefix sdb.vc/,${SDB_F})
|
||||
I=../libr/include
|
||||
|
||||
@ -175,8 +177,8 @@ sdb-sync sync-sdb:
|
||||
mkdir -p sdb
|
||||
cp -rf ${SDB_SYNCFILES} sdb
|
||||
rm -rf sdb.vc
|
||||
rm -f src/sdb_version.h
|
||||
$(MAKE) -C sdb src/sdb_version.h
|
||||
rm -f include/sdb/version.h
|
||||
$(MAKE) -C sdb include/sdb/version.h
|
||||
mkdir -p sdb/test sdb/memcache
|
||||
sed -e 's,HAVE_VALA=,HAVE_VALA=#,' sdb/config.mk > .t
|
||||
mv .t sdb/config.mk
|
||||
|
@ -26,7 +26,7 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
CFLAGS:=-I../../libr/include -I../../libr/include/sdb $(CFLAGS)
|
||||
CFLAGS:=-I../../libr/include $(CFLAGS)
|
||||
LIBAR=libr_ar.${EXT_AR}
|
||||
LDFLAGS+=-L../../libr/util
|
||||
LIBS=-lr_util
|
||||
|
@ -6,7 +6,7 @@ AR?=ar
|
||||
RANLIB?=ranlib
|
||||
LIBNAME=libbochs
|
||||
LIBFILE=$(LIBNAME).$(EXT_SO)
|
||||
CFLAGS:=-I$(LIBR)/include -I$(LIBR)/include/sdb -Iinclude $(PIC_CFLAGS) $(CFLAGS)
|
||||
CFLAGS:=-I$(LIBR)/include -Iinclude $(PIC_CFLAGS) $(CFLAGS)
|
||||
MAJOR=0
|
||||
MINOR=1
|
||||
LD=$(CC)
|
||||
|
@ -9,7 +9,7 @@ AR?=$(CC_AR)
|
||||
RANLIB?=ranlib
|
||||
LIBNAME=libgdbr
|
||||
LIBFILE=$(LIBNAME).$(EXT_SO)
|
||||
CFLAGS:=-I$(LIBR)/include -I$(LIBR)/include/sdb $(PIC_CFLAGS) $(CFLAGS)
|
||||
CFLAGS:=-I$(LIBR)/include $(PIC_CFLAGS) $(CFLAGS)
|
||||
CFLAGS+=-Iinclude -I${LIBR}/include
|
||||
MAJOR=0
|
||||
MINOR=1
|
||||
|
@ -60,7 +60,7 @@ KERNFILES+=partmap/bsdlabel.c
|
||||
KERNFILES+=partmap/sunpc.c
|
||||
|
||||
KERNOBJS=$(subst .c,.o,${KERNFILES})
|
||||
CFLAGS:=-I../../libr/include -I../../libr/include/sdb -DGRUB_TARGET_NO_MODULES $(CFLAGS)
|
||||
CFLAGS:=-I../../libr/include -DGRUB_TARGET_NO_MODULES $(CFLAGS)
|
||||
CFLAGS+=-Iinclude
|
||||
# CFLAGS+=-g
|
||||
|
||||
|
@ -25,7 +25,7 @@ CFLAGS+=-DMINGW32=1
|
||||
endif
|
||||
# CFLAGS+=-g
|
||||
|
||||
CFLAGS:=-I../../libr/include -I../../libr/include/sdb $(CFLAGS)
|
||||
CFLAGS:=-I../../libr/include $(CFLAGS)
|
||||
LDFLAGS+=-L../../libr/util
|
||||
OBJS=code.o class.o ops.o
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#define U(x) x
|
||||
#include <r_list.h>
|
||||
#include <r_bin.h>
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
#if defined(_MSC_VER) && !defined(R_API_BIN_ONLY)
|
||||
#undef R_API
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include "code.h"
|
||||
#include <sdb.h>
|
||||
#include <sdb/sdb.h>
|
||||
|
||||
int main() {
|
||||
Sdb *kv = sdb_new(NULL, NULL, 0);
|
||||
|
@ -7,7 +7,7 @@ AR?=ar
|
||||
RANLIB?=ranlib
|
||||
LIBNAME=libqnxr
|
||||
LIBFILE=$(LIBNAME).$(EXT_SO)
|
||||
CFLAGS:=-Iinclude -I$(LIBR)/include -I$(LIBR)/include/sdb $(PIC_CFLAGS) $(CFLAGS)
|
||||
CFLAGS:=-Iinclude -I$(LIBR)/include $(PIC_CFLAGS) $(CFLAGS)
|
||||
MAJOR=0
|
||||
MINOR=1
|
||||
LD=$(CC)
|
||||
|
@ -1 +1 @@
|
||||
CFLAGS+=-I$(SHLR)/sdb/src
|
||||
CFLAGS+=-I$(SHLR)/sdb/include
|
||||
|
@ -10,7 +10,7 @@ CFLAGS_ASAN=$(addprefix -fsanitize=,$(ASANOPTS))
|
||||
CFLAGS_LEAK=$(addprefix -fsanitize=,$(LEAKOPTS))
|
||||
MKDIR=mkdir
|
||||
|
||||
all: pkgconfig src/sdb_version.h
|
||||
all: pkgconfig include/sdb/version.h
|
||||
${MAKE} -C src
|
||||
ifeq ($(BUILD_MEMCACHE),1)
|
||||
${MAKE} -C memcache
|
||||
@ -36,7 +36,7 @@ o xo xoxo ox:
|
||||
g++ -o sdb src/*.c -I src/
|
||||
|
||||
wasi wasm: $(WASI_SDK)
|
||||
${MAKE} src/sdb_version.h
|
||||
${MAKE} include/sdb/version.h
|
||||
CC=$(WASI_CC) CFLAGS="$(WASI_CFLAGS)" $(MAKE) CC=$(WASI_CC) -C src all WITHPIC=0
|
||||
mv src/sdb src/sdb.wasm
|
||||
file src/sdb.wasm
|
||||
@ -45,34 +45,35 @@ test:
|
||||
${MAKE} -C test
|
||||
|
||||
asan:
|
||||
$(MAKE) src/sdb_version.h
|
||||
$(MAKE) include/sdb/version.h
|
||||
CC=gcc LDFLAGS="$(CFLAGS_ASAN)" CFLAGS="$(CFLAGS_ASAN)" ${MAKE} -C src all
|
||||
asantest:
|
||||
export ASAN_OPTIONS=detect_leaks=0 ; \
|
||||
CC=gcc CFLAGS="$(CFLAGS_ASAN)" ${MAKE} -C test
|
||||
|
||||
leak:
|
||||
$(MAKE) src/sdb_version.h
|
||||
$(MAKE) include/sdb/version.h
|
||||
CC=gcc LDFLAGS="$(CFLAGS_LEAK)" CFLAGS="$(CFLAGS_LEAK)" $(MAKE) -C src all
|
||||
|
||||
leaktest:
|
||||
CC=gcc CFLAGS="$(CFLAGS_LEAK)" $(MAKE) -C test
|
||||
CC=gcc CFLAGS="$(CFLAGS_LEAK)" LDFLAGS="$(CFLAGS_LEAK)" $(MAKE) -C test
|
||||
|
||||
pkgconfig:
|
||||
[ -d pkgconfig ] && ${MAKE} -C pkgconfig || true
|
||||
|
||||
src/sdb_version.h:
|
||||
echo '#define SDB_VERSION "${SDBVER}"' > src/sdb_version.h
|
||||
include/sdb/version.h:
|
||||
echo '#define SDB_VERSION "${SDBVER}"' > include/sdb/version.h
|
||||
|
||||
CFILES=cdb.c buffer.c cdb_make.c ls.c ht.c sdb.c num.c base64.c text.c
|
||||
CFILES+=json.c ns.c lock.c util.c disk.c query.c array.c fmt.c main.c
|
||||
EMCCFLAGS=-O2 -s EXPORTED_FUNCTIONS="['_sdb_querys','_sdb_new0']"
|
||||
#EMCCFLAGS+=--embed-file sdb.data
|
||||
|
||||
sdb.js: src/sdb_version.h
|
||||
sdb.js: include/sdb/version.h
|
||||
cd src ; emcc ${EMCCFLAGS} -I. -o ../sdb.js ${CFILES}
|
||||
|
||||
clean:
|
||||
rm -f src/sdb_version.h
|
||||
rm -f include/sdb/version.h
|
||||
$(MAKE) -C src clean
|
||||
$(MAKE) -C memcache clean
|
||||
$(MAKE) -C test clean
|
||||
@ -101,9 +102,9 @@ install-dirs:
|
||||
$(INSTALL_DIR) ${DESTDIR}${MANDIR} ${DESTDIR}${LIBDIR}/pkgconfig ${DESTDIR}${BINDIR}
|
||||
$(INSTALL_DIR) ${DESTDIR}${DATADIR}/vala/vapi ${DESTDIR}${INCDIR}/sdb
|
||||
|
||||
INCFILES=src/sdb.h src/sdb_version.h src/cdb.h src/ht_uu.h src/ht_up.h src/ht_pp.h src/types.h
|
||||
INCFILES+=src/ls.h src/cdb_make.h src/buffer.h src/config.h src/sdbht.h
|
||||
INCFILES+=src/dict.h src/set.h src/ht_inc.h
|
||||
INCFLS=sdb.h version.h cdb.h ht_uu.h ht_up.h ht_pp.h types.h
|
||||
INCFLS+=ls.h cdb_make.h buffer.h config.h ht.h dict.h set.h ht_inc.h
|
||||
INCFILES=$(addprefix include/sdb/,$(INCFLS))
|
||||
|
||||
install: pkgconfig install-dirs
|
||||
$(INSTALL_MAN) src/sdb.1 ${DESTDIR}${MANDIR}
|
||||
@ -115,8 +116,9 @@ install: pkgconfig install-dirs
|
||||
ln -s libsdb$(SOVER) libsdb$(EXT_SO) ; \
|
||||
ln -s libsdb$(SOVER) libsdb$(EXT_SO).$(SOVERSION) ; \
|
||||
fi
|
||||
$(INSTALL_DATA) $(INCFILES) ${DESTDIR}${INCDIR}/sdb
|
||||
$(INSTALL_PROGRAM) src/sdb ${DESTDIR}${BINDIR}
|
||||
mkdir -p $(DESTDIR)/$(INCDIR)/sdb
|
||||
$(INSTALL_DATA) $(INCFILES) $(DESTDIR)$(INCDIR)/sdb
|
||||
$(INSTALL_PROGRAM) src/sdb $(DESTDIR)$(BINDIR)
|
||||
ifeq ($(BUILD_MEMCACHE),1)
|
||||
$(INSTALL_DATA) memcache/libmcsdb.a ${DESTDIR}${LIBDIR}
|
||||
$(INSTALL_DATA) memcache/mcsdb.h ${DESTDIR}${INCDIR}/sdb
|
||||
@ -151,21 +153,21 @@ ifneq (${HAVE_VALA},)
|
||||
endif
|
||||
|
||||
symstall: install-dirs
|
||||
cd src ; for a in libsdb.* ; do \
|
||||
ln -fs ${PWD}/src/$$a ${DESTDIR}${LIBDIR}/$$a ; done
|
||||
cd src && for a in libsdb.* ; do ln -fs ${PWD}/src/$$a ${DESTDIR}${LIBDIR}/$$a ; done
|
||||
ln -fs ${PWD}/src/sdb.1 ${DESTDIR}${MANDIR}/sdb.1
|
||||
ln -fs ${PWD}/src/sdb ${DESTDIR}${BINDIR}
|
||||
ln -fs ${PWD}/src/sdb.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/sdb_version.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/cdb.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/ht_uu.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/ht_up.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/ht_pp.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/types.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/ls.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/cdb_make.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/buffer.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/src/config.h ${DESTDIR}${INCDIR}/sdb
|
||||
mkdir -p ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/sdb.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/version.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/cdb.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/ht_uu.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/ht_up.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/ht_pp.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/types.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/ls.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/cdb_make.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/buffer.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/include/sdb/config.h ${DESTDIR}${INCDIR}/sdb
|
||||
ln -fs ${PWD}/bindings/vala/sdb.pc ${DESTDIR}${LIBDIR}/pkgconfig
|
||||
ln -fs ${PWD}/bindings/vala/mcsdb.pc ${DESTDIR}${LIBDIR}/pkgconfig
|
||||
ifneq (${HAVE_VALA},)
|
||||
@ -183,7 +185,7 @@ WCP=i386-mingw32
|
||||
# mxe
|
||||
#WCP=i686-pc-mingw32
|
||||
|
||||
w32: src/sdb_version.h
|
||||
w32: include/sdb/version.h
|
||||
cd src ; \
|
||||
${MAKE} OS=w32 WCP=${WCP} CC=${WCP}-gcc AR=${WCP}-ar RANLIB=${WCP}-ranlib sdb.exe
|
||||
|
||||
@ -191,7 +193,8 @@ w32: src/sdb_version.h
|
||||
IOS_CC=$(shell xcrun --sdk iphoneos --find clang) -isysroot $(shell xcrun --sdk iphoneos --show-sdk-path) -arch armv7 -arch arm64
|
||||
IOS_AR=$(shell xcrun --sdk iphoneos --find ar)
|
||||
IOS_RL=$(shell xcrun --sdk iphoneos --find ranlib)
|
||||
ios: src/sdb_version.h
|
||||
|
||||
ios: include/sdb/version.h
|
||||
${MAKE} CFLAGS=-DUSE_DLSYSTEM=1 OS=Darwin ARCH=arm CC="${IOS_CC}" AR="${IOS_AR}" RANLIB="${IOS_RL}" HAVE_VALA= all
|
||||
|
||||
v version:
|
||||
|
@ -6,7 +6,7 @@ INCDIR=${PREFIX}/include
|
||||
VAPIDIR=${DATADIR}/vala/vapi/
|
||||
MANDIR=${DATADIR}/man/man1
|
||||
|
||||
SDBVER=1.9.2
|
||||
SDBVER=1.9.4
|
||||
|
||||
BUILD_MEMCACHE=0
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#undef HT_TYPE
|
||||
#define HT_TYPE 2
|
||||
#include "ht_inc.h"
|
||||
#include "sdbht.h"
|
||||
#include "sdb/ht.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
@ -8,7 +8,7 @@
|
||||
#undef HT_TYPE
|
||||
#define HT_TYPE 3
|
||||
#include "ht_inc.h"
|
||||
#include "sdbht.h"
|
||||
#include "ht.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
@ -2,7 +2,7 @@
|
||||
#define _INCLUDE_RANGSTR_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "../types.h"
|
||||
#include "sdb/types.h"
|
||||
|
||||
#define RangstrType unsigned int
|
||||
|
||||
@ -13,7 +13,7 @@ typedef struct {
|
||||
const char *p;
|
||||
} Rangstr;
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
SDB_IPI void rangstr_print (Rangstr *s);
|
||||
SDB_IPI Rangstr rangstr_new (const char *s);
|
||||
SDB_IPI Rangstr rangstr_null(void);
|
@ -11,12 +11,13 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "sdbht.h"
|
||||
#include "ht.h"
|
||||
#include "ls.h"
|
||||
#include "dict.h"
|
||||
#include "cdb.h"
|
||||
#include "cdb_make.h"
|
||||
#include "sdb_version.h"
|
||||
#include "version.h"
|
||||
#include "rangstr.h"
|
||||
|
||||
/* Key value sizes */
|
||||
#define SDB_MIN_VALUE 1
|
||||
@ -281,7 +282,7 @@ SDB_API ut32 sdb_hash_len(const char *key, ut32 *len);
|
||||
SDB_API ut8 sdb_hash_byte(const char *s);
|
||||
|
||||
/* json api */
|
||||
// SDB_API int sdb_js0n(const unsigned char *js, RangstrType len, RangstrType *out);
|
||||
SDB_API int sdb_js0n(const unsigned char *js, RangstrType len, RangstrType *out);
|
||||
SDB_API bool sdb_isjson(const char *k);
|
||||
SDB_API char *sdb_json_get_str (const char *json, const char *path);
|
||||
SDB_API bool sdb_json_get_bool(const char *json, const char *path);
|
@ -32,11 +32,11 @@ else
|
||||
libsdb_name = 'sdb'
|
||||
endif
|
||||
|
||||
# Create sdb_version.h
|
||||
# Create include/sdb/version.h
|
||||
conf_data = configuration_data()
|
||||
conf_data.set_quoted('SDB_VERSION', sdb_version, description : 'From config.mk')
|
||||
configure_file(
|
||||
output : 'sdb_version.h',
|
||||
output : 'version.h',
|
||||
configuration : conf_data,
|
||||
install_dir : join_paths(get_option('includedir'), 'sdb')
|
||||
)
|
||||
@ -65,12 +65,12 @@ libsdb_sources = [
|
||||
'src/num.c',
|
||||
'src/query.c',
|
||||
'src/sdb.c',
|
||||
'src/sdbht.c',
|
||||
'src/ht.c',
|
||||
'src/util.c',
|
||||
'src/text.c'
|
||||
]
|
||||
|
||||
sdb_inc = include_directories(['.', 'src'])
|
||||
sdb_inc = include_directories(['.', 'include'])
|
||||
rpath_lib = ''
|
||||
rpath_exe = ''
|
||||
if get_option('local') and get_option('default_library') == 'shared'
|
||||
@ -99,21 +99,21 @@ sdb_dep = declare_dependency(
|
||||
|
||||
if not meson.is_subproject()
|
||||
include_files = [
|
||||
'src/buffer.h',
|
||||
'src/cdb.h',
|
||||
'src/cdb_make.h',
|
||||
'src/config.h',
|
||||
'src/dict.h',
|
||||
'src/ht_inc.h',
|
||||
'src/ht_pp.h',
|
||||
'src/ht_up.h',
|
||||
'src/ht_uu.h',
|
||||
'src/ht_up.h',
|
||||
'src/ls.h',
|
||||
'src/sdb.h',
|
||||
'src/sdbht.h',
|
||||
'src/set.h',
|
||||
'src/types.h'
|
||||
'include/sdb/buffer.h',
|
||||
'include/sdb/cdb.h',
|
||||
'include/sdb/cdb_make.h',
|
||||
'include/sdb/config.h',
|
||||
'include/sdb/dict.h',
|
||||
'include/sdb/ht_inc.h',
|
||||
'include/sdb/ht_pp.h',
|
||||
'include/sdb/ht_up.h',
|
||||
'include/sdb/ht_uu.h',
|
||||
'include/sdb/ht_up.h',
|
||||
'include/sdb/ls.h',
|
||||
'include/sdb/sdb.h',
|
||||
'include/sdb/ht.h',
|
||||
'include/sdb/set.h',
|
||||
'include/sdb/types.h'
|
||||
]
|
||||
install_headers(include_files, subdir: 'sdb')
|
||||
endif
|
||||
|
@ -1,9 +1,10 @@
|
||||
include ../config.mk
|
||||
|
||||
CFLAGS:=-g $(CFLAGS)
|
||||
OBJ=cdb.o buffer.o cdb_make.o ls.o sdbht.o ht_uu.o sdb.o num.o base64.o match.o
|
||||
OBJ=cdb.o buffer.o cdb_make.o ls.o ht.o ht_uu.o sdb.o num.o base64.o match.o
|
||||
OBJ+=json.o ns.o lock.o util.o disk.o query.o array.o fmt.o journal.o text.o
|
||||
OBJ+=dict.o ht_pp.o ht_up.o ht_pu.o set.o diff.o
|
||||
CFLAGS+=-I ../include
|
||||
SOBJ=$(subst .o,.o.o,${OBJ})
|
||||
WITHPIC?=1
|
||||
BIN=sdb${EXT_EXE}
|
||||
@ -21,19 +22,19 @@ json.o: json/api.c json/js0n.c json/path.c json/rangstr.c json/indent.c
|
||||
install:
|
||||
$(MAKE) -C .. install
|
||||
|
||||
sdb_version.h:
|
||||
$(MAKE) -C .. src/sdb_version.h
|
||||
../include/sdb/version.h:
|
||||
$(MAKE) -C .. include/sdb/version.h
|
||||
|
||||
shared: sdb_version.h
|
||||
shared: ../include/sdb/version.h
|
||||
$(MAKE) libsdb${SOVER}
|
||||
|
||||
static: sdb_version.h
|
||||
static: ../include/sdb/version.h
|
||||
$(MAKE) libsdb$(EXT_AR)
|
||||
|
||||
sdb_objs: sdb_version.h
|
||||
sdb_objs: ../include/sdb/version.h
|
||||
$(MAKE) ${OBJ}
|
||||
|
||||
sdb_objs2: sdb_version.h
|
||||
sdb_objs2: ../include/sdb/version.h
|
||||
$(MAKE) ${SOBJ}
|
||||
|
||||
libsdb.lib libsdb$(EXT_AR): sdb_objs
|
||||
@ -58,7 +59,7 @@ ifneq ($(SILENT),)
|
||||
endif
|
||||
$(CC) ${LDFLAGS} $(LDFLAGS_SHARED) -o $@ ${SOBJ}
|
||||
|
||||
bin_deps: sdb_version.h
|
||||
bin_deps: ../include/sdb/version.h
|
||||
$(MAKE) libsdb.a main.o
|
||||
|
||||
bin $(BIN): bin_deps
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* sdb - MIT - Copyright 2011-2022 - pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
#include <limits.h>
|
||||
|
||||
// TODO: Push should always prepend. do not make this configurable
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* base64 enc/dec - MIT - Copyright 2011-2022 - pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
#define SZ 1024
|
||||
static const char cb64[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Public Domain */
|
||||
|
||||
#include "buffer.h"
|
||||
#include "sdb/buffer.h"
|
||||
|
||||
void buffer_init(buffer *s, BufferOp op, int fd, char *buf, ut32 len) {
|
||||
s->x = buf;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Public domain - author D. J. Bernstein, modified by pancake - 2014-2016 */
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include "cdb.h"
|
||||
#include "sdb/cdb.h"
|
||||
#if USE_MMAN
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
@ -1,8 +1,8 @@
|
||||
/* Public domain. */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "cdb.h"
|
||||
#include "cdb_make.h"
|
||||
#include "sdb/sdb.h"
|
||||
#include "sdb/cdb.h"
|
||||
#include "sdb/cdb_make.h"
|
||||
|
||||
#define ALIGNMENT sizeof (void*)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* sdb - MIT - Copyright 2017-2022 - pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
SDB_API dict *dict_new(ut32 size, dict_freecb f) {
|
||||
dict *m = (dict *)calloc (1, sizeof (dict));
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* sdb - MIT - Copyright 2019 - thestr4ng3r */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
SDB_API int sdb_diff_format(char *str, int size, const SdbDiff *diff) {
|
||||
int r = 0;
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
#if __SDB_WINDOWS__
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* sdb - MIT - Copyright 2014-2022 - pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
// TODO: convert into a function
|
||||
// TODO: Add 'a' format for array of pointers null terminated??
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* sdb - MIT - Copyright 2011-2022 - pancake */
|
||||
|
||||
#include "sdbht.h"
|
||||
#include "sdb/ht.h"
|
||||
|
||||
void sdbkv_fini(SdbKv *kv) {
|
||||
free (kv->base.key);
|
@ -1,7 +1,7 @@
|
||||
/* sdb - MIT - Copyright 2018-2022 - ret2libc, pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "ht_pp.h"
|
||||
#include "sdb/sdb.h"
|
||||
#include "sdb/ht_pp.h"
|
||||
#include "ht.inc"
|
||||
|
||||
static HtName_(Ht)* internal_ht_default_new(ut32 size, ut32 prime_idx, HT_(DupValue) valdup, HT_(KvFreeFunc) pair_free, HT_(CalcSizeV) calcsizeV) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* sdb - MIT - Copyright 2018-2022 - ret2libc, pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "ht_pu.h"
|
||||
#include "sdb/sdb.h"
|
||||
#include "sdb/ht_pu.h"
|
||||
#include "ht.inc"
|
||||
|
||||
static void free_kv_key(HT_(Kv) *kv) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* sdb - MIT - Copyright 2018-2022 - ret2libc, pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "ht_up.h"
|
||||
#include "sdb/sdb.h"
|
||||
#include "sdb/ht_up.h"
|
||||
#include "ht.inc"
|
||||
|
||||
static HtName_(Ht)* internal_ht_default_new(ut32 size, ut32 prime_idx, HT_(DupValue) valdup, HT_(KvFreeFunc) pair_free, HT_(CalcSizeV) calcsizeV) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* sdb - MIT - Copyright 2018-2022 - ret2libc, pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "ht_uu.h"
|
||||
#include "sdb/sdb.h"
|
||||
#include "sdb/ht_uu.h"
|
||||
#include "ht.inc"
|
||||
|
||||
// creates a default HtUU that has strings as keys
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* sdb - MIT - Copyright 2011-2016 - pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
#include <fcntl.h>
|
||||
#if __UNIX__ || __MINGW32__
|
||||
#include <unistd.h>
|
||||
|
@ -1,7 +1,8 @@
|
||||
/* sdb - MIT - Copyright 2012-2022 - pancake */
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
#include "json/rangstr.c"
|
||||
#include "json/js0n.c"
|
||||
#include "json/path.c"
|
||||
|
@ -8,6 +8,7 @@ CFLAGS+=-Wall -g
|
||||
BIN=a.out
|
||||
OBJ=rangstr.o path.o js0n.o api.o main.o
|
||||
OBJ+=../libsdb.a
|
||||
CFLAGS+=-I../../include
|
||||
|
||||
all: ${BIN}
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "rangstr.h"
|
||||
#include "sdb/rangstr.h"
|
||||
|
||||
/* public sdb api */
|
||||
char *api_json_get (const char *s, const char *p) {
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
// opportunity to further optimize would be having different jump tables for higher depths
|
||||
|
||||
#include "rangstr.h"
|
||||
#include "sdb/rangstr.h"
|
||||
|
||||
#define PUSH(i) if(depth == 1) prev = *out++ = ((cur+i) - js)
|
||||
#define CAP(i) if(depth == 1) prev = *out++ = ((cur+i) - (js + prev) + 1)
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "rangstr.h"
|
||||
#include "json.h"
|
||||
#include "../sdb.h"
|
||||
#include "sdb/rangstr.h"
|
||||
#include "sdb/json.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
Rangstr json_find (const char *s, Rangstr *rs);
|
||||
int test_main () {
|
||||
|
@ -3,8 +3,9 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "rangstr.c"
|
||||
#include "../types.h"
|
||||
#include "sdb/rangstr.h"
|
||||
#include "sdb/sdb.h"
|
||||
#include "sdb/types.h"
|
||||
|
||||
SDB_IPI void json_path_first(Rangstr *s) {
|
||||
char *p;
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include "rangstr.h"
|
||||
#include "sdb/rangstr.h"
|
||||
|
||||
SDB_IPI Rangstr rangstr_null(void) {
|
||||
Rangstr rs = {0, 0, 0, 0, 0};
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* sdb - MIT - Copyright 2012-2022 - pancake */
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
SDB_API bool sdb_lock_file(const char *f, char *buf, size_t buf_size) {
|
||||
size_t len;
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* sdb - MIT - Copyright 2007-2022 - pancake, alvaro */
|
||||
|
||||
#include <string.h>
|
||||
#include "ls.h"
|
||||
#include "sdb/ls.h"
|
||||
|
||||
#if 0
|
||||
1 128= 7s / 32
|
||||
|
@ -8,7 +8,7 @@
|
||||
#if USE_DLSYSTEM
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
typedef enum {
|
||||
text,
|
||||
@ -548,7 +548,9 @@ static int insertkeys(Sdb *db, const char **args, int nargs, int mode) {
|
||||
for (i = 0; i < nargs; i++) {
|
||||
switch (mode) {
|
||||
case '-':
|
||||
must_save |= sdb_query (db, args[i]);
|
||||
if (sdb_query (db, args[i])) {
|
||||
must_save = true;
|
||||
}
|
||||
break;
|
||||
case '=':
|
||||
if (strchr (args[i], '=')) {
|
||||
@ -1011,18 +1013,22 @@ int main(int argc, const char **argv) {
|
||||
int kvs = mo->db0 + 2;
|
||||
if (mo->argi + 2 < mo->argc) {
|
||||
for (i = mo->argi + 2; i < argc; i++) {
|
||||
save |= sdb_query (s, mo->argv[i]);
|
||||
if (sdb_query (s, mo->argv[i])) {
|
||||
save = true;
|
||||
}
|
||||
if (mo->format) {
|
||||
fflush (stdout);
|
||||
ret = write_null ();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (kvs < argc) {
|
||||
save |= insertkeys (s, argv + mo->argi + 2, argc - kvs, '-');
|
||||
if (kvs < argc && insertkeys (s, argv + mo->argi + 2, argc - kvs, '-')) {
|
||||
save = true;
|
||||
}
|
||||
for (; (line = slurp (stdin, NULL));) {
|
||||
save |= sdb_query (s, line);
|
||||
if (sdb_query (s, line)) {
|
||||
save = true;
|
||||
}
|
||||
if (mo->format) {
|
||||
fflush (stdout);
|
||||
ret = write_null ();
|
||||
@ -1050,7 +1056,9 @@ int main(int argc, const char **argv) {
|
||||
sdb_config (s, options);
|
||||
if (mo->argi + 1 < mo->argc) {
|
||||
for (i = mo->db0 + 1; i < argc; i++) {
|
||||
save |= sdb_query (s, mo->argv[i]);
|
||||
if (sdb_query (s, mo->argv[i])) {
|
||||
save = true;
|
||||
}
|
||||
if (mo->format) {
|
||||
fflush (stdout);
|
||||
ret = write_null ();
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* sdb - MIT - Copyright 2015-2016 - pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static inline int haveSuffix(const char *glob, int glob_len, const char *sfx) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* sdb - MIT - Copyright 2011-2022 - pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
SDB_API void sdb_ns_lock(Sdb *s, int lock, int depth) {
|
||||
SdbListIter *it;
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* sdb - MIT - Copyright 2011-2016 - pancake */
|
||||
/* sdb - MIT - Copyright 2011-2022 - pancake */
|
||||
|
||||
#include "sdb.h"
|
||||
#include "types.h"
|
||||
#include "sdb/sdb.h"
|
||||
|
||||
// check if key exists and if it's a number.. rename?
|
||||
SDB_API bool sdb_num_exists (Sdb *s, const char *key) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user