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