GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
STRUCTS_TYPE_STRING(3) FreeBSD Library Functions Manual STRUCTS_TYPE_STRING(3)

structs_type_string, structs_type_string_null, —
structs types for strings

PDEL Library (libpdel, -lpdel)

#include <sys/types.h>
#include <pdel/structs/structs.h>
#include <pdel/structs/type/string.h>

STRUCTS_STRING_TYPE(mtype, asnull);

STRUCTS_FIXEDSTRING_TYPE(bufsize);

extern const struct structs_type structs_type_string;
extern const struct structs_type structs_type_string_null;

The STRUCTS_STRING_TYPE() and STRUCTS_FIXEDSTRING_TYPE() macros define a structs(3) type (i.e., a struct structs_type) for describing variable and bounded length strings, respectively.

STRUCTS_STRING_TYPE() describes a char * data type which points to a string buffer allocated with typed_mem(3) type mtype. If asnull is non-zero, then an empty string may be represented as a NULL pointer; otherwise, the char * pointer can never be NULL (or else the program may core dump) and so the empty string must always be represented as a pointer to a zero length string.

STRUCTS_FIXEDSTRING_TYPE() describes an array of char having length bufsize in which a string having length at most bufsize - 1 is stored. The string is always terminated with a '\0' byte.

The structs(3) library supplies two pre-defined variable length string types, structs_type_string and structs_type_string_null. Both types use the typed_mem(3) type STRUCTS_TYPE_STRING_MTYPE, defined in the header file. structs_type_string represents empty strings as pointers to an empty string, while structs_type_string_null represents empty strings as NULL pointers.

libpdel(3), structs(3), structs_type(3), typed_mem(3)

The PDEL library was developed at Packet Design, LLC. http://www.packetdesign.com/

Archie Cobbs ⟨archie@freebsd.org⟩
April 22, 2002 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.