* renamed udd to ctx in qse_mmgr_t
* fixed problems in build and test scripts
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/** @defgroup awk AWK
|
||||
/** @page awk AWK
|
||||
|
||||
@section awk_intro INTRODUCTION
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/** @defgroup cut TEXT CUTTER
|
||||
/** @page cut TEXT CUTTER
|
||||
|
||||
@section cut_contents CONTENTS
|
||||
- \ref cut_intro
|
||||
|
@ -2,18 +2,12 @@
|
||||
|
||||
@section qse_intro INTRODUCTION
|
||||
|
||||
The QSE library implements functionality of various Unix commands in an
|
||||
embeddable form and defines data types, functions, and classes that you can
|
||||
use when you embed such functionality into an application. The interface has
|
||||
been designed to be flexible enough to access various aspects of embedding
|
||||
application and an embedded object from each other.
|
||||
|
||||
Currently the library contains the following components:
|
||||
- @subpage awk "AWK Interpreter"
|
||||
- @subpage cut "CUT Text Cutter"
|
||||
- @subpage sed "SED Stream Editor"
|
||||
|
||||
As the library grows, more components will be added.
|
||||
The QSE library implements various Unix commands in an embeddable form and
|
||||
defines data types, functions, and classes that you can use when you embed
|
||||
them into an application. It also provides more fundamental data types and
|
||||
funtions needed when you deal with memory, streams, data structures.
|
||||
The interface has been designed to be flexible enough to access various
|
||||
aspects of embedding application and an embedded object from each other.
|
||||
|
||||
The library is licensed under the GNU Lesser General Public License version 3:
|
||||
http://www.gnu.org/licenses/
|
||||
@ -23,6 +17,16 @@ The project webpage: http://code.abiyo.net/@qse
|
||||
For further information, contact:
|
||||
Chung, Hyung-Hwan <hyunghwan.chung@gmail.com>
|
||||
|
||||
@section components MODULES
|
||||
|
||||
See the subpages for various modules available in this library.
|
||||
|
||||
- @subpage mem "Memory Management"
|
||||
- @subpage io "I/O Handling"
|
||||
- @subpage awk "AWK Interpreter"
|
||||
- @subpage cut "CUT Text Cutter"
|
||||
- @subpage sed "SED Stream Editor"
|
||||
|
||||
@section installation INSTALLATION
|
||||
|
||||
@subsection build_from_source BUILINDG FROM A SOURCE PACKAGE
|
||||
@ -87,18 +91,5 @@ Under the wide character mode:
|
||||
|
||||
#qse_mchar_t maps to @b char and #qse_wchar_t maps to @b wchar_t or equivalent.
|
||||
|
||||
@section library_modules LIBRARY MODULES
|
||||
@b QSE contains a set of APIs. Each set is organized into a library module
|
||||
and its interface is exported via header files. Commonly used functions and
|
||||
data structures are organized into a common functions library and forms the
|
||||
foundation for other modules. Specialized functions and data structures are
|
||||
organized to dedicated modules. See relevant subpages for more information
|
||||
on each module.
|
||||
|
||||
- @subpage mem "Memory Management"
|
||||
- @subpage io "I/O Handling"
|
||||
- @subpage awk "AWK Interpreter"
|
||||
- @subpage cut "CUT Text Cutter"
|
||||
- @subpage sed "SED Stream Editor"
|
||||
|
||||
*/
|
||||
|
@ -1,6 +1,60 @@
|
||||
/** @page mem Memory Management
|
||||
|
||||
@section mem_alloc Memory Allocator
|
||||
- Private heap allocator #qse_xma_t
|
||||
- Fixed-size block allocator #qse_fma_t
|
||||
@section mem_overview Overview
|
||||
|
||||
A memory manager is an instance of a structure type #qse_mmgr_t. Creating
|
||||
and/or initializing an object requires a memory manager to be passed in.
|
||||
If you pass in #QSE_NULL for a memory manager, the object is created and/or
|
||||
initialized with the default memory manager.
|
||||
|
||||
The default memory manager is merely a wrapper to memory allocation functions
|
||||
provided by underlying operating systems: HeapAlloc/HeapReAlloc/HeapFree
|
||||
on _WIN32 and malloc/realloc/free on other platforms. You can get this default
|
||||
memory manager with qse_getdflmmgr() and can change it with qse_setdflmmgr().
|
||||
|
||||
Typically, the name of a function creating an object begins with @b qse_,
|
||||
ends with @b _open, and accepts a memory manager as the first parameter.
|
||||
See qse_mbs_open() for instance. So you can customize memory management
|
||||
at the per-object level.
|
||||
|
||||
@section mem_xma Priviate Heap
|
||||
|
||||
While the default memory manager allocates memory from a system-wide heap,
|
||||
you can create a private heap and use it when you create an object.
|
||||
The #qse_xma_t type defines a private heap manager and its functions offer
|
||||
sufficient interface to form a memory manager over a private heap.
|
||||
|
||||
A typical usage is shown below:
|
||||
|
||||
@code
|
||||
qse_mmgr_t mmgr;
|
||||
|
||||
/* Create a heap */
|
||||
heap = qse_xma_open (QSE_NULL, 0, 1024 * 1024); /* 1M heap */
|
||||
|
||||
/* Initialize a new memory */
|
||||
mmgr.alloc = (qse_mmgr_alloc_t)qse_xma_alloc;
|
||||
mmgr.realloc = (qse_mmgr_realloc_t)qse_xma_realloc;
|
||||
mmgr.free = (qse_mmgr_free_t)qse_xma_realloc;
|
||||
mmgr.ctx = heap;
|
||||
|
||||
/*
|
||||
* You can pass 'mmgr' when you create/initialize a different object
|
||||
*/
|
||||
....
|
||||
....
|
||||
|
||||
/* Destroy the heap */
|
||||
qse_xma_close (heap);
|
||||
@endcode
|
||||
|
||||
Note that creating a private heap requires a memory manager, too. The example
|
||||
above used the default memory manager to create a private heap within the
|
||||
global heap. This means that you can split a heap to smaller subheaps.
|
||||
|
||||
@section mem_fma Fixed-size Block Allocator
|
||||
|
||||
If the size of memory blocks to allocate share the same size, you can use
|
||||
#qse_fma_t for performance.
|
||||
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/** @defgroup sed Stream Editor
|
||||
/** @page sed Stream Editor
|
||||
|
||||
@section sed_contents CONTENTS
|
||||
- \ref sed_intro
|
||||
|
Reference in New Issue
Block a user