]> git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/testcatalog.cxx
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / ppdc / testcatalog.cxx
1 //
2 // Test program for message catalog class.
3 //
4 // Copyright 2008 by Apple Inc.
5 //
6 // These coded instructions, statements, and computer programs are the
7 // property of Apple Inc. and are protected by Federal copyright
8 // law. Distribution and use rights are outlined in the file "LICENSE.txt"
9 // which should have been included with this file. If this file is
10 // file is missing or damaged, see the license at "http://www.cups.org/".
11 //
12
13 //
14 // Include necessary headers...
15 //
16
17 #include "ppdc-private.h"
18
19
20 //
21 // 'main()' - Open a message catalog
22 //
23
24 int // O - Exit status
25 main(int argc, // I - Number of command-line arguments
26 char *argv[]) // I - Command-line arguments
27 {
28 ppdcCatalog *catalog; // Message catalog
29 ppdcMessage *m; // Current message
30
31
32 if (argc != 2)
33 {
34 puts("Usage: testcatalog filename");
35 return (1);
36 }
37
38 // Scan the command-line...
39 catalog = new ppdcCatalog(NULL, argv[1]);
40
41 printf("%s: %d messages\n", argv[1], catalog->messages->count);
42
43 for (m = (ppdcMessage *)catalog->messages->first();
44 m;
45 m = (ppdcMessage *)catalog->messages->next())
46 printf("%s: %s\n", m->id->value, m->string->value);
47
48 catalog->release();
49
50 // Return with no errors.
51 return (0);
52 }