1
/* create-abbrevs.m - Utility to create a list of time zones and their
2
associated abbreviations.
4
Copyright (C) 1997 Free Software Foundation, Inc.
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public License as
8
published by the Free Software Foundation; either version 2 of the
9
License, or (at your option) any later version.
11
This program is distributed in the hope that it will be useful, but
12
WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21
#include <Foundation/NSArray.h>
22
#include <Foundation/NSAutoreleasePool.h>
23
#include <Foundation/NSException.h>
24
#include <Foundation/NSDictionary.h>
25
#include <Foundation/NSDate.h>
26
#include <Foundation/NSUtilities.h>
27
#include <Foundation/NSTimeZone.h>
30
main (int argc, char *argv[])
33
id pool, zone, dict, e, details, name;
35
pool = [NSAutoreleasePool new];
37
for (i = 1; i < argc; i++)
39
name = [NSString stringWithCString: argv[i]];
40
zone = [NSTimeZone timeZoneWithName: name];
45
dict = [NSMutableDictionary dictionary];
46
details = [zone timeZoneDetailArray];
47
e = [details objectEnumerator];
48
while ((detail = [e nextObject]) != nil)
49
[dict setObject: name forKey: [detail timeZoneAbbreviation]];
50
e = [dict keyEnumerator];
51
while ((abbrev = [e nextObject]) != nil)
52
printf("%@\t%@\n", abbrev, name);