home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume18 / x11fix16 / part01 < prev    next >
Encoding:
Internet Message Format  |  1992-08-02  |  50.7 KB

  1. Path: uunet!elroy.jpl.nasa.gov!swrinde!mips!msi!dcmartin
  2. From: rws@expo.lcs.mit.edu (Bob Scheifler)
  3. Newsgroups: comp.sources.x
  4. Subject: v18i078: X11R5 public fix #16, Part01/03
  5. Message-ID: <csx-18i078-X11-fix16@uunet.UU.NET>
  6. Date: 3 Aug 92 14:38:30 GMT
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. Lines: 1791
  10. Approved: dcmartin@msi.com
  11. Originator: dcmartin@fascet
  12.  
  13. Submitted-by: Bob Scheifler <rws@expo.lcs.mit.edu>
  14. Posting-number: Volume 18, Issue 78
  15. Archive-name: X11-fix16/part01
  16.  
  17. Fix 16 corrects the following problems:
  18.  
  19. Xlib: fix-14 was generated against the wrong version of one file, introducing
  20.     a free of static memory
  21. Xlib: (Xsi) XSetICValues does not permit changing XNResource{Name,Class}
  22. Xlib: (Xsi) _XConvertMBToWC() returns unkindly error code
  23. Xlib: (Xsi) XmbTextPerCharExtents returns wrong ink dimensions
  24. Xlib: (Xsi) X{wc/mb}LookupString don't work at XBufferOverflow
  25. Xlib: (Xsi) close some memory leaks
  26. Xlib: (Ximp) memory destroyed when XGetIMValues is called
  27. Xlib: (Ximp) error processing is incorrect
  28.  
  29. #!/bin/sh
  30. # This is a shell archive (produced by shar 3.50)
  31. # To extract the files from this archive, save it to a file, remove
  32. # everything above the "!/bin/sh" line above, and type "sh file_name".
  33. #
  34. # made 08/03/1992 14:37 UTC by dcmartin@fascet
  35. # Source directory /n/merlin/u2/src/X11R5/fixes
  36. #
  37. # existing files will NOT be overwritten unless -c is specified
  38. #
  39. # This is part 1 of a multipart archive                                    
  40. # do not concatenate these parts, unpack them in order with /bin/sh        
  41. #
  42. # This shar contains:
  43. # length  mode       name
  44. # ------ ---------- ------------------------------------------
  45. # 109408 -rw-r--r-- fix-16
  46. #
  47. if test -r _shar_seq_.tmp; then
  48.     echo 'Must unpack archives in sequence!'
  49.     echo Please unpack part `cat _shar_seq_.tmp` next
  50.     exit 1
  51. fi
  52. # ============= fix-16 ==============
  53. if test -f 'fix-16' -a X"$1" != X"-c"; then
  54.     echo 'x - skipping fix-16 (File already exists)'
  55.     rm -f _shar_wnt_.tmp
  56. else
  57. > _shar_wnt_.tmp
  58. echo 'x - extracting fix-16 (Text)'
  59. sed 's/^X//' << 'SHAR_EOF' > 'fix-16' &&
  60. X              Release 5 Public Patch #16
  61. X               MIT X Consortium
  62. X
  63. To apply this patch:
  64. X
  65. cd to the top of the source tree (to the directory containing the "mit"
  66. and "contrib" subdirectories) and do:
  67. X    patch -p -s < ThisFile
  68. Patch will work silently unless an error occurs.
  69. If you want to watch patch do its thing, leave out the "-s" argument to patch.
  70. X
  71. Finally, to rebuild after applying this patch, cd to the "mit" subdirectory
  72. and do:
  73. X        make -k >& make.log
  74. X
  75. Brief notes on what this patch fixes:
  76. X
  77. XXlib: fix-14 was generated against the wrong version of one file, introducing
  78. X    a free of static memory
  79. XXlib: (Xsi) XSetICValues does not permit changing XNResource{Name,Class}
  80. XXlib: (Xsi) _XConvertMBToWC() returns unkindly error code
  81. XXlib: (Xsi) XmbTextPerCharExtents returns wrong ink dimensions
  82. XXlib: (Xsi) X{wc/mb}LookupString don't work at XBufferOverflow
  83. XXlib: (Xsi) close some memory leaks
  84. XXlib: (Ximp) memory destroyed when XGetIMValues is called
  85. XXlib: (Ximp) error processing is incorrect
  86. X
  87. Prereq: public-patch-15
  88. X
  89. *** /tmp/,RCSt1022087    Sat Aug  1 12:44:11 1992
  90. --- mit/bug-report    Sat Aug  1 12:42:11 1992
  91. ***************
  92. *** 2,8 ****
  93. X  Subject: [area]: [synopsis]   [replace with actual area and short description]
  94. X  
  95. X  VERSION:
  96. !     R5, public-patch-15
  97. X      [MIT public patches will edit this line to indicate the patch level]
  98. X  
  99. X  CLIENT MACHINE and OPERATING SYSTEM:
  100. --- 2,8 ----
  101. X  Subject: [area]: [synopsis]   [replace with actual area and short description]
  102. X  
  103. X  VERSION:
  104. !     R5, public-patch-16
  105. X      [MIT public patches will edit this line to indicate the patch level]
  106. X  
  107. X  CLIENT MACHINE and OPERATING SYSTEM:
  108. *** /tmp/,RCSt1016014    Sat Aug  1 11:32:02 1992
  109. --- mit/lib/X/XcmsInt.c    Sat Aug  1 11:32:06 1992
  110. ***************
  111. *** 1,4 ****
  112. ! /* $XConsortium: XcmsInt.c,v 1.8 91/07/25 01:08:44 rws Exp $" */
  113. X  
  114. X  /*
  115. X   * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
  116. --- 1,4 ----
  117. ! /* $XConsortium: XcmsInt.c,v 1.9 92/01/02 19:27:32 rws Exp $" */
  118. X  
  119. X  /*
  120. X   * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
  121. ***************
  122. *** 268,275 ****
  123. X          (*((XcmsFunctionSet *)ccc->pPerScrnInfo->functionSet)->screenFreeProc)
  124. X              (ccc->pPerScrnInfo->screenData);
  125. X          }
  126. X      }
  127. -     Xfree(ccc->pPerScrnInfo);
  128. X      }
  129. X  
  130. X      /*
  131. --- 268,275 ----
  132. X          (*((XcmsFunctionSet *)ccc->pPerScrnInfo->functionSet)->screenFreeProc)
  133. X              (ccc->pPerScrnInfo->screenData);
  134. X          }
  135. +         Xfree(ccc->pPerScrnInfo);
  136. X      }
  137. X      }
  138. X  
  139. X      /*
  140. *** /tmp/,RCSt1016078    Sat Aug  1 11:32:50 1992
  141. --- mit/lib/X/XcmsLRGB.c    Sat Aug  1 11:32:58 1992
  142. ***************
  143. *** 1,4 ****
  144. ! /* $XConsortium: XcmsLRGB.c,v 1.20 91/08/20 13:51:23 keith Exp $" */
  145. X  
  146. X  /*
  147. X   * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
  148. --- 1,4 ----
  149. ! /* $XConsortium: XcmsLRGB.c,v 1.22 92/01/02 19:28:13 rws Exp $" */
  150. X  
  151. X  /*
  152. X   * Code and supporting documentation (c) Copyright 1990 1991 Tektronix, Inc.
  153. ***************
  154. *** 637,643 ****
  155. X        default:
  156. X          XFree (property_return);
  157. X          goto FreeSCCData;
  158. -         break;
  159. X      }
  160. X  
  161. X      /*
  162. --- 637,642 ----
  163. ***************
  164. *** 835,842 ****
  165. X   *    SYNOPSIS
  166. X   */
  167. X  static void
  168. ! LINEAR_RGB_FreeSCCData(pScreenData)
  169. !     LINEAR_RGB_SCCData *pScreenData;
  170. X  /*
  171. X   *    DESCRIPTION
  172. X   *
  173. --- 834,841 ----
  174. X   *    SYNOPSIS
  175. X   */
  176. X  static void
  177. ! LINEAR_RGB_FreeSCCData(pScreenDataTemp)
  178. !     XPointer pScreenDataTemp;
  179. X  /*
  180. X   *    DESCRIPTION
  181. X   *
  182. ***************
  183. *** 846,852 ****
  184. X   *
  185. X   */
  186. X  {
  187. !     if (pScreenData) {
  188. X      if (pScreenData->pRedTbl) {
  189. X          if (pScreenData->pGreenTbl) {
  190. X          if (pScreenData->pRedTbl->pBase != 
  191. --- 845,853 ----
  192. X   *
  193. X   */
  194. X  {
  195. !     LINEAR_RGB_SCCData *pScreenData = (LINEAR_RGB_SCCData *) pScreenDataTemp;
  196. !     if (pScreenData && pScreenData != &Default_RGB_SCCData) {
  197. X      if (pScreenData->pRedTbl) {
  198. X          if (pScreenData->pGreenTbl) {
  199. X          if (pScreenData->pRedTbl->pBase != 
  200. *** /tmp/d11541    Sat Aug  1 10:38:33 1992
  201. --- mit/lib/X/Xsi/TextPerBd.c    Sat Aug  1 10:38:24 1992
  202. ***************
  203. *** 1,5 ****
  204. X  /*
  205. !  * $XConsortium: TextPerBd.c,v 1.15 91/10/08 14:19:10 rws Exp $
  206. X   */
  207. X  
  208. X  /*
  209. --- 1,5 ----
  210. X  /*
  211. !  * $XConsortium: TextPerBd.c,v 1.16 92/07/29 11:39:57 rws Exp $
  212. X   */
  213. X  
  214. X  /*
  215. ***************
  216. *** 114,120 ****
  217. X                          byte2 > fnt->max_char_or_byte2)
  218. X                          ind = 0;
  219. X                      else
  220. !                         ind  = (byte1 - fnt->min_byte1) * d + byte2;
  221. X                  }
  222. X                  if (fnt->per_char != NULL)
  223. X                      onechar = fnt->per_char + ind;
  224. --- 114,121 ----
  225. X                          byte2 > fnt->max_char_or_byte2)
  226. X                          ind = 0;
  227. X                      else
  228. !                         ind  = (byte1 - fnt->min_byte1) * d
  229. !                  + (byte2 - fnt->min_char_or_byte2);
  230. X                  }
  231. X                  if (fnt->per_char != NULL)
  232. X                      onechar = fnt->per_char + ind;
  233. *** /tmp/d11650    Sat Aug  1 10:39:40 1992
  234. --- mit/lib/X/Xsi/XCnvWCToMB.c    Sat Aug  1 10:39:35 1992
  235. ***************
  236. *** 1,5 ****
  237. X  /*
  238. !  * $XConsortium: XCnvWCToMB.c,v 1.23 92/04/14 15:54:49 rws Exp $
  239. X   */
  240. X  
  241. X  /*
  242. --- 1,5 ----
  243. X  /*
  244. !  * $XConsortium: XCnvWCToMB.c,v 1.24 92/07/29 11:44:21 rws Exp $
  245. X   */
  246. X  
  247. X  /*
  248. ***************
  249. *** 48,54 ****
  250. X  /*
  251. X    _IsValidEscSequence()
  252. X    if str is valid escape sequence returns length of it in bytes.
  253. !   else if str is not valid escape sequence returns -1.
  254. X  
  255. X    ISO 2022
  256. X      6.3.3 Categories of escape sequence
  257. --- 48,55 ----
  258. X  /*
  259. X    _IsValidEscSequence()
  260. X    if str is valid escape sequence returns length of it in bytes.
  261. !   else if str is not valid escape sequence returns BadEncoding.
  262. !   else if str has not enough data returns BadTerminate.
  263. X  
  264. X    ISO 2022
  265. X      6.3.3 Categories of escape sequence
  266. ***************
  267. *** 86,92 ****
  268. X      int i;
  269. X  
  270. X      if (len <= 0)
  271. !     return (-1);
  272. X  
  273. X      if (*str == ESC) {
  274. X      if (len == 1)    /* Only ESC */
  275. --- 87,93 ----
  276. X      int i;
  277. X  
  278. X      if (len <= 0)
  279. !     return (BadTerminate);
  280. X  
  281. X      if (*str == ESC) {
  282. X      if (len == 1)    /* Only ESC */
  283. ***************
  284. *** 98,117 ****
  285. X      } else if (*str >= 0x30 && *str <= 0x7e) {
  286. X          return (2);
  287. X      } else if (*str >= 0x20 && *str <= 0x2f) {
  288. !         for (i++; len > 0; str++,i++, len--) {
  289. X          if (*str >= 0x30 && *str <= 0x7e)
  290. X              return(i);
  291. X          if (*str < 0x20 || *str >= 0x7f)
  292. !             return (-1); /* Not valid Escape seqence */
  293. X          }
  294. !         return (-1);
  295. X      } else {
  296. !         return (-1);
  297. X      }
  298. X      } else if (*str == CSI) {
  299. X      len--; i = 1; str++;
  300. X      } else {
  301. !     return (-1);    /* Not Escape sequence */
  302. X      }
  303. X  
  304. X      if (len == 0)
  305. --- 99,118 ----
  306. X      } else if (*str >= 0x30 && *str <= 0x7e) {
  307. X          return (2);
  308. X      } else if (*str >= 0x20 && *str <= 0x2f) {
  309. !         for (i++, len--, str++; len > 0; str++,i++, len--) {
  310. X          if (*str >= 0x30 && *str <= 0x7e)
  311. X              return(i);
  312. X          if (*str < 0x20 || *str >= 0x7f)
  313. !             return (BadEncoding); /* Not valid Escape seqence */
  314. X          }
  315. !         return (BadTerminate);
  316. X      } else {
  317. !         return (BadEncoding);
  318. X      }
  319. X      } else if (*str == CSI) {
  320. X      len--; i = 1; str++;
  321. X      } else {
  322. !     return (BadEncoding);    /* Not Escape sequence */
  323. X      }
  324. X  
  325. X      if (len == 0)
  326. ***************
  327. *** 121,129 ****
  328. X      if (*str >= 0x40 && *str <= 0x7e)
  329. X          return(i);
  330. X      if (*str < 0x20 || *str >= 0x7f)
  331. !         return (-1); /* Not valid Escape seqence */
  332. X      }
  333. !     return (-1);
  334. X  }
  335. X  
  336. X  
  337. --- 122,130 ----
  338. X      if (*str >= 0x40 && *str <= 0x7e)
  339. X          return(i);
  340. X      if (*str < 0x20 || *str >= 0x7f)
  341. !         return (BadEncoding); /* Not valid Escape seqence */
  342. X      }
  343. !     return (BadTerminate);
  344. X  }
  345. X  
  346. X  
  347. ***************
  348. *** 199,205 ****
  349. X          }
  350. X          continue;
  351. X          }
  352. !         Return(BadEncoding);
  353. X      }
  354. X          /*
  355. X           * filter control characters.
  356. --- 200,206 ----
  357. X          }
  358. X          continue;
  359. X          }
  360. !         Return(len);
  361. X      }
  362. X          /*
  363. X           * filter control characters.
  364. *** /tmp/,RCSt1016201    Sat Aug  1 11:34:06 1992
  365. --- mit/lib/X/Xsi/XConnIM.c    Sat Aug  1 11:34:10 1992
  366. ***************
  367. *** 1,5 ****
  368. X  /*
  369. !  * $XConsortium: XConnIM.c,v 1.17 92/03/03 10:02:09 rws Exp $
  370. X   */
  371. X  
  372. X  /*
  373. --- 1,5 ----
  374. X  /*
  375. !  * $XConsortium: XConnIM.c,v 1.18 92/07/29 13:55:35 rws Exp $
  376. X   */
  377. X  
  378. X  /*
  379. ***************
  380. *** 104,109 ****
  381. --- 104,110 ----
  382. X      im->major_version = (long)ntohl(i);
  383. X      bcopy((char *)(prop + offset_of_minor_version), (char *)&i, version_size);
  384. X      im->minor_version = (long)ntohl(i);
  385. +     Xfree((char *)prop);
  386. X      if (im->major_version != XIM_MAJOR_VERSION) return(False);
  387. X      if (!(im->minor_version >= XIM_MINOR_VERSION)) return(False);
  388. X  
  389. *** /tmp/d11780    Sat Aug  1 10:41:01 1992
  390. --- mit/lib/X/Xsi/XCrIC.c    Sat Aug  1 10:40:55 1992
  391. ***************
  392. *** 1,5 ****
  393. X  /*
  394. !  * $XConsortium: XCrIC.c,v 1.31 92/04/14 15:44:17 rws Exp $
  395. X   */
  396. X  
  397. X  /*
  398. --- 1,5 ----
  399. X  /*
  400. !  * $XConsortium: XCrIC.c,v 1.34 92/07/29 13:54:58 rws Exp $
  401. X   */
  402. X  
  403. X  /*
  404. ***************
  405. *** 41,47 ****
  406. X  # define Va_start(a,b) va_start(a)
  407. X  #endif
  408. X  
  409. ! #if __STDC__ && !defined(VMS)
  410. X  #define RConst const
  411. X  #else
  412. X  #define RConst /**/
  413. --- 41,47 ----
  414. X  # define Va_start(a,b) va_start(a)
  415. X  #endif
  416. X  
  417. ! #if __STDC__ && !defined(NORCONST)
  418. X  #define RConst const
  419. X  #else
  420. X  #define RConst /**/
  421. ***************
  422. *** 88,93 ****
  423. --- 88,95 ----
  424. X      _XUnregisterFilter(im->core.display, ic->core.focus_window,
  425. X                 ic->prototype_filter, (XPointer)ic);
  426. X  
  427. +     if (ic->mb) _XlcFreeLocale(ic->mb);
  428. +     if (ic->wc) _XlcFreeLocale(ic->wc);
  429. X  #ifdef    XML
  430. X      if (ic->xlc_num > 0) {
  431. X      int i;
  432. ***************
  433. *** 97,104 ****
  434. --- 99,112 ----
  435. X          _XlcFreeLocale(ic->wc_temp[i]);
  436. X      }
  437. X      }
  438. +     if (ic->mb_temp) Xfree(ic->mb_temp);
  439. +     if (ic->wc_temp) Xfree(ic->wc_temp);
  440. X      if (ic->values.using_language) Xfree(ic->values.using_language);
  441. +     if (ic->values.current_language) Xfree(ic->values.current_language);
  442. X  #endif    /* XML */
  443. +     if (ic->ct_buf) Xfree(ic->ct_buf);
  444. +     if (ic->wc_buf) Xfree(ic->wc_buf);
  445. +     (void) _XipFreeAllICQueue(ic);
  446. X  }
  447. X  
  448. X  static RConst XICMethodsRec ic_methods = {
  449. ***************
  450. *** 139,146 ****
  451. X      }
  452. X  }
  453. X  
  454. ! static unsigned long
  455. ! _ReadRdb(display, ic, mask, rdb, res_name, res_class)
  456. X      Display *display;
  457. X      XipIC ic;
  458. X      unsigned long mask;
  459. --- 147,154 ----
  460. X      }
  461. X  }
  462. X  
  463. ! unsigned long
  464. ! _XipReadRdb(display, ic, mask, rdb, res_name, res_class)
  465. X      Display *display;
  466. X      XipIC ic;
  467. X      unsigned long mask;
  468. ***************
  469. *** 312,318 ****
  470. X      }
  471. X      im->default_ic->core.im = (XIM)im;
  472. X  
  473. !     im->default_mask = _ReadRdb(im->core.display, im->default_ic,
  474. X                  (unsigned long)0,
  475. X                  im->core.rdb, im->core.res_name,
  476. X                  im->core.res_class);
  477. --- 320,326 ----
  478. X      }
  479. X      im->default_ic->core.im = (XIM)im;
  480. X  
  481. !     im->default_mask = _XipReadRdb(im->core.display, im->default_ic,
  482. X                  (unsigned long)0,
  483. X                  im->core.rdb, im->core.res_name,
  484. X                  im->core.res_class);
  485. ***************
  486. *** 374,380 ****
  487. X      }
  488. X  
  489. X      if (im->core.rdb && ic->values.res_name && ic->values.res_class) {
  490. !     mask |= _ReadRdb(im->core.display, ic, mask, im->core.rdb,
  491. X               ic->values.res_name, ic->values.res_class);
  492. X      }
  493. X      
  494. --- 382,388 ----
  495. X      }
  496. X  
  497. X      if (im->core.rdb && ic->values.res_name && ic->values.res_class) {
  498. !     mask |= _XipReadRdb(im->core.display, ic, mask, im->core.rdb,
  499. X               ic->values.res_name, ic->values.res_class);
  500. X      }
  501. X      
  502. ***************
  503. *** 438,445 ****
  504. X      for (;;) {
  505. X      if ((_XipReadFromIM(im, (char *)&reply1, sz_ximEventReply) < 0) ||
  506. X          (reply1.state == 0xffff)) {
  507. !         Xfree((char *)ic);
  508. !         return(NULL);
  509. X      }
  510. X      if (reply1.detail == XIM_CALLBACK) {
  511. X          /*
  512. --- 446,452 ----
  513. X      for (;;) {
  514. X      if ((_XipReadFromIM(im, (char *)&reply1, sz_ximEventReply) < 0) ||
  515. X          (reply1.state == 0xffff)) {
  516. !         goto _err_ret;
  517. X      }
  518. X      if (reply1.detail == XIM_CALLBACK) {
  519. X          /*
  520. ***************
  521. *** 446,462 ****
  522. X           * Call the callback routines.
  523. X           */
  524. X          if (_XipCallCallbacks(ic) < 0) {
  525. !         Xfree((char *)ic);
  526. !         return(NULL);
  527. X          }
  528. X      } else if (reply1.detail == XIM_IC) {
  529. X          if (_XipReadFromIM(im, (char *)&reply, sz_ximCreateICReply) < 0) {
  530. !         Xfree((char *)ic);
  531. !         return(NULL);
  532. X          }
  533. X          if (reply.state != 0) {
  534. !         Xfree((char *)ic);
  535. !         return(NULL);
  536. X          }
  537. X          ic->icid = reply.xic;
  538. X          break;
  539. --- 453,466 ----
  540. X           * Call the callback routines.
  541. X           */
  542. X          if (_XipCallCallbacks(ic) < 0) {
  543. !         goto _err_ret;
  544. X          }
  545. X      } else if (reply1.detail == XIM_IC) {
  546. X          if (_XipReadFromIM(im, (char *)&reply, sz_ximCreateICReply) < 0) {
  547. !         goto _err_ret;
  548. X          }
  549. X          if (reply.state != 0) {
  550. !         goto _err_ret;
  551. X          }
  552. X          ic->icid = reply.xic;
  553. X          break;
  554. ***************
  555. *** 487,492 ****
  556. --- 491,513 ----
  557. X      }
  558. X  #endif    /* XML */
  559. X      return((XIC)ic);
  560. + _err_ret:
  561. +     if (ic->mb) _XlcFreeLocale(ic->mb);
  562. +     if (ic->wc) _XlcFreeLocale(ic->wc);
  563. + #ifdef  XML
  564. +     if (ic->xlc_num > 0) {
  565. +     for (i = 0; i < ic->xlc_num; i++) {
  566. +         _XlcFreeLocale(ic->mb_temp[i]);
  567. +         _XlcFreeLocale(ic->wc_temp[i]);
  568. +     }
  569. +     }
  570. +     if (ic->mb_temp) Xfree(ic->mb_temp);
  571. +     if (ic->wc_temp) Xfree(ic->wc_temp);
  572. +     if (ic->values.using_language) Xfree(ic->values.using_language);
  573. + #endif  /* XML */
  574. +     Xfree((char *)ic);
  575. +     return(NULL);
  576. X  }
  577. X  
  578. X  /*
  579. *** /tmp/d11909    Sat Aug  1 10:42:19 1992
  580. --- mit/lib/X/Xsi/XICSetVal.c    Sat Aug  1 10:42:14 1992
  581. ***************
  582. *** 1,5 ****
  583. X  /*
  584. !  * $XConsortium: XICSetVal.c,v 1.28 92/04/24 16:14:45 rws Exp $
  585. X   */
  586. X  
  587. X  /*
  588. --- 1,5 ----
  589. X  /*
  590. !  * $XConsortium: XICSetVal.c,v 1.29 92/07/28 17:54:11 rws Exp $
  591. X   */
  592. X  
  593. X  /*
  594. ***************
  595. *** 360,365 ****
  596. --- 360,370 ----
  597. X      err = _XipICSetValues(ic, args, &mask);
  598. X      if (err)
  599. X      return(err);
  600. +     if (im->core.rdb &&
  601. +     (mask & (1L << ICResourceClass | 1L << ICResourceName))) {
  602. +     mask |= _XipReadRdb(im->core.display, ic, mask, im->core.rdb,
  603. +                 ic->values.res_name, ic->values.res_class);
  604. +     }
  605. X      
  606. X      if (mask & (1L << ICFocusWindow)) {
  607. X      _XUnregisterFilter(im->core.display, old_focus_window,
  608. *** /tmp/d11947    Sat Aug  1 10:42:44 1992
  609. --- mit/lib/X/Xsi/XIMKeyBind.c    Sat Aug  1 10:42:40 1992
  610. ***************
  611. *** 1,5 ****
  612. X  /*
  613. !  * $XConsortium: XIMKeyBind.c,v 1.23 92/04/24 16:14:56 rws Exp $
  614. X   */
  615. X  
  616. X  /*
  617. --- 1,5 ----
  618. X  /*
  619. !  * $XConsortium: XIMKeyBind.c,v 1.25 92/07/29 12:10:04 rws Exp $
  620. X   */
  621. X  
  622. X  /*
  623. ***************
  624. *** 51,62 ****
  625. X      int            ret_len, scanned_bytes;
  626. X      int            ret;
  627. X      unsigned char    buf[32];
  628. X  #ifndef X_WCHAR
  629. X      char        *mbuf;
  630. X  #endif
  631. X  
  632. X      if (ev->keycode == 0) {
  633. !     (void)_XipGetNextICQueue(ic, &type, &length, keysym, (char **)&ptr);
  634. X      if (type == XIM_STRING || (type == XIM_KEYSYM && length > 0)) {
  635. X  #ifdef X_WCHAR
  636. X          ret_len = nchars;
  637. --- 51,67 ----
  638. X      int            ret_len, scanned_bytes;
  639. X      int            ret;
  640. X      unsigned char    buf[32];
  641. +     KeySym        tmp_ks;
  642. X  #ifndef X_WCHAR
  643. X      char        *mbuf;
  644. X  #endif
  645. X  
  646. X      if (ev->keycode == 0) {
  647. !     if (ev->state > 0) {
  648. !         _XipGetOverflowICQueue(ic, &type, &length, &tmp_ks, (char **)&ptr);
  649. !     } else {
  650. !         _XipGetNextICQueue(ic, &type, &length, &tmp_ks, (char **)&ptr);
  651. !     }
  652. X      if (type == XIM_STRING || (type == XIM_KEYSYM && length > 0)) {
  653. X  #ifdef X_WCHAR
  654. X          ret_len = nchars;
  655. ***************
  656. *** 75,103 ****
  657. X          ret_len = mbstowcs(buffer, mbuf, nchars);
  658. X  #endif
  659. X          if (ret_len == nchars)
  660. !             ret = XBufferOverflow;
  661. X          }
  662. X  #endif
  663. !         if (ret < 0) {
  664. X          *status = XBufferOverflow;
  665. X          return(0);
  666. X          }
  667. !         if (type == XIM_STRING)
  668. !         *status = XLookupChars;
  669. !         else
  670. X          *status = XLookupBoth;
  671. X          return(ret_len);
  672. !     } else if (type == XIM_KEYSYM) {
  673. X          *status = XLookupKeySym;
  674. X          return(0);
  675. X      } else {
  676. !         *status = 0;
  677. X          return(0);
  678. X      }
  679. X      } else {
  680. !     ret_len = XLookupString(ev, (char *)buf, 32, keysym, NULL);
  681. X      if (ret_len > 0) {
  682. !         if (*keysym != NoSymbol) {
  683. X          *status = XLookupBoth;
  684. X          } else {
  685. X          *status = XLookupChars;
  686. --- 80,117 ----
  687. X          ret_len = mbstowcs(buffer, mbuf, nchars);
  688. X  #endif
  689. X          if (ret_len == nchars)
  690. !             ret = BadBuffer;
  691. X          }
  692. X  #endif
  693. !         if (ret == BadBuffer) {
  694. !         _XipSaveOverflowICQueue(ic, type, length, tmp_ks, ptr);
  695. !         ev->state = 1;
  696. X          *status = XBufferOverflow;
  697. X          return(0);
  698. +         } else if (ret < 0) {
  699. +         *status = XLookupNone;
  700. +         return(0);
  701. X          }
  702. !         if (type == XIM_KEYSYM && keysym) {
  703. !         *keysym = tmp_ks;
  704. X          *status = XLookupBoth;
  705. +         } else {
  706. +         *status = XLookupChars;
  707. +         }
  708. X          return(ret_len);
  709. !     } else if (type == XIM_KEYSYM && keysym) {
  710. !         *keysym = tmp_ks;
  711. X          *status = XLookupKeySym;
  712. X          return(0);
  713. X      } else {
  714. !         *status = XLookupNone;
  715. X          return(0);
  716. X      }
  717. X      } else {
  718. !     ret_len = XLookupString(ev, (char *)buf, 32, &tmp_ks, NULL);
  719. X      if (ret_len > 0) {
  720. !         if (tmp_ks != NoSymbol && keysym) {
  721. !         *keysym = tmp_ks;
  722. X          *status = XLookupBoth;
  723. X          } else {
  724. X          *status = XLookupChars;
  725. ***************
  726. *** 107,115 ****
  727. X          ret = _XConvertMBToWC(ic->wc, (unsigned char *)buf, ret_len,
  728. X                  (wchar *)buffer, &nchars, &scanned_bytes,
  729. X                  (_State *)NULL);
  730. !         if (ret < 0) {
  731. X          *status = XBufferOverflow;
  732. X          return(0);
  733. X          }
  734. X          ret_len = nchars;
  735. X          /* XXX BUG Need to restore saved status */
  736. --- 121,132 ----
  737. X          ret = _XConvertMBToWC(ic->wc, (unsigned char *)buf, ret_len,
  738. X                  (wchar *)buffer, &nchars, &scanned_bytes,
  739. X                  (_State *)NULL);
  740. !         if (ret == BadBuffer) {
  741. X          *status = XBufferOverflow;
  742. X          return(0);
  743. +         } else if (ret < 0) {
  744. +         *status = XLookupNone;
  745. +         return(0);
  746. X          }
  747. X          ret_len = nchars;
  748. X          /* XXX BUG Need to restore saved status */
  749. ***************
  750. *** 122,128 ****
  751. X  #endif
  752. X  #endif
  753. X      } else {
  754. !         if (*keysym != NoSymbol) {
  755. X          *status = XLookupKeySym;
  756. X          } else {
  757. X          *status = XLookupNone;
  758. --- 139,146 ----
  759. X  #endif
  760. X  #endif
  761. X      } else {
  762. !         if (tmp_ks != NoSymbol && keysym) {
  763. !         *keysym = tmp_ks;
  764. X          *status = XLookupKeySym;
  765. X          } else {
  766. X          *status = XLookupNone;
  767. ***************
  768. *** 147,162 ****
  769. X      unsigned char    *ptr;
  770. X      int            ret_len, scanned_bytes;
  771. X      int            ret;
  772. X  
  773. X      if (ev->keycode == 0) {
  774. !     _XipGetNextICQueue(ic, &type, &length, keysym, (char **)&ptr);
  775. X      if (type == XIM_STRING) {
  776. X          ret_len = nbytes;
  777. X          ret = _XConvertCTToMB(ic->mb, ptr, length, (unsigned char *)buffer,
  778. X                    &ret_len, &scanned_bytes, (_State *)NULL);
  779. !         if (ret < 0) {
  780. X          *status = XBufferOverflow;
  781. X          return(0);
  782. X          }
  783. X          *status = XLookupChars;
  784. X          return(ret_len);
  785. --- 165,190 ----
  786. X      unsigned char    *ptr;
  787. X      int            ret_len, scanned_bytes;
  788. X      int            ret;
  789. +     KeySym        tmp_ks;
  790. X  
  791. X      if (ev->keycode == 0) {
  792. !     if (ev->state > 0) {
  793. !         _XipGetOverflowICQueue(ic, &type, &length, &tmp_ks, (char **)&ptr);
  794. !     } else {
  795. !         _XipGetNextICQueue(ic, &type, &length, &tmp_ks, (char **)&ptr);
  796. !     }
  797. X      if (type == XIM_STRING) {
  798. X          ret_len = nbytes;
  799. X          ret = _XConvertCTToMB(ic->mb, ptr, length, (unsigned char *)buffer,
  800. X                    &ret_len, &scanned_bytes, (_State *)NULL);
  801. !         if (ret == BadBuffer) {
  802. !         _XipSaveOverflowICQueue(ic, type, length, tmp_ks, ptr);
  803. !         ev->state = 1;
  804. X          *status = XBufferOverflow;
  805. X          return(0);
  806. +         } else if (ret < 0) {
  807. +         *status = XLookupNone;
  808. +         return(0);
  809. X          }
  810. X          *status = XLookupChars;
  811. X          return(ret_len);
  812. ***************
  813. *** 167,195 ****
  814. X                        (unsigned char *)buffer,
  815. X                        &ret_len, &scanned_bytes,
  816. X                        (_State *)NULL);
  817. !         if (ret < 0) {
  818. X              *status = XBufferOverflow;
  819. X              return(0);
  820. X          }
  821. !         *status = XLookupBoth;
  822. X          return(length);
  823. X          }
  824. -         *status = XLookupKeySym;
  825. X          return(0);
  826. X      } else {
  827. !         *status = 0;
  828. X          return(0);
  829. X      }
  830. X      } else {
  831. !     ret_len = XLookupString(ev, buffer, nbytes, keysym, NULL);
  832. X      if (ret_len > 0) {
  833. !         if (*keysym != NoSymbol) {
  834. X          *status = XLookupBoth;
  835. X          } else {
  836. X          *status = XLookupChars;
  837. X          }
  838. X      } else {
  839. !         if (*keysym != NoSymbol) {
  840. X          *status = XLookupKeySym;
  841. X          } else {
  842. X          *status = XLookupNone;
  843. --- 195,239 ----
  844. X                        (unsigned char *)buffer,
  845. X                        &ret_len, &scanned_bytes,
  846. X                        (_State *)NULL);
  847. !         if (ret == BadBuffer) {
  848. !             _XipSaveOverflowICQueue(ic, type, length, tmp_ks, ptr);
  849. !             ev->state = 1;
  850. X              *status = XBufferOverflow;
  851. X              return(0);
  852. +         } else if (ret < 0) {
  853. +             *status = XLookupNone;
  854. +             return(0);
  855. X          }
  856. !         if (keysym) {
  857. !             *keysym = tmp_ks;
  858. !             *status = XLookupBoth;
  859. !         } else {
  860. !             *status = XLookupChars;
  861. !         }
  862. X          return(length);
  863. +         } else if (keysym) {
  864. +         *keysym = tmp_ks;
  865. +         *status = XLookupKeySym;
  866. +         } else {
  867. +         *status = XLookupNone;
  868. X          }
  869. X          return(0);
  870. X      } else {
  871. !         *status = XLookupNone;
  872. X          return(0);
  873. X      }
  874. X      } else {
  875. !     ret_len = XLookupString(ev, buffer, nbytes, &tmp_ks, NULL);
  876. X      if (ret_len > 0) {
  877. !         if (tmp_ks != NoSymbol && keysym) {
  878. !         *keysym = tmp_ks;
  879. X          *status = XLookupBoth;
  880. X          } else {
  881. X          *status = XLookupChars;
  882. X          }
  883. X      } else {
  884. !         if (tmp_ks != NoSymbol && keysym) {
  885. !         *keysym = tmp_ks;
  886. X          *status = XLookupKeySym;
  887. X          } else {
  888. X          *status = XLookupNone;
  889. ***************
  890. *** 212,256 ****
  891. X      int            length;
  892. X      char        *ptr;
  893. X      int            ret_len;
  894. X  
  895. X      if (ev->keycode == 0) {
  896. !     _XipGetNextICQueue(ic, &type, &length, keysym, &ptr);
  897. X      if (type == XIM_STRING) {
  898. X          if (length > nbytes) {
  899. X          *status = XBufferOverflow;
  900. X          return(0);
  901. X          }
  902. X          (void)strncpy(buffer, ptr, length);
  903. !         buffer[length] = 0;
  904. X          *status = XLookupChars;
  905. X          return(nbytes);
  906. X      } else if (type == XIM_KEYSYM) {
  907. X          if (length > 0) {
  908. X          if (length > nbytes) {
  909. X              *status = XBufferOverflow;
  910. X              return(0);
  911. X          }
  912. X          (void)strncpy(buffer, ptr, length);
  913. !         buffer[length] = 0;
  914. !         *status = XLookupBoth;
  915. X          return(nbytes);
  916. X          }
  917. -         *status = XLookupKeySym;
  918. X          return(0);
  919. X      } else {
  920. !         *status = 0;
  921. X          return(0);
  922. X      }
  923. X      } else {
  924. !     ret_len = XLookupString(ev, buffer, nbytes, keysym, NULL);
  925. X      if (ret_len > 0) {
  926. !         if (*keysym != NoSymbol) {
  927. X          *status = XLookupBoth;
  928. X          } else {
  929. X          *status = XLookupChars;
  930. X          }
  931. X      } else {
  932. !         if (*keysym != NoSymbol) {
  933. X          *status = XLookupKeySym;
  934. X          } else {
  935. X          *status = XLookupNone;
  936. --- 256,319 ----
  937. X      int            length;
  938. X      char        *ptr;
  939. X      int            ret_len;
  940. +     KeySym        tmp_ks;
  941. X  
  942. X      if (ev->keycode == 0) {
  943. !     if (ev->state > 0) {
  944. !         _XipGetOverflowICQueue(ic, &type, &length, &tmp_ks, (char **)&ptr);
  945. !     } else {
  946. !         _XipGetNextICQueue(ic, &type, &length, &tmp_ks, &ptr);
  947. !     }
  948. X      if (type == XIM_STRING) {
  949. X          if (length > nbytes) {
  950. +         _XipSaveOverflowICQueue(ic, type, length, tmp_ks, ptr);
  951. +         ev->state = 1;
  952. X          *status = XBufferOverflow;
  953. X          return(0);
  954. X          }
  955. X          (void)strncpy(buffer, ptr, length);
  956. !         if (length < nbytes) buffer[length] = 0;
  957. X          *status = XLookupChars;
  958. X          return(nbytes);
  959. X      } else if (type == XIM_KEYSYM) {
  960. X          if (length > 0) {
  961. X          if (length > nbytes) {
  962. +             _XipSaveOverflowICQueue(ic, type, length, tmp_ks, ptr);
  963. +             ev->state = 1;
  964. X              *status = XBufferOverflow;
  965. X              return(0);
  966. X          }
  967. X          (void)strncpy(buffer, ptr, length);
  968. !         if (length < nbytes) buffer[length] = 0;
  969. !         if (keysym) {
  970. !             *keysym = tmp_ks;
  971. !             *status = XLookupBoth;
  972. !         } else {
  973. !             *status = XLookupChars;
  974. !         }
  975. X          return(nbytes);
  976. +         } else if (keysym) {
  977. +         *status = XLookupKeySym;
  978. +         } else {
  979. +         *status = XLookupNone;
  980. X          }
  981. X          return(0);
  982. X      } else {
  983. !         *status = XLookupNone;
  984. X          return(0);
  985. X      }
  986. X      } else {
  987. !     ret_len = XLookupString(ev, buffer, nbytes, &tmp_ks, NULL);
  988. X      if (ret_len > 0) {
  989. !         if (tmp_ks != NoSymbol && keysym) {
  990. !         *keysym = tmp_ks;
  991. X          *status = XLookupBoth;
  992. X          } else {
  993. X          *status = XLookupChars;
  994. X          }
  995. X      } else {
  996. !         if (tmp_ks != NoSymbol && keysym) {
  997. !         *keysym = tmp_ks;
  998. X          *status = XLookupKeySym;
  999. X          } else {
  1000. X          *status = XLookupNone;
  1001. *** /tmp/d12010    Sat Aug  1 10:43:28 1992
  1002. --- mit/lib/X/Xsi/XIMQueue.c    Sat Aug  1 10:43:23 1992
  1003. ***************
  1004. *** 1,5 ****
  1005. X  /*
  1006. !  * $XConsortium: XIMQueue.c,v 1.9 91/11/17 15:58:54 rws Exp $
  1007. X   */
  1008. X  
  1009. X  /*
  1010. --- 1,5 ----
  1011. X  /*
  1012. !  * $XConsortium: XIMQueue.c,v 1.11 92/07/29 13:55:40 rws Exp $
  1013. X   */
  1014. X  
  1015. X  /*
  1016. ***************
  1017. *** 138,144 ****
  1018. X          if (_XipReadFromIM(im, ic->in->ptr, ic->in->length) < 0)
  1019. X              return(-1);
  1020. X          } else {
  1021. !         (void) strcpy(ic->in->ptr, (char *)str);
  1022. X          }
  1023. X      }
  1024. X      } else if (type == XIM_STRING) {
  1025. --- 138,144 ----
  1026. X          if (_XipReadFromIM(im, ic->in->ptr, ic->in->length) < 0)
  1027. X              return(-1);
  1028. X          } else {
  1029. !         (void) strncpy(ic->in->ptr, (char *)str, length);
  1030. X          }
  1031. X      }
  1032. X      } else if (type == XIM_STRING) {
  1033. ***************
  1034. *** 185,188 ****
  1035. --- 185,252 ----
  1036. X      }
  1037. X  }
  1038. X  
  1039. + void
  1040. + _XipFreeAllICQueue(ic)
  1041. +     XipIC ic;
  1042. + {
  1043. +     register XIMQueue *start = ic->in;
  1044. +     register XIMQueue *p, *f;
  1045. +     for (p = ic->in; p;) {
  1046. X  
  1047. +     if (p->buf_max > 0) Xfree((char *)p->ptr);
  1048. +     f = p;
  1049. +     p = p->next;
  1050. +     Xfree((char *)f);
  1051. +     if (p == start) break;
  1052. +     }
  1053. + }
  1054. + /*
  1055. +  * Save to Overflow Queue
  1056. +  */
  1057. + void
  1058. + _XipSaveOverflowICQueue(ic, type, length, keysym, ptr)
  1059. +     XipIC ic;
  1060. +     short type;
  1061. +     int length;
  1062. +     KeySym keysym;
  1063. +     char *ptr;
  1064. + {
  1065. +     register XIMQueue *q = &ic->overflow;
  1066. +     q->type = type;
  1067. +     q->length = length;
  1068. +     q->keysym = keysym;
  1069. +     q->state = 0;
  1070. +     if (q->length > 0) {
  1071. +     if (q->buf_max < q->length) {
  1072. +         q->ptr = (char *)Xrealloc((char *)q->ptr, (unsigned)q->length);
  1073. +         q->buf_max = q->length;
  1074. +     }
  1075. +     (void) bcopy(ptr, q->ptr, (unsigned)q->length);
  1076. +     }
  1077. + }
  1078. + /*
  1079. +  * Get from Overflow Queue
  1080. +  */
  1081. + void
  1082. + _XipGetOverflowICQueue(ic, type, length, keysym, ptr)
  1083. +     XipIC ic;
  1084. +     short *type;
  1085. +     int *length;
  1086. +     KeySym *keysym;
  1087. +     char **ptr;
  1088. + {
  1089. +     register XIMQueue *q = &ic->overflow;
  1090. +     if (q->type == XIM_STRING || q->type == XIM_KEYSYM) {
  1091. +     *type = q->type;
  1092. +     *length = q->length;
  1093. +     if (keysym != NULL) *keysym = q->keysym;
  1094. +     *ptr = q->ptr;
  1095. +     q->type = 0;
  1096. +     } else {
  1097. +     *type = 0;
  1098. +     }
  1099. + }
  1100. *** /tmp/d12081    Sat Aug  1 10:44:15 1992
  1101. --- mit/lib/X/Xsi/XOpenIM.c    Sat Aug  1 10:44:11 1992
  1102. ***************
  1103. *** 1,5 ****
  1104. X  /*
  1105. !  * $XConsortium: XOpenIM.c,v 1.17 91/08/12 17:20:36 rws Exp $
  1106. X   */
  1107. X  
  1108. X  /*
  1109. --- 1,5 ----
  1110. X  /*
  1111. !  * $XConsortium: XOpenIM.c,v 1.19 92/07/28 17:52:13 rws Exp $
  1112. X   */
  1113. X  
  1114. X  /*
  1115. ***************
  1116. *** 41,47 ****
  1117. X  extern int getuid();
  1118. X  #endif
  1119. X  
  1120. ! #if __STDC__ && !defined(VMS)
  1121. X  #define RConst const
  1122. X  #else
  1123. X  #define RConst /**/
  1124. --- 41,47 ----
  1125. X  extern int getuid();
  1126. X  #endif
  1127. X  
  1128. ! #if __STDC__ && !defined(NORCONST)
  1129. X  #define RConst const
  1130. X  #else
  1131. X  #define RConst /**/
  1132. ***************
  1133. *** 72,80 ****
  1134. X      { XNFocusWindow, sizeof(Window), offset(core.focus_window),
  1135. X        (unsigned short)IMResourceReadWrite, ICFocusWindow },
  1136. X      { XNResourceName, sizeof(char *), offset(values.res_name),
  1137. !       (unsigned short)IMResourceReadWrite, -1 },
  1138. X      { XNResourceClass, sizeof(char *), offset(values.res_class),
  1139. !       (unsigned short)IMResourceReadWrite, -1 },
  1140. X      { XNFilterEvents, sizeof(long), offset(core.filter_events),
  1141. X        (unsigned short)IMResourceRead, ICFilterEvents },
  1142. X      { XNPreeditAttributes, sizeof(ICAttributes *), offset(core.preedit_attr),
  1143. --- 72,80 ----
  1144. X      { XNFocusWindow, sizeof(Window), offset(core.focus_window),
  1145. X        (unsigned short)IMResourceReadWrite, ICFocusWindow },
  1146. X      { XNResourceName, sizeof(char *), offset(values.res_name),
  1147. !       (unsigned short)IMResourceReadWrite, ICResourceName },
  1148. X      { XNResourceClass, sizeof(char *), offset(values.res_class),
  1149. !       (unsigned short)IMResourceReadWrite, ICResourceClass },
  1150. X      { XNFilterEvents, sizeof(long), offset(core.filter_events),
  1151. X        (unsigned short)IMResourceRead, ICFilterEvents },
  1152. X      { XNPreeditAttributes, sizeof(ICAttributes *), offset(core.preedit_attr),
  1153. *** /tmp/d12485    Sat Aug  1 10:48:37 1992
  1154. --- mit/lib/X/Xsi/XIMlibint.h    Sat Aug  1 10:48:32 1992
  1155. ***************
  1156. *** 1,5 ****
  1157. X  /*
  1158. !  * $XConsortium: XIMlibint.h,v 1.11 91/11/17 15:59:01 rws Exp $
  1159. X   */
  1160. X  
  1161. X  /*
  1162. --- 1,5 ----
  1163. X  /*
  1164. !  * $XConsortium: XIMlibint.h,v 1.13 92/07/29 13:55:45 rws Exp $
  1165. X   */
  1166. X  
  1167. X  /*
  1168. ***************
  1169. *** 60,65 ****
  1170. --- 60,68 ----
  1171. X  extern void    _XipFreeNextICQueue();
  1172. X  extern int    _XipPutICQueue();
  1173. X  extern void    _XipGetNextICQueue();
  1174. + extern void    _XipFreeAllICQueue();
  1175. + extern void    _XipSaveOverflowICQueue();
  1176. + extern void    _XipGetOverflowICQueue();
  1177. X  extern int    _XipWriteToIM();
  1178. X  extern int    _XipReadFromIM();
  1179. X  extern int    _XipFlushToIM();
  1180. *** /tmp/d12549    Sat Aug  1 10:49:16 1992
  1181. --- mit/lib/X/Xsi/Xi18nint.h    Sat Aug  1 10:49:12 1992
  1182. ***************
  1183. *** 1,5 ****
  1184. X  /*
  1185. !  * $XConsortium: Xi18nint.h,v 1.19 92/04/14 15:45:50 rws Exp $
  1186. X   */
  1187. X  
  1188. X  /*
  1189. --- 1,5 ----
  1190. X  /*
  1191. !  * $XConsortium: Xi18nint.h,v 1.20 92/07/29 11:58:18 rws Exp $
  1192. X   */
  1193. X  
  1194. X  /*
  1195. ***************
  1196. *** 117,123 ****
  1197. X  typedef struct {
  1198. X      XICMethods        methods;        /* method list of this IC */
  1199. X      XICCoreRec        core;            /* core data of this IC */
  1200. !     struct _XIMQueue    *in, *out, *prev;
  1201. X      Bool        (*prototype_filter)();
  1202. X      XLocale        mb;
  1203. X      XLocale        wc;
  1204. --- 117,123 ----
  1205. X  typedef struct {
  1206. X      XICMethods        methods;        /* method list of this IC */
  1207. X      XICCoreRec        core;            /* core data of this IC */
  1208. !     struct _XIMQueue    *in, *out, *prev, overflow;
  1209. X      Bool        (*prototype_filter)();
  1210. X      XLocale        mb;
  1211. X      XLocale        wc;
  1212. *** /tmp/d13599    Sat Aug  1 11:05:16 1992
  1213. --- mit/lib/X/Ximp/XIMProto.h    Sat Aug  1 11:05:12 1992
  1214. ***************
  1215. *** 1,4 ****
  1216. ! /* $XConsortium: XIMProto.h,v 1.5 92/04/14 13:28:34 rws Exp $ */
  1217. X  /******************************************************************
  1218. X  
  1219. X                Copyright 1991, 1992 by FUJITSU LIMITED
  1220. --- 1,4 ----
  1221. ! /* $XConsortium: XIMProto.h,v 1.6 92/07/29 10:15:02 rws Exp $ */
  1222. X  /******************************************************************
  1223. X  
  1224. X                Copyright 1991, 1992 by FUJITSU LIMITED
  1225. ***************
  1226. *** 28,34 ****
  1227. X  ******************************************************************/
  1228. X  
  1229. X  /* Ximp implementation revision */
  1230. ! #define XIMP_REVISION "Ximp Revision 3.2"
  1231. X  
  1232. X  /* Ximp Protocol Version */
  1233. X  #define XIMP_PROTOCOL_VERSION "XIMP.3.5"
  1234. --- 28,34 ----
  1235. X  ******************************************************************/
  1236. X  
  1237. X  /* Ximp implementation revision */
  1238. ! #define XIMP_REVISION "Ximp Revision 3.3"
  1239. X  
  1240. X  /* Ximp Protocol Version */
  1241. X  #define XIMP_PROTOCOL_VERSION "XIMP.3.5"
  1242. *** /tmp/d13631    Sat Aug  1 11:05:35 1992
  1243. --- mit/lib/X/Ximp/XimpCallbk.c    Sat Aug  1 11:05:31 1992
  1244. ***************
  1245. *** 1,9 ****
  1246. ! /* $XConsortium: XimpCallbk.c,v 1.5 92/04/14 13:28:40 rws Exp $ */
  1247. X  /******************************************************************
  1248. X  
  1249. X                Copyright 1991, 1992 by Fuji Xerox Co.,Ltd.
  1250. X                Copyright 1991, 1992 by FUJITSU LIMITED
  1251. X                Copyright 1991, 1992 by Sun Microsystems, Inc.
  1252. X  
  1253. X  Permission to use, copy, modify, distribute, and sell this software
  1254. X  and its documentation for any purpose is hereby granted without fee,
  1255. --- 1,10 ----
  1256. ! /* $XConsortium: XimpCallbk.c,v 1.6 92/07/29 10:15:36 rws Exp $ */
  1257. X  /******************************************************************
  1258. X  
  1259. X                Copyright 1991, 1992 by Fuji Xerox Co.,Ltd.
  1260. X                Copyright 1991, 1992 by FUJITSU LIMITED
  1261. X                Copyright 1991, 1992 by Sun Microsystems, Inc.
  1262. +               Copyright 1991, 1992 by Sony Corporation
  1263. X  
  1264. X  Permission to use, copy, modify, distribute, and sell this software
  1265. X  and its documentation for any purpose is hereby granted without fee,
  1266. ***************
  1267. *** 10,36 ****
  1268. X  provided that the above copyright notice appear in all copies and that
  1269. X  both that copyright notice and this permission notice appear in
  1270. X  supporting documentation, and that the name of Fuji Xerox Co.,Ltd.,
  1271. ! FUJITSU LIMITED, Sun Microsystems, Inc. not be used in advertising or
  1272. ! publicity pertaining to distribution of the software without specific,
  1273. ! written prior permission.  Fuji Xerox Co.,Ltd., FUJITSU LIMITED makes
  1274. X  no representations about the suitability of this software for any
  1275. X  purpose.  It is provided "as is" without express or implied warranty.
  1276. X  
  1277. ! FUJI XEROX CO.,LTD., FUJITSU LIMITED, SUN MICROSYSTEMS DISCLAIMS ALL
  1278. ! WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  1279. ! WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL FUJI
  1280. ! XEROX CO.,LTD., FUJITSU LIMITED, SUN MICROSYSTEMS BE LIABLE FOR ANY
  1281. ! SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  1282. X  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  1283. X  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  1284. X  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  1285. X  
  1286. X    Auther: Kazunori Nishihara,  Fuji Xerox Co.,Ltd.
  1287. -                                kaz@ssdev.ksp.fujixerox.co.jp
  1288. X            Takashi Fujiwara     FUJITSU LIMITED
  1289. -                                fujiwara@a80.tech.yk.fujitsu.co.jp
  1290. X            Hideki Hiura         Sun Microsystems, Inc.
  1291. !                                hhiura@Sun.COM
  1292. X  ******************************************************************/
  1293. X  
  1294. X  #define NEED_EVENTS
  1295. --- 11,37 ----
  1296. X  provided that the above copyright notice appear in all copies and that
  1297. X  both that copyright notice and this permission notice appear in
  1298. X  supporting documentation, and that the name of Fuji Xerox Co.,Ltd.,
  1299. ! FUJITSU LIMITED, Sun Microsystems, Inc. and Sony Corporation not be
  1300. ! used in advertising or publicity pertaining to distribution of the
  1301. ! software without specific, written prior permission.
  1302. ! Fuji Xerox Co.,Ltd., FUJITSU LIMITED and Sony Corporation make
  1303. X  no representations about the suitability of this software for any
  1304. X  purpose.  It is provided "as is" without express or implied warranty.
  1305. X  
  1306. ! FUJI XEROX CO.,LTD., FUJITSU LIMITED, SUN MICROSYSTEMS AND
  1307. ! SONY CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  1308. ! INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
  1309. ! IN NO EVENT SHALL FUJI XEROX CO.,LTD., FUJITSU LIMITED,
  1310. ! SUN MICROSYSTEMS AND SONY CORPORATION BE LIABLE FOR ANY SPECIAL,
  1311. ! INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
  1312. X  RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
  1313. X  CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  1314. X  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  1315. X  
  1316. X    Auther: Kazunori Nishihara,  Fuji Xerox Co.,Ltd.
  1317. X            Takashi Fujiwara     FUJITSU LIMITED
  1318. X            Hideki Hiura         Sun Microsystems, Inc.
  1319. !           Makoto Wakamatsu     Sony Corporation
  1320. X  ******************************************************************/
  1321. X  
  1322. X  #define NEED_EVENTS
  1323. ***************
  1324. *** 266,280 ****
  1325. X      }
  1326. X  }
  1327. X  
  1328. ! static int      _time_flag = 0;
  1329. ! #ifdef XIMP_SIGNAL
  1330. ! static int
  1331. ! _time_out()
  1332. X  {
  1333. !     _time_flag = 1;
  1334. X  }
  1335. - #endif                /* XIMP_SIGNAL */
  1336. X  
  1337. X  void
  1338. X  _Ximp_CallPreeditDrawCallback2(xic, event)
  1339. X      Ximp_XIC        xic;
  1340. --- 267,307 ----
  1341. X      }
  1342. X  }
  1343. X  
  1344. ! static Bool
  1345. ! _Ximp_DCMPredicate( d, ev, arg0 )
  1346. ! Display        *d;
  1347. ! XEvent        *ev;
  1348. ! XPointer    arg0;
  1349. X  {
  1350. !     XimpCMPredicateArg    arg = (XimpCMPredicateArg)arg0;
  1351. !     ICID        icid;
  1352. !     int            n;
  1353. !     if( ev->type == ClientMessage ) {
  1354. !     if( ev->xclient.message_type == arg->type ) {
  1355. !         if( ev->xclient.format == 8 ) {
  1356. !         for( icid = 0, n = 0; n < 4; n++ ) {
  1357. !             icid <<= 8;
  1358. !             icid += ev->xclient.data.b[n];
  1359. !         }
  1360. !         if( icid == arg->icid )
  1361. !             return( True );
  1362. !         }
  1363. !         else if( ev->xclient.format == 32  &&
  1364. !              ev->xclient.data.l[0] == XIMP_ERROR  &&
  1365. !              ev->xclient.data.l[1] == arg->icid ) {
  1366. !         return( True );
  1367. !         }
  1368. !     }
  1369. !     }
  1370. !     else if( ev->type == DestroyNotify ) {
  1371. !     if( ev->xdestroywindow.window == arg->owner ) {
  1372. !         return( True );
  1373. !     }
  1374. !     }
  1375. X  }
  1376. X  
  1377. X  void
  1378. X  _Ximp_CallPreeditDrawCallback2(xic, event)
  1379. X      Ximp_XIC        xic;
  1380. ***************
  1381. *** 291,296 ****
  1382. --- 318,324 ----
  1383. X      Atom            type;
  1384. X      int             format;
  1385. X      unsigned long   nitems, after;
  1386. +     XimpCMPredicateArgRec    Arg;
  1387. X  
  1388. X      bzero(&CallData, sizeof(XIMPreeditDrawCallbackStruct));
  1389. X      bzero(&cbtext, sizeof(XIMText));
  1390. ***************
  1391. *** 347,377 ****
  1392. X          /*
  1393. X           * Following Client message must be the preedit string.
  1394. X           */
  1395. ! #ifdef XIMP_SIGNAL
  1396. !         signal(SIGALRM, _time_out);
  1397. !         alarm(XIMP_TIME_OUT);
  1398. ! #endif                /* XIMP_SIGNAL */
  1399. !         while (_time_flag != 1) {
  1400. !         if ((XCheckTypedEvent(xic->core.im->core.display, ClientMessage, &ev)) == False) {
  1401. ! #ifdef XIMP_SIGNAL
  1402. !             sleep(1);
  1403. ! #endif                /* XIMP_SIGNAL */
  1404. !             continue;
  1405. !         }
  1406. !         if (ev.xclient.message_type != ((Ximp_XIM) xic->core.im)->ximp_impart->improtocol_id) {
  1407. !             XPutBackEvent(xic->core.im->core.display, &ev);
  1408. !             continue;
  1409. !         } else {
  1410. ! #ifdef XIMP_SIGNAL
  1411. !             alarm(0);
  1412. ! #endif                /* XIMP_SIGNAL */
  1413. !             break;
  1414. !         }
  1415. !         }
  1416. X  
  1417. X          ctlen = ev.xclient.data.b[4];
  1418. X          length = ctlen * XIMP_MB_CUR_MAX(xic->core.im->core.lcd);
  1419. -         _time_flag = 0;
  1420. X          
  1421. X          if (((Ximp_XIM) xic->core.im)->ximp_impart->use_wchar) {
  1422. X          cbtext.string.wide_char = (wchar_t *) Xmalloc((length + 1) * sizeof(wchar_t));
  1423. --- 375,388 ----
  1424. X          /*
  1425. X           * Following Client message must be the preedit string.
  1426. X           */
  1427. !         Arg.type = ((Ximp_XIM)xic->core.im)->ximp_impart->improtocol_id;
  1428. !         Arg.owner = ((Ximp_XIM)xic->core.im)->ximp_impart->fe_window;
  1429. !         Arg.icid = xic->ximp_icpart->icid;
  1430. !         if( !_XimpIfEvent( xic, &ev, _Ximp_DCMPredicate, (XPointer)&Arg ) )
  1431. !         return;
  1432. X  
  1433. X          ctlen = ev.xclient.data.b[4];
  1434. X          length = ctlen * XIMP_MB_CUR_MAX(xic->core.im->core.lcd);
  1435. X          
  1436. X          if (((Ximp_XIM) xic->core.im)->ximp_impart->use_wchar) {
  1437. X          cbtext.string.wide_char = (wchar_t *) Xmalloc((length + 1) * sizeof(wchar_t));
  1438. ***************
  1439. *** 648,659 ****
  1440. X      Ximp_XIC        xic;
  1441. X      XClientMessageEvent *event;
  1442. X  {
  1443. !     register XIMCallback *cb;
  1444. !     char           *text;
  1445. !     int             length;
  1446. X      XIMStatusDrawCallbackStruct CallData;
  1447. !     XIMText         cbtext;
  1448. !     XEvent          ev;
  1449. X  
  1450. X      cb = &xic->core.status_attr.callbacks.draw;
  1451. X      CallData.type = ToXIMStatusDataType(event->data.l[2]);
  1452. --- 659,671 ----
  1453. X      Ximp_XIC        xic;
  1454. X      XClientMessageEvent *event;
  1455. X  {
  1456. !     register XIMCallback    *cb;
  1457. !     char            *text;
  1458. !     int                     length;
  1459. X      XIMStatusDrawCallbackStruct CallData;
  1460. !     XIMText                 cbtext;
  1461. !     XEvent                  ev;
  1462. !     XimpCMPredicateArgRec    Arg;
  1463. X  
  1464. X      cb = &xic->core.status_attr.callbacks.draw;
  1465. X      CallData.type = ToXIMStatusDataType(event->data.l[2]);
  1466. ***************
  1467. *** 660,687 ****
  1468. X      if (CallData.type == XIMTextType) {
  1469. X      CallData.data.text = &cbtext;
  1470. X  
  1471. ! #ifdef XIMP_SIGNAL
  1472. !     signal(SIGALRM, _time_out);
  1473. !     alarm(XIMP_TIME_OUT);
  1474. ! #endif                /* XIMP_SIGNAL */
  1475. !     while (_time_flag != 1) {
  1476. !         if ((XCheckTypedEvent(xic->core.im->core.display, ClientMessage, &ev)) == False) {
  1477. ! #ifdef XIMP_SIGNAL
  1478. !         sleep(1);
  1479. ! #endif                /* XIMP_SIGNAL */
  1480. !         continue;
  1481. !         }
  1482. !         if (ev.xclient.message_type != ((Ximp_XIM) xic->core.im)->ximp_impart->improtocol_id) {
  1483. !         XPutBackEvent(xic->core.im->core.display, &ev);
  1484. !         continue;
  1485. !         } else {
  1486. ! #ifdef XIMP_SIGNAL
  1487. !         alarm(0);
  1488. ! #endif                /* XIMP_SIGNAL */
  1489. !         break;
  1490. !         }
  1491. !     }
  1492. !     _time_flag = 0;
  1493. X      if (cb->callback) {
  1494. X          length = ev.xclient.data.b[4];
  1495. X          if (((Ximp_XIM) xic->core.im)->ximp_impart->use_wchar) {
  1496. --- 672,683 ----
  1497. X      if (CallData.type == XIMTextType) {
  1498. X      CallData.data.text = &cbtext;
  1499. X  
  1500. !     Arg.type = ((Ximp_XIM)xic->core.im)->ximp_impart->improtocol_id;
  1501. !     Arg.owner = ((Ximp_XIM)xic->core.im)->ximp_impart->fe_window;
  1502. !     Arg.icid = xic->ximp_icpart->icid;
  1503. !     if( !_XimpIfEvent( xic, &ev, _Ximp_DCMPredicate, (XPointer)&Arg ) )
  1504. !         return;
  1505. X      if (cb->callback) {
  1506. X          length = ev.xclient.data.b[4];
  1507. X          if (((Ximp_XIM) xic->core.im)->ximp_impart->use_wchar) {
  1508. *** /tmp/d13727    Sat Aug  1 11:06:32 1992
  1509. --- mit/lib/X/Ximp/XimpIC.c    Sat Aug  1 11:06:28 1992
  1510. ***************
  1511. *** 1,4 ****
  1512. ! /* $XConsortium: XimpIC.c,v 1.6 92/04/14 13:29:06 rws Exp $ */
  1513. X  /******************************************************************
  1514. X  
  1515. X                Copyright 1991, 1992 by FUJITSU LIMITED
  1516. --- 1,4 ----
  1517. ! /* $XConsortium: XimpIC.c,v 1.7 92/07/29 10:15:50 rws Exp $ */
  1518. X  /******************************************************************
  1519. X  
  1520. X                Copyright 1991, 1992 by FUJITSU LIMITED
  1521. ***************
  1522. *** 136,142 ****
  1523. X                          _Ximp_XimFilter_Keypress,
  1524. X                          (XPointer)ic);
  1525. X              ic->ximp_icpart->filter_mode |= 0x1;
  1526. !         }
  1527. X      }
  1528. X      return((XIC)ic);
  1529. X  
  1530. --- 136,147 ----
  1531. X                          _Ximp_XimFilter_Keypress,
  1532. X                          (XPointer)ic);
  1533. X              ic->ximp_icpart->filter_mode |= 0x1;
  1534. !             _XRegisterFilterByType(ic->core.im->core.display,
  1535. !                            ic->core.focus_window,
  1536. !                            ClientMessage, ClientMessage,
  1537. !                            _Ximp_XimFilter_Client, NULL);
  1538. !             ic->ximp_icpart->filter_mode |= 0x2;
  1539. !             }
  1540. X      }
  1541. X      return((XIC)ic);
  1542. X  
  1543. ***************
  1544. *** 162,167 ****
  1545. --- 167,176 ----
  1546. X                     _Ximp_XimFilter_Client, (XPointer)NULL);
  1547. X      }
  1548. X       _Ximp_IM_SendMessage(ic, XIMP_DESTROY, NULL, NULL, NULL);
  1549. +     if( ic->ximp_icpart->preedit_font )
  1550. +         Xfree( ic->ximp_icpart->preedit_font );
  1551. +     if( ic->ximp_icpart->status_font )
  1552. +         Xfree( ic->ximp_icpart->status_font );
  1553. X      Xfree(ic->ximp_icpart);
  1554. X      return;
  1555. X  }
  1556. ***************
  1557. *** 201,222 ****
  1558. X  _Ximp_SetFocusWindow(ic)
  1559. X      Ximp_XIC     ic;
  1560. X  {
  1561. -     Atom         actual_type;
  1562. -     int         actual_format;
  1563. -     unsigned long     nitems, bytes_after;
  1564. -     int        *prop_int;
  1565. -     while(1) {
  1566. -         XGetWindowProperty(ic->core.im->core.display,
  1567. -             ic->core.client_window,
  1568. -             ((Ximp_XIM)ic->core.im)->ximp_impart->focus_win_id,
  1569. -             0L, 1000000L, False, XA_WINDOW,
  1570. -             &actual_type, &actual_format, &nitems, &bytes_after,
  1571. -             (unsigned char **)&prop_int);
  1572. -         if(nitems == 0)
  1573. -             break;
  1574. -         XFree((XPointer)prop_int);
  1575. -         }
  1576. X      XChangeProperty(ic->core.im->core.display, ic->core.client_window,
  1577. X              ((Ximp_XIM)ic->core.im)->ximp_impart->focus_win_id,
  1578. X              XA_WINDOW, 32, PropModeReplace,
  1579. --- 210,215 ----
  1580. ***************
  1581. *** 253,262 ****
  1582. X      Ximp_XIC         ic;
  1583. X  {
  1584. X      Ximp_PreeditPropRec    *preedit_atr;
  1585. -     Atom             actual_type;
  1586. -     int             actual_format;
  1587. -     unsigned long         nitems, bytes_after;
  1588. -     int            *prop_int;
  1589. X      unsigned char         prop_data[XIMP_PREEDIT_MAX_CHAR];
  1590. X  
  1591. X      preedit_atr = &(ic->ximp_icpart->preedit_attr);
  1592. --- 246,251 ----
  1593. ***************
  1594. *** 275,292 ****
  1595. X      _Ximp_AttributesSetL(prop_data, preedit_atr->SpotLocation.x,    48);
  1596. X      _Ximp_AttributesSetL(prop_data, preedit_atr->SpotLocation.y,    52);
  1597. X  
  1598. -     while(1) {
  1599. -         XGetWindowProperty(ic->core.im->core.display,
  1600. -             ic->core.client_window,
  1601. -             ((Ximp_XIM)ic->core.im)->ximp_impart->preedit_atr_id,
  1602. -             0L, 1000000L, False,
  1603. -             ((Ximp_XIM)ic->core.im)->ximp_impart->preedit_atr_id,
  1604. -             &actual_type, &actual_format, &nitems, &bytes_after,
  1605. -             (unsigned char **)(&prop_int));
  1606. -         if(nitems == 0)
  1607. -             break;
  1608. -         XFree((XPointer)prop_int);
  1609. -         }
  1610. X      XChangeProperty(ic->core.im->core.display, ic->core.client_window,
  1611. X              ((Ximp_XIM)ic->core.im)->ximp_impart->preedit_atr_id,
  1612. X              ((Ximp_XIM)ic->core.im)->ximp_impart->preedit_atr_id,
  1613. --- 264,269 ----
  1614. ***************
  1615. *** 298,320 ****
  1616. X  _Ximp_SetPreeditFont(ic)
  1617. X      Ximp_XIC         ic;
  1618. X  {
  1619. -     Atom            actual_type;
  1620. -     int            actual_format;
  1621. -     unsigned long        nitems, bytes_after;
  1622. -     char            *prop;
  1623. X      if (ic->core.preedit_attr.fontset != NULL) {
  1624. -         while(1) {
  1625. -         XGetWindowProperty(ic->core.im->core.display,
  1626. -             ic->core.client_window,
  1627. -             ((Ximp_XIM)ic->core.im)->ximp_impart->preeditfont_id,
  1628. -             0L, 1000000L, False, XA_STRING,
  1629. -             &actual_type, &actual_format, &nitems, &bytes_after,
  1630. -             (unsigned char **)&prop);
  1631. -         if(nitems == 0)
  1632. -             break;
  1633. -         XFree((XPointer)prop);
  1634. -             }
  1635. X          XChangeProperty(ic->core.im->core.display, ic->core.client_window,
  1636. X              ((Ximp_XIM)ic->core.im)->ximp_impart->preeditfont_id,
  1637. X              XA_STRING, 8, PropModeReplace,
  1638. --- 275,281 ----
  1639. ***************
  1640. *** 329,338 ****
  1641. X      Ximp_XIC         ic;
  1642. X  {
  1643. X      Ximp_StatusPropRec    *status_atr;
  1644. -     Atom             actual_type;
  1645. -     int             actual_format;
  1646. -     unsigned long         nitems, bytes_after;
  1647. -     int            *prop_int;
  1648. X      unsigned char         prop_data[XIMP_STATUS_MAX_CHAR];
  1649. X  
  1650. X      status_atr = &(ic->ximp_icpart->status_attr);
  1651. --- 290,295 ----
  1652. ***************
  1653. *** 350,367 ****
  1654. X      _Ximp_AttributesSetL(prop_data, status_atr->AreaNeeded.height, 44);
  1655. X      _Ximp_AttributesSetL(prop_data, status_atr->window,            48);
  1656. X  
  1657. -     while(1) {
  1658. -         XGetWindowProperty(ic->core.im->core.display,
  1659. -             ic->core.client_window,
  1660. -             ((Ximp_XIM)ic->core.im)->ximp_impart->status_atr_id,
  1661. -             0L, 1000000L, False,
  1662. -             ((Ximp_XIM)ic->core.im)->ximp_impart->status_atr_id,
  1663. -             &actual_type, &actual_format, &nitems, &bytes_after,
  1664. -             (unsigned char **)&prop_int);
  1665. -         if(nitems == 0)
  1666. -             break;
  1667. -         XFree((XPointer)prop_int);
  1668. -         }
  1669. X      XChangeProperty(ic->core.im->core.display, ic->core.client_window,
  1670. X              ((Ximp_XIM)ic->core.im)->ximp_impart->status_atr_id,
  1671. X              ((Ximp_XIM)ic->core.im)->ximp_impart->status_atr_id,
  1672. --- 307,312 ----
  1673. ***************
  1674. *** 373,395 ****
  1675. X  _Ximp_SetStatusFont(ic)
  1676. X      Ximp_XIC        ic;
  1677. X  {
  1678. -     Atom            actual_type;
  1679. -     int            actual_format;
  1680. -     unsigned long        nitems, bytes_after;
  1681. -     char            *prop;
  1682. X      if (ic->core.status_attr.fontset != NULL) {
  1683. -         while(1) {
  1684. -         XGetWindowProperty(ic->core.im->core.display,
  1685. -             ic->core.client_window,
  1686. -             ((Ximp_XIM)ic->core.im)->ximp_impart->statusfont_id,
  1687. -             0L, 1000000L, False, XA_STRING,
  1688. -             &actual_type, &actual_format, &nitems, &bytes_after,
  1689. -             (unsigned char **)&prop);
  1690. -         if(nitems == 0)
  1691. -             break;
  1692. -         XFree((XPointer)prop);
  1693. -         }
  1694. X          XChangeProperty(ic->core.im->core.display, ic->core.client_window,
  1695. X              ((Ximp_XIM)ic->core.im)->ximp_impart->statusfont_id,
  1696. X              XA_STRING, 8, PropModeReplace,
  1697. --- 318,324 ----
  1698. *** /tmp/d13760    Sat Aug  1 11:06:52 1992
  1699. --- mit/lib/X/Ximp/XimpIM.c    Sat Aug  1 11:06:47 1992
  1700. ***************
  1701. *** 1,8 ****
  1702. ! /* $XConsortium: XimpIM.c,v 1.6 92/04/14 13:29:18 rws Exp $ */
  1703. X  /******************************************************************
  1704. X  
  1705. X                Copyright 1991, 1992 by FUJITSU LIMITED
  1706. !               Copyright 1991, 1992 by Sony Corporaion
  1707. X  
  1708. X  Permission to use, copy, modify, distribute, and sell this software
  1709. X  and its documentation for any purpose is hereby granted without fee,
  1710. --- 1,8 ----
  1711. ! /* $XConsortium: XimpIM.c,v 1.8 92/07/29 10:16:10 rws Exp $ */
  1712. X  /******************************************************************
  1713. X  
  1714. X                Copyright 1991, 1992 by FUJITSU LIMITED
  1715. !               Copyright 1991, 1992 by Sony Corporation
  1716. X  
  1717. X  Permission to use, copy, modify, distribute, and sell this software
  1718. X  and its documentation for any purpose is hereby granted without fee,
  1719. ***************
  1720. *** 26,32 ****
  1721. X  PERFORMANCE OF THIS SOFTWARE.
  1722. X  
  1723. X    Author: Takashi Fujiwara     FUJITSU LIMITED 
  1724. !       Makoto Wakamatsu     Sony Corporaion
  1725. X  
  1726. X  ******************************************************************/
  1727. X  
  1728. --- 26,32 ----
  1729. X  PERFORMANCE OF THIS SOFTWARE.
  1730. X  
  1731. X    Author: Takashi Fujiwara     FUJITSU LIMITED 
  1732. !       Makoto Wakamatsu     Sony Corporation
  1733. X  
  1734. X  ******************************************************************/
  1735. X  
  1736. ***************
  1737. *** 156,168 ****
  1738. X          XFree( ximp_impart->process_start_keys->keys_list );
  1739. X          XFree( ximp_impart->process_start_keys );
  1740. X      }
  1741. !     if(ximp_impart->connectserver) {
  1742. !         for(i=0; i < Ximp_Xim_count; i++) {
  1743. !             if(Ximp_Xim_List[i] == im) {
  1744. !                 Ximp_Xim_List[i] = NULL;
  1745. !                 break;
  1746. !             }
  1747. X          }
  1748. X          _Ximp_SetupFreeExtension(im);
  1749. X          _Ximp_SetupFree(ximp_impart->im_proto_vl,
  1750. X                  ximp_impart->im_styles,
  1751. --- 156,168 ----
  1752. X          XFree( ximp_impart->process_start_keys->keys_list );
  1753. X          XFree( ximp_impart->process_start_keys );
  1754. X      }
  1755. !     for(i=0; i < Ximp_Xim_count; i++) {
  1756. !         if(Ximp_Xim_List[i] == im) {
  1757. !             Ximp_Xim_List[i] = NULL;
  1758. !             break;
  1759. X          }
  1760. +     }
  1761. +     if(ximp_impart->connectserver) {
  1762. X          _Ximp_SetupFreeExtension(im);
  1763. X          _Ximp_SetupFree(ximp_impart->im_proto_vl,
  1764. X                  ximp_impart->im_styles,
  1765. ***************
  1766. *** 255,262 ****
  1767. X              XA_STRING, &actual_type, &actual_format, &nitems,
  1768. X              &bytes_after, (unsigned char **)(&prop)) != Success)
  1769. X          return(False);
  1770. !     if((version = Xmalloc((sizeof(char) * nitems + 1))) == NULL)
  1771. X          return(False);
  1772. X      strncpy(version, prop, nitems);
  1773. X      version[nitems] = '\0';
  1774. X      XFree(prop);
  1775. --- 255,264 ----
  1776. X              XA_STRING, &actual_type, &actual_format, &nitems,
  1777. X              &bytes_after, (unsigned char **)(&prop)) != Success)
  1778. X          return(False);
  1779. !     if((version = Xmalloc((sizeof(char) * nitems + 1))) == NULL) {
  1780. SHAR_EOF
  1781. true || echo 'restore of fix-16 failed'
  1782. fi
  1783. echo 'End of  part 1'
  1784. echo 'File fix-16 is continued in part 2'
  1785. echo 2 > _shar_seq_.tmp
  1786. exit 0
  1787. -- 
  1788. Senior Systems Scientist        mail: dcmartin@msi.com
  1789. Molecular Simulations, Inc.        uucp: uunet!dcmartin
  1790. 796 North Pastoria Avenue        at&t: 408/522-9236
  1791. Sunnyvale, California 94086        fax: 408/732-0831
  1792.