]>
git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/testcatalog.cxx
4 // Test program for message catalog class.
6 // Copyright 2008 by Apple Inc.
8 // These coded instructions, statements, and computer programs are the
9 // property of Apple Inc. and are protected by Federal copyright
10 // law. Distribution and use rights are outlined in the file "LICENSE.txt"
11 // which should have been included with this file. If this file is
12 // file is missing or damaged, see the license at "http://www.cups.org/".
16 // main() - Open a message catalog
20 // Include necessary headers...
27 // 'main()' - Open a message catalog
30 int // O - Exit status
31 main(int argc
, // I - Number of command-line arguments
32 char *argv
[]) // I - Command-line arguments
34 ppdcCatalog
*catalog
; // Message catalog
35 ppdcMessage
*m
; // Current message
40 puts("Usage: testcatalog filename");
44 // Scan the command-line...
45 catalog
= new ppdcCatalog(NULL
, argv
[1]);
47 printf("%s: %d messages\n", argv
[1], catalog
->messages
->count
);
49 for (m
= (ppdcMessage
*)catalog
->messages
->first();
51 m
= (ppdcMessage
*)catalog
->messages
->next())
52 printf("%s: %s\n", m
->id
->value
, m
->string
->value
);
56 // Return with no errors.