cstrc man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

cstrc(l)			BEGEMOT Library			      cstrc(l)

NAME
       cstrc, cstrd - convert between ANSI C-strings and strings

SYNOPSIS
       # include <begemot.h>

       char * cstrc(char **pstr, char delim, size_t *plen);

       char * cstrd(const char *str, char delim, size_t len);

       int cstrwarn;

DESCRIPTION
       The  cstrc  function converts a string as specified in the ANSI C-stan‐
       dard to the usual internal representation.  All	escape	sequences  are
       (hopefully)  recognized. Setting cstrwarn to any non-zero value enables
       some warning messages, which are emitted	 via  warn(l).	 Pstr  is  the
       address	of a pointer to the string to be parsed.  Delim is the charac‐
       ter at which the parsing should stop. It should be a single or a double
       quote character. Parsing stops also if a NUL character is found. * pstr
       is left pointing to the terminating character. At entry to the function
       * pstr should point behind the initial delimiter.  * plen will hold the
       number of bytes in the output string. The string will  be  NUL  termni‐
       nated, but note, that it may contain embedded NULs.

       Cstrd prints a string with non-printable characters converted to escape
       sequences.  delim is escaped in the  output  string  (usually  '\''  or
       '"').

       The user is responsible the deallocate the memory returned by cstrc and
       cstrd.  Both functions call xalloc(l) and xrealloc(l) and therefor  end
       in panic(l) if not enough memory is available.

RETURN VALUE
       Both  functions return allocated memory that must be freed by the call‐
       er. They may never return NULL.

SEE ALSO
       panic(l), xalloc(l), xrealloc(3b)

BUGS
       Certainly.

BEGEMOT				  9 Oct 1996			      cstrc(l)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net