Logo Search packages:      
Sourcecode: ack version File versions  Download package

codetozen.c

/*    Copyright 1993 H.Ogasawara (COR.)   */

/* v1.00  1993 10/10    Ogasawara Hiroyuki            */
/*                oga@dgw.yz.yamagata-u.ac.jp   */

#define     HIRAGANA    0
#define     ZENMAP            0

static unsigned char    zenmap0[]= {
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f,
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
};

#if ZENMAP
# include   "zenmap.hex"
#else
static unsigned short   zenmap1[]= {
# if !HIRAGANA
      0x2121,0x2123,0x2156,0x2157,0x2122,0x2126,0x2572,0x2521,
      0x2523,0x2525,0x2527,0x2529,0x2563,0x2565,0x2567,0x2543,
      0x213c,0x2522,0x2524,0x2526,0x2528,0x252a,0x252b,0x252d,
      0x252f,0x2531,0x2533,0x2535,0x2537,0x2539,0x253b,0x253d,
      0x253f,0x2541,0x2544,0x2546,0x2548,0x254a,0x254b,0x254c,
      0x254d,0x254e,0x254f,0x2552,0x2555,0x2558,0x255b,0x255e,
      0x255f,0x2560,0x2561,0x2562,0x2564,0x2566,0x2568,0x2569,
      0x256a,0x256b,0x256c,0x256d,0x256f,0x2573,0x212b,0x212c,

      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x252c,0x252e,
      0x2530,0x2532,0x2534,0x2536,0x2538,0x253a,0x253c,0x253e,
      0x2540,0x2542,0x2545,0x2547,0x2549,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x2550,0x2553,0x2556,0x2559,0x255c,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,

      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x2551,0x2554,0x2557,0x255a,0x255d,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
# else
      0x2121,0x2123,0x2156,0x2157,0x2122,0x2126,0x2472,0x2421,
      0x2423,0x2425,0x2427,0x2429,0x2463,0x2465,0x2467,0x2443,
      0x213c,0x2422,0x2424,0x2426,0x2428,0x242a,0x242b,0x242d,
      0x242f,0x2431,0x2433,0x2435,0x2437,0x2439,0x243b,0x243d,
      0x243f,0x2441,0x2444,0x2446,0x2448,0x244a,0x244b,0x244c,
      0x244d,0x244e,0x244f,0x2452,0x2455,0x2458,0x245b,0x245e,
      0x245f,0x2460,0x2461,0x2462,0x2464,0x2466,0x2468,0x2469,
      0x246a,0x246b,0x246c,0x246d,0x246f,0x2473,0x212b,0x212c,

      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x242c,0x242e,
      0x2430,0x2432,0x2434,0x2436,0x2438,0x243a,0x243c,0x243e,
      0x2440,0x2442,0x2445,0x2447,0x2449,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x2450,0x2453,0x2456,0x2459,0x245c,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,

      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x2451,0x2454,0x2457,0x245a,0x245d,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
      0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
# endif
};
#endif      /* ZENMAP */

CodeToZen( code )
unsigned int      code;
{
      unsigned int      zen, zen2;
      if( code < 0x100 && (zen= zenmap0[code]) != 0xff ){
            unsigned int      next= getcode();
            if( next == 0xde ){
                  if( zen2= zenmap1[zen+0x40] )
                        return      zen2;
            }else if( next == 0xdf ){
                  if( zen2= zenmap1[zen+0x80] )
                        return      zen2;
            }
            ungetcode( next );
            code= zenmap1[zen];
      }
      return      code;
}


Generated by  Doxygen 1.6.0   Back to index