platform/upstream/rpm.git
15 years agoTake advantage of headerNextTag() in python hdr.keys()
Panu Matilainen [Wed, 30 Sep 2009 12:04:39 +0000 (15:04 +0300)]
Take advantage of headerNextTag() in python hdr.keys()
- avoids whole lotta unnecessary copying of data, we're only interested
  in tag numbers here
- dont filter out stuff - python consumers can look at i18n data too

15 years agoAdd iterator support to python header objects
Panu Matilainen [Wed, 30 Sep 2009 11:51:33 +0000 (14:51 +0300)]
Add iterator support to python header objects

15 years agoAdd alternative header iterator method
Panu Matilainen [Wed, 30 Sep 2009 11:48:19 +0000 (14:48 +0300)]
Add alternative header iterator method
- we dont always want the actual contents of the tag to be copied
  on iteration, so add an interface that returns the next tag in the
  header
- this lets callers to decide what to do with the tag and how to
  retrieve it

15 years agoAdd some flags to rpmtd creation
Panu Matilainen [Wed, 30 Sep 2009 10:05:24 +0000 (13:05 +0300)]
Add some flags to rpmtd creation
- permit disabling extension retrieval and "raw" (untranslated i18n) tags
- always use HEADERGET_ALLOC for data availability sanity

15 years agoAdd beginnings of rpmtd wrappings to python
Panu Matilainen [Wed, 30 Sep 2009 09:45:07 +0000 (12:45 +0300)]
Add beginnings of rpmtd wrappings to python
- unlike other types, store the C-level td structure directly in the
  python object, this lets us selectively expose some members directly,
  avoids having to deal with rpmtd allocation separately and as leaves
  the reference counting to python as rpmtd's aren't refcounted on C-level

15 years agoTurn hdrGetHeader() into argument parsing converter interface
Panu Matilainen [Wed, 30 Sep 2009 09:11:43 +0000 (12:11 +0300)]
Turn hdrGetHeader() into argument parsing converter interface

15 years agoSanitize getattr behavior of header objects
Panu Matilainen [Wed, 30 Sep 2009 07:33:52 +0000 (10:33 +0300)]
Sanitize getattr behavior of header objects
- when generic getattr fails, only try retrieving header tag as attribute
  if it's a valid tag
- clear any python errors if generic getattr failed
- split generating a python object from header + tag to an internal helper

15 years agoRequire expected type in PyArg_ParseTupleAndKeywords() already
Panu Matilainen [Mon, 28 Sep 2009 15:22:14 +0000 (18:22 +0300)]
Require expected type in PyArg_ParseTupleAndKeywords() already

15 years agoSupport numeric expansion in rpm.expandMacro()
Panu Matilainen [Mon, 28 Sep 2009 14:23:28 +0000 (17:23 +0300)]
Support numeric expansion in rpm.expandMacro()

15 years agoPush rpm.signalsCaught() to python level
Panu Matilainen [Mon, 28 Sep 2009 13:37:14 +0000 (16:37 +0300)]
Push rpm.signalsCaught() to python level
- only implement the bare minimum in C by adding a thin wrapper for
  rpmsqIsCaught(), the rest can easily be done in python

15 years agoImplement rpm.readHeaderFromFD() in python instead of C
Panu Matilainen [Mon, 28 Sep 2009 13:19:22 +0000 (16:19 +0300)]
Implement rpm.readHeaderFromFD() in python instead of C

15 years agoImplement rpm.readHeaderListFromFD() in python instead of C
Panu Matilainen [Mon, 28 Sep 2009 13:07:09 +0000 (16:07 +0300)]
Implement rpm.readHeaderListFromFD() in python instead of C

15 years agoImplement rpmreadHeaderListFromFile() in python instead of C
Panu Matilainen [Mon, 28 Sep 2009 11:50:33 +0000 (14:50 +0300)]
Implement rpmreadHeaderListFromFile() in python instead of C

15 years agoA few cases of Py_RETURN_NONE missed on the first round
Panu Matilainen [Mon, 28 Sep 2009 10:48:19 +0000 (13:48 +0300)]
A few cases of Py_RETURN_NONE missed on the first round

15 years agoArrange rpm.headerLoad() compatibility on python level
Panu Matilainen [Mon, 28 Sep 2009 10:30:28 +0000 (13:30 +0300)]
Arrange rpm.headerLoad() compatibility on python level

