2 Unix SMB/Netbios implementation.
4 Copyright (C) Andrew Tridgell 2001
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU 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.
28 given an upcase table file, create a lowcase table file
31 typedef unsigned short smb_ucs2_t;
33 static smb_ucs2_t upcase[0x10000], lowcase[0x10000];
38 char *fname = "upcase.dat";
40 fd = open(fname, O_RDONLY, 0);
46 if (read(fd, upcase, 0x20000) != 0x20000) {
47 printf("%s is too short\n", fname);
51 for (i=0;i<0x10000;i++) {
52 if (upcase[i] != i) lowcase[upcase[i]] = i;
55 for (i=0;i<0x10000;i++) {
56 if (lowcase[i] == 0) lowcase[i] = i;
61 fname = "lowcase.dat";
63 fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC, 0644);
69 write(fd, lowcase, 0x20000);