gspool_getspd(3)

NAME
gspool_getspd - get the default permissions

SYNOPSIS
#include <gspool.h>

int gspool_getspd(const int fd, struct apisphdr *res)

DESCRIPTION
The gspool_getspd() function is used to retrieve the defaults privileges, form types etc for new users on the host with which the API is communicating.

fd is a file descriptor previously returned by gspool_open

res is a descriptor which upon return will contain the the default user privileges. The structure apisphdr is defined in gspool.h and contains the following elements: Time last read password file Minimum priority Maximum priority Default priority Default form type Allowed form type pattern Default printer Allowed printer pattern Privilege flag Class of printers Maximum copies allowed Release of GNUspool

The "spu_flgs" field will contain a combination of the following: Administrator (edit admin file) Can run sstop (can stop scheduler) Can use other forms than default Can change priority on queue Can change other users' jobs Can move to printer queue Can halt, restart printer Can set any priority on queue Can change own default priority Can add/delete printers Can override class Can unqueue jobs Can view other jobs not neccesarily edit Can access remote jobs Can access remote printers Can save default options Can access sub-screens Can use other printers from default

ALLPRIVS
    A combination of all of the above

RETURN VALUES
The function gspool_getspd() returns 0 if successful otherwise one of the following codes: Invalid user name Invalid File descriptor failure writing to the network failure reading from the network The user does not have permission

EXAMPLE
An example to view the default privleges on the host machine:

 int fd, ret;
 struct apisphdr res;

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

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

 if (res.sph_flgs & PV_HALTGO)
     printf("users cannot stop and start printers\n");

 printf("the default maximum priority is %s\n", res);
 gspool_close(fd);

SEE ALSO
gspool_getspu(3), gspool_putspu(3), gspool_putspd(3).

COPYRIGHT
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.

AUTHOR
John M Collins, Xi Software Ltd.