Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions 18 CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.17)
project(python_cdb C)

set(CMAKE_C_STANDARD 11)

include_directories(src)
include_directories(/usr/include/python3.8/)

add_executable(python_cdb
src/cdb.c
src/cdb.h
src/cdb_hash.c
src/cdb_make.c
src/cdb_make.h
src/cdbmodule.c
src/uint32.h
src/uint32_pack.c
src/uint32_unpack.c src/unicode.c src/unicode.h)
67 changes: 34 additions & 33 deletions 67 setup.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
#! /usr/bin/env python
#! /usr/bin/env python3

SRCDIR = "src"
SRCFILES = map(lambda f: SRCDIR + '/' + f + '.c',
["cdbmodule","cdb","cdb_make","cdb_hash",
"uint32_pack","uint32_unpack"])
from setuptools import setup, Extension

from distutils.core import setup, Extension
SRCDIR = "src"
FILES = ("cdbmodule", "cdb", "cdb_make", "cdb_hash",
"uint32_pack", "uint32_unpack", 'unicode')
SRCFILES = list(map(lambda f: SRCDIR + '/' + f + '.c', FILES))

setup (# Distribution meta-data
name = "python-cdb",
version = "0.35",
description = "Interface to constant database files",
author = "Alan Grow",
author_email = "alangrow+python-cdb@gmail.com",
license = "GPL",
long_description = \
'''The python-cdb extension module is an adaptation of D. J. Bernstein's
constant database package (see http://cr.yp.to/cdb.html).

cdb files are mappings of keys to values, designed for wickedly
fast lookups and atomic updates. This module mimics the normal
cdb utilities, cdb(get|dump|make), via convenient, high-level Python
objects.''',
ext_modules = [ Extension(
"cdb",
SRCFILES,
include_dirs=[ SRCDIR + '/' ],
extra_compile_args=['-fPIC'],
)
],
url = "https://github.com/acg/python-cdb",
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
],
)
setup(
name="python-cdb",
version="0.35",
description="Interface to constant database files",
author="Alan Grow",
author_email="alangrow+python-cdb@gmail.com",
license="GPL",
long_description='''
The python-cdb extension module is an adaptation of D. J. Bernstein's
constant database package (see http://cr.yp.to/cdb.html).
cdb files are mappings of keys to values, designed for wickedly
fast lookups and atomic updates. This module mimics the normal
cdb utilities, cdb(get|dump|make), via convenient, high-level Python
objects.''',
ext_modules=[
Extension(
"cdb",
SRCFILES,
include_dirs=[SRCDIR + '/' ],
extra_compile_args=['-fPIC'],
)
],
url="https://github.com/acg/python-cdb",
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
],
)
2 changes: 1 addition & 1 deletion 2 src/cdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ int cdb_read(struct cdb *c,char *buf,unsigned int len,uint32 pos)
static int match(struct cdb *c,char *key,unsigned int len,uint32 pos)
{
char buf[32];
int n;
unsigned int n;

while (len > 0) {
n = sizeof buf;
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.