=head1 NAME

gspool_putspd - set new defaults for Xi Text

=head1 SYNOPSIS

=for man
\&\fB#include <gspool.h>\fR
.PP

=for html
<STRONG>#include &lt;gspool.h&gt;</STRONG>
<br>

B<int gspool_putspu(const int> I<fd>B<, struct apispdr *>I<ret>B<)>

=head1 DESCRIPTION

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

Its parameters are as follows:

B<fd> is a file descriptor previously returned by B<gspool_open>

B<res> points to a structure which contains the privileges.
The C<struct apisphdr> is defined in the file F<gspool.h>.

=for html
<p>The fields of the structure are <a href="#Apisphdr_def">as defined</a>
for <strong>gspool_getspd</strong>.</p>

=head1 RETURN VALUES

=for html
<p>The function returns 0 if successful otherwise one of the error codes
<a href="TxtAPI-3.html#Error_codes">listed in Chapter 3</a>.</p>

=for man
.Ip "GSPOOL_UNKNOWN_USER" 8
Invalid user name
.Ip "GSPOOL_INVALID_FD" 8
Invalid File descriptor
.Ip "GSPOOL_BADWRITE" 8
failure writing to the network
.Ip "GSPOOL_BADREAD" 8
failure reading from the network
.Ip "GSPOOL_NOPERM" 8
The user does not have permission
.Ip "GSPOOL_ZERO_CLASS" 8
A class code of zero is illegal
.Ip "GSPOOL_BAD_PRIORITY" 8
One of the priority fields contains zero
.Ip "GSPOOL_BAD_COPIES" 8
The copies field contains zero
.Ip "GSPOOL_BAD_FORM" 8
The form type filed has been left empty

=head1 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);

=head1 SEE ALSO

gspool_getspu(3),
gspool_getspd(3),
gspool_putspu(3)

=head1 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.

=head1 AUTHOR

John M Collins, Xi Software Ltd.

=cut

## Local Variables:
## mode: nroff
## End:
