gspool_putspd - set new defaults for Xi Text
int gspool_putspu(const int fd, struct apispdr *ret)
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.
The fields of the structure are as defined for gspool_getspd.
The function returns 0 if successful otherwise one of the error codes listed in Chapter 3.
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);
gspool_getspu(3),
gspool_getspd(3),
gspool_putspu(3)
Copyright (c) 2009 Free Software Foundation, Inc. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
John M Collins, Xi Software Ltd.