]>
git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/testcatalog.cxx
bf046dd3d1c707a311c372c1e378d001f0b873ab
2 // Test program for message catalog class.
4 // Copyright 2008 by Apple Inc.
6 // These coded instructions, statements, and computer programs are the
7 // property of Apple Inc. and are protected by Federal copyright
8 // law. Distribution and use rights are outlined in the file "LICENSE.txt"
9 // which should have been included with this file. If this file is
10 // file is missing or damaged, see the license at "http://www.cups.org/".
14 // Include necessary headers...
17 #include "ppdc-private.h"
21 // 'main()' - Open a message catalog
24 int // O - Exit status
25 main(int argc
, // I - Number of command-line arguments
26 char *argv
[]) // I - Command-line arguments
28 ppdcCatalog
*catalog
; // Message catalog
29 ppdcMessage
*m
; // Current message
34 puts("Usage: testcatalog filename");
38 // Scan the command-line...
39 catalog
= new ppdcCatalog(NULL
, argv
[1]);
41 printf("%s: %d messages\n", argv
[1], catalog
->messages
->count
);
43 for (m
= (ppdcMessage
*)catalog
->messages
->first();
45 m
= (ppdcMessage
*)catalog
->messages
->next())
46 printf("%s: %s\n", m
->id
->value
, m
->string
->value
);
50 // Return with no errors.