- Timestamp:
- 01/01/09 05:14:32 (4 years ago)
- Location:
- lang/python/pytc/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/python/pytc/trunk/ChangeLog
r24694 r27713 1 2008-12-31 Tasuku SUENAGA <gunyarakun@sourceforge.net> 2 3 * version 0.7 4 * Added Python 2.4 compatibility. Thanks to Vernon Tang. 5 * Allow negitive values on optimize and tune methods of pytc.BDB and pytc.HDB. Thanks to Vernon Tang. 6 * removed unnecessarily links(libz and libm). Thanks to Vernon Tang. 7 1 8 2008-11-22 Tasuku SUENAGA <gunyarakun@sourceforge.net> 2 9 -
lang/python/pytc/trunk/pytc.c
r24694 r27713 17 17 #include <tchdb.h> 18 18 #include <tcutil.h> 19 #include <limits.h> 20 21 #if PY_VERSION_HEX < 0x02050000 22 typedef inquiry lenfunc; 23 #endif 19 24 20 25 /* FIXME: handle error */ … … 27 32 iter_item 28 33 } itertype; 34 35 static bool 36 char_bounds(short x) { 37 if (x < SCHAR_MIN) { 38 PyErr_SetString(PyExc_OverflowError, 39 "signed byte integer is less than minimum"); 40 return false; 41 } else if (x > SCHAR_MAX) { 42 PyErr_SetString(PyExc_OverflowError, 43 "signed byte integer is greater than maximum"); 44 return false; 45 } else { 46 return true; 47 } 48 } 29 49 30 50 /* Error Objects */ … … 511 531 a(PyTCHDB *self, PyObject *args, PyObject *keywds) { \ 512 532 bool result; \ 513 charapow, fpow; \533 short apow, fpow; \ 514 534 PY_LONG_LONG bnum; \ 515 535 unsigned char opts; \ 516 536 static char *kwlist[] = {"bnum", "apow", "fpow", "opts", NULL}; \ 517 537 \ 518 if (!PyArg_ParseTupleAndKeywords(args, keywds, "L bbB:" #b, kwlist, \538 if (!PyArg_ParseTupleAndKeywords(args, keywds, "LhhB:" #b, kwlist, \ 519 539 &bnum, &apow, &fpow, &opts)) { \ 540 return NULL; \ 541 } \ 542 if (!(char_bounds(apow) && char_bounds(fpow))) { \ 520 543 return NULL; \ 521 544 } \ … … 1239 1262 a(PyTCBDB *self, PyObject *args, PyObject *keywds) { \ 1240 1263 bool result; \ 1241 charapow, fpow; \1264 short apow, fpow; \ 1242 1265 int lmemb, nmemb; \ 1243 1266 PY_LONG_LONG bnum; \ … … 1245 1268 static char *kwlist[] = {"lmemb", "nmemb", "bnum", "apow", "fpow", "opts", NULL}; \ 1246 1269 \ 1247 if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiL bbB:" #b, kwlist, \1270 if (!PyArg_ParseTupleAndKeywords(args, keywds, "iiLhhB:" #b, kwlist, \ 1248 1271 &lmemb, &nmemb, &bnum, \ 1249 1272 &apow, &fpow, &opts)) { \ 1273 return NULL; \ 1274 } \ 1275 if (!(char_bounds(apow) && char_bounds(fpow))) { \ 1250 1276 return NULL; \ 1251 1277 } \ -
lang/python/pytc/trunk/setup.py
r24694 r27713 18 18 19 19 ext = Extension('pytc', 20 libraries = ['tokyocabinet' , 'z', 'pthread', 'm', 'c'],20 libraries = ['tokyocabinet'], 21 21 sources = ['pytc.c'], 22 22 include_dirs = include_dirs, … … 25 25 26 26 setup(name = 'pytc', 27 version = '0. 6',27 version = '0.7', 28 28 description = 'Tokyo Cabinet Python bindings', 29 29 long_description = '''
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)