]>
Commit | Line | Data |
---|---|---|
4509bb49 | 1 | // |
503b54c9 | 2 | // Test program for message catalog class. |
4509bb49 | 3 | // |
503b54c9 | 4 | // Copyright 2008 by Apple Inc. |
4509bb49 | 5 | // |
e3101897 | 6 | // Licensed under Apache License v2.0. See the file "LICENSE" for more information. |
4509bb49 MS |
7 | // |
8 | ||
9 | // | |
10 | // Include necessary headers... | |
11 | // | |
12 | ||
38e73f87 | 13 | #include "ppdc-private.h" |
4509bb49 MS |
14 | |
15 | ||
16 | // | |
503b54c9 | 17 | // 'main()' - Open a message catalog |
4509bb49 MS |
18 | // |
19 | ||
20 | int // O - Exit status | |
21 | main(int argc, // I - Number of command-line arguments | |
22 | char *argv[]) // I - Command-line arguments | |
23 | { | |
24 | ppdcCatalog *catalog; // Message catalog | |
25 | ppdcMessage *m; // Current message | |
26 | ||
27 | ||
28 | if (argc != 2) | |
29 | { | |
30 | puts("Usage: testcatalog filename"); | |
31 | return (1); | |
32 | } | |
33 | ||
34 | // Scan the command-line... | |
35 | catalog = new ppdcCatalog(NULL, argv[1]); | |
36 | ||
37 | printf("%s: %d messages\n", argv[1], catalog->messages->count); | |
38 | ||
39 | for (m = (ppdcMessage *)catalog->messages->first(); | |
40 | m; | |
41 | m = (ppdcMessage *)catalog->messages->next()) | |
42 | printf("%s: %s\n", m->id->value, m->string->value); | |
43 | ||
e4572d57 | 44 | catalog->release(); |
4509bb49 MS |
45 | |
46 | // Return with no errors. | |
47 | return (0); | |
48 | } |