Tung-Han Hsieh - 2000-04-10

Hello,
         
Here I found two problems in libtabe:
  
1. I am trying to port libtabe to the HP-UX plateform. On that plateform,
   it use the ANSI C compiler. Of course it can also work on the traditional
   C mode, but it cannot work on the "mixed" mode. However, in libtabe
   source code, the "mixed" situation does exist, for example:
       
   in tabe.h:
        struct TsiDB {
          int type;
          int flags;          void *dbcp;
          void (*Close)(struct TsiDB *tsidb);
          int  (*RecordNumber)(struct TsiDB *tsidb);
          int  (*Put)(struct TsiDB *tsidb, struct TsiInfo *tsi);
          int  (*Get)(struct TsiDB *tsidb, struct TsiInfo *tsi);
          int  (*CursorSet)(struct TsiDB *tsidb, struct TsiInfo *tsi);
          int  (*CursorNext)(struct TsiDB *tsidb, struct TsiInfo *tsi);
          int  (*CursorPrev)(struct TsiDB *tsidb, struct TsiInfo *tsi);
        };
  
        the function pointers like "void (*Close)(struct TsiDB *tsidb);"
        is recognized as the ANSI declaration. And the following function  
        declaration:
  
        ZhiStr              tabeYinLookupZhiList(Yin yin);
  
        is too. But  
         
   in tabe_yin.c:  
         
        ZhiStr        tabeYinLookupZhiList(yin)
        Yin yin;
        {
                ........
        }
         
        The function definition is the traditional C convention. So the
        compiler complains.

   Therefore, I suggest that we might need to change the code such that
   it is completely obey the ANSI standard. I think this should be
   reasonable modification. I want to here others' opinion. If you agree,  
   I will help to do these changes.
  
       
2. I think that libtabe is too specialized to the Big5 encoding. I personally
   do not think this is a good idea. Although we usally use Big5 to handle
   ZhuYin, but I think we should also consider more general framework.
   So, I suggest that we should try to make libtabe to be encoding
   independent. In fact, I plan to rewrite the next release of xcin to
   handle more general encodings, like Unicode or UTF8. Currently xcin is
   not completely ready to handle these, but I will make it work. So, I also
   hope that libtabe can acomplish this. Otherwise libtabe is too limited
   in the future application.
               
   I think, at least, libtabe binary programs should have the ability to
   be encoding independent, while the data files like tsi.src need not.
   So that in some day, if we need to switch to another encoding, we
   only need to convert the data files, and everything works.

   Therefore, if we really want to make the program to be encoding
   independent, I suggest that this should be the highest piority of
   the development of libtabe. Since this should be the very basic
   algorithm of the whole system, and almost everything depends on it.
   If we can finish it earlier, then we don't need to go back to do
   changes if we have write more new codes.

  
Please give me suggestions for my opinions. Thank you very much.
  
  
Best Regards,

T.H.Hsieh

          char *db_name;
          void *dbp;