Home
Highly Reusable Software By activity User Interface Text Strings Math Processing
Stored Data
Communications
Hard World File System
|
#License - #Source code - #Example Use -
#include <librock/parse.h> int librock_counttoeol( const char *psz );
Typical use is to advance a pointer, replacing code like:
while((*ptr != '\r')&&(*ptr != '\n')&&(*ptr != '\0')) ptr++;with:
ptr += librock_counttoeol(ptr);Also used in parsing, where the count is needed to copy, compare, or write a limited number of characters starting at ptr. For example:
fwrite(ptr,1,librock_counttoeol(ptr),stdout);Also used to chop off the newline part of a string buffer. For example:
buffer[librock_counttoeol(buffer)] = '\0';
librock_assert() // #ifdef librock_DEBUG
Copyright 1998-2002 Forrest J. Cavalier III, http://www.mibsoftware.com Open-source under MIT license. NO WARRANTY. Copies must retain this block. License text in <librock/license/mit.txt> librock_LIDESC_HC=cc598307414a9997b32b60a2e7a8e7c6a13d6438
Verbatim copying and distribution of this generated page is permitted in any medium provided that no changes are made.
(The source of this manual page may be covered by a more permissive license which allows modifications.)
Want to help? We welcome comments, patches. -- Need help? Request paid support.