/*
- * "$Id: ipp.c,v 1.17 2000/01/04 13:45:32 mike Exp $"
+ * "$Id: ipp.c,v 1.18 2000/01/25 03:50:47 mike Exp $"
*
* IPP backend for the Common UNIX Printing System (CUPS).
*
int copies; /* Number of copies remaining */
- if (argc < 6 || argc > 7)
+ if (argc == 1)
+ {
+ fputs("network ipp \"\" \"Internet Printing Protocol\"\n", stderr);
+ return (0);
+ }
+ else if (argc < 6 || argc > 7)
{
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
argv[0]);
/*
- * End of "$Id: ipp.c,v 1.17 2000/01/04 13:45:32 mike Exp $".
+ * End of "$Id: ipp.c,v 1.18 2000/01/25 03:50:47 mike Exp $".
*/
/*
- * "$Id: lpd.c,v 1.14 2000/01/04 13:45:32 mike Exp $"
+ * "$Id: lpd.c,v 1.15 2000/01/25 03:50:47 mike Exp $"
*
* Line Printer Daemon backend for the Common UNIX Printing System (CUPS).
*
int status; /* Status of LPD job */
- if (argc < 6 || argc > 7)
+ if (argc == 1)
+ {
+ fputs("network lpd \"\" \"LPD/LPR Host or Printer\"\n", stderr);
+ return (0);
+ }
+ else if (argc < 6 || argc > 7)
{
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
argv[0]);
/*
- * End of "$Id: lpd.c,v 1.14 2000/01/04 13:45:32 mike Exp $".
+ * End of "$Id: lpd.c,v 1.15 2000/01/25 03:50:47 mike Exp $".
*/
/*
- * "$Id: parallel.c,v 1.8 2000/01/04 13:45:32 mike Exp $"
+ * "$Id: parallel.c,v 1.9 2000/01/25 03:50:47 mike Exp $"
*
* Parallel port backend for the Common UNIX Printing System (CUPS).
*
*
* Contents:
*
- * main() - Send a file to the specified parallel port.
+ * main() - Send a file to the specified parallel port.
+ * list_devices() - List all parallel devices.
*/
/*
#endif /* WIN32 || __EMX__ */
+/*
+ * Local functions...
+ */
+
+void list_devices(void);
+
+
/*
* 'main()' - Send a file to the specified parallel port.
*
struct termios opts; /* Parallel port options */
- if (argc < 6 || argc > 7)
+ if (argc == 1)
+ {
+ list_devices();
+ return (0);
+ }
+ else if (argc < 6 || argc > 7)
{
fputs("Usage: parallel job-id user title copies options [file]\n", stderr);
return (1);
/*
- * End of "$Id: parallel.c,v 1.8 2000/01/04 13:45:32 mike Exp $".
+ * 'list_devices()' - List all parallel devices.
+ */
+
+void
+list_devices(void)
+{
+#ifdef __linux
+ int i; /* Looping var */
+ char device[255]; /* Device filename */
+
+
+ for (i = 0; i < 4; i ++)
+ {
+ sprintf(device, "/dev/lp%d", i);
+ if (access(device, F_OK) == 0)
+ fprintf(stderr, "parallel parallel:/dev/lp%d \"\" \"Parallel Port #%d\"\n",
+ i, i + 1);
+ }
+#elif defined(__sgi)
+#elif defined(__sun)
+#elif defined(__hpux)
+#elif defined(__osf)
+#elif defined(FreeBSD) || defined(OpenBSD) || defined(NetBSD)
+#endif
+}
+
+
+/*
+ * End of "$Id: parallel.c,v 1.9 2000/01/25 03:50:47 mike Exp $".
*/
/*
- * "$Id: serial.c,v 1.8 2000/01/04 13:45:32 mike Exp $"
+ * "$Id: serial.c,v 1.9 2000/01/25 03:50:47 mike Exp $"
*
* Serial port backend for the Common UNIX Printing System (CUPS).
*
#endif /* WIN32 || __EMX__ */
+/*
+ * Local functions...
+ */
+
+void list_devices(void);
+
+
/*
* 'main()' - Send a file to the printer or server.
*
struct termios opts; /* Parallel port options */
- if (argc < 6 || argc > 7)
+ if (argc == 1)
+ {
+ list_devices();
+ return (0);
+ }
+ else if (argc < 6 || argc > 7)
{
fputs("Usage: serial job-id user title copies options [file]\n", stderr);
return (1);
/*
- * End of "$Id: serial.c,v 1.8 2000/01/04 13:45:32 mike Exp $".
+ * 'list_devices()' - List all serial devices.
+ */
+
+void
+list_devices(void)
+{
+#ifdef __linux
+ int i; /* Looping var */
+ char device[255]; /* Device filename */
+
+
+ for (i = 0; i < 4; i ++)
+ {
+ sprintf(device, "/dev/ttyS%d", i);
+ if (access(device, F_OK) == 0)
+ fprintf(stderr, "serial serial:/dev/ttyS%d \"\" \"Serial Port #%d\"\n", i,
+ i + 1);
+ }
+#elif defined(__sgi)
+#elif defined(__sun)
+#elif defined(__hpux)
+#elif defined(__osf)
+#elif defined(FreeBSD) || defined(OpenBSD) || defined(NetBSD)
+#endif
+}
+
+
+/*
+ * End of "$Id: serial.c,v 1.9 2000/01/25 03:50:47 mike Exp $".
*/
/*
- * "$Id: socket.c,v 1.9 2000/01/04 13:45:33 mike Exp $"
+ * "$Id: socket.c,v 1.10 2000/01/25 03:50:47 mike Exp $"
*
* AppSocket backend for the Common UNIX Printing System (CUPS).
*
fd_set input; /* Input set for select() */
- if (argc < 6 || argc > 7)
+ if (argc == 1)
+ {
+ fputs("network socket \"\" \"AppSocket/HP JetDirect\"\n", stderr);
+ return (0);
+ }
+ else if (argc < 6 || argc > 7)
{
fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
argv[0]);
/*
- * End of "$Id: socket.c,v 1.9 2000/01/04 13:45:33 mike Exp $".
+ * End of "$Id: socket.c,v 1.10 2000/01/25 03:50:47 mike Exp $".
*/
#
-# "$Id: Makefile,v 1.27 2000/01/21 20:33:16 mike Exp $"
+# "$Id: Makefile,v 1.28 2000/01/25 03:50:47 mike Exp $"
#
# Support library Makefile for the Common UNIX Printing System (CUPS).
#
# Object files...
#
-LIBOBJS = emit.o filter.o http.o ipp.o language.o mark.o mime.o \
- options.o page.o ppd.o snprintf.o string.o type.o \
- usersys.o util.o
-OBJS = $(LIBOBJS) testhttp.o testmime.o testppd.o
+LIBOBJS = emit.o http.o ipp.o language.o mark.o options.o page.o ppd.o \
+ snprintf.o string.o usersys.o util.o
+OBJS = $(LIBOBJS) testhttp.o testppd.o
#
# Header files to install...
#
-HEADERS = cups.h http.h ipp.h language.h mime.h ppd.h
+HEADERS = cups.h http.h ipp.h language.h ppd.h
#
# Targets in this directory...
#
-TARGETS = $(LIBCUPS) testhttp testmime testppd
+TARGETS = $(LIBCUPS) testhttp testppd
#
# Make all targets...
$(RM) cups_C.h
$(AWK) '{print "\"" $$0 "\","}' < ../locale/C/cups_C > cups_C.h
-emit.o: ppd.h ../config.h ../Makedefs
-filter.o: mime.h ../config.h ../Makedefs
-http.o: http.h ipp.h string.h ../config.h ../Makedefs
-ipp.o: http.h ipp.h string.h language.h ../config.h ../Makedefs
-language.o: cups_C.h language.h string.h ../config.h ../Makedefs
-mark.o: ppd.h ../config.h ../Makedefs
-mime.o: mime.h ../config.h ../Makedefs
-options.o: cups.h ../config.h ../Makedefs
-page.o: ppd.h ../config.h ../Makedefs
-ppd.o: language.h ppd.h ../config.h ../Makedefs
-snprintf.o: string.h ../config.h ../Makedefs
-string.o: string.h ../config.h ../Makedefs
-type.o: mime.h ../config.h ../Makedefs
-usersys.o: cups.h ../config.h ../Makedefs
-util.o: cups.h http.h ipp.h ../config.h ../Makedefs
+emit.o: ppd.h
+http.o: http.h ipp.h string.h
+ipp.o: http.h ipp.h string.h language.h
+language.o: cups_C.h language.h string.h
+mark.o: ppd.h
+options.o: cups.h
+page.o: ppd.h
+ppd.o: language.h ppd.h
+snprintf.o: string.h
+string.o: string.h
+usersys.o: cups.h
+util.o: cups.h http.h ipp.h
#
# testhttp (dependency on static CUPS library is intentional)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a $(NETLIBS)
-testhttp.o: http.h ../Makedefs
-
-#
-# testmime (dependency on static CUPS library is intentional)
-#
-
-testmime: testmime.o libcups.a
- echo Linking $@...
- $(CC) $(LDFLAGS) -o $@ testmime.o libcups.a
-
-testmime.o: mime.h ../Makedefs
+testhttp.o: http.h
#
# testppd (dependency on static CUPS library is intentional)
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ testppd.o libcups.a $(NETLIBS)
-testppd.o: ppd.h ../Makedefs
+testppd.o: ppd.h
+
+$(OBJS): ../Makedefs ../config.h
#
-# End of "$Id: Makefile,v 1.27 2000/01/21 20:33:16 mike Exp $".
+# End of "$Id: Makefile,v 1.28 2000/01/25 03:50:47 mike Exp $".
#
#
-# "$Id: Makefile,v 1.17 2000/01/20 13:05:41 mike Exp $"
+# "$Id: Makefile,v 1.18 2000/01/25 03:50:48 mike Exp $"
#
# Scheduler Makefile for the Common UNIX Printing System (CUPS).
#
-# Copyright 1997-1999 by Easy Software Products, all rights reserved.
+# Copyright 1997-2000 by Easy Software Products, all rights reserved.
#
# These coded instructions, statements, and computer programs are the
# property of Easy Software Products and are protected by Federal
CUPSDOBJS = auth.o cert.o classes.o client.o conf.o dirsvc.o main.o ipp.o \
listen.o job.o log.o printers.o
-OBJS = $(CUPSDOBJS) testspeed.o
+MIMEOBJS = filter.o mime.o type.o
+OBJS = $(CUPSDOBJS) $(MIMEOBJS) testmime.o testspeed.o
#
# Make everything...
#
-all: cupsd testspeed
+all: cupsd libmime.a testmime testspeed
+
#
# Clean all object files...
#
clean:
- rm -f $(OBJS) cupsd testspeed
+ rm -f $(OBJS) cupsd libmime.a testmime testspeed
+
#
# Install the scheduler...
-$(MKDIR) $(SERVERROOT)/ppd
-$(MKDIR) $(SERVERROOT)/requests
+
#
# Make the scheduler executable, "cupsd".
#
-cupsd: $(CUPSDOBJS) ../cups/$(LIBCUPS)
+cupsd: $(CUPSDOBJS) libmime.a ../cups/$(LIBCUPS)
echo Linking $@...
- $(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) $(LIBS)
+ $(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) libmime.a $(LIBS)
$(CUPSDOBJS): auth.h cert.h classes.h client.h conf.h cupsd.h dirsvc.h job.h \
- printers.h ../cups/cups.h ../cups/http.h ../cups/ipp.h \
- ../cups/language.h ../cups/mime.h ../cups/string.h
+ mime.h printers.h ../cups/cups.h ../cups/http.h ../cups/ipp.h \
+ ../cups/language.h ../cups/string.h
+
+
+#
+# libmime.a
+#
+
+libmime.a: $(MIMEOBJS)
+ echo Archiving $@...
+ $(RM) $@
+ $(AR) $(ARFLAGS) $@ $(MIMEOBJS)
+ $(RANLIB) $@
+
+$(MIMEOBJS): mime.h
+
+
+#
+# testmime
+#
+
+testmime: testmime.o libmime.a
+ echo Linking $@...
+ $(CC) $(LDFLAGS) -o $@ testmime.o libmime.a
+
+testmime.o: mime.h
#
# Make the test program, "testspeed".
$(OBJS): ../config.h ../Makedefs
#
-# End of "$Id: Makefile,v 1.17 2000/01/20 13:05:41 mike Exp $".
+# End of "$Id: Makefile,v 1.18 2000/01/25 03:50:48 mike Exp $".
#
/*
- * "$Id: filter.c,v 1.11 2000/01/04 13:45:34 mike Exp $"
+ * "$Id: filter.c,v 1.1 2000/01/25 03:50:48 mike Exp $"
*
* File type conversion routines for the Common UNIX Printing System (CUPS).
*
#include <stdlib.h>
#include <ctype.h>
-#include "string.h"
+#include <cups/string.h>
#include "mime.h"
/*
- * End of "$Id: filter.c,v 1.11 2000/01/04 13:45:34 mike Exp $".
+ * End of "$Id: filter.c,v 1.1 2000/01/25 03:50:48 mike Exp $".
*/
/*
- * "$Id: mime.c,v 1.16 2000/01/04 13:45:35 mike Exp $"
+ * "$Id: mime.c,v 1.1 2000/01/25 03:50:48 mike Exp $"
*
* MIME database file routines for the Common UNIX Printing System (CUPS).
*
* load_types() - Load a xyz.types file...
* delete_rules() - Free all memory for the given rule tree.
* load_convs() - Load a xyz.convs file...
- *
- * Revision History:
- *
- * $Log: mime.c,v $
- * Revision 1.16 2000/01/04 13:45:35 mike
- * Y2k copyright changes.
- *
- * Revision 1.15 1999/10/10 15:40:23 mike
- * Scanf, strcpy, and sprintf security changes.
- *
- * Revision 1.14 1999/07/12 16:09:38 mike
- * Fixed all constant arrays to use "const" modifier.
- *
- * Revision 1.13 1999/06/18 18:36:10 mike
- * Fixed address to 44141 Airport View Drive...
- *
- * Revision 1.12 1999/04/21 21:19:33 mike
- * Changes for HP-UX.
- *
- * Revision 1.11 1999/04/21 19:31:29 mike
- * Changed the directory header stuff to use the autoconf-recommended
- * sequence of #ifdef's.
- *
- * Changed the language routines to look for the LOCALEDIR environment
- * variable, and if it is not defined to use the LOCALEDIR string defined
- * in config.h.
- *
- * Revision 1.10 1999/03/01 20:51:53 mike
- * Code cleanup - removed extraneous semi-colons...
- *
- * Revision 1.9 1999/02/26 22:00:51 mike
- * Added more debug statements.
- *
- * Fixed bugs in cupsPrintFile() - wasn't setting the IPP_TAG_MIMETYPE
- * value tag for the file type.
- *
- * Updated conversion filter code to handle wildcards for super-type.
- *
- * Revision 1.8 1999/02/20 16:04:38 mike
- * Updated mime.c to scan directories under WIN32.
- *
- * Fixed some compiler warnings under WIN32.
- *
- * Updated VC++ project files.
- *
- * Updated mime.types and mime.convs files for actual registered
- * MIME type names.
- *
- * Revision 1.7 1999/02/05 17:40:53 mike
- * Added IPP client read/write code.
- *
- * Added string functions missing from some UNIXs.
- *
- * Added option parsing functions.
- *
- * Added IPP convenience functions (not implemented yet).
- *
- * Updated source files to use local string.h as needed (for
- * missing string functions)
- *
- * Revision 1.6 1999/02/01 22:08:39 mike
- * Restored original directory-scanning functionality of mimeLoad().
- *
- * Revision 1.4 1999/01/27 18:31:56 mike
- * Updated PPD routines to handle emulations and patch files.
- *
- * Added DSC comments to emit output as appropriate.
- *
- * Revision 1.3 1999/01/24 14:18:43 mike
- * Check-in prior to CVS use.
- *
- * Revision 1.2 1998/08/06 14:38:38 mike
- * Finished coding and testing for CUPS 1.0.
- *
- * Revision 1.1 1998/06/11 20:50:53 mike
- * Initial revision
*/
/*
#include <stdlib.h>
#include <ctype.h>
-#include "string.h"
+#include <cups/string.h>
#include "mime.h"
#if defined(WIN32) || defined(__EMX__)
/*
- * End of "$Id: mime.c,v 1.16 2000/01/04 13:45:35 mike Exp $".
+ * End of "$Id: mime.c,v 1.1 2000/01/25 03:50:48 mike Exp $".
*/
/*
- * "$Id: mime.h,v 1.7 2000/01/04 13:45:35 mike Exp $"
+ * "$Id: mime.h,v 1.1 2000/01/25 03:50:48 mike Exp $"
*
* MIME type/conversion database definitions for the Common UNIX Printing System (CUPS).
*
#endif /* !_MIME_H_ */
/*
- * End of "$Id: mime.h,v 1.7 2000/01/04 13:45:35 mike Exp $".
+ * End of "$Id: mime.h,v 1.1 2000/01/25 03:50:48 mike Exp $".
*/
/*
- * "$Id: testmime.c,v 1.8 2000/01/04 13:45:37 mike Exp $"
+ * "$Id: testmime.c,v 1.1 2000/01/25 03:50:49 mike Exp $"
*
* MIME test program for the Common UNIX Printing System (CUPS).
*
/*
- * End of "$Id: testmime.c,v 1.8 2000/01/04 13:45:37 mike Exp $".
+ * End of "$Id: testmime.c,v 1.1 2000/01/25 03:50:49 mike Exp $".
*/
/*
- * "$Id: type.c,v 1.12 2000/01/04 13:45:37 mike Exp $"
+ * "$Id: type.c,v 1.1 2000/01/25 03:50:49 mike Exp $"
*
* MIME typing routines for the Common UNIX Printing System (CUPS).
*
#include <ctype.h>
#include <locale.h>
-#include "string.h"
+#include <cups/string.h>
#include "mime.h"
/*
- * End of "$Id: type.c,v 1.12 2000/01/04 13:45:37 mike Exp $".
+ * End of "$Id: type.c,v 1.1 2000/01/25 03:50:49 mike Exp $".
*/