*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> get_proplist_entry (3)              



NAME    [Toc]    [Back]

       get_proplist_entry  -  initializes  pointers to the corresponding
 entries in an Extended File Attribute buffer

SYNOPSIS    [Toc]    [Back]

       #include <sys/proplist.h>

       int get_proplist_entry(
               char **name,
               int **flags,
               int **value_size,
               char **value,
               char **bufptr );

PARAMETERS    [Toc]    [Back]

       Points to the Extended File Attribute name.  Points to the
       system-wide  file  attributes  for Extended File Attribute
       entries in the Property List.  Points to the size in bytes
       of  the  Extended  File  Attribute  value.   Points to the
       Extended File Attribute value.   Points  to  the  Extended
       File Attribute buffer.

DESCRIPTION    [Toc]    [Back]

       The  get_proplist_entry() function initializes the **name,
       **value_size, and **value parameters with the  corresponding
  values  in the Extended File Attribute buffer pointed
       to by **bufptr. The  function  can  be  called  repeatedly
       because  it  advances  the  Extended File Attribute buffer
       pointer **bufptr to the  end  of  the  current  entry.  An
       Extended  File  Attribute is a name and value pair that is
       contained in a variable-sized structure called a  Property
       List. A Property List is part of a file's metadata and can
       contain abstract  name  and  value  pairs  (Extended  File
       Attributes) that can be set either by the operating system
       (for example, ACLs and  privileges)  or  by  a  user-level
       application (for example, PC File Attributes).

       This  function  should  be used to parse the Extended File
       Attribute buffer returned by the getproplist(3)  function.

RETURN VALUES    [Toc]    [Back]

       If  successful,  the function returns the size of the current
 Extended File Attribute in the Property List.

EXAMPLES    [Toc]    [Back]

       #include <sys/proplist.h> main() { char *ptr, *buf, *name,
       *value;     int     *value_len,    *flags,    buffer_size,
       min_buffer_size, ret,  nbytes;  struct  proplistname_args;
       static  char  *names[] = {      "primary_name",      "secondary_name",


        * How big a buffer do I need to store my name and value
        * pair in a property list ?
        */  buffer_size  =  sizeof_proplist_entry("primary_name",
       18);     buffer_size     +=    sizeof_proplist_entry("secondary_name",

        * Malloc the buffer
        */ buf = ptr = (char *)malloc(buffer_size);
             .  again: /*
        * Call the system call to load buffer with property list
        * entries.
        */ ret = getproplist("/tmp/foo",  &getargs,  buffer_size,
       buf,                &min_buffer_size);  if  (ret  <  0)  {
            perror("getproplist");      free(buf);       exit(1);
       } /*
        *  If buffer_size is not sufficient to store the name and
        * pairs, malloc a bigger buffer and try again.
        */ if (ret == 0 && min_buffer_size) {
                       buf = (char *)malloc(min_buffer_size);
                       buffer_size = min_buffer_size;
                       goto again; } /*
        * Buffer contains ret bytes of name and value pairs
        */ ptr = buf; while (ret > 0) {      /*       * Call getproplist_entry
 to initialize name and value       * pointers
 to entries position within buffer.        */       ret
       -=  get_proplist_entry(&name,  &flags, &value_len, &value,
                             &ptr);       printf("name  %s  value
       len %d value %s\n",           name, *value_len, value); }

SEE ALSO    [Toc]    [Back]

       Functions: add_proplist_entry(3), delproplist(3), fdelproplist(3),   fgetproplist(3),   fsetproplist(3),   get_proplist_entry(3),       getproplist(3),      setproplist(3),

       Files: proplist(4), sys/proplist.h.

[ Back ]
 Similar pages
Name OS Title
add_proplist_entry Tru64 adds an Extended File Attribute to the Extended File Attribute buffer
sizeof_proplist_entry Tru64 determines space necessary to store an Extended File Attribute
zclear IRIX initializes the z-buffer of the current framebuffer
utmpx IRIX utmp and wtmp extended-format entries
setextattr OpenBSD set a named extended attribute
VOP_SETEXTATTR FreeBSD set named extended attribute for a vnode
cd_xar Tru64 reads the Extended Attribute Record for
cdxar Tru64 Read the Extended Attribute Record from a CD-ROM
cd_cxar Tru64 reads the Extended Attribute Record for
getextattr OpenBSD retrieve a named extended attribute
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service