]>
Commit | Line | Data |
---|---|---|
4509bb49 | 1 | // |
503b54c9 | 2 | // Test program for message catalog class. |
4509bb49 | 3 | // |
503b54c9 | 4 | // Copyright 2008 by Apple Inc. |
4509bb49 | 5 | // |
503b54c9 MS |
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/". | |
4509bb49 MS |
11 | // |
12 | ||
13 | // | |
14 | // Include necessary headers... | |
15 | // | |
16 | ||
38e73f87 | 17 | #include "ppdc-private.h" |
4509bb49 MS |
18 | |
19 | ||
20 | // | |
503b54c9 | 21 | // 'main()' - Open a message catalog |
4509bb49 MS |
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 | ||
e4572d57 | 48 | catalog->release(); |
4509bb49 MS |
49 | |
50 | // Return with no errors. | |
51 | return (0); | |
52 | } |