e-lib Programmers' Reference Manual

Karel Kubat

e-tunity

2002 ff.

Table of Contents

Chapter 1: Introduction

1.1: For e-lib V3 users

1.2: Installation of e-lib

1.2.1: General preparations
1.2.2: Preparations for shared libraries
1.2.3: Compiling and installing
1.2.4: FastCGI

1.3: Using the functions, classes and libraries

1.3.1: Using the C functions
1.3.2: Using the C++ classes
1.3.3: Using getline

Chapter 2: C Function Reference

2.1: base64_decode - decode a base64-format buffer

2.2: base64_encode - encode a string to base64-format

2.3: bth_init - initialize a BTHash structure

2.4: bth_insert - insert data into a BTHash storage given a unique identifier

2.5: bth_lookup - look up data in a BTHash storage given an identifier

2.6: btn_insert - insert a node into a binary tree

2.7: btn_lookup - look up a node in a btree

2.8: cgi_escape - escape a string to CGI format

2.9: cgi_getdata - convert CGI-sent data to variables and un-escaped values

2.10: cgi_ismultipart - determine whether a CGI buffer holds a multipart message

2.11: cgi_setpostfile - define the input stream for the CGI POST method

2.12: cgi_unescape - un-escape a CGI-value string

2.13: cgi_unescape_buf - un-escape a CGI value buffer

2.14: checksum - determine checksum of a file

2.15: checksum_adler32 - determine checksum of a buffer

2.16: cmm_allocated - determine how many bytes of memory are allocated

2.17: cmm_blocksize - determine the size of a CMM-allocated block

2.18: cmm_cleanup - deallocate blocks from a given level upwards

2.19: cmm_free - free cmm_malloc()-d memory

2.20: cmm_malloc - allocate memory, given some level

2.21: cmm_realloc - reallocate a cmm_malloc()-d block of memory

2.22: cmm_setlevel - set the level for cmm operations

2.23: cmm_storeblock - store an allocated memory block in the cmm administration

2.24: copyfile - copy source file onto destination file

2.25: copyright - show standard copyright notice

2.26: copyright_contact - redefine the "contact" string in a copyright message

2.27: copyright_owner - redefine the "owner" string in a copyright message

2.28: copyright_setoutput - define output file for the copyright() function

2.29: daemonize - fork a daemon process

2.30: elib_require - check e-lib version, stop if too low

2.31: elib_version - determine the version of this e-lib

2.32: equal - compare first parts of 2 strings without regard to casing

2.33: error - print error message including program name and exit

2.34: fchecksum_adler32 - determine checksum of a file

2.35: fgetline - read a line from a file, allocate buffer and return it

2.36: filetype - determine the type of a file

2.37: fin_push - push a block of data back into a file, to be read by fin_read()

2.38: fin_read - read a block of data from a file, possibly a pushed-back block

2.39: get_log_setup - return currently active logging parameters

2.40: hash - compute hash-index for a string

2.41: hashbuf - compute hash-index for a buffer

2.42: html_escape - convert special chars in a buffer to HTML-escape sequences

2.43: html_unescape - convert escaped HTML to original characters

2.44: image_size - determine the size of an image

2.45: lap_end - stop a task stopwatch and log the results

2.46: lap_setup - define stopwatch laptime log file

2.47: lap_start - start the stopwatch mechanism

2.48: log_dontflush - suppress log file flushing when logmsg() is called

2.49: logmsg - log messages to a log file, defined by log_setup ()

2.50: log_rotate - rotate a log file if it exceeds given limits

2.51: log_setup - define logging options

2.52: log_timestamp - enable or disable timestamping of log entries

2.53: log_wrap - enable or disable log line-wrapping

2.54: make_socket - create a server-side TCP/IP socket for a port

2.55: md5 - compute an MD5 digest

2.56: ml_decode - decode a *ML representation into a "normal" buffer

2.57: ml_encode - encode a buffer into *ML representation

2.58: mmsg_body - return n'th body of a parsed mail message

2.59: mmsg_destroy - deallocate a MailMsg handle

2.60: mmsg_fileparse - parse a mail message from file

2.61: mmsg_fparse - parse a mail message a file handle

2.62: mmsg_header - return header of a mail message

2.63: mmsg_headerval - retrieve value of a header variable

