diff --git a/CHANGELOG.md b/CHANGELOG.md index b1433312..3bf02a43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ This file is used to document any relevant changes done to libphorward. Released on: April 17, 2018 +- v0.22.3: Updated documentation, thanks to AGS - v0.22.2: inline-symbols incorrectly implemented in pbnf - v0.22.1: Build-system fixes (Windows only) - v0.22.1: pgetline() function as POSIX compatiblity layer diff --git a/Version b/Version index 25d3ccce..f44d128b 100755 --- a/Version +++ b/Version @@ -1,4 +1,4 @@ #!/bin/sh -echo "0.22.2" +echo "0.22.3" # When changing version number, remove src/version.h to regenerate it! diff --git a/configure b/configure index df1c572e..87da9ef9 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Phorward Toolkit 0.22.2. +# Generated by GNU Autoconf 2.69 for Phorward Toolkit 0.22.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Phorward Toolkit' PACKAGE_TARNAME='phorward-toolkit' -PACKAGE_VERSION='0.22.2' -PACKAGE_STRING='Phorward Toolkit 0.22.2' +PACKAGE_VERSION='0.22.3' +PACKAGE_STRING='Phorward Toolkit 0.22.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1316,7 +1316,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Phorward Toolkit 0.22.2 to adapt to many kinds of systems. +\`configure' configures Phorward Toolkit 0.22.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1387,7 +1387,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Phorward Toolkit 0.22.2:";; + short | recursive ) echo "Configuration of Phorward Toolkit 0.22.3:";; esac cat <<\_ACEOF @@ -1498,7 +1498,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Phorward Toolkit configure 0.22.2 +Phorward Toolkit configure 0.22.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1917,7 +1917,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Phorward Toolkit $as_me 0.22.2, which was +It was created by Phorward Toolkit $as_me 0.22.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2784,7 +2784,7 @@ fi # Define the identity of the package. PACKAGE='phorward-toolkit' - VERSION='0.22.2' + VERSION='0.22.3' cat >>confdefs.h <<_ACEOF @@ -13392,7 +13392,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Phorward Toolkit $as_me 0.22.2, which was +This file was extended by Phorward Toolkit $as_me 0.22.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13449,7 +13449,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Phorward Toolkit config.status 0.22.2 +Phorward Toolkit config.status 0.22.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index ad9118cb..f97f7cc3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.68]) -AC_INIT([Phorward Toolkit], [0.22.2]) +AC_INIT([Phorward Toolkit], [0.22.3]) AC_PREFIX_DEFAULT([/usr]) AC_CONFIG_SRCDIR([src/phorward.tpl.h]) diff --git a/doc/phorward.html b/doc/phorward.html index 6d7f5a05..a25b485e 100644 --- a/doc/phorward.html +++ b/doc/phorward.html @@ -13,8 +13,8 @@
@@ -722,7 +722,7 @@

