home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / libi18n / unicode / tbltool / xlatgenmac.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.7 KB  |  55 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /*
  19.     single filename1 filename2 
  20. */
  21. #include <stdio.h>
  22. #include <stdlib.h>
  23.  
  24. void GenMap(char* name1, char* name2, 
  25.     unsigned short array1[], unsigned short array2[])
  26. {
  27.     int i,j,found;
  28.  
  29.     printf("/*     Translation %s -> %s   */\n",name1, name2);
  30.     ReportUnmap(array1,array2);
  31.     printf("/*        x0x1 x2x3 x4x5 x6x7 x8x9 xAxB xCxD xExF   */\n");
  32.         for(i=0;i<256;i++)
  33.         {
  34.         if((i%16) == 0)
  35.             printf("/*%Xx*/  $\"",i/16);
  36.                 for(found=0,j=0;j<256;j++)
  37.                 {
  38.                         if(array1[i] == array2[j])
  39.                         {
  40.                 printf("%02X",j);
  41.                                 found = 1;
  42.                                 break;
  43.                         }
  44.                 }
  45.                 if(found == 0)
  46.                 {
  47.             printf("%2X",i);
  48.                 }
  49.         if((i%16) == 15)
  50.             printf("\"\n");
  51.         else if(i%2)
  52.             printf(" ");
  53.         }
  54. }
  55.