]>
git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/testcatalog.cxx
2 // Test program for message catalog class.
4 // Copyright © 2008-2019 by Apple Inc.
6 // Licensed under Apache License v2.0. See the file "LICENSE" for more
11 // Include necessary headers...
14 #include "ppdc-private.h"
18 // 'main()' - Open a message catalog
21 int // O - Exit status
22 main(int argc
, // I - Number of command-line arguments
23 char *argv
[]) // I - Command-line arguments
25 ppdcCatalog
*catalog
; // Message catalog
26 ppdcMessage
*m
; // Current message
31 puts("Usage: testcatalog filename");
35 // Scan the command-line...
36 catalog
= new ppdcCatalog(NULL
, argv
[1]);
38 printf("%s: %u messages\n", argv
[1], (unsigned)catalog
->messages
->count
);
40 for (m
= (ppdcMessage
*)catalog
->messages
->first();
42 m
= (ppdcMessage
*)catalog
->messages
->next())
43 printf("%s: %s\n", m
->id
->value
, m
->string
->value
);
47 // Return with no errors.