Back to index

im-sdk  12.3.91
CreateData.c
Go to the documentation of this file.
00001 #include  <stdio.h>
00002 #include  <string.h>
00003 #include  <stdlib.h>
00004 #include  "GeneType.h"
00005 #include  "PyBasic.h"
00006 #include  "ciku.h"
00007 
00008 extern JINT    Hzcode2244ToYjcode(JINT nHzcode);
00009 JINT   GetDyzInfo(JINT nHzcode, JINT* pnDyzYjCode);
00010 JINT   EncodeDyzTo2244(JINT nHzcode, JINT nYjcode);
00011 JINT   FastMatchYinJieStr(CHAR* szPystr);
00012 UCHAR* RecovDyz2244(UCHAR *szDyz2244);
00013 CHAR   LastChar (JINT nYinjieCode);
00014 CHAR   FirstChar(JINT nYinjieCode);
00015 JINT   ValidButLastChar (JINT nYinjieCode);
00016 JINT   ValidButFirstChar(JINT nYinjieCode);
00017 JINT   ValidAddChar(CHAR ch, JINT nYinjieCode);
00018 
00019 VOID   InitCizuItem(JINT nItems);
00020 VOID   InitSingleHanziByYj(JINT nArraySize);
00021 VOID   InitCizuGroupByYj(JINT nArraySize);
00022 VOID   CopyStructCZ(CizuItem* pThisCZ, CizuItem* pNewCZ);
00023 VOID   GetAllCizuItems(JINT nMode);
00024 JINT   GetNextLine(FILE* pfFile, CHAR* szBuf);
00025 VOID   FilterVtoU(UCHAR* pszLine);
00026 VOID   GetHzInfo(UCHAR *pszLine, UCHAR *pszHz, JINT *pnYj, JINT *pnHzNum, JINT *pnYjNum);
00027 VOID   GetYjInfo(UCHAR *pszLine, UCHAR *pszHz, JINT *pnYj, UCHAR *pszHz2244);
00028 JINT   EnumFanganForm(UCHAR *pszHz, JINT *pnYj, JINT nYjNum, JINT *pnbFanganFlag, JINT *pnFanganYj, JINT nMode, JINT nDspMode);
00029 JINT   EnumEnaoForm  (UCHAR* pszHz, JINT *pnYj, JINT nYjNum, JINT *pnbEnaoFlag,   JINT *pnFanganYj, JINT nMode, JINT nDspMode);
00030 JINT   EnumXianForm  (UCHAR* pszHz, JINT *pnYj, JINT nYjNum, JINT *pnbXianFlag,   JINT *pnXianYj,   JINT nMode, JINT nDspMode);
00031 VOID   BuildSingleHzDB(JINT nDspMode);
00032 
00033 JINT   CompIntArray(JINT* pnArray1, JINT* pnArray2);
00034 VOID   QuickSort(JINT nFirst, JINT nLast);
00035 
00036 VOID   SetCkh(CikuHeader *pCkh);
00037 VOID   SetShi(ShIndex *pShi);
00038 VOID   SetDhi(DhIndex *pDhi);
00039 VOID   SetMhi(MhIndex *pMhi);
00040 VOID   SetGbki(GbkIndex *pGbki);
00041 
00042 VOID   ProcGbkHz();
00043 
00044 extern JINT    nItemNum;
00045 extern JINT    nSortNumber;
00046 extern JINT    nGbkNumByYj[NUM_YINJIE];
00047 extern JWORD   wGbkHzByYj[NUM_YINJIE][400];
00048 extern CizuItem              czCZ[MAX_CIZU_ITEMS];
00049 extern SingleHanziByYj       shSH[NUM_YINJIE];
00050 extern CizuGroupByYj  cgCG[NUM_YINJIE];
00051 
00052 
00053 VOID CreateAllData()
00054 {
00055        JINT   i, j, k, t;
00056        JINT   nTmpRes;
00057        JINT   nFanganNum, nEnaoNum, nXianNum, nXianNum2;
00058        JINT   nFrom, nTo;
00059        JINT   nFlag[MAX_CIZU_ITEMS];
00060 
00061        InitCizuItem (MAX_CIZU_ITEMS);
00062        InitSingleHanziByYj (NUM_YINJIE);
00063        InitCizuGroupByYj (NUM_YINJIE);
00064 
00065        GetAllCizuItems(READ_RAW_CIZU);
00066 
00067        for(i = 0; i < nItemNum; i++)
00068        {
00069               FilterVtoU(czCZ[i].szLine);
00070               GetHzInfo (czCZ[i].szLine, czCZ[i].szHz, czCZ[i].nYj, &(czCZ[i].nHzNum), &(czCZ[i].nYjNum));
00071               GetYjInfo (czCZ[i].szLine, czCZ[i].szHz, czCZ[i].nYj, czCZ[i].szHz2244);
00072        }
00073 
00074        nFanganNum = 0;
00075        for(i = 0; i < nItemNum; i++)
00076        {
00077               nTmpRes = EnumFanganForm(czCZ[i].szHz, czCZ[i].nYj, czCZ[i].nYjNum, &(czCZ[i].nbIsFanganForm), czCZ[i].nFanganFormYj, ENUM_SIMP, F_NOPRINT);
00078               if (nTmpRes == TRUE)
00079               {
00080                      t = nItemNum + nFanganNum;
00081                      CopyStructCZ(&(czCZ[i]), &(czCZ[t]));
00082                      EnumFanganForm(czCZ[t].szHz, czCZ[t].nYj, czCZ[t].nYjNum, &(czCZ[t].nbIsFanganForm), czCZ[t].nFanganFormYj, ENUM_SIMP_W, F_PRINT);
00083                      nFanganNum ++;
00084               }
00085        }
00086        nItemNum += nFanganNum;
00087        printf ("%d FanganForm Added. nItemNum is %d\n", nFanganNum, nItemNum);
00088 
00089        nEnaoNum = 0;
00090        for (i = 0; i < nItemNum; i++)
00091        {
00092               nTmpRes = EnumEnaoForm(czCZ[i].szHz, czCZ[i].nYj, czCZ[i].nYjNum, &(czCZ[i].nbIsEnaoForm), czCZ[i].nFanganFormYj, ENUM_SIMP, F_NOPRINT);
00093               if (nTmpRes == TRUE)
00094               {
00095                      t = nItemNum + nEnaoNum;
00096                      CopyStructCZ(&(czCZ[i]), &(czCZ[t]));
00097                      EnumEnaoForm(czCZ[t].szHz, czCZ[t].nYj, czCZ[t].nYjNum, &(czCZ[t].nbIsEnaoForm), czCZ[t].nFanganFormYj, ENUM_SIMP_W, F_PRINT);
00098                      nEnaoNum ++;
00099               }
00100        }
00101        nItemNum += nEnaoNum;
00102        printf ("%d EnaoForm Added. nItemNum is %d\n", nEnaoNum, nItemNum);
00103 
00104        nXianNum  = 0;
00105        nXianNum2 = 0;
00106        for (i = 0; i < nItemNum; i++)
00107        {
00108               nTmpRes = EnumXianForm(czCZ[i].szHz, czCZ[i].nYj, czCZ[i].nYjNum, &(czCZ[i].nbIsXianForm), czCZ[i].nXianFormYj, ENUM_SIMP, F_NOPRINT);
00109               if (nTmpRes == TRUE)
00110               {
00111                      t = nItemNum + nXianNum;
00112                      if (czCZ[i].nYjNum == 2)
00113                      {
00114                             EnumXianForm(czCZ[i].szHz, czCZ[i].nYj, czCZ[i].nYjNum, &(czCZ[i].nbIsXianForm), czCZ[i].nXianFormYj, ENUM_SIMP_W, F_PRINT);
00115                             nXianNum2 ++;
00116                      }
00117               }
00118        }
00119        nItemNum += nXianNum;
00120        printf ("%d XianForm Added. nItemNum is %d [nXianNum2 is %d]\n", nXianNum, nItemNum, nXianNum2);
00121 
00122        nFrom = 0;
00123        nTo   = nItemNum - 1;
00124        nSortNumber = 0;
00125        fprintf (stderr, "SortNum:    ");
00126        QuickSort (nFrom, nTo);
00127        fprintf (stderr, "\b\b\b\b\b\b\b%07d", nSortNumber);
00128        fprintf (stderr, "\n\n\n");
00129 
00130        /* Filter these duplicated Items: Scott Ma 1998-08-12 */
00131        memset(nFlag, 0x00, sizeof(JINT) * MAX_CIZU_ITEMS);
00132 
00133        for (i = 0; i < nItemNum; i++)
00134               nFlag[i] = 1;
00135        k = 0;
00136        for (i = 0; i < nItemNum; i++)
00137        {
00138               for (j = i + 1; j < nItemNum; j++)
00139               {
00140                      if ( (czCZ[i].nHzNum == czCZ[j].nHzNum) && (czCZ[i].nYjNum == czCZ[j].nYjNum) &&
00141                           (strncmp((CHAR*)(czCZ[i].szHz2244), (CHAR*)(czCZ[j].szHz2244), 2 * czCZ[i].nHzNum) == 0) &&
00142                           (CompIntArray(czCZ[i].nYj, czCZ[j].nYj) == 0) )
00143                      {
00144                             printf("!!! Duplicated Cizu Item to be deleted ==>[%2d]%s\n", strlen((char*)(czCZ[j].szHz2244)), RecovDyz2244(czCZ[j].szHz2244));
00145                             fflush(stdout);
00146                             k++;
00147                             nFlag[j] = 0;
00148                      }
00149                      else
00150                      {
00151                             break;
00152                      }
00153               }
00154        }
00155        printf("Warning: Totally %d duplicated Cizu Items were deleted!\n", k);
00156 
00157        i = j = k = 0;
00158        for (i = 0; i < nItemNum; i++)
00159        {
00160               if (nFlag[i] == 1)
00161               {
00162                      CopyStructCZ(&(czCZ[i]), &(czCZ[j]));
00163                      j++;
00164               }
00165               else
00166                      k++;
00167        }
00168        printf("Warning: Totally %d duplicated Cizu Items were deleted!\n", k);
00169        nItemNum -= k;
00170 
00171        /**************************************************************************/
00172 
00173        BuildSingleHzDB(SINGLEHZ_DSP_NONE);
00174        ProcGbkHz();
00175 
00176        for (i = 0; i < nItemNum; i++)
00177        {
00178               if (!(czCZ[i].nbIsXianForm))
00179               {
00180                      cgCG[czCZ[i].nYj[0]].nNum2ndYjIs[czCZ[i].nYj[1]] ++;
00181                      cgCG[czCZ[i].nYj[0]].nIdxItem[ cgCG[czCZ[i].nYj[0]].nNumFirstYjIs ] = i;
00182                      cgCG[czCZ[i].nYj[0]].nNumFirstYjIs++;
00183               }
00184               else if (czCZ[i].nbIsXianForm)
00185               {
00186                      cgCG[czCZ[i].nXianFormYj[0]].nNum2ndYjIs[czCZ[i].nXianFormYj[1]] ++;
00187                      cgCG[czCZ[i].nXianFormYj[0]].nIdxItem[ cgCG[czCZ[i].nXianFormYj[0]].nNumFirstYjIs ] = i;
00188                      cgCG[czCZ[i].nXianFormYj[0]].nNumFirstYjIs++;
00189               }
00190        }
00191 }
00192 
00193 
00194 VOID SetCkh(CikuHeader *pCkh)
00195 {
00196        JINT   i, nLen;
00197        CHAR   szName[] = " SUN TDC P.R.C. 汉语拼音词库 1.0";
00198        CHAR   szCopyright[] = "版权所有(C) 太阳计算机系统(中国)有限公司 1997_11";
00199 
00200        for (i = 0; i < 32; i++)
00201               pCkh->szName[i]           = '\0';
00202        for (i = 0; i < 48; i++)
00203               pCkh->szCopyright[i] = '\0';
00204 
00205        pCkh->nMagicDescHi    = 0x35303539;
00206        pCkh->nMagicDescLow   = 0x34333442;
00207        pCkh->nSize         = sizeof(CikuHeader);
00208        pCkh->nFileSize            = 0;
00209 
00210        nLen = strlen(szName);
00211        for (i = 0; i < nLen; i++)
00212               pCkh->szName[i]           = szName[i];
00213 
00214        nLen = strlen(szCopyright);
00215        for (i = 0; i < nLen; i++)
00216               pCkh->szCopyright[i] = szCopyright[i];
00217 
00218        pCkh->nVersion             = 0x00010000;         /* Version 1.0 */
00219        pCkh->nLatestTime     = 0;
00220        pCkh->nIdxShPos            = 0;
00221        pCkh->nIdxDhPos            = 0;
00222        pCkh->nIdxMhPos            = 0;
00223        pCkh->nIdxGbkPos      = 0;
00224        pCkh->nReserve2            = 0;
00225        pCkh->nReserve3            = 0;
00226 
00227        printf("Sizeof this structure is %d\n", sizeof(CikuHeader));
00228 }
00229 
00230 
00231 VOID SetShi(ShIndex *pShi)
00232 {
00233        JINT   i, k, nTmp;
00234 
00235        pShi->nSize         = sizeof(ShIndex);
00236        pShi->nStartPos            = 0;                                /* To be added by a BaseOffset */
00237 
00238        for (i = 0; i < (NUM_YINJIE + 1); i++)
00239               pShi->nYjOff[i]       = 0;
00240 
00241        /*
00242        ** Each pShi->nYjOff[i] is less than 0x00FFFFFF. Highest 8 bit contains
00243        ** the number of nXianFormNum.
00244        */
00245        for (i = 0; i < NUM_YINJIE; i++)
00246        {
00247               nTmp = (2 * shSH[i].nHzNum) + (4 * shSH[i].nXianFormNum);
00248               for (k = i; k < NUM_YINJIE; k++)
00249                      pShi->nYjOff[k + 1] += nTmp;
00250               pShi->nYjOff[i + 1] += (shSH[i].nXianFormNum << 24);
00251        }
00252 
00253        pShi->nEndPos       = pShi->nYjOff[NUM_YINJIE] & 0x00FFFFFF;     /* To be added by a BaseOffset */
00254 
00255        printf("sizeof(ShIndex) is %d, Total Single Hanzi Data area size is %d\n", sizeof(ShIndex), pShi->nEndPos );
00256 }
00257 
00258 
00259 VOID SetDhi(DhIndex *pDhi)
00260 {
00261        JINT   i, k, nt1, nTmp;
00262        JINT   nD2Num[NUM_YINJIE];
00263 
00264        pDhi->nSize         = sizeof(DhIndex);
00265        pDhi->nStartPos            = 0;                      /* To be added by a BaseOffset */
00266 
00267        for (i = 0; i < (NUM_YINJIE + 1); i++)
00268               pDhi->nYjOff[i]       = 0;
00269 
00270        for (i = 0; i < NUM_YINJIE; i++)
00271               nD2Num[i]      = 0;
00272 
00273        for (i = 0; i < NUM_YINJIE; i++)
00274        {
00275               for (k = 0; k < cgCG[i].nNumFirstYjIs; k++)
00276               {
00277                      nt1 = czCZ[ cgCG[i].nIdxItem[k] ].nHzNum;
00278                      if (nt1 == 2)
00279                             nD2Num[i] ++;
00280               }
00281        }
00282 
00283        for (i = 0; i < NUM_YINJIE; i++)
00284        {
00285               nTmp = 5 * nD2Num[i];                            /* 4 + 1(nFreqData) */
00286               for (k = i; k < NUM_YINJIE; k++)
00287                      pDhi->nYjOff[k + 1] += nTmp;
00288        }
00289 
00290        pDhi->nEndPos       = pDhi->nYjOff[NUM_YINJIE];  /* To be added by a BaseOffset */
00291        printf("Total Size of Double Hanzi Area is %d\n", pDhi->nEndPos);
00292 }
00293 
00294 
00295 VOID SetMhi(MhIndex *pMhi)
00296 {
00297        JINT   i, k, nt1;
00298        JINT   nM3Num[NUM_YINJIE], nM3Len[NUM_YINJIE];
00299 
00300        pMhi->nSize         = sizeof(MhIndex);
00301        pMhi->nStartPos            = 0;
00302 
00303        for (i = 0; i < (NUM_YINJIE + 1); i++)
00304               pMhi->nYjOff[i]       = 0;
00305 
00306        for (i = 0; i < NUM_YINJIE; i++)
00307        {
00308               nM3Num[i]     = 0;
00309               nM3Len[i]     = 0;
00310        }
00311 
00312        for (i = 0; i < NUM_YINJIE; i++)
00313        {
00314               for (k = 0; k < cgCG[i].nNumFirstYjIs; k++)
00315               {
00316                      nt1 = czCZ[ cgCG[i].nIdxItem[k] ].nHzNum;
00317                      if (nt1 > 2)
00318                      {
00319                             nM3Num[i] ++;
00320                             nM3Len[i] += (2 * nt1) + 1;
00321                      }
00322               }
00323        }
00324 
00325        for (i = 0; i < NUM_YINJIE; i++)
00326               for (k = i; k < NUM_YINJIE; k++)
00327                      pMhi->nYjOff[k + 1] += nM3Len[i];
00328 
00329        pMhi->nEndPos       = pMhi->nYjOff[NUM_YINJIE];  /* To be added by a BaseOffset */
00330 
00331        printf("Total Size of Multiple (>=3) Hanzi Area is %d\n", pMhi->nEndPos);
00332 }
00333 
00334 
00335 VOID SetGbki(GbkIndex *pGbki)
00336 {
00337        JINT   i, k;
00338 
00339        pGbki->nSize        = sizeof(GbkIndex);
00340        pGbki->nStartPos      = 0;                    /* To be added by a BaseOffset */
00341 
00342        for (i = 0; i < (NUM_YINJIE + 1); i++)
00343               pGbki->nYjOff[i]  = 0;
00344 
00345        for (i = 0; i < NUM_YINJIE; i++)
00346               for (k = i; k < NUM_YINJIE; k++)
00347                      pGbki->nYjOff[k + 1] += (sizeof(JWORD) * nGbkNumByYj[i]);  /* Each GBK Hanzi is 2 bytes */
00348 
00349        pGbki->nEndPos             = pGbki->nYjOff[NUM_YINJIE]; /* To be added by a BaseOffset */
00350 
00351        printf("sizeof(GbkIndex) is %d, Total GBK Single Hanzi Data area size is %d Bytes\n",
00352               sizeof(GbkIndex), pGbki->nEndPos );
00353 }
00354 
00355 
00356 VOID CreateCikuFile()
00357 {
00358        JINT   nFileSize;
00359        BYTE*  pbAllData;
00360        JINT   i, k, m, nTmp, nt1, nAll;
00361        FILE*  pfCiku;
00362 
00363        CikuHeader    ckh;
00364        ShIndex             shi;
00365        DhIndex             dhi;
00366        MhIndex             mhi;
00367        GbkIndex      gbki;
00368 
00369        SetCkh(&ckh);
00370        SetShi(&shi);
00371        SetDhi(&dhi);
00372        SetMhi(&mhi);
00373        SetGbki(&gbki);
00374 
00375        nFileSize  = sizeof(CikuHeader) + sizeof(ShIndex) + sizeof(DhIndex) + sizeof(MhIndex) + sizeof(GbkIndex)
00376                  + shi.nYjOff[NUM_YINJIE] + dhi.nYjOff[NUM_YINJIE] + mhi.nYjOff[NUM_YINJIE] + gbki.nYjOff[NUM_YINJIE];
00377 
00378        printf("\n\n=========================================\n");
00379        printf("nFileSize is   %d[0x%X]\n", nFileSize, nFileSize);
00380 
00381        ckh.nFileSize = nFileSize;
00382        ckh.nIdxShPos = sizeof(CikuHeader);
00383        ckh.nIdxDhPos = ckh.nIdxShPos + sizeof(ShIndex);
00384        ckh.nIdxMhPos = ckh.nIdxDhPos + sizeof(DhIndex);
00385        ckh.nIdxGbkPos       = ckh.nIdxMhPos + sizeof(MhIndex);
00386 
00387        shi.nStartPos = ckh.nIdxGbkPos + sizeof(GbkIndex);
00388        shi.nEndPos    += shi.nStartPos;
00389 
00390        dhi.nStartPos = shi.nEndPos;
00391        dhi.nEndPos    += dhi.nStartPos;
00392 
00393        mhi.nStartPos = dhi.nEndPos;
00394        mhi.nEndPos    += mhi.nStartPos;
00395 
00396        gbki.nStartPos       = mhi.nEndPos;
00397        gbki.nEndPos   += gbki.nStartPos;
00398 
00399        pbAllData = (BYTE*)malloc(nFileSize);
00400        if (pbAllData == NULL)
00401        {
00402               fprintf(stderr, "Failed to Alloc memory for pbAllData\n");
00403               exit(FALSE);
00404        }
00405 
00406        memset (pbAllData, '\0', nFileSize);
00407 
00408        nAll = 0;
00409        nTmp = sizeof(CikuHeader);
00410        for (i = 0; i < nTmp; i++)
00411               pbAllData[nAll++]  = (BYTE)*((BYTE*)(&ckh) + i);
00412 
00413        nTmp = sizeof(ShIndex);
00414        for (i = 0; i < nTmp; i++)
00415               pbAllData[nAll++]  = (BYTE)*((BYTE*)(&shi) + i);
00416 
00417        nTmp = sizeof(DhIndex);
00418        for (i = 0; i < nTmp; i++)
00419               pbAllData[nAll++]  = (BYTE)*((BYTE*)(&dhi) + i);
00420 
00421        nTmp = sizeof(MhIndex);
00422        for (i = 0; i < nTmp; i++)
00423               pbAllData[nAll++]  = (BYTE)*((BYTE*)(&mhi) + i);
00424 
00425        nTmp = sizeof(GbkIndex);
00426        for (i = 0; i < nTmp; i++)
00427               pbAllData[nAll++]  = (BYTE)*((BYTE*)(&gbki) + i);
00428 
00429        /* Single Hanzi Area */
00430        for (i = 0; i < NUM_YINJIE; i++)
00431        {
00432               for (k = 0; k < (2 * shSH[i].nHzNum); k++)
00433                      pbAllData[nAll++] = (BYTE)(shSH[i].szHanzi[k] ^ ((i + 56) / 2));
00434 
00435               for (k = 0; k < (4 * shSH[i].nXianFormNum); k++)
00436                      pbAllData[nAll++] = (BYTE)(shSH[i].szXianFormList[k] ^ ((i + 56) / 2));
00437        }
00438 
00439        /* Double Hanzi Area */
00440        for (i = 0; i < NUM_YINJIE; i++)
00441        {
00442               for (k = 0; k < cgCG[i].nNumFirstYjIs; k++)
00443               {
00444                      nt1 = czCZ[ cgCG[i].nIdxItem[k] ].nHzNum;
00445                      if (nt1 == 2)
00446                      {
00447                             pbAllData[nAll++] = (BYTE) ( ((czCZ[cgCG[i].nIdxItem[k]].nFreq) * 8) ^ ((i + 56) / 2));           /* Freq */
00448                             for (m = 0; m < (2 * nt1); m++)
00449                                    pbAllData[nAll++] = (BYTE) ((czCZ[cgCG[i].nIdxItem[k]].szHz2244[m]) ^ ((i + 56) / 2));     /* Data */
00450                      }
00451               }
00452        }
00453 
00454        /*
00455        **  Multiple Hanzi Area
00456        **
00457        **  ABOUT Freq and Length BYTE:     7 |<== 5 Bits Freq ==>|<= 3 Bits Length =>| 0
00458        **  3 Bits (000 ~ 111) indicates the length of this Cizu is (2 ~ 9).
00459        **  5 Bits (00000 ~ 11111) indicates the freqence of this cizu is (0 ~ 31). (Default is 0 ~ 15)
00460        */
00461        for (i = 0; i < NUM_YINJIE; i++)
00462        {
00463               for (k = 0; k < cgCG[i].nNumFirstYjIs; k++)
00464               {
00465                      nt1 = czCZ[ cgCG[i].nIdxItem[k] ].nHzNum;
00466                      if (nt1 > 2)
00467                      {
00468                             nTmp = ((czCZ[cgCG[i].nIdxItem[k]].nFreq) << 3) + (nt1 - 2);
00469                             pbAllData[nAll++] = (BYTE) (nTmp ^ ((i + 56) / 2));                   /* Freq and Length */
00470 
00471                             for (m = 0; m < (2 * nt1); m++)
00472                                    pbAllData[nAll++] = (BYTE) ((czCZ[cgCG[i].nIdxItem[k]].szHz2244[m]) ^ ((i + 56) / 2));     /* Data */
00473                      }
00474               }
00475        }
00476 
00477        /* GBK Single Hanzi Area */
00478        for (i = 0; i < NUM_YINJIE; i++)
00479        {
00480               for (k = 0; k < nGbkNumByYj[i]; k++)
00481               {
00482                      pbAllData[nAll++] = (BYTE)( (((JINT)wGbkHzByYj[i][k] & 0xFF00) >> 8) ^ ((i + 56) / 2));
00483                      pbAllData[nAll++] = (BYTE)(  ((JINT)wGbkHzByYj[i][k] & 0x00FF)  ^ ((i + 56) / 2));
00484               }
00485        }
00486 
00487        pfCiku = fopen("PyCiku.dat", "wb");
00488        if (pfCiku == NULL)
00489        {
00490               fprintf (stderr, "Failed to Create System Ciku [PyCiku.dat]\n");
00491               exit (FALSE);
00492        }
00493 
00494        for (i = 0; i < nFileSize; i++)
00495               fprintf (pfCiku, "%c", pbAllData[i]);
00496 
00497        fclose(pfCiku);
00498 }
00499 
00500