15 years agoOSGi dependency generator fixes from Alphonse Van Assche (ticket #101)
Panu Matilainen [Mon, 28 Sep 2009 08:09:32 +0000 (11:09 +0300)]
OSGi dependency generator fixes from Alphonse Van Assche (ticket #101)
- This patch fix some minor bug, remove unused code and increase drastically
  the perf by threading execution of tasks and using zip command instead of
  jar to get meta-data

15 years agoEnable subtyping on the rest of our type-objects
Panu Matilainen [Thu, 24 Sep 2009 10:57:55 +0000 (13:57 +0300)]
Enable subtyping on the rest of our type-objects
- not very useful atm as various places return hard-wired built-in types

15 years agoEliminate all custom tp_free() type methods
Panu Matilainen [Thu, 24 Sep 2009 10:40:44 +0000 (13:40 +0300)]
Eliminate all custom tp_free() type methods
- tp_free()'s purpose is only to free up the memory used by the python
  object structure, cleaning up our own allocations belongs to tp_dealloc()

15 years agoEnable subtyping on rpm.ts class
Panu Matilainen [Thu, 24 Sep 2009 10:19:20 +0000 (13:19 +0300)]
Enable subtyping on rpm.ts class

15 years agoCall generic python setattr if not scriptFd
Panu Matilainen [Thu, 24 Sep 2009 10:05:36 +0000 (13:05 +0300)]
Call generic python setattr if not scriptFd
- yet more preliminaries for subtyping

15 years agotp_setattro() is supposed to return -1 on errors
Panu Matilainen [Thu, 24 Sep 2009 10:04:34 +0000 (13:04 +0300)]
tp_setattro() is supposed to return -1 on errors

15 years agoCall (sub)type tp_free from destructors
Panu Matilainen [Thu, 24 Sep 2009 09:52:32 +0000 (12:52 +0300)]
Call (sub)type tp_free from destructors
- more preliminaries for subtyping
- remove pointless NULL checks

15 years agoMake object allocation type agnostic
Panu Matilainen [Thu, 24 Sep 2009 08:42:17 +0000 (11:42 +0300)]
Make object allocation type agnostic
- pass (sub)type down to wrappers
- call subtype tp_alloc() instead of PyObject_New()
- preliminaries for allowing subtyping

15 years agoRemove unnecessary header type checking
Panu Matilainen [Wed, 23 Sep 2009 14:44:07 +0000 (17:44 +0300)]
Remove unnecessary header type checking
- the type is already validated by PyArg_ParseTupleAndKeywords(),
  no need to doublecheck

15 years agoRemove the broken tp_print method from spec
Panu Matilainen [Wed, 23 Sep 2009 11:41:30 +0000 (14:41 +0300)]
Remove the broken tp_print method from spec

15 years agoDecouple python spec objects from transaction objects
Panu Matilainen [Wed, 23 Sep 2009 11:21:13 +0000 (14:21 +0300)]
Decouple python spec objects from transaction objects
- ts structure is only necessary for hysterically passing back the
  parse result from parseSpec(), hide this in the bindings
- deprecate ts.parseSpec() for later ripping

15 years agoOops, binary data can and should be presented as python strings
Panu Matilainen [Wed, 23 Sep 2009 10:12:43 +0000 (13:12 +0300)]
Oops, binary data can and should be presented as python strings

15 years agoAdd rpmtd to python object converter, change header code to use that
Panu Matilainen [Wed, 23 Sep 2009 09:49:15 +0000 (12:49 +0300)]
Add rpmtd to python object converter, change header code to use that
- vastly simpler than the former goo in hdr_subscribe

15 years agoTurn tagNumFromPyObject() into an object converter interface
Panu Matilainen [Wed, 23 Sep 2009 09:28:47 +0000 (12:28 +0300)]
Turn tagNumFromPyObject() into an object converter interface
- permits direct validation and conversion from arg parsing

15 years agoTurn rpmFdFromPyObject() into an object converter interface
Panu Matilainen [Wed, 23 Sep 2009 09:05:02 +0000 (12:05 +0300)]
Turn rpmFdFromPyObject() into an object converter interface
- permits direct validation and conversion from arg parsing

15 years agoPermit any file object in rpm.readHeaderListFromFD()
Panu Matilainen [Wed, 23 Sep 2009 08:51:55 +0000 (11:51 +0300)]
Permit any file object in rpm.readHeaderListFromFD()

15 years agoPermit file objects in python header constructor
Panu Matilainen [Wed, 23 Sep 2009 08:42:59 +0000 (11:42 +0300)]
Permit file objects in python header constructor

15 years agoAdd write() method to python headers
Panu Matilainen [Wed, 23 Sep 2009 08:41:20 +0000 (11:41 +0300)]
Add write() method to python headers

15 years agoAccept any file object in ts.hdrFromFdno()
Panu Matilainen [Wed, 23 Sep 2009 08:10:38 +0000 (11:10 +0300)]
Accept any file object in ts.hdrFromFdno()

15 years agoAdd helper to convert python file objects to rpmio FD_t type
Panu Matilainen [Wed, 23 Sep 2009 08:09:19 +0000 (11:09 +0300)]
Add helper to convert python file objects to rpmio FD_t type

15 years agoAdd te.NEVRA() method, adjust docs
Panu Matilainen [Wed, 23 Sep 2009 07:49:47 +0000 (10:49 +0300)]
Add te.NEVRA() method, adjust docs

15 years agoRemove tp_print methods from all rpm-python objects
Panu Matilainen [Wed, 23 Sep 2009 07:44:41 +0000 (10:44 +0300)]
Remove tp_print methods from all rpm-python objects
- these violate the intended use of tp_print, python docs state
  "A type should never implement tp_print in a way that produces
  different output than tp_repr or tp_str would."

15 years agoLose the debug junk from python bindings
Panu Matilainen [Wed, 23 Sep 2009 07:39:40 +0000 (10:39 +0300)]
Lose the debug junk from python bindings

15 years agoAdd hdr.format(), deprecate hdr.sprintf()
Panu Matilainen [Wed, 23 Sep 2009 07:31:46 +0000 (10:31 +0300)]
Add hdr.format(), deprecate hdr.sprintf()
- sprintf() is a C'ism and format() is closer to current librpm anyway

15 years agoMake fiFromHeader() static inside header-py, deprecate
Panu Matilainen [Wed, 23 Sep 2009 07:19:46 +0000 (10:19 +0300)]
Make fiFromHeader() static inside header-py, deprecate

15 years agoDeprecate rpm.headerLoad()
Panu Matilainen [Wed, 23 Sep 2009 07:11:45 +0000 (10:11 +0300)]
Deprecate rpm.headerLoad()
- this is not needed now, just call rpm.hdr(<blob) to load

15 years agoDeprecate header filelist munging methods
Panu Matilainen [Wed, 23 Sep 2009 06:56:08 +0000 (09:56 +0300)]
Deprecate header filelist munging methods
- hdr.convert() is the generic way, the old stuff is not needed anymore
- macro to issue warnings just once

15 years agoEliminate unnecessary function
Panu Matilainen [Wed, 23 Sep 2009 06:27:47 +0000 (09:27 +0300)]
Eliminate unnecessary function

15 years agoPermit headerConvert() from python
Panu Matilainen [Wed, 23 Sep 2009 06:24:23 +0000 (09:24 +0300)]
Permit headerConvert() from python

15 years agoAdd has_key() method to header object
Panu Matilainen [Wed, 23 Sep 2009 06:03:25 +0000 (09:03 +0300)]
Add has_key() method to header object

15 years agoAdd support for creating new header objects
Panu Matilainen [Wed, 23 Sep 2009 05:51:12 +0000 (08:51 +0300)]
Add support for creating new header objects
- without arguments, rpm.hdr() creates an empty header
- with another header as argument, make a copy
- string argument is considered an unloaded header blob and copy-loaded

15 years agoRpm's allocators dont return on OOM, remove unnecessary check
Panu Matilainen [Wed, 23 Sep 2009 05:41:03 +0000 (08:41 +0300)]
Rpm's allocators dont return on OOM, remove unnecessary check

15 years agoAdd type checking macros for all rpm python type objects
Panu Matilainen [Tue, 22 Sep 2009 21:06:13 +0000 (00:06 +0300)]
Add type checking macros for all rpm python type objects

15 years agoRename python system.h for disambiguation
Panu Matilainen [Tue, 22 Sep 2009 20:02:47 +0000 (23:02 +0300)]
Rename python system.h for disambiguation

15 years agoLose the empty doxygen markers
Panu Matilainen [Tue, 22 Sep 2009 19:42:06 +0000 (22:42 +0300)]
Lose the empty doxygen markers
- nothing wrong with comments but empty comment placeholders
  are not exactly useful

15 years agoPut some consistency to python object creation
Panu Matilainen [Tue, 22 Sep 2009 18:53:21 +0000 (21:53 +0300)]
Put some consistency to python object creation
- all type object creation goes through foo_Wrap() which handle OOM
  and all type specific initialization

15 years agoMake all python object creation wrappers return PyObject pointers
Panu Matilainen [Tue, 22 Sep 2009 18:24:55 +0000 (21:24 +0300)]
Make all python object creation wrappers return PyObject pointers
- this way the only place where casts are needed are in the wrapper itself

15 years agoDont leak memory on rpm.ds iteration
Panu Matilainen [Tue, 22 Sep 2009 18:01:01 +0000 (21:01 +0300)]
Dont leak memory on rpm.ds iteration

15 years agoLose unnecessary next() methods
Panu Matilainen [Tue, 22 Sep 2009 17:50:41 +0000 (20:50 +0300)]
Lose unnecessary next() methods
- python adds next() methods for objects supporting iterators

15 years agoAll rpm-python iterators are self-iterators, just use PyObject_SelfIter
Panu Matilainen [Tue, 22 Sep 2009 17:20:07 +0000 (20:20 +0300)]
All rpm-python iterators are self-iterators, just use PyObject_SelfIter

15 years agoDont leak memory from rpm.dsSingle()
Panu Matilainen [Tue, 22 Sep 2009 16:55:34 +0000 (19:55 +0300)]
Dont leak memory from rpm.dsSingle()

15 years agoSimplify fiFromHeader()
Panu Matilainen [Tue, 22 Sep 2009 16:44:59 +0000 (19:44 +0300)]
Simplify fiFromHeader()
- just call the fi object, no need to manually redo all this stuff

15 years agoSimplify dsFromHeader()
Panu Matilainen [Tue, 22 Sep 2009 16:42:53 +0000 (19:42 +0300)]
Simplify dsFromHeader()
- just call the ds object, no need to manually redo all this stuff

15 years agoSanitize python object -> tag number exception handling
Panu Matilainen [Tue, 22 Sep 2009 16:19:02 +0000 (19:19 +0300)]
Sanitize python object -> tag number exception handling
- raise exception in tagNumFromPyObject(), not in 12 different callers
- check against RPMTAG_NOT_FOUND consistently instead of -1 and whatnot
- unknown tags are value, not key or type errors

15 years agoMove allocations out of rpmps object init method
Panu Matilainen [Tue, 22 Sep 2009 15:55:09 +0000 (18:55 +0300)]
Move allocations out of rpmps object init method
- tp_init can be called several times, allocating from there leaks memory
- tp_init gets called automatically on object creation, dont call manually
- nothing to initialize for rpmps...

15 years agoMove allocations out of rpmds object init method
Panu Matilainen [Tue, 22 Sep 2009 15:53:15 +0000 (18:53 +0300)]
Move allocations out of rpmds object init method
- tp_init can be called several times, allocating from there leaks memory
- tp_init gets called automatically on object creation, dont call manually

15 years agoMove allocations out of rpmfi object init method
Panu Matilainen [Tue, 22 Sep 2009 15:50:32 +0000 (18:50 +0300)]
Move allocations out of rpmfi object init method
- tp_init can be called several times, allocating from there leaks memory
- tp_init gets called automatically on object creation, dont call manually

15 years agoRemove useless rpmts python initialization
Panu Matilainen [Tue, 22 Sep 2009 15:22:50 +0000 (18:22 +0300)]
Remove useless rpmts python initialization

15 years agoRealize the remaining bits of direct rpmdb interface are dead too
Panu Matilainen [Tue, 22 Sep 2009 15:17:49 +0000 (18:17 +0300)]
Realize the remaining bits of direct rpmdb interface are dead too
- the code hasn't been enabled in a long long time despite being built...

15 years agoUse Py_RETURN_NONE macro for returning None everywhere
Panu Matilainen [Tue, 22 Sep 2009 14:49:53 +0000 (17:49 +0300)]
Use Py_RETURN_NONE macro for returning None everywhere

15 years agoEliminate unnecessary custom object allocation functions
Panu Matilainen [Tue, 22 Sep 2009 14:33:07 +0000 (17:33 +0300)]
Eliminate unnecessary custom object allocation functions
- these are just calling python defaults, no point at all...

15 years agoUse generic python get/set attribute functions directly where appropriate
Panu Matilainen [Tue, 22 Sep 2009 14:27:44 +0000 (17:27 +0300)]
Use generic python get/set attribute functions directly where appropriate
- no point in wrapping all this stuff in our own functions

15 years agoPython initialization spring clean
Panu Matilainen [Tue, 22 Sep 2009 14:12:22 +0000 (17:12 +0300)]
Python initialization spring clean
- split rpmtag enum additions to seprate function
- PyModule_AddIntConstant() does exactly what we need for the rest

15 years agoMake the python object structures opaque
Panu Matilainen [Tue, 22 Sep 2009 13:47:07 +0000 (16:47 +0300)]
Make the python object structures opaque

15 years agoLose the utterly broken rpmio FD_t wrappers
Panu Matilainen [Tue, 22 Sep 2009 13:39:39 +0000 (16:39 +0300)]
Lose the utterly broken rpmio FD_t wrappers

15 years agoLose the useless python debug stuff
Panu Matilainen [Tue, 22 Sep 2009 13:36:48 +0000 (16:36 +0300)]
Lose the useless python debug stuff

15 years agoWe dont support ancient python versions...
Panu Matilainen [Tue, 22 Sep 2009 13:28:58 +0000 (16:28 +0300)]
We dont support ancient python versions...

15 years agoKick out mummified rpmdb python interface remnants
Panu Matilainen [Tue, 22 Sep 2009 13:24:32 +0000 (16:24 +0300)]
Kick out mummified rpmdb python interface remnants

15 years agoMissing <string.h> include
Panu Matilainen [Tue, 22 Sep 2009 13:02:39 +0000 (16:02 +0300)]
Missing <string.h> include

15 years agoClean up + fix bad recno erasure in python ts.addErase()
Panu Matilainen [Tue, 22 Sep 2009 12:36:11 +0000 (15:36 +0300)]
Clean up + fix bad recno erasure in python ts.addErase()
- now that we can loop over RPMDBI_PACKAGES matches, the code can
  be simplified quite a bit
- walk through the iterator always to get a reliable installed status,
  previously ts.addErase() with bad record number wouldn't raise exception

15 years agoRemove no longer necessary RPMDBI_PACKAGES special casing
Panu Matilainen [Tue, 22 Sep 2009 11:53:56 +0000 (14:53 +0300)]
Remove no longer necessary RPMDBI_PACKAGES special casing

15 years agoFix endless loop on RPMDBI_PACKAGES iteration when offset specified
Panu Matilainen [Tue, 22 Sep 2009 11:52:57 +0000 (14:52 +0300)]
Fix endless loop on RPMDBI_PACKAGES iteration when offset specified

15 years agoUnbreak --tid and --querybynumber
Panu Matilainen [Tue, 22 Sep 2009 09:32:02 +0000 (12:32 +0300)]
Unbreak --tid and --querybynumber
- broken ages ago somewhere between 4.4.x and 4.6.x by typing changes
  presumably
- C99 strtoul() can figure the base on its own, remove unnecessary work

15 years agoDB_INCOMPLETE was removed in BDB 4.1 and we dont support older versions
Panu Matilainen [Tue, 22 Sep 2009 07:21:47 +0000 (10:21 +0300)]
DB_INCOMPLETE was removed in BDB 4.1 and we dont support older versions

15 years agoRemove ancient, unused code to filter duplicates on rpmdb rebuild
Panu Matilainen [Tue, 22 Sep 2009 06:26:39 +0000 (09:26 +0300)]
Remove ancient, unused code to filter duplicates on rpmdb rebuild
- enabling this as-is would be murderous to multilib systems
- getting duplicates in the db would be a bug elsewhere

15 years agoRip out dependency caching
Panu Matilainen [Mon, 21 Sep 2009 11:36:59 +0000 (14:36 +0300)]
Rip out dependency caching
- it doesn't speed up things that much, is broken in some chroot
  scenarios and is ugly ugly hardwired BDB hackery where it doesn't belong

15 years agoMove rpmdb home creation from backends to one level higher
Panu Matilainen [Mon, 21 Sep 2009 11:04:34 +0000 (14:04 +0300)]
Move rpmdb home creation from backends to one level higher
- this is a common operation for any backends, avoid duplication
- only try to create it once instead of every index open, and if it
  doesn't exist and cant be created, error out instead of trying to continue
  in vain

15 years agoAdd an internal API for getting rpmdb home wrt chroot state, use it
Panu Matilainen [Mon, 21 Sep 2009 11:00:46 +0000 (14:00 +0300)]
Add an internal API for getting rpmdb home wrt chroot state, use it

15 years agoRemove pointless per-index api version
Panu Matilainen [Mon, 21 Sep 2009 08:59:25 +0000 (11:59 +0300)]
Remove pointless per-index api version

15 years agoDB config stuff not needed outside dbconfig.c, make them static
Panu Matilainen [Mon, 21 Sep 2009 08:36:16 +0000 (11:36 +0300)]
DB config stuff not needed outside dbconfig.c, make them static
- additionally make the popt struct const since it can...

15 years agoBDB is not optional at least currently, remove useless ifdefs
Panu Matilainen [Mon, 21 Sep 2009 08:32:43 +0000 (11:32 +0300)]
BDB is not optional at least currently, remove useless ifdefs

15 years agoRemove useless no-op "teardown" and "usecursors" config bits
Panu Matilainen [Mon, 21 Sep 2009 08:29:27 +0000 (11:29 +0300)]
Remove useless no-op "teardown" and "usecursors" config bits

15 years agoRemove BDB RPC "support"
Panu Matilainen [Mon, 21 Sep 2009 08:00:50 +0000 (11:00 +0300)]
Remove BDB RPC "support"
- it's insecure, used by nobody (its been rather broken for a long
  time) and all, but BDB 4.8.x removed RPC support from upstream so we
  cant very well support in the future even if we wanted to

15 years agoRemove XA "support" from the backend
Panu Matilainen [Mon, 21 Sep 2009 07:29:38 +0000 (10:29 +0300)]
Remove XA "support" from the backend
- it's removed from BDB 4.8.x and this has hardly ever done anything anyway

15 years agoRemove unused db/dbenv methods "documentary" from the source
Panu Matilainen [Fri, 18 Sep 2009 10:53:46 +0000 (13:53 +0300)]
Remove unused db/dbenv methods "documentary" from the source

15 years agoUse db3Free() for on sqlite backend close too
Panu Matilainen [Fri, 18 Sep 2009 10:05:49 +0000 (13:05 +0300)]
Use db3Free() for on sqlite backend close too

15 years agoAlways populate dbi->dbi_file on db3New()
Panu Matilainen [Fri, 18 Sep 2009 10:13:59 +0000 (13:13 +0300)]
Always populate dbi->dbi_file on db3New()
- Only the actual db->open() wants NULL for temporary databases, everywhere
  else we want the tag name. Handle the temporary case where it counts
  instead of complicating things everywhere for the one special case.

15 years agoMop up leftover root/home foobar
Panu Matilainen [Fri, 18 Sep 2009 08:56:05 +0000 (11:56 +0300)]
Mop up leftover root/home foobar

15 years agoPer-dbi root and home dont make sense, always use rpmdb paths
Panu Matilainen [Fri, 18 Sep 2009 08:51:21 +0000 (11:51 +0300)]
Per-dbi root and home dont make sense, always use rpmdb paths

15 years agoSigh.. when not using environment, absolute paths are required
Panu Matilainen [Fri, 18 Sep 2009 06:49:28 +0000 (09:49 +0300)]
Sigh.. when not using environment, absolute paths are required

15 years agoAlways open database files relative to database home
Panu Matilainen [Thu, 17 Sep 2009 13:28:09 +0000 (16:28 +0300)]
Always open database files relative to database home
- This allows the db to move freely wherever (such as across chroots,
  RhBug:507309 and pile of related issues) .. and is even recommended
  by BDB documentation. Well duh.

15 years agoEXIT_FAILURE being defined is already handled in system.h
Panu Matilainen [Thu, 17 Sep 2009 09:51:28 +0000 (12:51 +0300)]
EXIT_FAILURE being defined is already handled in system.h

15 years agoCompare pointers against NULL, not 0
Panu Matilainen [Thu, 17 Sep 2009 09:40:29 +0000 (12:40 +0300)]
Compare pointers against NULL, not 0

15 years agoHave BDB use our allocation routines now that we can
Panu Matilainen [Thu, 17 Sep 2009 09:25:31 +0000 (12:25 +0300)]
Have BDB use our allocation routines now that we can
- rfree() prototype doesn't match free() but it doesn't matter in this
  case as it's just a convencience wrapper with no extra functionality
  and setting NULL is ok according to BDB docs
- db->set_alloc() can't be used if environment is used, fix the condition

15 years agoAdd runtime settable custom memory allocation failure callback routine
Panu Matilainen [Thu, 17 Sep 2009 08:36:10 +0000 (11:36 +0300)]
Add runtime settable custom memory allocation failure callback routine
- lets API users perform theirn own cleanup / exit through their own
  routines in case of allocation failure, or even try to free up
  some memory and retry allocation