²z xcin Jk module [cAHηsW module kC

----------------------------------------
A. [c (include/module.h, include/imodule.h, include/cinput.h, module.c):

   module ]pتOƱ programmer iHܮea[JsJk䴩A]
   ڤwɶqNӳ:

	1. programmer interface (module.h)
	2. internal implementation (imodule.h)

   Programmer iHz| internal Ӹ`ALuݭnN module.h Yw
   q module_t ƵcnYiCi঳ǤH internal Ӹ`A
   G`惡y@C

   ҿסumodule JγQMΡvOӶqAΥHUҤl:

   ҦpYϥΪ̫U ctrl+alt+1 Ұ cj(ܾe) JkAh xcin |䤺
   cinput ChӿJkñҰʥAwqpU:

=========================================================================
typedef struct cinput_s {
    char *modname;
    char *objname;
    imodule_t *inpmod;
} cinput_t;

cinput_t cinput[MAX_INP_ENTRY];
=========================================================================

   ] xcin  rcfile ]wAϥΪ̦Uϥ cj JkABӿJk
   M gen_inp module,  setkey O 1, ӿJk٨SQJAh cinput 
   epU:

	cinput[1].modname = "gen_inp";
	cinput[1].objname = "cj";
	cinput[1].inpmod = NULL;

   䤤 inpmod OuwJBwM cj oӿJk module, YȤO NULL, 
   ܸӿJkwgJBiHϥΡAh xcin |WϥΥCϤA xcin N
   i汵UӪJu@C

   o xcin | tmodule_t *mod_templet; o list MݦS "gen_inp"
   o module uMҡvC tmodule_t Owqb imodule.h Aݩ internal
   CpGFAhMΡAoɵ{|ھ tmodule_t TA
   @ imodule_t (wqb imodule.h) cA conf data structer,
   object name  "cj", YM cj JkCB cinput[1].inpmod ]|
   VoӷsͥXӪ imodule_t cC

   U@b mod_templet 䤣 "gen_inp" ܡANn dlopen() ۵wЪ 
   gen_inp.so ɸJFCJAN|[J mod_templet list YAMA
   X@ cj Jk imodule_t ӨϥΡC

   oثܭnO: @ module O@ӹB@ (object), uOӮMҡAO
   ǳƳQYӿJkӮMΪA@ module MҥiHQhؤPJkMΡC
   ]Ab module wqA䥻ƵcOsbAӬOnQYӿ
   JkM (Y imodule_t) ɡAtΤ~| malloc() @ŶƵcA
   å rcfile ŪtŪJ]w (ШHU)C



----------------------------------------
B. Ƶc (include/module.h):

   ѩ include/module.h wqF xcin module A include/xcintool.h 
   iF xcin u禡Ao .h ɳObg xcin module ɩҥA
   Fyja xcin gsҲաAڭ̯SO}o .h ɪv: ޾
   xcin Mݩ GPL, HYݭn xcin gsҲծɡAL̥iHHΦ
   ޥγoɪeAӤ|vTL̩ҼgҲժvACԨ CopyRight 
   nC

   n[JsJk module, zunnpUƵcügn禡Yi:

=================================  module.h  ==============================
typedef struct module_s  module_t;
struct module_s {
    char *name;
    char *version;
    char *comments;
    char **valid_objname;
    enum mtype module_type;

    int conf_size;
    int (*init) (void *conf, char *objname, xcin_rc_t *xc);
        /* called when IM first loaded & initialized. */
    int (*xim_init) (void *conf, inpinfo_t *inpinfo);
        /* called when trigger key occures to switch IM. */
    unsigned (*xim_end) (void *conf, inpinfo_t *inpinfo);
        /* called just before xim_init() to leave IM, not necessary */
    unsigned (*keystroke) (void *conf, inpinfo_t *inpinfo, keyinfo_t *keyinfo);
        /* called to input key code, and output chinese char. */
    int (*show_keystroke) (void *conf, simdinfo_t *simdinfo);
        /* called to show the key stroke */
    int (*terminate) (void *conf);
	/* called when xcin is going to exit. */
};
=============================================================================

   Ъ`NAѩ xcin ĥΪO module QJkMΡA[WC@ IC (Input 
   Context, Ш structer @媺) JAWߪ]pAGJ
   kb xcin ҧtNnO@ server, RRaݨӦ xcin
   ШDAðX^C]AҦJk module Ƶc
   : ӿJkγ]wA void *conf ܼƶǤJWz module 禡F
   t@ӬOC IC JAơAoاڭ̨èSN IC cǤJ module
   禡ءAO] IC cٲoAܦhP XIM Ӹ`AӧڧƱCӿ
   Jk module iHPoǲӸ`LAGbON inpinfo_t *inpinfo ǤJ
   ( show_keystroke ӨǤJO simdinfo_t *simdinfo), inpinfo o
   Ƶc]tFثe xcin APJkTAOG̶q޹DC


   1. ӿJkγ]w:

      oǳ]wDnOq rcfile ŪtΪƩҳ]wAPɤ]iHΨӫOs
      xim_init() IsɨӦ xcin_rc_t *xc (Y xcin_rc) һݪơC|@
      Ҥl:

