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