Introduction

  • base provides tools for dynamic data structures and utility functions used throughout the library, including linked lists, hash-tables, stacks and arrays,
  • -
  • parse defines tools to express grammars and provides a built-in LALR(1) parser generator and objects to handle abstract syntax trees, integrating perfectly with the tools from *regex* for lexical analysis, +
  • parse defines tools to express grammars and provides a built-in LALR(1) parser generator and objects to handle abstract syntax trees, integrating perfectly with the tools from regex for lexical analysis,
  • regex provides tools for lexical analysis and regular expression processing,
  • @@ -777,7 +777,7 @@

    Features

  • Dynamic data structures
  • @@ -3338,8 +3338,8 @@

    p_ccl_compat

    Usage:

    -Checks if the character-classes l and r are in the same -character universe and compatible for operations. +Checks if the character-classes l and r are configured +to be in the same character universe and compatible for operations.

    @@ -3367,7 +3367,7 @@

    p_ccl_count

    Returns the total number of characters the class is holding.

    - +

    @@ -3388,6 +3388,10 @@

    p_ccl_create

    Constructor function to create a new character-class.

    +min and max can either be specified as -1, so the configured default +constants PCCL_MIN and PCCL_MAX will be used. The values can also be inverted. +

    +

    Returns a pointer to the newly created character-class. This pointer should be released with p_ccl_free() when its existence is no longer required.

    @@ -3522,7 +3526,7 @@

    p_ccl_erase

    Erases a character-class ccl.

    -The function sets a character-class to zero, as it continas no character range +The function sets a character-class to zero, as it contains no character range definitions. The object ccl will be still alive. To delete the entire object, use p_ccl_free(). @@ -3641,7 +3645,7 @@

    p_ccl_intersect

    within is the pointer to the second character-class.

    -Returns a new character-class containing the insersections from ccl +Returns a new character-class containing the intersection of ccl and within. If there is no intersection between both character-classes, the function returns (pccl*)NULL. @@ -3691,7 +3695,7 @@

    p_ccl_parse

    Parses the character-class definition provided in ccldef and assigns this definition to the character-class ccl. ccldef may contain -UTF-8 formatted input. Escape-sequences will be interpretered to their correct +UTF-8 formatted input. Escape-sequences will be interpreted to their correct character representations.

    @@ -3726,7 +3730,7 @@

    p_ccl_parsechar

    Usage:

    -Reads a character from a string. The character may exist of one single +Reads a character from a string. The character may consist of one single character or it may be made up of an escape sequence or UTF-8 character. The function returns the number of bytes read.

    @@ -3766,7 +3770,7 @@

    p_ccl_parseshorthand

    the pointer str is moved the characters consumed.

    -If no shorthand sequence could be found, it returns FALSE, remaining ccl +If no shorthand sequence could be found, it returns FALSE, leaving ccl untouched. @@ -3855,7 +3859,7 @@

    p_ccl_test

    Usage:

    -Tests a character-class if it cointains a character. +Tests a character-class if it contains a character.

    ccl is the pointer to character-class to be tested. @@ -3928,7 +3932,7 @@

    p_ccl_to_str

    The returned pointer belongs to the ccl and is managed by the character-class handling functions, so it should not be freed manually. - +

    @@ -3946,16 +3950,17 @@

    p_ccl_union

    Usage:

    -Unions two character-classes into a new, normalized one. +Creates the union of two character-classes and returns the newly created, +normalized character-class.

    ccl is the pointer to the character-class that will be extended to all -ranges contained in add. -add is character-class that will be unioned with ccl. +ranges contained in add. add is the character-class that will be joined +with ccl.

    The function creates and returns a new character-class that is the union -if ccl and add. +of ccl and add.

    @@ -4071,8 +4076,8 @@

    pany_fprint

    Usage:

    -Print the type and value of val to stream -without any conversion. This function shall be used for debug only. +Print the type and value of val to stream without any conversion. +This function shall be used for debugging purposes only.

    stream is the stream to write to. @@ -4491,7 +4496,7 @@

    pany_parse

    Any other content is taken as string. If the parameter enforce is set to -an desired PANY_-type, this type will be enforced, and no special recognition +a desired PANY_-type, this type will be enforced, and no special recognition is done.

    @@ -5285,10 +5290,10 @@

    parray_init

    This should be evaluated using the sizeof()-macro.

    -chunk defines the chunk size, where an array-(re)allocation will be performed. -If, e.g. this is set to 128, then, if the 128th item is created within the -array, a realloction is done. Once allocated memory remains until the array is -freed again. +chunk defines the chunk size, when an array-(re)allocation will be +performed. If, e.g. this is set to 128, then, if the 128th item is created +within the array, a realloction is done. Once allocated memory remains until +the array is freed again.

    @@ -5480,7 +5485,7 @@

    parray_pop

    The function returns the pointer of the popped item. Because dynamic arrays only grow and no memory is freed, the returned data pointer is still valid, and will -only be overidden with the next push operation. +only be overridden with the next push operation.

    array is the pointer to array where to pop an item off. @@ -5660,7 +5665,7 @@

    parray_rget

    the array).

    -Use parray_get() for access items from the begin. +Use parray_get() to access items from the begin.

    @@ -5765,7 +5770,7 @@

    parray_shift

    The function returns the pointer of the shifted item. Because dynamic arrays only grow and no memory is freed, the returned data -pointer is still valid, and will only be overidden with the next unshift +pointer is still valid, and will only be overridden with the next unshift operation.

    @@ -5828,7 +5833,7 @@

    parray_unshift

    with a macro. It can be left (void*)NULL, so no memory will be copied.

    -The function returns the address of the newly unhshifted item, and (void*)NULL +The function returns the address of the newly unshifted item, and (void*)NULL if the item could not be unshifted.

    @@ -5858,7 +5863,7 @@

    pasprintf

    ... are the parameters according to the placeholders set in fmt.

    -Returns a char* Returns the allocated string which cointains the format string +Returns a char* Returns the allocated string which contains the format string with inserted values. @@ -6025,7 +6030,7 @@

    pfree

    NULL-pointers and returns a (void*)NULL pointer for direct pointer memory reset.

    -It could be used this way to immedatelly reset a pointer to NULL: +It could be used this way to immediately reset a pointer to NULL:

    
    @@ -6036,7 +6041,7 @@ 

    pfree

    ptr is the pointer to be freed.

    -Returns always (void*)NULL. +Always returns (void*)NULL.

    @@ -6178,7 +6183,7 @@

    plex_create

    PREGEX_COMP_STATIC -The regular expressions passed should be converted 1:1 as it where a string-constant. Any regex-specific symbols will be ignored and taken as they where escaped. +The regular expressions passed should be converted 1:1 as if it were a string-constant. Any regex-specific symbols will be ignored and taken as if escaped. PREGEX_RUN_WCHAR @@ -6198,7 +6203,7 @@

    plex_create

    PREGEX_RUN_DEBUG -Debug mode; output some debug to stderr. +Debug mode; output some debug info to stderr. @@ -6271,7 +6276,7 @@

    plex_define

    PREGEX_COMP_STATIC -The regular expressions passed should be converted 1:1 as it where a string-constant. Any regex-specific symbols will be ignored and taken as they where escaped. +The regular expressions passed should be converted 1:1 as if it were a string-constant. Any regex-specific symbols will be ignored and taken as if escaped. PREGEX_COMP_PTN @@ -6308,7 +6313,7 @@

    plex_free

    lex is the pointer to a plex-structure that will be released.

    -Returns always (plex*)NULL. +Always returns (plex*)NULL.

    @@ -6366,7 +6371,7 @@

    plex_next

    If a token can be matched, the function returns the pointer to the position -where the match starts at. id receives the id of the matching patternn, +where the match starts at. id receives the id of the matching pattern, end receives the end pointer of the match, when provided. id and end can be omitted by providing NULL-pointers.

    @@ -6485,7 +6490,7 @@

    plist_clear

    The function has nearly the same purpose as plist_erase(), except that the entire list is only cleared, but if the list was initialized with -PLIST_MOD_RECYCLE, existing pointers are hold for later usage. +PLIST_MOD_RECYCLE, existing pointers are held for later usage.

    @@ -6566,19 +6571,19 @@

    plist_create

    • PLIST_MOD_NONE for no special flagging.
    • -
    • PLIST_MOD_PTR to use the plist-object in pointer-mode: Each plistel-element cointains only a pointer to an object in the memory and returnsthis, instead of copying from or into pointers. +
    • PLIST_MOD_PTR to use the plist-object in pointer-mode: Each plistel-element cointains only a pointer to an object in the memory and returns this, instead of copying from or into pointers.
    • -
    • PLIST_MOD_RECYCLE to configure that elements that are removed during listusage will be reused later. +
    • PLIST_MOD_RECYCLE to configure that elements that are removed during list usage will be reused later.
    • PLIST_MOD_AUTOSORT to automatically sort elements on insert operations.
    • -
    • PLIST_MOD_EXTKEYS to configure that string pointers to hash-table keyvalues are stored elsewhere, so the plist-module only uses the originalpointers instead of copying them. +
    • PLIST_MOD_EXTKEYS to configure that string pointers to hash-table keyvalues are stored elsewhere, so the plist-module only uses the original pointers instead of copying them.
    • -
    • PLIST_MOD_PTRKEYS disables string keys and uses the pointer/valueprovided as key directly. +
    • PLIST_MOD_PTRKEYS disables string keys and uses the pointer/value provided as key directly.
    • -
    • PLIST_MOD_UNIQUE to disallow hash-table-key collisions, so elements witha key that already exist in the object will be rejected. +
    • PLIST_MOD_UNIQUE to disallow hash-table-key collisions, so elements with a key that already exist in the object will be rejected.
    • -
    • PLIST_MOD_WCHAR to let all key values handle as wide-character strings. +
    • PLIST_MOD_WCHAR to handle all key values as wide-character strings.
    @@ -6834,7 +6839,7 @@

    plist_init

    flags defines an optional flag configuration that modifies the behavior of the linked list and hash table usage.
    - +

    @@ -6859,8 +6864,7 @@

    plist_insert

    list.

    -If key is not NULL, the element will be additionally engaged -into the lists hash table. +If key is not NULL, the element will also be added to the lists hash table.

    If src is NULL, a zero-initialized element is inserted into the list for @@ -7041,7 +7045,7 @@

    plist_pop

    Pop last element to dest off the list list.

    -Like list would be a stack, the last element of the list is poppend and +Like list would be a stack, the last element of the list is popped and its content is written to dest, if provided at the end of the list.

    @@ -7066,7 +7070,7 @@

    plist_prev

    Usage:

    -Access previous element of a current unit u. +Access previous element of current unit u.

    @@ -7111,7 +7115,7 @@

    plist_remove

    Usage:

    -Removes the element e from the the list and frees it or puts +Removes the element e from the list and frees it or puts it into the unused element chain if PLIST_MOD_RECYCLE is flagged.

    @@ -7293,7 +7297,7 @@

    plist_shift

    Shift src at begin of list.

    -Like list would be a queue, src is shifted at the begin of the list. +Like list would be a queue, src is shifted at the beginning of the list. This function can only be used for linked lists without the hash-table feature in use. @@ -7317,7 +7321,7 @@

    plist_size

    Return element size of list l. - +

    @@ -7342,10 +7346,12 @@

    plist_sort

    The sort-function can be modified by using plist_set_sortfn(). -The default sort function sorts the list by they contents, internally by using -the memcmp() standard function. +

    +

    +The default sort function sorts the list by content using the memcmp() +standard function.

    - +

    @@ -7371,8 +7377,10 @@

    plist_subsort

    The sort-function can be modified by using plist_set_sortfn(). -The default sort function sorts the list by they contents, internally by using -the memcmp() standard function. +

    +

    +The default sort function sorts the list by content using the memcmp() +standard function.

    @@ -7392,9 +7400,9 @@

    plist_swap

    Usage:

    -Swaps the positions of the list elemements a and b with each +Swaps the positions of the list elements a and b with each other. The elements must be in the same plist object, else the function -returns with FALSE. +returns FALSE.

    @@ -7444,15 +7452,15 @@

    plist_unshift

    Usage:

    -Take first element to dest from the list list. +Take first element of list and write it to dest.

    Like list would be a queue, the first element of the list is taken and its content is written to dest.

    -dest can be omitted and given as (void*)NULL, so the first element will -be taken from the list and discards. +dest can be omitted and given as (void*)NULL, so the first element from +list will be taken and discarded.

    @@ -7476,7 +7484,7 @@

    pmalloc

    The function is a wrapper for the system function malloc(), but with memory -initialization to zero, and immediatelly stops the program if no more memory +initialization to zero, and immediately stops the program if no more memory can be allocated.

    @@ -7511,7 +7519,7 @@

    pmemdup

    size is the size of pointer's data storage.

    -Returns the new pointer to the memory copy. This should be casted back to the +Returns the new pointer to the memory copy. This should be cast back to the type of ptr again.

    @@ -7794,11 +7802,11 @@

    pp_gram_from_bnf

    Usage:

    -Compiles a Backus-Naur-Format definition into a grammar. +Compiles a Backus-Naur form definition into a grammar.

    g is the grammar that receives the result of the parse. -This grammar is extended to new definitions when it already contains symbols. +This grammar gets extended with new definitions if it already contains symbols.

    src is the BNF definition string that defines the grammar. @@ -7841,7 +7849,7 @@

    pp_gram_from_ebnf

    Usage:

    -Compiles an Extended Backus-Naur-Format definition into a grammar. +Compiles an Extended Backus-Naur form definition into a grammar.

    g is the grammar that receives the result of the parse. @@ -7872,7 +7880,7 @@

    pp_gram_from_ebnf

    - +

    pp_gram_from_pbnf

    @@ -7889,7 +7897,7 @@

    pp_gram_from_pbnf

    Usage:

    -Compiles an Phorward Backus-Naur-Format definition into a parser. +Compiles an Phorward Backus-Naur form definition into a parser.

    p is the parser that receives the result of the parse. @@ -7929,13 +7937,12 @@

    pp_gram_from_pbnf

    // Nonterminals ---------------------------------------------------------------- -inline := Flag_emit '(' alternation ')' - | '(' alternation ')' - ; - terminal : CCL | String | Token | Regex | Function ; -symbol := Terminal | Nonterminal | terminal | inline ; +symbol := Terminal + | Nonterminal + | terminal + | '(' alternation ')' = inline ; modifier : symbol '*' = kle | symbol '+' = pos @@ -7994,7 +8001,7 @@

    pp_gram_prepare

    @@ -8299,7 +8306,7 @@

    pp_prod_remove

    Usage:

    -Removes all occurences of symbol sym from the right-hand-side of +Removes all occurrences of symbol sym from the right-hand-side of production p.

    @@ -8628,9 +8635,9 @@

    prealloc

    Dynamically (re)allocate memory on the heap.

    -The function is a wrapper to the system-function realloc(), but always -accepts a NULL-pointer and immediatelly stops the program if no more memory -can be allocated. +The function wraps the system-function realloc(), but always accepts a +NULL-pointer and immediately stops the program if no more memory can be +allocated.

    oldptr is the pointer to be reallocated. If this is (void*)NULL, prealloc() works like a normal call to pmalloc(). @@ -8640,7 +8647,7 @@

    prealloc

    The function returns the allocated heap memory pointer. The returned memory -address should be freed using pfree() after it is not required anymore. +address should be freed using pfree() after it is not required any more.

    @@ -8698,7 +8705,7 @@

    pregex_create

    PREGEX_COMP_STATIC -The regular expression passed should be converted 1:1 asit where a string-constant. Any regex-specific symbols will be ignored and taken as they where escaped. +The regular expression passed should be converted 1:1 as it where a string-constant. Any regex-specific symbols will be ignored and taken as they where escaped. PREGEX_RUN_WCHAR @@ -8864,7 +8871,7 @@

    pregex_qmatch

    regex is the regular expression pattern to be processed.

    -str is the string on which the pattern will be executed on. +str is the string on which the pattern will be executed.

    flags are for regular expression compile- and runtime-mode switching. @@ -8876,8 +8883,8 @@

    pregex_qmatch

    It is optional. matches must be released with parray_free() after its usage.

    -Returns the number of matches, which is the amount of result entries in the -returned array matches. If the value is negative, an error occured. +Returns the number of matches, which is the number of result entries in the +returned array matches. If the value is negative, an error occurred.

    @@ -8905,7 +8912,7 @@

    pregex_qreplace

    regex is the regular expression pattern to be processed.

    -str is the string on which the pattern will be executed on. +str is the string on which the pattern will be executed.

    replace is the string that will be inserted as replacement for each pattern @@ -8945,7 +8952,7 @@

    pregex_qsplit

    regex is the regular expression pattern to be processed.

    -str is the string on which the pattern will be executed on. +str is the string on which the pattern will be executed.

    flags are for regular expression compile- and runtime-mode switching. @@ -8957,7 +8964,7 @@

    pregex_qsplit

    It is optional. matches must be released with parray_free() after its usage.

    -Returns the number of split substrings, which is the amount of result entries in +Returns the number of split substrings, which is the number of result entries in the returned array matches. If the value is negative, an error occured.

    @@ -8992,7 +8999,7 @@

    pregex_replace

    The function returns the string with the replaced elements, or (char*)NULL -in error case. +in case of an error.

    @@ -9027,8 +9034,8 @@

    pregex_split

    called in a loop.

    -The function returns (char*)NULL in case that there is no more string to split, -else it returns start. +The function returns (char*)NULL in case there is no more string to split, else +it returns start.

    @@ -9049,7 +9056,7 @@

    pregex_splitall

    Split a string at all matches of the regular expression regex from -begin of pointer start, and optionally return the splitted matches as an +begin of pointer start, and optionally returns the substrings found as an array.

    @@ -9060,7 +9067,7 @@

    pregex_splitall

    The function fills the array matches, if provided, with items of size prange. It returns the total number of matches.
    - +

    @@ -9078,19 +9085,18 @@

    pstr_to_wcs

    Usage:

    -This functions converts an UTF-8-multi-byte string into an Unicode +This functions converts an UTF-8-multi-byte string into a Unicode wide-character string.

    -The string conversion is performed into dynamically allocated memory. The function wraps mbstowcs(), so set_locale() must be done before this function works properly.

    str is the zero-terminated multi-byte-character string to be converted into a wide-character string. -freestr defines if the input-string shall be freed after successfull -conversion, if set to TRUE. +freestr if value equals TRUE then str will be freed after successfull +conversion.

    Returns the wide-character pendant of str as pointer to dynamically @@ -9114,7 +9120,7 @@

    pstrcasecmp

    Usage:

    -Compare a string by ignoring case-order. +Compare a string ignoring case-order.

    s1 is the string to compare with s2. @@ -9146,7 +9152,7 @@

    pstrcatchar

    str is the pointer to a string to be appended. If this is (char*)NULL, -the string will be newly allocated. chr is the the character to be appended +the string will be newly allocated. chr is the character to be appended to str.

    @@ -9183,12 +9189,12 @@

    pstrcatstr

    freesrc frees the pointer provided as append automatically by -this function, if set to TRUE. This parameter has only a comfort-function. +this function, if set to TRUE.

    Returns a char*-pointer to (possibly re-)allocated and appended string. (char*)NULL is returned if no memory could be (re)allocated, or both strings -where NULL. If dest is NULL and freesrc is FALSE, the function +were NULL. If dest is NULL and freesrc is FALSE, the function automatically returns the pointer src. This pointer must be released with pfree() when its existence is no longer required.

    @@ -9237,10 +9243,10 @@

    pstrget

    Usage:

    -Savely reads a string. +Safely reads a string.

    -str is the string pointer to be savely read. If str is NULL, the +str is the string pointer to be safely read. If str is NULL, the function returns a pointer to a static address holding an empty string. @@ -9265,7 +9271,7 @@

    pstrlen

    str is the parameter string to be evaluated. If (char*)NULL, the function -returns 0. pstrlen() is much more saver than strlen() because it returns 0 when +returns 0. pstrlen() is much safer than strlen() because it returns 0 when a NULL-pointer is provided.

    @@ -9315,7 +9321,7 @@

    pstrlwr

    Usage:

    -Convert a string to lower-case order. +Convert a string to lower-case.

    s is the acts both as input and output-string. @@ -9341,7 +9347,7 @@

    pstrncasecmp

    Usage:

    -Compare a string by ignoring case-order about a maximum of n bytes. +Compare two strings ignoring case-order up to a maximum of n bytes.

    s1 is the string to compare with s2. @@ -9349,10 +9355,10 @@

    pstrncasecmp

    n is the number of bytes to compare.

    -Returns 0 if both strings are equal. Returns a value <0 if s1 is lower than +Returns 0 if both strings are equal. Returns a value <0 if s1 is less than s2 or a value >0 if s1 is greater than s2. - +

    @@ -9370,8 +9376,7 @@

    pstrncatstr

    Usage:

    -Dynamicaly appends a number of n-characters from one string to another -string. +Dynamicaly appends n-characters from one string to another string.

    The function works similar to pstrcatstr(), but allows to copy only a maximum @@ -9385,7 +9390,7 @@

    pstrncatstr

    Returns a char*-pointer to (possibly re-)allocated and appended string. (char*)NULL is returned if no memory could be (re)allocated, or both strings -where NULL. This pointer must be released with pfree() when its existence +were NULL. This pointer must be released with pfree() when its existence is no longer required.

    @@ -9415,7 +9420,7 @@

    pstrndup

    str is the parameter string to be duplicated. If this is provided as (char*)NULL, the function will also return (char*)NULL. -n is the the number of characters to be copied and duplicated from str. +n is the number of characters to be copied and duplicated from str. If n is greater than the length of str, copying will stop at the zero terminator.

    @@ -9442,8 +9447,8 @@

    pstrput

    Usage:

    -Assign a string into a dynamically allocated pointer. - pstrput() manages the assignment of an dynamically allocated string. +Assign a string to a dynamically allocated pointer. + pstrput() manages the assignment of a dynamically allocated string.

    str is a pointer receiving the target pointer to be (re)allocated. If @@ -9451,11 +9456,11 @@

    pstrput

    to a copy of val.

    -val is the the string to be assigned to str (as a independent copy). +val is the string to be assigned to str (as a independent copy).

    Returns a pointer to the allocated heap memory on success, (char*)NULL else. -This is the same pointer as returned like calling *str. The returned pointer +This is the same pointer as returned when calling *str. The returned pointer must be released with pfree() or another call of pstrput(). Calling pstrput() as pstrput( &p, (char*)NULL ); is equivalent to p = pfree( &p ). @@ -9502,11 +9507,11 @@

    pstrrender

    -Returns an allocated string which is the resulting source. This string must be -release by pfree() or another function releasing heap memory when its existence -is no longer required. +Returns an allocated string which is the result of rendering. This string must +be released by pfree() or another function releasing heap memory when its +existence is no longer required. - +

    @@ -9528,13 +9533,16 @@

    pstrreplace

    str is the string to be replaced in. find is the substring to be -matched. replace is the the string to be inserted for each match of the +matched. replace is the string to be inserted for each match of the substring find.

    -Returns a pointer to char* containing the allocated string which is the -resulting source. This pointer must be released with pfree() when its existence -is no longer required. +Returns a char* containing the allocated string which is the result of replacing +all occurences of find with replace in str. +

    +

    +This pointer must be released with pfree() when its existence is no longer +required.

    @@ -9584,12 +9592,12 @@

    pstrsplit

    token reference pointers.

    -tokens is the an allocated array of tokenized array values. +tokens is an allocated array of tokenized array values. Requires a pointer to char**. str is the input string to be tokenized. sep is the token separation substring. -limit is the token limit; If set to 0, there is no token limit available, so -that as much as possible tokens are read. +limit is the token limit; If set to 0, there is no token limit available, +in which case as many as possible tokens are read.

    Returns the number of separated tokens, or -1 on error. @@ -9685,8 +9693,8 @@

    pstrunescape

    The replacement is done within the memory bounds of str itself, because the -unescaped version of the character requires lesser space that its previous -escape sequence. +unescaped version of the character requires less space than its previous escape +sequence.

    The function always returns its input pointer. @@ -9722,10 +9730,10 @@

    pstrupr

    Usage:

    -Convert a string to upper-case order. +Convert a string to upper-case.

    -s is the acts both as input and output-string. +s acts both as input- and output string.

    Returns s. @@ -9751,12 +9759,12 @@

    pvasprintf

    Implementation and replacement for vasprintf.

    -str is the pointer receiving the resultung, allocated string pointer. -fmt is the the format string. +str is the pointer receiving the result, allocated string pointer. +fmt is the format string. ... are the parameters according to the placeholders set in fmt.

    -Returns the number of characters written, or -1 in error case. +Returns the number of characters written, or -1 in case of an error.

    @@ -9908,7 +9916,7 @@

    pwcs_to_str

    str is the zero-terminated string to be converted to UTF-8. -freestr defines if the input-string shall be freed after successfull +freestr defines if the input-string shall be freed after successful conversion, if set to TRUE.

    @@ -9968,13 +9976,13 @@

    pwcscatstr

    str is the pointer to a wchar_t-string to be appended. If this is (wchar_t*)NULL, the string is newly allocated. -append is the the string to be appended. +append is the string to be appended. freesrc if true, append is free'd automatically by this function.

    Returns a wchar_t* Pointer to (possibly re-)allo- cated and appended string. (wchar_t*)NULL is returned if no memory could be (re)allocated, or both strings -where NULL. +were NULL.

    @@ -10022,10 +10030,10 @@

    pwcsget

    Usage:

    -Savely reads a wide-character string. +Safely reads a wide-character string.

    -str is the string pointer to be savely read. If str is NULL, the +str is the string pointer to be safely read. If str is NULL, the function returns a pointer to a static address holding an empty string.

    @@ -10046,13 +10054,13 @@

    pwcslen

    Usage:

    -Saver strlen replacement for wide-character. +Safe strlen replacement for wide-character.

    str is the parameter string to be evaluated. If (wchar_t*)NULL, the function returns 0. - +

    @@ -10070,19 +10078,18 @@

    pwcsncatstr

    Usage:

    -Appends a number of N characters from one wide-character string to a dynamic -string. +Appends n characters from one wide-character string to a dynamic string.

    str is the pointer to a wchar_t-string to be appended. If this is (wchar_t*)NULL, the string is newly allocated. append is the begin of character sequence to be appended. -n is the amount of characters to be appended to str. +n is the number of characters to be appended to str.

    Returns a wchar_t* Pointer to (possibly re-)allo- cated and appended string. (wchar_t*)NULL is returned if no memory could be (re)allocated, or both strings -where NULL. +were NULL.

    @@ -10141,7 +10148,7 @@

    pwcsput

    Usage:

    -Assign a wide-character string into a dynamically allocated pointer. +Assign a wide-character string to a dynamically allocated pointer. pwcsput() manages the assignment of an dynamically allocated wide-chararacter string.

    @@ -10152,15 +10159,15 @@

    pwcsput

    val is the the wide-character string to be assigned to str -(as a independent copy). +(as an independent copy).

    Returns a pointer to the allocated heap memory on success, (char_t*)NULL else. -This is the same pointer as returned like calling *str. The returned pointer +This is the same pointer as returned when calling *str. The returned pointer must be released with pfree() or another call of pwcsput(). Calling pwcsput() as pwcsput( &p, (char*)NULL ); is equivalent to p = pfree( &p ).

    - +

    @@ -10186,8 +10193,9 @@

    pwhich

    directories is a string specifying the directories to search in. If this is (char*)NULL, the environment variable PATH will be used and -evaluated by using getenv(). The path can be split with multiple pathes -by a character that depends on the current platform (Unix: ":", Windows: ";"). +evaluated by using getenv() #fn_getenv]. The path can be split with multiple +paths by a character that depends on the current platform +(Unix: ":", Windows: ";").

    Returns a static pointer to the absolute path that contains the file specified @@ -10293,10 +10301,10 @@

    u8_parse_char

    chr is the input- and output-pointer (the pointer is replaced by the pointer -to the next character or escape-sequence within the string. +to the next character or escape-sequence within the string).

    -The function teturns the character code of the parsed character. +The function returns the character code of the parsed character.

    diff --git a/doc/phorward.t2t b/doc/phorward.t2t index f23a4bef..aea931fa 100644 --- a/doc/phorward.t2t +++ b/doc/phorward.t2t @@ -1,6 +1,6 @@ The Phorward Libraries -libphorward 0.22.1 -April 2018 +libphorward 0.22.3 +May 2018 %!preproc(xhtml): '@([a-zA-Z0-9_]+)((\(\))?)' '[\1\2 #fn_\1]' %!preproc(xhtml): '%NEED:(\d+)' "''' " @@ -30,7 +30,7 @@ The library is made up of several modules. These are: - **any** provides a dynamical, extendible data structure and interface to store, convert and handle variables of different value types ("variant" data type), - **base** provides tools for dynamic data structures and utility functions used throughout the library, including linked lists, hash-tables, stacks and arrays, -- **parse** defines tools to express grammars and provides a built-in LALR(1) parser generator and objects to handle abstract syntax trees, integrating perfectly with the tools from *regex* for lexical analysis, +- **parse** defines tools to express grammars and provides a built-in LALR(1) parser generator and objects to handle abstract syntax trees, integrating perfectly with the tools from //regex// for lexical analysis, - **regex** provides tools for lexical analysis and regular expression processing, - **string** is an extended string processing library, - **vm** can be used to implement and run stack-based virtual machines and instruction sets aimed to work with the *any* data type. diff --git a/doc/ref.t2t b/doc/ref.t2t index a85308d9..fe9801a6 100644 --- a/doc/ref.t2t +++ b/doc/ref.t2t @@ -341,8 +341,8 @@ pboolean p_ccl_compat( pccl* l, pccl* r ) **Usage:** -Checks if the character-classes //l// and //r// are in the same -character universe and compatible for operations. +Checks if the character-classes //l// and //r// are configured +to be in the same character universe and compatible for operations. %FUNCTION:END %NEED:15 %FUNCTION:BEGIN @@ -362,7 +362,7 @@ Returns the number of characters within a character-class. Returns the total number of characters the class is holding. %FUNCTION:END -%NEED:15 +%NEED:17 %FUNCTION:BEGIN === p_ccl_create ===[fn_p_ccl_create] @@ -376,6 +376,8 @@ pccl* p_ccl_create( int min, int max, char* ccldef ) Constructor function to create a new character-class. +//min// and //max// can either be specified as -1, so the configured default +constants PCCL_MIN and PCCL_MAX will be used. The values can also be inverted. Returns a pointer to the newly created character-class. This pointer should be released with [p_ccl_free() #fn_p_ccl_free] when its existence is no longer required. diff --git a/src/Makefile.in b/src/Makefile.in index 96fe9076..a099dd3c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -941,7 +941,8 @@ any/any.print.c: any/any.h any/any.gen.awk # Phorward Foundation Library Documentation ../doc/ref.t2t: $(libphorward_la_SOURCES) $(noinst_HEADERS) - echo "" >$@ + echo "% --- DON'T EDIT THIS FILE, IT IS GENERATED FROM SRC/ ---" >$@ + echo "" >>$@ echo "" >>$@ echo "" >>$@ pdoc -d 2 $(libphorward_la_SOURCES) $(noinst_HEADERS) >>$@ diff --git a/src/base/ccl.c b/src/base/ccl.c index dc45126a..901cd52a 100644 --- a/src/base/ccl.c +++ b/src/base/ccl.c @@ -23,6 +23,8 @@ static int ccl_SORTFUNC( plist* list, plistel* el, plistel* er ) /** Constructor function to create a new character-class. +//min// and //max// can either be specified as -1, so the configured default +constants PCCL_MIN and PCCL_MAX will be used. The values can also be inverted. Returns a pointer to the newly created character-class. This pointer should be released with p_ccl_free() when its existence is no longer required. @@ -64,8 +66,8 @@ pccl* p_ccl_create( int min, int max, char* ccldef ) RETURN( ccl ); } -/** Checks if the character-classes //l// and //r// are in the same -character universe and compatible for operations. */ +/** Checks if the character-classes //l// and //r// are configured +to be in the same character universe and compatible for operations. */ pboolean p_ccl_compat( pccl* l, pccl* r ) { if( !( l && r ) ) diff --git a/src/phorward.h b/src/phorward.h index 835ac9e6..55ebacae 100644 --- a/src/phorward.h +++ b/src/phorward.h @@ -99,7 +99,7 @@ typedef char pboolean; -#define LIBPHORWARD_VERSION "0.22.2" +#define LIBPHORWARD_VERSION "0.22.3" diff --git a/src/version.h b/src/version.h index 6138eb9c..d8c345e9 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LIBPHORWARD_VERSION "0.22.2" +#define LIBPHORWARD_VERSION "0.22.3"