============================================================================
(define cj
        '((SETKEY         1)
          (AUTO_COMPOSE   YES)
          (AUTO_UPCHAR    YES)
          (AUTO_FULLUP    NO)
          (SPACE_AUTOUP   NO)
          (SELKEY_SHIFT   NO)
          (SPACE_IGNORE   NO)
          (SPACE_RESET    YES)
          (AUTO_RESET     NO)
          (END_KEY        NO)
          (WILD_ENABLE    NO)
          (AUTO_SELECT    NO)
          (SINMD_IN_LINE1 NO)
          (BEEP_WRONG     YES)
          (BEEP_DUPCHAR   YES)))
============================================================================

      Wz]wObҰ xcin AXU (Φb IC U) ۦPC
      ѩ cj oӿJkM "gen_inp" module, B "gen_inp" module
      ]iHQLJkҮMΡAOJkbMΫAWzγ]wȤ
      oP cj Jk@ˡCyܻA\hJkiHM "gen_inp"
      module, ϥθ module 禡P\AUOJkγ]wƵc
      }C

      ]AbWY module_t ƵcASuγ]wϡvAۤϪ
      ڭ̦uγ]wϤjpv: int conf_size; oO programmer 
      wA]CӤPJk module 䤽γ]wϸƵciण@ˡC
      tη| module uQYӿJkMΫA~|ھ conf_size 
       module (Jk) t@WߪθƵcϰC

      ܩ module 禡npϥΤθƵcO? UiHݨCӨ禡
      @ void *conf A]NOӸƵc|gѦǤJCWҭzA
      ڭ̦bg{ɡAڭ̥uHUd:

============================================================================
typedef struct {		/* oO module ۩wθƵc */
    char *inpname;
    int  setkey;
    ...........
} my_module_datastr_t;

int my_module_init(void *conf, char *objname, core_config_t *xc)
/* oO module  init() 禡 */
{
    my_module_datastr_t *cf = (my_module_datastr_t *)conf;

    cf->inpname = .....;
    cf->setkey = .....;
}

.................

module_t module_ptr = {
    ......
    sizeof(my_module_datastr_t),	/* oO conf_size  */
    ......
    my_module_init,			/* oO init  */
};
============================================================================

      Ъ`NA̫᪺ module_ptr oӦWrOSA@wnγoӦWrAo
      xcin bϥ dlopen() J module ɡA~ module_t YC
      C


   2. C IC JA:

      C IC JAƬOѦUOJk module P xcin tΦ@P@C
      C X window ǳƱ xcin JɡA xcin N|ͤ@ IC
      Pɤ]|@ inpinfo_t Ƶcxs IC JA:

=============================================================================
typedef struct inpinfo_s  inpinfo_t;
struct inpinfo_s {
    int imid;                           /* ID of current IM Context */
    void *iccf;                         /* Internal data of IM for each IC */

    char *inp_cname;                    /* IM Chinese name */
    char *inp_ename;                    /* IM English name */
    ubyte_t area3_len;                  /* Length of area 3 of window (n_char)*/
    ubyte_t zh_ascii;                   /* The zh_ascii mode */
    unsigned short xcin_wlen;           /* xcin window length */
    unsigned guimode;                   /* GUI mode flag */

    ubyte_t keystroke_len;              /* # chars of keystroke */
    wch_t *s_keystroke;                 /* keystroke printed in area 3 */
    wch_t *suggest_skeystroke;          /* keystroke printed in area 3 */

    ubyte_t n_selkey;                   /* # of selection keys */
    wch_t *s_selkey;                    /* the displayed select keys */
    unsigned short n_mcch;              /* # of chars with the same keystroke */
    wch_t *mcch;                        /* multi-char list */
    ubyte_t *mcch_grouping;             /* grouping of mcch list */
    byte_t mcch_pgstate;                /* page state of multi-char */

    unsigned short n_lcch;              /* # of composed cch list. */
    wch_t *lcch;                        /* composed cch list. */
    unsigned short edit_pos;            /* editing position in lcch list. */
    ubyte_t *lcch_grouping;             /* grouping of lcch list */

    wch_t cch_publish;                  /* A published cch. */
    char *cch;                          /* the string for commit. */
};
=============================================================================

      ӦƵ|ǤJYǯSw module 禡 (p keystroke() 禡)A
      module ѻPBzCC쪺NqpU:

      imid:  ثeϥΥJk module  IMC sC

      iccf:  ɭԷJkҲջݭnC@ IC (ƹWOC@ IMCAC
	  IC iHU۪ IMC, ]iH@Τ@ IMCC structer @媺)
	  UO͸ƵcɡAhӰk: @OۦbӿJkγ]w
	   ( 1 I) ۦ@@ IMC ƦCAMǥ imid ӵ
	  OoǸƦCOݩ󨺨 IMCCt@Ӹ²檺kOQ iccf o
	  ӫСAثe IMC ݪƵcAhCY IMC Qϥ
	  ɡAiccf N۵MݪƵcFC

	  Ъ`NA xcin |z@ЩҫƵcAGznΦ
	  ЮɡAۦTwTuƵcWAӥBѩ inpinfo
	  OҦJk@ΪAGzTwCbJkڡA iccf 
	  VOTC@²檺kOb xim_init() (z)  malloc
	  @Ӱϰ쵹 iccf, Ӧb xim_end() (z) N free C

      inp_cname:  JkWC

      inp_ename:  Jk^WC

      area3_len:  զrϤjp (: ^rӼ)

      zh_ascii:   ثe xcin O_BοJҦHOhȬ 1A_h 0C

      xcin_wlen:  oO xcin ҳ]wAΨӧiDJkҲեثe xcin 
		  סC

      guimode:  JkҲեiHγoܼƨӳ]w GUI tίSwܪA:

	  GUIMOD_SELKEYSPOT:  ثeJkBhrܮɡA]wiHq
		GUI tάO_NCӿ㲴C (Spot light) ܡC

	  GUIMOD_SINMDLINE1:  ]wiHq GUI tΦbLXuJkrXv
		ɡAObӦmLXA٬ObĤ@LXC

	  GUIMOD_LISTCHAR:  Y]w on, h GUI tη|b xcin Ĥ@
		LX inpinfo->lcch rꪺeAîھ inpinfo->edit_pos
		eXЦmAoOΩ bimsphone ҲաAJrɡA
		rä|W] client ءAӬOdb xcin 
		Ĥ@AӴЫhܤFثeJmCY] off, h xcin 
		Ĥ@Nΰhr () ܪCAYCX inpinfo->mcch
		e (pGe)C

      keystroke_len:  ثewJrXסC

      s_keystroke:  ثewJrXAYNܦb xcin ĤGĤG
	  ϪeCЪ`N xcin |@wİϪeAGUJk
	  ۦ@AШe iccf C

      suggest_skeystroke:  JkҲթҫĳ keystroke ܦrCJ
	  ҲեiHMwO_nѦơCΪkO: YJkզrA
	  iHNr㪺 keystroke J buffer C xcin Yo{
	   ksystroke 禡 (Y show_keystroke()) ݪJkP
	  JkۦPɡAN|ĥ suggest_skeystroke e
	  xcin ĤGĤTϪơAӤ|hIsӿJk 
	  show_keystroke() 禡C

	  Ъ`N xcin |@wİϪeAGUJkۦ@
	  AШe iccf C

      n_selkey:  Jkhr䪺ӼơC

      s_selkey:  JkhrCCЪ`N xcin |@w
	  ϪeAGUJkۦ@C

      n_mcch:  ثehr buffer mcch rơC

      mcch:  ثehrCACjpWL n_selkey ȡCЪ`N 
	  xcin |@wİϪeAGUJkۦ@C

      mcch_grouping:  mcch sCCpG mcch_grouping  NULL ɡAhC
	  mcch rY@ӿWߪﶵAB n_mcch Y mcch rơCY
	  mcch_grouping  NULL ɡAhĤ@ mcch_grouping ȥN`@
	  XӿﶵAӨC mcch_grouping ȥNӿﶵb mcch 
	  rơCҦp:

		n_mcch = 9;
		mcch_grouping[5] = {4, 2, 2, 1, 4}
		mcch = {ѮέMR}

	  䤤Ĥ@ 4 YN`@ 4 ӿﶵCh xcin bhrܮɷ|N
	  

		1.  2.Ѯ  3.  4.MR

	  Y mcch P n_mcch eܡA mcch_grouping  NULL, h xcin 
	  |N

		1.  2.  3.  4.  5.  6.  7.M  8.  9.R

	  ]AYb@hrܮɡAzݭn mcch_grouping, GN]
	  NULL YiCYnɡAiHNeJ mcch AåH
	  mcch_grouping UϹjC

      mcch_pgstate:  ܥثehruvAA䤤u@vN xcin 
	  Ĥ@iHܪeסCȥiHpU:

	  MCCH_ONEPG:  hr`ƥiHb@ܪ̡C

	  MCCH_BEGIN:  hr`ƶWL@iܡAɥbĤ@C

	  MCCH_MIDDLE: hr`ƶWL@iܡAɥbĤ@P̫@C

	  MCCH_END:  hr`ƶWL@iܡAɥb̫@C

           xcin UܰϦmPNqAШ structer @媺C

      n_lcch:  lcch wİϤr (s) ӼơC

      lcch:  bimsphone ΨLu۵MvJkΨӦCܤwJr
	  wİϡAe guimode -> GUIMOD_LISTCHAR CЪ`N xcin
	  @wİϡAGUJkҲխYnϥΥɡAۦ@C
	  Шe iccf C

      edit_pos:   lcch rCثeЦmAШe
	  guimode -> GUIMOD_LISTCHAR C

      lcch_grouping:  lcch sCCP lcch, n_lcch YP mcch_grouping
	  mcch, n_mcch YO񪺡C@άOb bimsphone 
	  u۵MvJkAbwJrꪺwİϤUХܩuAHN@
	  ӦNqCҦpbwİϤwJF:

		ѮέMR
		--- ---   -------
	  Y lcch_grouping e {4, 2, 2, 1, 4} B n_lcch=9 ɡAh 
	  xcin |ХܦpWuCY lcch_grouping  NULL ɡAh xcin u|e
	  XǦrAӤ|ФW󩳽uC

      cch_publish:  ܥثewզrBiHuGvrCNQΨӰ
	  uJkrܡvΡAzC

      cch:  ΨӦsJkҲշǳ commit  XIM client rCЪ`N xcin
	  @wİϡAGUJkҲխYnϥΥɡAۦ@C


