gspool_putspd(3)

NAME
gspool_putspd - set new defaults for Xi Text

SYNOPSIS
#include <gspool.h>

int gspool_putspu(const int fd, struct apispdr *ret)

DESCRIPTION
The gspool_putspd() function is used to set the default user privileges on the local host.

Its parameters are as follows:

fd is a file descriptor previously returned by gspool_open

res points to a structure which contains the privileges. The "struct apisphdr" is defined in the file gspool.h.

RETURN VALUES
Invalid user name Invalid File descriptor failure writing to the network failure reading from the network The user does not have permission A class code of zero is illegal One of the priority fields contains zero The copies field contains zero The form type filed has been left empty

EXAMPLE
An example to give all users the permission to add and delete printers:

 int fd, ret;
 struct apisphdr new_privs;

 fd = gspool_open("myhost", (char *)0, 0);
 if (fd < 0) {  /* error handling */
     ...
 }

 /* get the current permissions */

 ret = gspool_getspd(fd, &new_privs);
 if (ret < 0) { /* error handling */
     ...
 }

 if (!(new_privs.sph_flgs & PV_ADDDEL))
     new_privs.sph_flgs |= PV_ADDDEL;

 ret = gspool_putspd(fd, &new_privs);
 if (ret < 0) { /* error handling */
     ...
 }
 gspool_close(fd);

SEE ALSO
gspool_getspu(3), gspool_getspd(3), gspool_putspu(3)

AUTHOR
John M Collins, Xi Software Ltd.