From 4509bb49335b3edfdb1b03d83d6cd05890968b59 Mon Sep 17 00:00:00 2001 From: msweet Date: Thu, 3 Jul 2008 05:38:29 +0000 Subject: Merge changes from CUPS 1.4svn-r7715. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@834 a1ca3aef-8c08-0410-bb20-df032aa958be --- ppdc/testcatalog.cxx | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 ppdc/testcatalog.cxx (limited to 'ppdc/testcatalog.cxx') diff --git a/ppdc/testcatalog.cxx b/ppdc/testcatalog.cxx new file mode 100644 index 000000000..808738d90 --- /dev/null +++ b/ppdc/testcatalog.cxx @@ -0,0 +1,63 @@ +// +// "$Id$" +// +// Test program for message catalog class. +// +// Copyright 2008 by Apple Inc. +// +// These coded instructions, statements, and computer programs are the +// property of Apple Inc. and are protected by Federal copyright +// law. Distribution and use rights are outlined in the file "LICENSE.txt" +// which should have been included with this file. If this file is +// file is missing or damaged, see the license at "http://www.cups.org/". +// +// Contents: +// +// main() - Open a message catalog +// + +// +// Include necessary headers... +// + +#include "ppdc.h" + + +// +// 'main()' - Open a message catalog +// + +int // O - Exit status +main(int argc, // I - Number of command-line arguments + char *argv[]) // I - Command-line arguments +{ + ppdcCatalog *catalog; // Message catalog + ppdcMessage *m; // Current message + + + if (argc != 2) + { + puts("Usage: testcatalog filename"); + return (1); + } + + // Scan the command-line... + catalog = new ppdcCatalog(NULL, argv[1]); + + printf("%s: %d messages\n", argv[1], catalog->messages->count); + + for (m = (ppdcMessage *)catalog->messages->first(); + m; + m = (ppdcMessage *)catalog->messages->next()) + printf("%s: %s\n", m->id->value, m->string->value); + + delete catalog; + + // Return with no errors. + return (0); +} + + +// +// End of "$Id$". +// -- cgit v1.2.3