----------------------------------------
C. module_t 컡:

   HUUYᦳХ (*) ̪ܥnA_hiiL (Yi] 0 
   NULL)C

   1. name (*):  ҲզW١C

   2. version (*):  

      ҲժCЪ`NtΪҲժOĥΤrAp "19990217"Ct
      JҲծɡA|ˬdҲժOOPtΪ@ˡAOܫh
      J (]OtΪҲլ[ciw) C]Azn xcin [Js
      ծɡAЪ`Nnwثe xcin ҲթwqPӼgC

   3. comments:

      Ҳժ²uCiHǥ xcin -m <module name> ӦLXAԨ Usage
      @媺C


   4. valid_objname:

      wiΨӮMΦ module JkWCCC̫ᥲH@ NULL item
      CYwAhtΰ] module uQW٬ name Jk (P
      ҲզPW) ҮMΡCCW٥iH *  ? UΦrAҦp:

	{"my_inp", "my_inp_ext_*", "my_inp_ver??", NULL}

      hZOJkW٬ "my_inp", "my_inp_ext_style1", "my_inp_ext_power",
      "my_inp_ver99" .... AiHMΦҲաC

   5. module_type (*):

      ثe xcin uwq@ module_type, bг] MOD_CINPUTC

   6. conf_size (*):  Ҳժγ]wƵcjpC

   7. int (*init) (void *conf, char *objname, xcin_rc_t *xc) (*):

      Ҳժlƨ禡AOΩӼҲղĤ@QJγQYJkMήɤ~IsC
      ȬOnҦlưʧ@APɭnN rcfile һݪŪiӡC
      UѼƷNqpU:

      conf:  Ҳժγ]wƵcСC

      objname:  MΦҲժJk^W١C

      xc:  V xcin_rc_t (xcin ]wƵc) СA@ЦU
            module  xcin T (p locale ]w)Ccw
	   qpU:

	typedef struct {
	    char *lc_ctype;		/* LC_CTYPE locale category name */
	    char *lc_messages;		/* LC_MESSAGES locale category name */
	    char *encoding;		/* encoding name */
	} locale_t;

	typedef struct {
	    char *rcfile;               /* rcfile name. */
	    char *default_dir;          /* Default module directory. */
	    char *user_dir;             /* User data directory. */
	    locale_t locale;            /* Locale name. */
	} xcin_rc_t;

      禡Y\Ǧ^ True, ѶǦ^ FalseC


   8. int (*xim_init) (void *conf, inpinfo_t *inpinfo) (*)

      禡b@ӷs IC (s window ǳƱ xcin J) ͮɡAάY
      IC PJkɳQIsCoɥnnʧ@ IC lơA
      Pɤ]nlƦ IC JA (Y]w inpinfo)C

      Ъ`NAѩ inpinfo Oݩ IC Ƶc@AäݩU module, U 
      module uOΥӻP xcin qӤwCyܻA inpinfo OҦJk 
      module @ΪC]AYӿJkǳƳQY IC ϥήɡA IC K|Is 
      禡Ah禡 inpinfo C]w (]̥ثeȥi
      OWӨϥΥJkҲթҳ]AAΩثeJkҲ)AåB
      n malloc wİϵ inpinfo->iccf, inpinfo->s_keystroke, inpinfo->lcch,
      P inpinfo->cch ϥΡC

      禡Y\Ǧ^ True, ѶǦ^ FalseC


   9. unsigned int (*xim_end) (void *conf, inpinfo_t *inpinfo) (*)

      CY IC ɡAΤPJkɡA xcin bIst@ӿJk 
      xim_init() e|IsثeoӿJk xim_end()Cڭ̥iHb@
      eu@AҦpݭnM free  inpinfo->iccf, inpinfo->s_keystroke, 
      inpinfo->lcch, P inpinfo->cch wİ .... C

      禡Ǧ^ȥiHP keystroke() Ǧ^Ȥ@ˡAGiΩ commit rA
      zC


  10. unsigned int (*keystroke) (void *conf, 
		inpinfo_t *inpinfo, keyinfo_t *keyinfo) (*)

      禡wqJk module rBz覡CCϥΪ̺VJ@ӫA
      xcin K|Is禡Coɥ禡r䪺NqAݭn xcin 
      AAPɱNGǦ^ xcin iBzʧ@C䤤 conf P 
      inpinfo_t peҭzA keyinfo_t cwqpU:

typedef struct {
    KeySym keysym;                      /* X11 key code. */
    unsigned int keystate;              /* X11 key state/modifiers */
    char keystr[16];                    /* X11 key name (in ascii) */
    int keystr_len;                     /* key name length */
} keyinfo_t;


      禡Ǧ^ȥiHOpUN | (bitwise OR) զX:

      IMKEY_ABSORB:  ܥJkNoӦrRRlFA xcin ݭn
		Lʧ@CΪkhbΩզr~C

      IMKEY_COMMIT:  ܥJkwզrAo xcin |N inpinfo->cch
		oӤrǵثe X app,  X app |NoӦrܦb
		WC

      IMKEY_IGNORE:  ܳoӦr糧JkӨOSNqAJk
		BzoӦrA xcin NrѨLBzC

      IMKEY_BELL:  ܥJknD xcin oXu͡v@nC

      IMKEY_BELL2: ܥJknD xcin oXt@ءu͡v@nC{b xcin
		䴩ءu͡vnAq`ΥHNثehriHܡAΪ
		ϥΪ̿J~CJkҲեiHݭn䴩Υu IMKEY_BELL
		iC

      IMKEY_SHIFTESC:  ܥثeϥΪ̦P٫UF shift PLrAӥB
		JkNBzoӦrAӽ xcin Nr/bοJ
		ҲճBzC

      IMKEY_SHIFTPHR:  ܥثeϥΪ̦P٫UF shift PLrAP
		IMKEY_SHIFTESC POAo^oO浹 qphrase ӳBzA]NO
		ֳtyJ\CJkҲեiHݭn䴩\C

      IMKEY_CTRLPHR:  ܥثeϥΪ̦P٫UF ctrl PLrAΨӰ
		tyJ (qphrase)A@λP IMKEY_SHIFTPHR ۦPC

      IMKEY_ALTPHR:  ܥثeϥΪ̦P٫UF alt PLrAΨӰֳt
		yJ (qphrase)A@λP IMKEY_SHIFTPHR ۦPC

      IMKEY_FALLBACKPHR:  ܥثeϥΪ̫UFYrAӦr䥻JkB
		zAGiH浹ֳtyJ (qphrase)A@λP IMKEY_SHIFTPHR
		ۦPC

  11. int (*show_keystroke) (void *conf, simdinfo_t *simdinfo);

      禡ΨܬYӯSwrrXC xcin |ݭnIs禡A
      N禡һݪƸg simdinfo cǤJAHcwqpU:

