]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/backend.c
Load cups into easysw/current.
[thirdparty/cups.git] / cups / backend.c
1 /*
2 * "$Id: backend.c 5024 2006-01-29 14:58:15Z mike $"
3 *
4 * Backend functions for the Common UNIX Printing System (CUPS).
5 *
6 * Copyright 2006 by Easy Software Products.
7 *
8 * These coded instructions, statements, and computer programs are the
9 * property of Easy Software Products and are protected by Federal
10 * copyright law. Distribution and use rights are outlined in the file
11 * "LICENSE.txt" which should have been included with this file. If this
12 * file is missing or damaged please contact Easy Software Products
13 * at:
14 *
15 * Attn: CUPS Licensing Information
16 * Easy Software Products
17 * 44141 Airport View Drive, Suite 204
18 * Hollywood, Maryland 20636 USA
19 *
20 * Voice: (301) 373-9600
21 * EMail: cups-info@cups.org
22 * WWW: http://www.cups.org
23 *
24 * This file is subject to the Apple OS-Developed Software exception.
25 *
26 * Contents:
27 *
28 * cupsBackendDeviceURI() - Get the device URI for a backend.
29 */
30
31 /*
32 * Include necessary headers...
33 */
34
35 #include <stdlib.h>
36 #include "backend.h"
37 #include "string.h"
38
39
40 /*
41 * 'cupsBackendDeviceURI()' - Get the device URI for a backend.
42 *
43 * The "argv" argument is the argv argument passed to main(). This
44 * function returns the device URI passed in the DEVICE_URI environment
45 * variable or the device URI passed in argv[0], whichever is found
46 * first.
47 */
48
49 const char * /* O - Device URI or NULL */
50 cupsBackendDeviceURI(char **argv) /* I - Command-line arguments */
51 {
52 const char *device_uri; /* Device URI */
53
54
55 if ((device_uri = getenv("DEVICE_URI")) != NULL)
56 return (device_uri);
57
58 if (!argv || !argv[0] || !strchr(argv[0], ':'))
59 return (NULL);
60 else
61 return (argv[0]);
62 }
63
64
65 /*
66 * End of "$Id: backend.c 5024 2006-01-29 14:58:15Z mike $".
67 */