2.64: mmsg_new - initialize a MailMsg handle

2.65: mmsg_parse - parse a mail message

2.66: mmsg_partheaderval - retrieve header value of a mail message part

2.67: mmsg_parts - return number of parts in a mail message

2.68: mmsg_reset - reset a MailMsg handle

2.69: mmsg_setheader - set or modify a mail message header

2.70: movefile - move a source file to a destination file

2.71: msg - show message on stderr when in verbose mode

2.72: msg_and_log - log a message and optionally show verbose message

2.73: msg_on - increase program verbosity by 1

2.74: out_of_memory - the "out of memory" handler function

2.75: ps_freesnapshot - Deallocate memory occupied by a process snapshot

2.76: ps_makesnapshot - make a snapshot of the Unix process table

2.77: ps_sortsnapshot - sort a process list snapshot

2.78: random_ulong - generate random unsigned long number

2.79: rc_clean - reset resource-read values

2.80: rc_read - read resource file

2.81: rc_setting - return option/value setting, read via rc_read()

2.82: rc_setval - add value to resource-read set

2.83: rc_value - determine value of a resource file variable

2.84: rx_find - find a regular expression in a string

2.85: rx_ignorecase - ignore casing in regular expression matching

2.86: rx_match - match regular expression and a string

2.87: set_memerr - set the "out of memory" handler function

2.88: setprogname - set the program name for error() and msg()

2.89: sf_sleep - signal-free sleep implementation

2.90: sig_catch - flag-based signal handler

2.91: skipline - skip to the next line in a string buffer

2.92: stab_addsprintf - add a string to a string table using sprintf()-like capabilities

2.93: stab_addstr - add string to string table

2.94: stab_find - find string in a string table

2.95: stab_free - discard memory used by a Strtab, reset member fields

2.96: stab_ifind - find string in a string table, without regard to casing

2.97: stab_maxlen - determine max string length in a string table

2.98: stab_popstr - pop a string off a string table

2.99: str_add - add string to reallocatable string buffer

2.100: str_addchar - add a single character to a relocateble string buffer

2.101: str_equal - compare strings without regard to casing, returns matched characters

2.102: stricmp - compare two strings without regard to casing

2.103: stripstring - strip leading and trailing spaces in a buffer

2.104: strireplace - replace a substring in a string

2.105: stristr - search for substring in a string without regard to casing

2.106: strnicmp - compare two strings over a given length, ignoring casing

2.107: str_printf - fill a string using printf capabilities

2.108: str_short - return shortened duplicate of string, with ... appended

2.109: strupr - convert string to upper case

2.110: str_vprintf - fill a string using vprintf capabilities

2.111: suggest_ext - suggest an appropriate extension for a file name

2.112: supply_ext - supply an appropriate extension for a file name

2.113: tmp_clean - clean up files created by tmp_file()

2.114: tmp_file - construct name for a temporary file

2.115: tmp_fileprefix - define the file prefix for temporary files

2.116: tmp_fopen - open a tmp file for writing

2.117: xcalloc - allocate memory or issue an error

2.118: xmalloc - Allocate memory or issue an out-of-memory error

2.119: xrealloc - Reallocate memory or issue an error

2.120: xstrdup - Duplicate in memory a string or issue an error

2.121: zip_compress - compress a buffer

2.122: zip_decompress - decompress a buffer

2.123: zip_threshold - set the value for compression routines

Chapter 3: C++ Class Reference

3.1: eArray - Storage in an array format

3.1.1: Synopsis
3.1.2: Description
3.1.3: Storing and retrieving

3.2: eHttpHdr - HTTP Request Header handling

3.2.1: Synopsis
3.2.2: Description

3.3: eHttpRequest - HTTP Request handling

3.3.1: Synopsis
3.3.2: Description

3.4: eObj - basic class type of the e++ library

3.4.1: Synopsis
3.4.2: Description

3.5: eProgram - basic program functions

3.5.1: Synopsis
3.5.2: Description

3.6: eStorable - base class for storable objects

3.6.1: Description

3.7: eStr - String class

3.7.1: Synopsis
3.7.2: Description

3.8: eStrArr - Storage of eStr in array format

3.8.1: Synopsis
3.8.2: Description

3.9: eSysinfo - System information

3.9.1: Synopsis
3.9.2: Description

Chapter 4: Changelog