int gspool_ptradd(const intfd, struct apispptr *ptrd)
DESCRIPTION
The function gspool_ptradd() is used to create a printer.
fd is a file descriptor previously returned by gspool_open
ptrd is a "struct apispptr" describing the details of the
printer. It is defined in the file gspool.h.
The fields in struct apispptr are defined in the documentation for
gspool_ptrread(3).
Only values for the name, device, formtype, description, local flag, the minimun
and maximum job sizes, the network filter flag and the class code are
accepted. All other parameters are ignored. We suggest that you clear
all fields to zero before starting. Future releases with additional
fields will be guaranteed to default to the existing behaviour if the
additional fields are set to zero.
RETURN VALUES
Xt_ptradd returns zero if successful, otherwise an error code will
be returned according to the reason for failure.
Error codes which might be returned are:
GSPOOL_INVALID_FD
Invalid file descriptor
GSPOOL_BADWRITE
failure writing to network
GSPOOL_BADREAD
failure reading from network
GSPOOL_NOPERM
User does not have permission to add printers
GSPOOL_BAD_FORM
invalid form type
EXAMPLE
An example to add a printer called "hplj1" on device "/dev/tty12" with form type "a4"
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.