Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
5131cf8
Use cmake to build.
berkus Oct 29, 2012
3987fd3
Clean clang warnings.
berkus Oct 29, 2012
f090b06
Remove obsolete dir.
berkus Oct 29, 2012
f67c83a
Build 64 bits version.
berkus Oct 29, 2012
e8a426d
python/PyView: properly reference count parent objects
avdv Feb 6, 2013
86d6319
Merge pull request #4 from avdv/fix-refcount-pyview
jcw Feb 6, 2013
9a89d38
Define SHLIB_LD in terms of $CXX instead of g++
gahr Oct 24, 2013
d31ea20
Fix 9a89d38 in configure.in, regenerate configure
gahr Oct 24, 2013
0b8a41a
Merge pull request #6 from berkus/master
jcw Jan 20, 2014
c82d272
Merge branch 'master' of https://github.com/jcw/metakit
gahr Jan 29, 2014
3a49c4d
- Add CMake support for building Python and Tcl
gahr Jan 29, 2014
5675baf
Merge pull request #7 from gahr/master
jcw Jan 29, 2014
d2ef35f
Remove more warnings about dubious operations priority.
berkus Feb 3, 2014
5cd63fb
Use stdint.h for types.
berkus Feb 3, 2014
b08a855
Need to provide some defaults for the config.h.cmake file.
berkus Feb 3, 2014
04f5682
Use current build directory for proper in-tree builds.
berkus Feb 3, 2014
16b3a30
Build demos and tests only when BUILD_TESTING is defined.
berkus Feb 3, 2014
079a8e3
Add option to build with system STL.
berkus Feb 3, 2014
856bf04
Build both shared and static libs.
berkus Feb 3, 2014
16bfa22
More warnings found by clang - writable static strings deprecated.
berkus Feb 3, 2014
dd800b3
Add regression test.
berkus Feb 3, 2014
4d1e345
Use specific datatypes.
berkus Feb 3, 2014
04855ab
Add install locations for demos and tests.
berkus Feb 3, 2014
d5649bc
Add Travis-CI config.
berkus Feb 3, 2014
585f915
Add test with proper working dir.
berkus Feb 3, 2014
b7dc7b0
More warnings found by clang - writable static strings deprecated.
berkus Feb 3, 2014
de5a724
Use stdint.h for types.
berkus Feb 3, 2014
e6fbb78
Use specific datatypes.
berkus Feb 3, 2014
483343c
Need to provide some defaults for the config.h.cmake file.
berkus Feb 3, 2014
ad73cfc
Use current build directory for proper in-tree builds.
berkus Feb 3, 2014
a0e6536
Build demos and tests only when BUILD_TESTING is defined.
berkus Feb 3, 2014
e88d1c9
Add option to build with system STL.
berkus Feb 3, 2014
04ae443
Build both shared and static libs.
berkus Feb 3, 2014
761f0ca
Add regression test.
berkus Feb 3, 2014
1c092db
Add install locations for demos and tests.
berkus Feb 3, 2014
602a6c2
Add test with proper working dir.
berkus Feb 3, 2014
17fad9e
Build demos even without ctest.
berkus Feb 3, 2014
e7b8964
Change install paths for demos and tests.
berkus Feb 3, 2014
8430892
Merge pull request #9 from berkus/fix-warnings-1
jcw Feb 3, 2014
d6a63f1
Merge pull request #10 from berkus/fix-types-1
jcw Feb 3, 2014
80ab8b2
Merge branch 'master' of https://github.com/jcw/metakit
berkus Feb 3, 2014
55ac3e9
Merge branch 'master' into update-cmake-builds
berkus Feb 3, 2014
e247b25
Merge pull request #12 from berkus/update-cmake-builds
jcw Feb 3, 2014
686b36a
unregister channels in workspace destructor
Sep 5, 2014
f73ad5b
support ranlib and ar
Sep 5, 2014
124ab15
fish shared obj linker
Sep 5, 2014
f365727
Fixed Mk4tcl compiling issue
Sep 6, 2014
00dd9cd
Updated to fix FFF 484 to make resultant kit work on 64-bit big endia…
Sep 6, 2014
27a7e3f
Updated to use stdint in Metakit to determine integer types
Sep 6, 2014
3107fe8
Merge branch 'fix64bitbigendianffff484'
Sep 6, 2014
f3de88a
Merge branch 'fix64bitfilespace'
Sep 6, 2014
5eca3fe
Merge branch 'fixsharedobjlinker'
Sep 6, 2014
9b8572d
Merge branch 'supportrandlibandar'
Sep 6, 2014
6b662e0
Merge branch 'unregisterchans'
Sep 6, 2014
7d828b5
use AC_CONFIG_HEADERS instead of AC_OUTPUT for config.h
Sep 6, 2014
9c75b5f
fix segmentation fault in test basic-19, in which the storage is clos…
Sep 16, 2014
a5a9dfd
add "return" as acceptable code to test basic-7
Sep 21, 2014
efb579a
Merge remote-tracking branch 'upstream/master'
Sep 21, 2014
351b6a2
Merge pull request #13 from pooryorick/master
jcw Sep 25, 2014
5db9ef8
Fixed ranlib typo.
Mar 25, 2015
5b80915
Merge pull request #14 from tpoole/ranlibtypo
jcw Mar 25, 2015
cdf6189
bump version and update email address
jcw Jun 18, 2015
cb1ebee
latest autoconf, minor tweak
jcw Jun 18, 2015
30e8fcc
On OS X, use two-level namespace and dynamic lookup of undefined symbols
ryandesign Jun 20, 2015
1fb598a
Use LDFLAGS as set at configure time
ryandesign Jun 20, 2015
4f74fe1
Update URLs in README
ryandesign Jun 20, 2015
e406694
Merge pull request #15 from ryandesign/TWO_LEVEL_NAMESPACE
jcw Jun 20, 2015
555fa28
Merge pull request #16 from ryandesign/LDFLAGS
jcw Jun 20, 2015
b253b4c
Merge pull request #17 from ryandesign/URLs
jcw Jun 20, 2015
73201a4
remove install-docs target, add -lstdc++
Aug 14, 2018
8b1a849
Merge branch 'master' of https://git.jeelabs.org/jcw/metakit
Aug 14, 2018
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
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: cpp
script:
- cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=YES . && make -j4 && ASAN_OPTIONS=alloc_dealloc_mismatch=0 ctest -V
notifications:
email: false
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2015-06-18 ############################################ MK 2.4.9.8

Consolidate all the changes since the move to GitHub.

2011-08-18 Move code to public repository on GitHub

The Subversion repository at svn://svn.equi4.com/metakit is now
Expand Down
50 changes: 50 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
cmake_minimum_required(VERSION 2.8)
project(metakit)

set(CMAKE_OSX_ARCHITECTURES x86_64)

include(CheckIncludeFiles)
include(CheckFunctionExists)
include(CheckTypeSize)
include(CTest)

check_include_files(dlfcn.h HAVE_DLFCN_H)
check_include_files(inttypes.h HAVE_INTTYPES_H)
check_include_files(memory.h HAVE_MEMORY_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(stdlib.h HAVE_STDLIB_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(string.h HAVE_STRING_H)
check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(unistd.h HAVE_UNISTD_H)

check_function_exists(bcopy HAVE_BCOPY)
check_function_exists(memmove HAVE_MEMMOVE)
check_function_exists(mmap HAVE_MMAP)

set(CMAKE_EXTRA_INCLUDE_FILES)
check_type_size(long SIZEOF_LONG)
check_type_size("long long" LONG_LONG)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

option (USE_SYSTEM_STL "Build with system STL (duh?)" OFF)
option (METAKIT_TCL "Build Tcl bindings" ON)
option (METAKIT_PYTHON "Build Python bindings" ON)

add_subdirectory(src)
add_subdirectory(demos)

if (BUILD_TESTING)
add_subdirectory(tests)
endif (BUILD_TESTING)

if (METAKIT_TCL)
add_subdirectory(tcl)
endif()
if (METAKIT_PYTHON)
add_subdirectory(python)
endif()

2 changes: 1 addition & 1 deletion NOTES-2.3.4
Original file line number Diff line number Diff line change
Expand Up @@ -382,4 +382,4 @@ when tweaks for top performance have been done in 2.01 (2.3.4 is not yet
as highly optimized, and has a slightly different performance behavior).


-- Jean-Claude Wippler <jcw@equi4.com>
-- Jean-Claude Wippler <jc@wippler.nl>
14 changes: 7 additions & 7 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The Metakit Library 2.4.9.7 Jun 2007
The Metakit Library 2.4.9.8 Jun 2015
==============================================================================


Expand Down Expand Up @@ -34,11 +34,11 @@ DOCUMENTATION - All documentation uses HTML. The main page is "Metakit.html",
The C++ API Reference is extracted from the source code using Doxygen.

WEBSITE URLS - The main pages on the world wide web, for news and downloads:
Homepage: http://www.equi4.com/metakit.html
Python news: http://www.equi4.com/metakit/python.html
Tcl/Tk news: http://www.equi4.com/metakit/tcl.html
License info: http://www.equi4.com/metakit/license.html
Contact info: http://www.equi4.com/about/contact.html
Homepage: http://equi4.com/metakit/
Python news: http://equi4.com/metakit/python.html
Tcl/Tk news: http://equi4.com/metakit/tcl.html
License info: http://equi4.com/metakit/license.html
Contact info: http://equi4.com/about/contact.html

ACKNOWLEDGEMENTS - Thanks to everyone who has helped shape and extend Metakit,
including Kyrill Denisenko, Mark Roseman, Gordon McMillan, Matt Newman,
Expand Down Expand Up @@ -200,4 +200,4 @@ DEALINGS IN THE SOFTWARE.


==============================================================================
-- Jean-Claude Wippler <jcw@equi4.com>
-- Jean-Claude Wippler <jc@wippler.nl>
1 change: 0 additions & 1 deletion builds/!keepme.txt

This file was deleted.

54 changes: 54 additions & 0 deletions config.h.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/* Define to 1 if you have the `bcopy' function. */
#cmakedefine HAVE_BCOPY 1

/* Define to 1 if you have the <dlfcn.h> header file. */
#cmakedefine HAVE_DLFCN_H 1

/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1

/* Define to 1 if the system has the type `long long'. */
#cmakedefine HAVE_LONG_LONG 1

/* Define to 1 if you have the `memmove' function. */
#cmakedefine HAVE_MEMMOVE 1

/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H

/* Define to 1 if you have the `mmap' function. */
#cmakedefine HAVE_MMAP 1

/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1

/* The size of a `long', as computed by sizeof. */
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@

/* Define to 1 if you have the ANSI C header files. */
#cmakedefine STDC_HEADERS 1

/* Define to empty if `const' does not conform to ANSI C. */
#cmakedefine const @ANSI_CONST@

/* Define as `__inline' if that's what the C compiler calls it, or to nothing
if it is not supported. */
#cmakedefine inline @COMPILER_INLINE@
17 changes: 17 additions & 0 deletions demos/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
include_directories(../include ../src .)

add_executable(demo demo.cpp)
target_link_libraries(demo mk4_static)
install(TARGETS demo
RUNTIME DESTINATION demos)

add_executable(dump dump.cpp)
target_link_libraries(dump mk4_static)
install(TARGETS dump
RUNTIME DESTINATION demos)

add_executable(myio myio.cpp)
target_link_libraries(myio mk4_static)
install(TARGETS myio
RUNTIME DESTINATION demos)

10 changes: 5 additions & 5 deletions demos/myio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class CEncryptStrategy : public c4_FileStrategy
virtual ~CEncryptStrategy ();

// Reading and writing of course messes around with all the data
virtual int DataRead(long, void*, int);
virtual void DataWrite(long, const void*, int);
virtual int DataRead(t4_i32, void*, int);
virtual void DataWrite(t4_i32, const void*, int);

// For this example, we also disable all explicit file flushes
virtual void DataCommit(long) { }
virtual void DataCommit(t4_i32) { }

// Cannot use memory mapped file access when decoding on the fly
virtual void ResetFileMapping() { }
Expand All @@ -45,7 +45,7 @@ CEncryptStrategy::~CEncryptStrategy ()
{
}

int CEncryptStrategy::DataRead(long lOff, void* lpBuf, int nCount)
int CEncryptStrategy::DataRead(t4_i32 lOff, void* lpBuf, int nCount)
{
int result = 0;

Expand All @@ -62,7 +62,7 @@ int CEncryptStrategy::DataRead(long lOff, void* lpBuf, int nCount)
return result;
}

void CEncryptStrategy::DataWrite(long lOff, const void* lpBuf, int nCount)
void CEncryptStrategy::DataWrite(t4_i32 lOff, const void* lpBuf, int nCount)
{
if (nCount > 0)
{
Expand Down
29 changes: 6 additions & 23 deletions include/mk4.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef __MK4_H__
#define __MK4_H__

#include <stdint.h>

//---------------------------------------------------------------------------
//
// TITLE
Expand Down Expand Up @@ -43,7 +45,7 @@
//---------------------------------------------------------------------------

/// Current release = 100 * major + 10 * minor + maintenance
#define d4_MetakitLibraryVersion 249 // 2.4.9.7 release, Jun 16, 2007
#define d4_MetakitLibraryVersion 249 // 2.4.9.8 release, Jun 18, 2015
#define d4_MetaKitLibraryVersion d4_MetakitLibraryVersion // compat, yuck

//---------------------------------------------------------------------------
Expand Down Expand Up @@ -197,28 +199,9 @@ defined(__x86_64__) || defined(__s390x__) || defined(__alpha) || \
#define d4_inline
#endif

typedef unsigned char t4_byte; // create typedefs for t4_byte, etc.

#if q4_LONG64
typedef int t4_i32; // if longs are 64b, then int must be 32b
#else
typedef long t4_i32; // if longs aren't 64b, then they are 32b
#endif

#if q4_LONG64 // choose a way to represent 64b integers
typedef long t4_i64;
#elif defined (LONG_LONG)
typedef LONG_LONG t4_i64;
#elif HAVE_LONG_LONG
typedef long long t4_i64;
#else
struct t4_i64 {
long l1;
long l2;
};
bool operator == (const t4_i64 a_, const t4_i64 b_);
bool operator < (const t4_i64 a_, const t4_i64 b_);
#endif
typedef uint8_t t4_byte; // create typedefs for t4_byte, etc.
typedef int32_t t4_i32; // if longs are 64b, then int must be 32b
typedef int64_t t4_i64;

//---------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion include/mk4.inl
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ d4_inline bool operator!= (c4_Cursor a_, c4_Cursor b_)
d4_inline bool operator< (c4_Cursor a_, c4_Cursor b_)
{
return a_._seq < b_._seq ||
a_._seq == b_._seq && a_._index < b_._index;
(a_._seq == b_._seq && a_._index < b_._index);
}

d4_inline bool operator> (c4_Cursor a_, c4_Cursor b_)
Expand Down
2 changes: 1 addition & 1 deletion license.terms
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 1996-2007 Jean-Claude Wippler
Copyright (c) 1996-2015 Jean-Claude Wippler

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand Down
14 changes: 14 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
set(PYTHON_VERSION_MAJOR 2)
find_package(PythonLibs 2)

include_directories (../include . ./scxx ${PYTHON_INCLUDE_DIRS})

set(metakit_python_SOURCES
PyProperty.cpp
PyRowRef.cpp
PyStorage.cpp
PyView.cpp
scxx/PWOImp.cpp)
add_library(Mk4py SHARED ${metakit_python_SOURCES})
target_link_libraries(Mk4py mk4 ${PYTHON_LIBRARIES})

6 changes: 3 additions & 3 deletions python/PyRowRef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static PyObject *PyRowRef_getattr(PyRowRef *o, char *nm) {
}
return out;
} else if (strcmp(nm, "__view__") == 0) {
return new PyView(o->Container());
return new PyView(o->Container(), o);
} else if (strcmp(nm, "__index__") == 0) {
return PyInt_FromLong((&(*o))._index);
}
Expand Down Expand Up @@ -197,7 +197,7 @@ void PyRowRef::setFromPython(const c4_RowRef &row, const c4_Property &prop,
}
else {
//((const c4_ViewProp&) prop) (row) = c4_View ();
PyView tmp(((const c4_ViewProp &)prop)(row));
PyView tmp(((const c4_ViewProp &)prop)(row), 0);
PWOSequence lst(attr);
tmp.SetSize(lst.len());
for (int i = 0; i < lst.len(); i++) {
Expand Down Expand Up @@ -288,7 +288,7 @@ PyObject *PyRowRef::asPython(const c4_Property &prop) {
}
case 'V':
{
return new PyView(((const c4_ViewProp &)prop)(*this));
return new PyView(((const c4_ViewProp &)prop)(*this), this);
}
case 'B':
case 'M':
Expand Down
17 changes: 6 additions & 11 deletions python/PyStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static char *contents__doc =

static PyObject *PyStorage_Contents(PyStorage *o, PyObject *_args) {
try {
return new PyView(*o);
return new PyView(*o, o);
} catch (...) {
return 0;
}
Expand Down Expand Up @@ -230,7 +230,7 @@ static PyObject *PyStorage_View(PyStorage *o, PyObject *_args) {
try {
PWOSequence args(_args);
PWOString nm(args[0]);
return new PyView(o->View(nm));
return new PyView(o->View(nm), o);
} catch (...) {
return 0;
}
Expand All @@ -243,7 +243,7 @@ static PyObject *PyStorage_GetAs(PyStorage *o, PyObject *_args) {
try {
PWOSequence args(_args);
PWOString descr(args[0]);
return new PyView(o->GetAs(descr));
return new PyView(o->GetAs(descr), o);
} catch (...) {
return 0;
}
Expand Down Expand Up @@ -330,19 +330,14 @@ static void PyStorage_dealloc(PyStorage *o) {
delete o;
}

static int PyStorage_print(PyStorage *o, FILE *f, int) {
fprintf(f, "<PyStorage object at %lx>", (long)o);
return 0;
}

static PyObject *PyStorage_getattr(PyStorage *o, char *nm) {
return Py_FindMethod(StorageMethods, o, nm);
}

PyTypeObject PyStoragetype = {
PyObject_HEAD_INIT(&PyType_Type)0, "PyStorage", sizeof(PyStorage), 0,
(destructor)PyStorage_dealloc, /*tp_dealloc*/
(printfunc)PyStorage_print, /*tp_print*/
0, /*(printfunc)PyStorage_print, /*tp_print*/
(getattrfunc)PyStorage_getattr, /*tp_getattr*/
0, /*tp_setattr*/
(cmpfunc)0, /*tp_compare*/
Expand Down Expand Up @@ -511,7 +506,7 @@ static PyObject *PyView_wrap(PyObject *o, PyObject *_args) {
}

c4_View cv = new PyViewer(seq, templ, (int)usetuples != 0);
return new PyView(cv, 0, ROVIEWER);
return new PyView(cv, 0 /* I'm unsure about passing 0 here. FIXME? */, 0, ROVIEWER);
} catch (...) {
return 0;
}
Expand Down Expand Up @@ -541,7 +536,7 @@ extern "C"__declspec(dllexport)
void initMk4py() {
PyObject *m = Py_InitModule4("Mk4py", Mk4Methods, mk4py_module_documentation,
0, PYTHON_API_VERSION);
PyObject_SetAttrString(m, "version", PyString_FromString("2.4.9.7"));
PyObject_SetAttrString(m, "version", PyString_FromString("2.4.9.8"));
PyObject_SetAttrString(m, "ViewType", (PyObject*) &PyViewtype);
PyObject_SetAttrString(m, "ViewerType", (PyObject*) &PyViewertype);
PyObject_SetAttrString(m, "ROViewerType", (PyObject*) &PyROViewertype);
Expand Down
Loading