Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
ph_get_fieldinfo(3)		C Library Calls		   ph_get_fieldinfo(3)

       ph_get_fieldinfo,  ph_retrieve_fieldinfo,  ph_fieldinfo_iterate,	ph_de-
       code_field_attributes - access field information	from PH	server

       #include	<phclient.h>

       int  ph_get_fieldinfo(PH	 *ph,  char  *fieldname,  struct  ph_fieldinfo
       int ph_retrieve_fields(PH *ph);
       void  ph_decode_field_attributes(unsigned  long bitmask,	char *buf, int
       int ph_fieldinfo_iterate(PH *ph,	struct ph_fieldinfo **fieldinfo);
       void ph_free_fieldinfo(PH *ph);
       int ph_is_fieldinfo_cached(PH *ph);

       This man	page documents version 1.2 of libphclient.

       These functions allow the caller	to access the field list from  the  PH
       server  associated  with	the PH handle ph.  The information for a given
       field is	encoded	as a struct ph_fieldinfo, which	 includes  the	fields
       name  (the  field's  name),  id (the field's numeric ID), max_size (the
       maximum size of the field), description (a text string  describing  the
       field), and attrib (a bitmask of	attributes associated with the field).

       The  ph_retrieve_fieldinfo() function retrieves the field list from the
       server associated with ph and caches it locally.	 If the	field list  is
       already	cached	before the call	to ph_retrieve_fieldinfo(), it returns
       successfully without doing anything.

       The ph_free_fieldinfo() function	frees the memory associated  with  the
       locally-cached  field  list.   A	 subsequent call to ph_retrieve_field-
       info() will reload the cache from the server.

       The ph_is_fieldinfo_cached() macro determines whether or	not the	 field
       list is cached locally.

       The   ph_get_fieldinfo()	 function  sets	 fieldinfo  to	point  to  the
       ph_fieldinfo structure describing fieldname.  If	the field list has not
       been retrieved from the server, ph_retrieve_fieldinfo() is called.

       The  ph_fieldinfo_iterate()  function allows the	calling	application to
       iterate through the entire field	list by	setting	fieldinfo to the  next
       entry  at each call.  To	begin at the beginning of the list, the	caller
       must initialize fieldinfo to NULL.

       The ph_decode_field_attributes()	function generates a text  representa-
       tion  of	 the  attributes set in	bitmask.  It writes the	text string to
       the buffer of size bufsize pointed to by	buf.

       The ph_retrieve_fieldinfo() function returns 0 on success, or -1	on er-
       ror and sets errno.

       The  ph_is_fieldinfo_cached()  macro  returns  1	 if  the field list is
       cached locally, or 0 otherwise.

       The ph_fieldinfo_iterate() function returns 1 when field	information is
       returned,  or 0 when there are no more fields.  On error, it returns -1
       and sets	errno.

       The ph_get_fieldinfo() function returns 0 on success, PH_ERR_DATAERR if
       fieldname is not	found.	On error, it returns -1	and sets errno.

       The  ph_retrieve_fieldinfo() and	ph_get_fieldinfo() functions will fail
       with EINVAL if they  receive  an	 unexpected  response  code  from  the

       The  ph_retrieve_fieldinfo()  function may fail with any	error from the
       functions read()	or write().

       read(2),	write(2), ph_open(3)

University of Illinois		   Oct 2002		   ph_get_fieldinfo(3)


Want to link to this manual page? Use this URL:

home | help