typedef struct {
    int imid;                           /* ID of current Input Context */
    unsigned short xcin_wlen;           /* xcin window length */
    unsigned short guimode;             /* GUI mode flag */
    wch_t cch_publish;                  /* A published cch. */
    wch_t *s_keystroke;                 /* keystroke of cch_publish returned */
} simdinfo_t;

      䤤 cch_publish Y xcin Ʊ榹禡ܦrXrAөұo
      rXhg s_keystroke Ǧ^ xcin C

      Ъ`NA xcin ä@ s_keystroke wİϡAG禡ۦ@C
      @²檺kO禡ۦŧi@ static wİϡAMN s_keystroke
      VAҦp:

	  static wch_t my_keystroke[BUF_SIZE];
	  simdinfo->s_keystroke = my_keystroke;
	  .........

  12. int (*terminate) (void *conf);

       xcin Nnä[άYӿJk (Ҧp xcin NB@)ApG禡
      wqɡAN|Is禡Jk (Ҳ) i浲eu@Ap
       .... C


----------------------------------------
D. ҲժlƤu@:

ҲժlƤu@ӼhA@OJkĤ@QJϥήɡAN
clơFGOCϥΪ̤즹Jkɪ inpinfo_t cl
Ƥu@CoӤu@OѿJkҲժ int (*init)() P int (*xim_init)() 
Ө禡ӧC

Ӭݫ̪CѩJkҲջP xcin sô޹DOzL inpinfo_t 
cӹFAM inpinfo_t äOݩҲեƵcAOݩ IMC @
C]NOAC IMC ܴJk (]NOϥΪ̤LJk) ɡA
inpinfo_t cN|QsJkӨϥΡC]ACӿJkbCQJϥήɡA
n]@ inpinfo_t eC

ܩe̪A@ӿJkĤ@QJϥήɡAn@lƤu@A
䤤]AFG

1. MwJkW١G

   ѩ xcin-2.5.2 }lAxcinrc ]wɤw䴩 <IM_name>@<encoding> 
   AҦp cj@big5 NYO Big5 sXܾeJkC]

	int (*init) (void *conf, char *objname, xcin_rc_t *xc);

   禡ҶǤJ objname M xcinrc ҳ]wJkW٤@ˡC]
   Mw xcinrc uJkW١C覡Is xcin 禡:

	int get_objenc(char *objname, objenc_t *objenc);

   䤤 objname Y (*init)() ҶǤJ objnameCӦ禡ҶǦ^ objenc_t
   cpU:

typedef struct {
    char objname[50];		/* JkW */
    char encoding[50];		/* XW */
    char objloadname[100];	/* xcinrc ɤҳ]wJkW
				   (Y榡 <IM_name>@<encoding> */
} objenc_t;


2. Ū xcinrc ]w:

   xcinrc ]wŪOg

	int get_resource(char **cmd_list, char *value, int v_size, 
        	         int n_cmd_list)

   IsC䤤 cmd_list ΨӼХ xcinrc ɤYӤp`YӶءCn`NOA
   q`Jk]wObӿJkp`A]NO cmd_list[0] 
   JkW١CҦpAڭ̭nŪܾeJk AUTO_COMPOSE ﶵȮɡA
   b xcinrc ɪ]w:

	(define cj
		'((AUTO_COMPOSE  1)
		  .................))

   h get_resource() Is覡h:

	char *cmd[2], value[256];
	cmd[0] = "cj";
	cmd[1] = "AUTO_COMPOSE";
	if (get_resource(cmd, value, sizeof(value), 2)) {
	    /* we have read the value of AUTO_COMPOSE */
	}
	
   MӡA@ӿJkҲզӨAѩiHQhؿJkMΡAGJkW٬OL
   kƥDAGpWҨ˨ϥ "cj" rCo̤]ઽΤWz
   objname ӥNJA] xcinrc ɪ]w]iOo:

	(define cj@big5
		'((AUTO_COMPOSE  1)
		  .................))

   ]TgkOΥeIs get_objenc() Ǧ^ȨӥNJ:

	objenc_t objenc;
	........ .......

	if (get_objenc(objname, &objenc) == -1)
	    return False;
	cmd[0] = objenc.objloadname;
	............................

   lMWҤ@ˡApKiTaŪ xcinrc ]wFC



T.H.Hsieh
