*
* Line Printer Daemon interface for CUPS.
*
- * Copyright 2007-2014 by Apple Inc.
+ * Copyright 2007-2015 by Apple Inc.
* Copyright 1997-2006 by Easy Software Products, all rights reserved.
*
* These coded instructions, statements, and computer programs are the
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif /* HAVE_INTTYPES_H */
+#ifdef __APPLE__
+# include <vproc.h>
+#endif /* __APPLE__ */
/*
const char *docname, const char *user,
int num_options, cups_option_t *options);
static int get_printer(http_t *http, const char *name, char *dest,
- int destsize, cups_option_t **options,
+ size_t destsize, cups_option_t **options,
int *accepting, int *shared, ipp_pstate_t *state);
static int print_file(http_t *http, int id, const char *filename,
const char *docname, const char *user,
hostip[256], /* IP address */
*hostfamily; /* Address family */
int hostlookups; /* Do hostname lookups? */
+#ifdef __APPLE__
+ vproc_transaction_t vtran = vproc_transaction_begin(NULL);
+#endif /* __APPLE__ */
/*
syslog(LOG_ERR, "Unable to get command line from client!");
putchar(1);
+
+#ifdef __APPLE__
+ vproc_transaction_end(NULL, vtran);
+#endif /* __APPLE__ */
+
return (1);
}
* resource list, and/or user name.
*/
- command = line[0];
- dest = line + 1;
+ if ((command = line[0]) == '\0')
+ dest = line;
+ else
+ dest = line + 1;
if (command == 0x02)
list = NULL;
syslog(LOG_INFO, "Closing connection");
closelog();
+#ifdef __APPLE__
+ vproc_transaction_end(NULL, vtran);
+#endif /* __APPLE__ */
+
return (status);
}
get_printer(http_t *http, /* I - HTTP connection */
const char *name, /* I - Printer name from request */
char *dest, /* I - Destination buffer */
- int destsize, /* I - Size of destination buffer */
+ size_t destsize, /* I - Size of destination buffer */
cups_option_t **options, /* O - Printer options */
int *accepting, /* O - printer-is-accepting-jobs value */
int *shared, /* O - printer-is-shared value */