예제 #1
0
int
main (int argc, char **argv)
{
  char *mname = "";
  rb.buf = (char *) malloc ((unsigned) (rb.size = 0));
  if (argc > 1)
    mname = argv[1];

  if ((js = js_open (mname, 0)) == NULL)
    err ();

  if ((env = js_connect (js, "kana")) == NULL)
    err ();
  if ((fzk_file = js_file_read (env, FZK_FILE)) == -1)
    err ();
  if ((kihon_file = js_file_read (env, KIHON_DIC)) == -1)
    err ();
  if ((setto_file = js_file_read (env, SETTO_DIC)) == -1)
    err ();

  if (js_fuzokugo_set (env, fzk_file) == -1)
    err ();
  if ((kihon_dic_no = js_dic_add (env, kihon_file, -1, WNN_DIC_ADD_NOR, 1, WNN_DIC_RDONLY, WNN_DIC_RDONLY, NULL, NULL)) == -1)
    err ();
  if ((setto_dic_no = js_dic_add (env, setto_file, -1, WNN_DIC_ADD_NOR, 1, WNN_DIC_RDONLY, WNN_DIC_RDONLY, NULL, NULL)) == -1)
    err ();
  p_set (env);

  if ((rev_env = js_connect (js, "kanji")) == NULL)
    err ();

  if ((fzk_file = js_file_read (rev_env, FZK_FILE)) == -1)
    err ();
  if ((rev_file = js_file_read (rev_env, KIHON_DIC)) == -1)
    err ();
  if ((rev_setto_file = js_file_read (rev_env, SETTO_DIC)) == -1)
    err ();
  if (js_fuzokugo_set (rev_env, fzk_file) == -1)
    err ();

  if ((rev_dic_no = js_dic_add (rev_env, kihon_file, -1, WNN_DIC_ADD_REV, 1, WNN_DIC_RDONLY, WNN_DIC_RDONLY, NULL, NULL)) == -1)
    err ();
  if ((rev_setto_dic_no = js_dic_add (rev_env, setto_file, -1, WNN_DIC_ADD_REV, 1, WNN_DIC_RDONLY, WNN_DIC_RDONLY, NULL, NULL)) == -1)
    err ();
  p_set (rev_env);

#ifdef DEBUG
  printf ("Now discard file push any key\n");
  getchar ();
  js_file_discard (rev_env, rev_file);
  printf ("Now discard file\n");
#endif

  henkan ();
  js_close (js);
}
예제 #2
0
void sousin(int sdata){

    int i = 0;

     henkan(sdata);//int→char変換関数を用いる

       for(i=0;i<nul;i++){
          while(TXIF==0);     // 送信可能になるまで待つ
          TXREG = str[i];   // 送信中(TXIF == 1)
          TXIF = 0; //送信終了(送信可能TXIF == 0となる)
       }
       while(TXIF==0);
       TXREG = '\n';
       TXIF = 0;
       while(TXIF==0);
       TXREG = '\r';
       TXIF = 0;




}