]>
git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/testcatalog.cxx
2 // Test program for message catalog class.
4 // Copyright 2008 by Apple Inc.
6 // Licensed under Apache License v2.0. See the file "LICENSE" for more information.
10 // Include necessary headers...
13 #include "ppdc-private.h"
17 // 'main()' - Open a message catalog
20 int // O - Exit status
21 main(int argc
, // I - Number of command-line arguments
22 char *argv
[]) // I - Command-line arguments
24 ppdcCatalog
*catalog
; // Message catalog
25 ppdcMessage
*m
; // Current message
30 puts("Usage: testcatalog filename");
34 // Scan the command-line...
35 catalog
= new ppdcCatalog(NULL
, argv
[1]);
37 printf("%s: %d messages\n", argv
[1], catalog
->messages
->count
);
39 for (m
= (ppdcMessage
*)catalog
->messages
->first();
41 m
= (ppdcMessage
*)catalog
->messages
->next())
42 printf("%s: %s\n", m
->id
->value
, m
->string
->value
);
46 // Return with no errors.