From: morioka Date: Thu, 6 Mar 1997 12:48:05 +0000 (+0000) Subject: Don't use DEFVAR_LISP for dynamic loading. X-Git-Tag: emacs-canna-199811302358^2~1 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd0e1c6e9d9ad86e0ab180332a969b3e263ae9ab;p=elisp%2Femacs-canna.git Don't use DEFVAR_LISP for dynamic loading. --- diff --git a/canna.c b/canna.c index 475cb01..b878b93 100644 --- a/canna.c +++ b/canna.c @@ -143,7 +143,7 @@ */ #ifndef lint -static char rcs_id[] = "$Id: canna.c,v 1.35.1.1 1997-03-06 12:45:30 morioka Exp $"; +static char rcs_id[] = "$Id: canna.c,v 1.35.1.2 1997-03-06 12:48:05 morioka Exp $"; #endif #include @@ -186,18 +186,24 @@ static int Vcanna_empty_info, Vcanna_through_info; static int Vcanna_underline; static int Vcanna_inhibit_hankakukana; /* hir, 1994.12.5 */ +#ifndef CANNA_EMACS_DL static Lisp_Object Vcanna_kakutei_string; static Lisp_Object Vcanna_kakutei_yomi; static Lisp_Object Vcanna_kakutei_romaji; static Lisp_Object Vcanna_henkan_string; +#endif static int Vcanna_henkan_length; static int Vcanna_henkan_revPos; static int Vcanna_henkan_revLen; +#ifndef CANNA_EMACS_DL static Lisp_Object Vcanna_ichiran_string; +#endif static int Vcanna_ichiran_length; static int Vcanna_ichiran_revPos; static int Vcanna_ichiran_revLen; +#ifndef CANNA_EMACS_DL static Lisp_Object Vcanna_mode_string; +#endif static int IRCP_context; @@ -257,10 +263,19 @@ jrKanjiStatus *ks; } else { /* ³ÎÄꤷ¤¿Ê¸»úÎó */ +#ifndef CANNA_EMACS_DL Vcanna_kakutei_string = make_string(buf, len); +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-kakutei-string"), make_string(buf, len)); +#endif val = make_number(len); /* ³ÎÄꤷ¤¿Ê¸»úÎó¤ÎÆɤߤξðÊó... */ +#ifndef CANNA_EMACS_DL Vcanna_kakutei_yomi = Vcanna_kakutei_romaji = Qnil; +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-kakutei-yomi"), Qnil); + Fset(intern("canna-kakutei-romaji"), Qnil); +#endif if (ks->info & KanjiYomiInfo) { unsigned char *p = buf + len + 1; int yomilen = strlen(p); @@ -268,20 +283,37 @@ jrKanjiStatus *ks; if (len + yomilen + 1 < KEYTOSTRSIZE) { int yomilen2; +#ifndef CANNA_EMACS_DL Vcanna_kakutei_yomi = make_string(p, yomilen); /* ÆÉ¤ß */ +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-kakutei-yomi"), make_string(p, yomilen)); +#endif p += yomilen + 1; yomilen2 = strlen(p); if (len + yomilen + yomilen2 + 2 < KEYTOSTRSIZE) { +#ifndef CANNA_EMACS_DL Vcanna_kakutei_romaji = make_string(p, yomilen2); /* ¥í¡¼¥Þ»ú */ +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-kakutei-romaji"), make_string(p, yomilen2)); +#endif } } } /* ¸õÊäɽ¼¨¤Îʸ»úÎó¤Ç¤¹¡£*/ +#ifndef CANNA_EMACS_DL Vcanna_henkan_string = Qnil; +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-henkan-string"), Qnil); +#endif if (ks->length >= 0) { +#ifndef CANNA_EMACS_DL Vcanna_henkan_string = make_string(ks->echoStr, ks->length); +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-henkan-string"), + make_string(ks->echoStr, ks->length)); +#endif #ifdef CANNA_NEMACS Vcanna_henkan_length = ks->length; Vcanna_henkan_revPos = ks->revPos; @@ -301,9 +333,18 @@ jrKanjiStatus *ks; } /* °ìÍ÷¤Î¾ðÊó */ +#ifndef CANNA_EMACS_DL Vcanna_ichiran_string = Qnil; +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-ichiran-string"), Qnil); +#endif if (ks->info & KanjiGLineInfo && ks->gline.length >= 0) { +#ifndef CANNA_EMACS_DL Vcanna_ichiran_string = make_string(ks->gline.line, ks->gline.length); +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-ichiran-string"), + make_string(ks->gline.line, ks->gline.length)); +#endif #ifdef CANNA_NEMACS Vcanna_ichiran_length = ks->gline.length; Vcanna_ichiran_revPos = ks->gline.revPos; @@ -316,9 +357,18 @@ jrKanjiStatus *ks; } /* ¥â¡¼¥É¤Î¾ðÊó */ +#ifndef CANNA_EMACS_DL Vcanna_mode_string = Qnil; +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-ichiran-string"), Qnil); +#endif if (ks->info & KanjiModeInfo) { +#ifndef CANNA_EMACS_DL Vcanna_mode_string = make_string(ks->mode, strlen(ks->mode)); +#else /* CANNA_EMACS_DL */ + Fset(intern("canna-mode-string"), + make_string(ks->mode, strlen(ks->mode))); +#endif } /* ¤½¤Î¾¤Î¾ðÊó */ @@ -1000,7 +1050,6 @@ static int Vcanna_key_Cntrl_Left = IROHA_KEY_Cntrl_Left; static int Vcanna_key_Cntrl_Right = IROHA_KEY_Cntrl_Right; static int Vcanna_key_Cntrl_Down = IROHA_KEY_Cntrl_Down; -static Lisp_Object VCANNA; /* hir@nec, 1992.5.21 */ #ifdef CANNA_EMACS_DL static struct Lisp_Subr *s_canna_key_proc; @@ -1020,19 +1069,16 @@ static struct Lisp_Subr *s_canna_bunsetu_henkou; static struct Lisp_Subr *s_canna_henkan_kakutei; static struct Lisp_Subr *s_canna_henkan_end; static struct Lisp_Subr *s_canna_henkan_quit; +#else +static Lisp_Object VCANNA; /* hir@nec, 1992.5.21 */ #endif #ifndef CANNA_EMACS_DL syms_of_canna () -#else /* CANNA_EMACS_DL */ -void -emacs_canna_init () -#endif { DEFVAR_LISP ("CANNA", &VCANNA, ""); /* hir@nec, 1992.5.21 */ - VCANNA = Qt; /* hir@nec, 1992.5.21 */ + VCANNA = Qt; /* hir@nec, 1992.5.21 */ -#ifndef CANNA_EMACS_DL defsubr (&Scanna_key_proc); defsubr (&Scanna_initialize); defsubr (&Scanna_finalize); @@ -1045,6 +1091,14 @@ emacs_canna_init () defsubr (&Scanna_query_mode); defsubr (&Scanna_set_bunsetsu); #else /* CANNA_EMACS_DL */ +void +emacs_canna_init () +{ + Lisp_Object sym; + + sym = intern("CANNA"); + XSYMBOL (sym)->value = Qt; + s_canna_key_proc = (struct Lisp_Subr *)xmalloc (sizeof (struct Lisp_Subr)); bcopy (&Scanna_key_proc, s_canna_key_proc, sizeof (struct Lisp_Subr)); @@ -1109,19 +1163,33 @@ emacs_canna_init () defsubr (s_canna_set_bunsetsu); #endif +#ifndef CANNA_EMACS_DL DEFVAR_LISP("canna-kakutei-string", &Vcanna_kakutei_string, ""); DEFVAR_LISP("canna-kakutei-yomi", &Vcanna_kakutei_yomi, ""); DEFVAR_LISP("canna-kakutei-romaji", &Vcanna_kakutei_romaji, ""); DEFVAR_LISP("canna-henkan-string", &Vcanna_henkan_string, ""); +#else /* CANNA_EMACS_DL */ + sym = intern("canna-kakutei-string"); sym = Qnil; + sym = intern("canna-kakutei-yomi"); sym = Qnil; + sym = intern("canna-kakutei-romaji"); sym = Qnil; + sym = intern("canna-henkan-string"); sym = Qnil; +#endif DEFVAR_INT ("canna-henkan-length", &Vcanna_henkan_length, ""); DEFVAR_INT ("canna-henkan-revpos", &Vcanna_henkan_revPos, ""); DEFVAR_INT ("canna-henkan-revlen", &Vcanna_henkan_revLen, ""); +#ifndef CANNA_EMACS_DL DEFVAR_LISP("canna-ichiran-string", &Vcanna_ichiran_string, ""); +#else /* CANNA_EMACS_DL */ + sym = intern("canna-ichiran-string"); sym = Qnil; +#endif DEFVAR_INT ("canna-ichiran-length", &Vcanna_ichiran_length, ""); DEFVAR_INT ("canna-ichiran-revpos", &Vcanna_ichiran_revPos, ""); DEFVAR_INT ("canna-ichiran-revlen", &Vcanna_ichiran_revLen, ""); +#ifndef CANNA_EMACS_DL DEFVAR_LISP("canna-mode-string", &Vcanna_mode_string, ""); - +#else /* CANNA_EMACS_DL */ + sym = intern("canna-mode-string"); sym = Qnil; +#endif DEFVAR_BOOL ("canna-empty-info", &Vcanna_empty_info, "For canna"); DEFVAR_BOOL ("canna-through-info", &Vcanna_through_info, "For canna"); DEFVAR_BOOL ("canna-underline", &Vcanna_underline, "For canna");