home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume18 / X11R5-fix13 / part04 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  50.4 KB

  1. Path: uunet!dtix!darwin.sura.net!mips!msi!dcmartin
  2. From: gildea@EXPO.LCS.MIT.EDU (Stephen Gildea)
  3. Newsgroups: comp.sources.x
  4. Subject: v18i045: X11R5 public fix #13, Part04/05
  5. Message-ID: <1992Jul22.150802.18817@msi.com>
  6. Date: 22 Jul 92 15:08:02 GMT
  7. References: <csx-18i042-X11R5-fix13@uunet.UU.NET>
  8. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  9. Organization: Molecular Simulations, Inc.
  10. Lines: 1642
  11. Approved: dcmartin@msi.com
  12. Originator: dcmartin@fascet
  13.  
  14. Submitted-by: gildea@EXPO.LCS.MIT.EDU (Stephen Gildea)
  15. Posting-number: Volume 18, Issue 45
  16. Archive-name: X11R5-fix13/part04
  17.  
  18. #!/bin/sh
  19. # this is part.04 (part 4 of a multipart archive)
  20. # do not concatenate these parts, unpack them in order with /bin/sh
  21. # file fix-13 continued
  22. #
  23. if test ! -r _shar_seq_.tmp; then
  24.     echo 'Please unpack part 1 first!'
  25.     exit 1
  26. fi
  27. (read Scheck
  28.  if test "$Scheck" != 4; then
  29.     echo Please unpack part "$Scheck" next!
  30.     exit 1
  31.  else
  32.     exit 0
  33.  fi
  34. ) < _shar_seq_.tmp || exit 1
  35. if test ! -f _shar_wnt_.tmp; then
  36.     echo 'x - still skipping fix-13'
  37. else
  38. echo 'x - continuing file fix-13'
  39. sed 's/^X//' << 'SHAR_EOF' >> 'fix-13' &&
  40. ***************
  41. *** 524,533 ****
  42. X      }
  43. X      authp->authname = 0;
  44. X      authp->authdata = 0;
  45. !     if (index >= 0)
  46. X      {
  47. !     authp->authname = (char *) fsalloc(acp[index].namelen + 1);
  48. !     authp->authdata = (char *) fsalloc(acp[index].datalen + 1);
  49. X      if (!authp->authname || !authp->authdata) {
  50. X          fsfree((char *) authp->authname);
  51. X          fsfree((char *) authp->authdata);
  52. --- 530,539 ----
  53. X      }
  54. X      authp->authname = 0;
  55. X      authp->authdata = 0;
  56. !     if (index > 0)
  57. X      {
  58. !     authp->authname = (char *) fsalloc(acp[index - 1].namelen + 1);
  59. !     authp->authdata = (char *) fsalloc(acp[index - 1].datalen + 1);
  60. X      if (!authp->authname || !authp->authdata) {
  61. X          fsfree((char *) authp->authname);
  62. X          fsfree((char *) authp->authdata);
  63. ***************
  64. *** 534,542 ****
  65. X          fsfree((char *) authp);
  66. X          goto alloc_failure;
  67. X      }
  68. !     bcopy(acp[index].name, authp->authname, acp[index].namelen);
  69. !     bcopy(acp[index].data, authp->authdata, acp[index].datalen);
  70. X      }
  71. X      authp->acid = stuff->acid;
  72. X      if (!AddResource(client->index, stuff->acid, RT_AUTHCONT,(pointer) authp)) 
  73. X      {
  74. --- 540,550 ----
  75. X          fsfree((char *) authp);
  76. X          goto alloc_failure;
  77. X      }
  78. !     bcopy(acp[index - 1].name, authp->authname, acp[index - 1].namelen);
  79. !     bcopy(acp[index - 1].data, authp->authdata, acp[index - 1].datalen);
  80. X      }
  81. +     else
  82. +     size = 0;
  83. X      authp->acid = stuff->acid;
  84. X      if (!AddResource(client->index, stuff->acid, RT_AUTHCONT,(pointer) authp)) 
  85. X      {
  86. ***************
  87. *** 549,559 ****
  88. X      DEALLOCATE_LOCAL(acp);
  89. X      rep.type = FS_Reply;
  90. X      rep.status = accept;
  91. -     if (index < 0)
  92. -     {
  93. -     size = 0;
  94. -     index = 0;
  95. -     }
  96. X      rep.auth_index = index;
  97. X      rep.sequenceNumber = client->sequence;
  98. X      rep.length = (sizeof(fsCreateACReply) + size) >> 2;
  99. --- 557,562 ----
  100. ***************
  101. *** 566,571 ****
  102. --- 569,575 ----
  103. X      return client->noClientException;
  104. X  }
  105. X  
  106. + /* ARGSUSED */
  107. X  int
  108. X  DeleteAuthCont (value, id)
  109. X      pointer value;
  110. ***************
  111. *** 659,667 ****
  112. X      WriteReplyToClient(client, sizeof(fsGetResolutionReply), &reply);
  113. X      if (client->swapped)
  114. X      client->pSwapReplyFunc = CopySwap16Write;
  115. -     WriteSwappedDataToClient(client, client->resolutions,
  116. -                (client->num_resolutions * sizeof(fsResolution)));
  117. X  
  118. X      return client->noClientException;
  119. X  }
  120. X  
  121. --- 663,672 ----
  122. X      WriteReplyToClient(client, sizeof(fsGetResolutionReply), &reply);
  123. X      if (client->swapped)
  124. X      client->pSwapReplyFunc = CopySwap16Write;
  125. X  
  126. +     WriteSwappedDataToClient(client,
  127. +        (client->num_resolutions * sizeof(fsResolution)), client->resolutions);
  128. X      return client->noClientException;
  129. X  }
  130. X  
  131. ***************
  132. *** 709,721 ****
  133. X      }
  134. X      if (stuff->format_hint != 0 &&
  135. X          stuff->format_hint & ~ALL_FORMAT_BITS) {
  136. !     SendErrToClient(client, FSBadFormat,
  137. !             (pointer) &stuff->format_hint);
  138. X      return FSBadFormat;
  139. X      }
  140. X      if (stuff->format_mask & ~ALL_FORMAT_MASK_BITS) {
  141. !     SendErrToClient(client, FSBadFormat,
  142. !             (pointer) &stuff->format_mask);
  143. X      return FSBadFormat;
  144. X      }
  145. X      err = OpenFont(client, stuff->fid, stuff->format_hint, stuff->format_mask,
  146. --- 714,724 ----
  147. X      }
  148. X      if (stuff->format_hint != 0 &&
  149. X          stuff->format_hint & ~ALL_FORMAT_BITS) {
  150. !     SendErrToClient(client, FSBadFormat, (pointer) &stuff->format_hint);
  151. X      return FSBadFormat;
  152. X      }
  153. X      if (stuff->format_mask & ~ALL_FORMAT_MASK_BITS) {
  154. !     SendErrToClient(client, FSBadFormat, (pointer) &stuff->format_mask);
  155. X      return FSBadFormat;
  156. X      }
  157. X      err = OpenFont(client, stuff->fid, stuff->format_hint, stuff->format_mask,
  158. ***************
  159. *** 750,760 ****
  160. X      reply.sequenceNumber = client->sequence;
  161. X  
  162. X      /* get the header */
  163. !     err = LoadFontHeader(&cfp->font->info, &reply.header, &prop_info);
  164. X  
  165. !     if (err != Successful) {
  166. !     SendErrToClient(client, FontToFSError(err), (pointer) NULL);
  167. X      return err;
  168. X      }
  169. X      lendata = sizeof(fsPropInfo) +
  170. X      prop_info->num_offsets * sizeof(fsPropOffset) +
  171. --- 753,772 ----
  172. X      reply.sequenceNumber = client->sequence;
  173. X  
  174. X      /* get the header */
  175. !     err = LoadXFontInfo(client, &cfp->font->info, &reply.header, &prop_info);
  176. X  
  177. !     switch (err)
  178. !     {
  179. !     case Successful:
  180. !     break;
  181. !     case AllocError:
  182. !     SendErrToClient(client, FSBadAlloc, (pointer) 0);
  183. X      return err;
  184. +     default:
  185. +     ErrorF("ProcQueryXInfo: unexpected return val %d from LoadXFontInfo",
  186. +            err);
  187. +     SendErrToClient(client, FSBadImplementation, (pointer) 0);
  188. +     return err;
  189. X      }
  190. X      lendata = sizeof(fsPropInfo) +
  191. X      prop_info->num_offsets * sizeof(fsPropOffset) +
  192. ***************
  193. *** 772,778 ****
  194. X  }
  195. X  
  196. X  int
  197. ! ProcQueryXExtents8(client)
  198. X      ClientPtr   client;
  199. X  {
  200. X      ClientFontPtr cfp;
  201. --- 784,790 ----
  202. X  }
  203. X  
  204. X  int
  205. ! ProcQueryXExtents(client)
  206. X      ClientPtr   client;
  207. X  {
  208. X      ClientFontPtr cfp;
  209. ***************
  210. *** 801,807 ****
  211. X  }
  212. X  
  213. X  int
  214. ! ProcQueryXBitmaps8(client)
  215. X      ClientPtr   client;
  216. X  {
  217. X      ClientFontPtr cfp;
  218. --- 813,819 ----
  219. X  }
  220. X  
  221. X  int
  222. ! ProcQueryXBitmaps(client)
  223. X      ClientPtr   client;
  224. X  {
  225. X      ClientFontPtr cfp;
  226. ***************
  227. *** 858,889 ****
  228. X  CloseDownClient(client)
  229. X      ClientPtr   client;
  230. X  {
  231. !     if (client->clientGone == CLIENT_ALIVE) {
  232. X      client->clientGone = CLIENT_GONE;
  233. X      CloseDownConnection(client);
  234. !     FreeClientResources(client);
  235. !     if (ClientIsAsleep(client))
  236. !         ClientSignal(client);
  237. !     if (client->index < nextFreeClientID)
  238. !         nextFreeClientID = client->index;
  239. !     clients[client->index] = NullClient;
  240. !     fsfree(client);
  241. !     --nClients;
  242. X  
  243. X  #ifdef NOTYET
  244. X      /* reset server when last client goes away */
  245. X      if (client->requestVector != InitialVector && nClients == 0)
  246. X          dispatchException |= DE_RESET;
  247. X  #endif
  248. !     } else {
  249. !     FreeClientResources(client);
  250. !     if (ClientIsAsleep(client))
  251. !         ClientSignal(client);
  252. !     if (client->index < nextFreeClientID)
  253. !         nextFreeClientID = client->index;
  254. !     clients[client->index] = NullClient;
  255. !     fsfree(client);
  256. !     }
  257. X  
  258. X  #ifdef DEBUG
  259. X      fprintf(stderr, "Shut down client\n");
  260. --- 870,899 ----
  261. X  CloseDownClient(client)
  262. X      ClientPtr   client;
  263. X  {
  264. !     int client_alive = client->clientGone == CLIENT_ALIVE;
  265. !     if (client_alive) {
  266. X      client->clientGone = CLIENT_GONE;
  267. X      CloseDownConnection(client);
  268. !     }
  269. !     FreeClientResources(client);
  270. !     if (ClientIsAsleep(client))
  271. !     ClientSignal(client);
  272. !     if (client->index < nextFreeClientID)
  273. !     nextFreeClientID = client->index;
  274. !     clients[client->index] = NullClient;
  275. X  
  276. +     if (client_alive) {
  277. +     --nClients;
  278. X  #ifdef NOTYET
  279. X      /* reset server when last client goes away */
  280. X      if (client->requestVector != InitialVector && nClients == 0)
  281. X          dispatchException |= DE_RESET;
  282. X  #endif
  283. !     } 
  284. !     if (currentClient == client)
  285. !     currentClient = serverClient;
  286. !     fsfree(client);
  287. X  
  288. X  #ifdef DEBUG
  289. X      fprintf(stderr, "Shut down client\n");
  290. ***************
  291. *** 987,991 ****
  292. X  MarkClientException(client)
  293. X      ClientPtr   client;
  294. X  {
  295. !     client->noClientException = -1;
  296. X  }
  297. --- 997,1001 ----
  298. X  MarkClientException(client)
  299. X      ClientPtr   client;
  300. X  {
  301. !     client->noClientException = -2;
  302. X  }
  303. *** /tmp/da29150    Tue Jul 14 18:08:45 1992
  304. --- mit/fonts/server/difs/fonts.c    Tue Jul 14 18:08:44 1992
  305. ***************
  306. *** 1,4 ****
  307. ! /* $XConsortium: fonts.c,v 1.8 91/07/18 22:36:11 keith Exp $ */
  308. X  /*
  309. X   * font control
  310. X   */
  311. --- 1,4 ----
  312. ! /* $XConsortium: fonts.c,v 1.13 92/05/28 17:17:15 gildea Exp $ */
  313. X  /*
  314. X   * font control
  315. X   */
  316. ***************
  317. *** 7,31 ****
  318. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  319. X   * Massachusetts Institute of Technology
  320. X   *
  321. !  * Permission to use, copy, modify, and distribute this protoype software
  322. !  * and its documentation to Members and Affiliates of the MIT X Consortium
  323. !  * any purpose and without fee is hereby granted, provided
  324. X   * that the above copyright notice appear in all copies and that both that
  325. X   * copyright notice and this permission notice appear in supporting
  326. X   * documentation, and that the names of Network Computing Devices, Digital or
  327. !  * MIT not be used in advertising or publicity pertaining to distribution of
  328. !  * the software without specific, written prior permission.
  329. X   *
  330. !  * NETWORK COMPUTING DEVICES, DIGITAL AND MIT DISCLAIM ALL WARRANTIES WITH
  331. !  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  332. !  * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, DIGITAL OR MIT BE
  333. !  * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  334. !  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  335. !  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  336. !  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  337. !  *
  338. !  * $NCDId: @(#)fonts.c,v 4.14 1991/06/27 19:01:42 lemke Exp $
  339. !  *
  340. X   */
  341. X  
  342. X  #include        "FS.h"
  343. --- 7,28 ----
  344. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  345. X   * Massachusetts Institute of Technology
  346. X   *
  347. !  * Permission to use, copy, modify, distribute, and sell this software and
  348. !  * its documentation for any purpose is hereby granted without fee, provided
  349. X   * that the above copyright notice appear in all copies and that both that
  350. X   * copyright notice and this permission notice appear in supporting
  351. X   * documentation, and that the names of Network Computing Devices, Digital or
  352. !  * M.I.T. not be used in advertising or publicity pertaining to distribution
  353. !  * of the software without specific, written prior permission.
  354. X   *
  355. !  * NETWORK COMPUTING DEVICES, DIGITAL AND M.I.T. DISCLAIM ALL WARRANTIES WITH
  356. !  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  357. !  * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
  358. !  * DIGITAL OR M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  359. !  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  360. !  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  361. !  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  362. !  * THIS SOFTWARE.
  363. X   */
  364. X  
  365. X  #include        "FS.h"
  366. ***************
  367. *** 40,45 ****
  368. --- 37,43 ----
  369. X  #include    "globals.h"
  370. X  
  371. X  extern void (*ReplySwapVector[NUM_PROC_VECTORS]) ();
  372. + extern FSID FakeClientID();
  373. X  
  374. X  static FontPathElementPtr *font_path_elements = (FontPathElementPtr *) 0;
  375. X  static int  num_fpes = 0;
  376. ***************
  377. *** 153,159 ****
  378. X  }
  379. X  
  380. X  /* ARGSUSED */
  381. ! int
  382. X  FontWakeup(data, count, LastSelectMask)
  383. X      pointer     data;
  384. X      int         count;
  385. --- 151,157 ----
  386. X  }
  387. X  
  388. X  /* ARGSUSED */
  389. ! void
  390. X  FontWakeup(data, count, LastSelectMask)
  391. X      pointer     data;
  392. X      int         count;
  393. ***************
  394. *** 163,176 ****
  395. X      FontPathElementPtr fpe;
  396. X  
  397. X      if (count < 0)
  398. !     return FSSuccess;    /* ignore -1 return from select XXX */
  399. X      /* wake up any fpe's that may be waiting for information */
  400. X      for (i = 0; i < num_slept_fpes; i++) {
  401. X      fpe = slept_fpes[i];
  402. X      (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask);
  403. X      }
  404. -     return FSSuccess;
  405. X  }
  406. X  
  407. X  static Bool
  408. --- 161,172 ----
  409. X      FontPathElementPtr fpe;
  410. X  
  411. X      if (count < 0)
  412. !     return;            /* ignore -1 return from select XXX */
  413. X      /* wake up any fpe's that may be waiting for information */
  414. X      for (i = 0; i < num_slept_fpes; i++) {
  415. X      fpe = slept_fpes[i];
  416. X      (void) (*fpe_functions[fpe->type].wakeup_fpe) (fpe, LastSelectMask);
  417. X      }
  418. X  }
  419. X  
  420. X  static Bool
  421. ***************
  422. *** 581,587 ****
  423. X      int        len;
  424. X      int        type;
  425. X      char       *cp = paths;
  426. -     char       *colon;
  427. X      FontPathElementPtr fpe,
  428. X                 *fplist;
  429. X  
  430. --- 577,582 ----
  431. ***************
  432. *** 705,713 ****
  433. X      ClientPtr   client;
  434. X      LFclosurePtr c;
  435. X  {
  436. !     int         err;
  437. X      fsListFontsReply reply;
  438. !     FontNamesPtr names;
  439. X      FontPathElementPtr fpe;
  440. X      int         stringLens,
  441. X                  i,
  442. --- 700,708 ----
  443. X      ClientPtr   client;
  444. X      LFclosurePtr c;
  445. X  {
  446. !     int         err = Successful;
  447. X      fsListFontsReply reply;
  448. !     FontNamesPtr names = NULL;
  449. X      FontPathElementPtr fpe;
  450. X      int         stringLens,
  451. X                  i,
  452. ***************
  453. *** 840,848 ****
  454. X  {
  455. X      LFclosurePtr c;
  456. X  
  457. -     if (!num_fpes)
  458. -     return FSSuccess;
  459. X      c = make_list_fonts_closure(client, pattern, length, maxnames);
  460. X      if (!c)
  461. X      return FSBadAlloc;
  462. --- 835,840 ----
  463. ***************
  464. *** 851,856 ****
  465. --- 843,851 ----
  466. X      return FSSuccess;
  467. X  }
  468. X  
  469. + static int padlength[4] = {0, 3, 2, 1};
  470. + static char padding[3];
  471. X  do_list_fonts_with_info(client, c)
  472. X      ClientPtr   client;
  473. X      LFWXIclosurePtr c;
  474. ***************
  475. *** 966,972 ****
  476. X          name = c->savedName;
  477. X          namelen = strlen(name);
  478. X          }
  479. !         err = LoadFontHeader(pFontInfo, &hdr, &prop_info);
  480. X          if (err != Successful)
  481. X          break;
  482. X          lenpropdata = sizeof(fsPropInfo) +
  483. --- 961,967 ----
  484. X          name = c->savedName;
  485. X          namelen = strlen(name);
  486. X          }
  487. !         err = LoadXFontInfo(client, pFontInfo, &hdr, &prop_info);
  488. X          if (err != Successful)
  489. X          break;
  490. X          lenpropdata = sizeof(fsPropInfo) +
  491. ***************
  492. *** 975,981 ****
  493. X  
  494. X          reply->type = FS_Reply;
  495. X          reply->length =
  496. !         (sizeof(fsListFontsWithXInfoReply) + sizeof(fsFontHeader) +
  497. X           lenpropdata + namelen + 3) >> 2;
  498. X          reply->sequenceNumber = client->sequence;
  499. X          reply->nameLength = namelen;
  500. --- 970,976 ----
  501. X  
  502. X          reply->type = FS_Reply;
  503. X          reply->length =
  504. !         (sizeof(fsListFontsWithXInfoReply) +
  505. X           lenpropdata + namelen + 3) >> 2;
  506. X          reply->sequenceNumber = client->sequence;
  507. X          reply->nameLength = namelen;
  508. ***************
  509. *** 982,996 ****
  510. X          reply->nReplies = numFonts;
  511. X          reply->header = hdr;
  512. X          WriteReplyToClient(client, sizeof(fsListFontsWithXInfoReply), reply);
  513. -         (void) WriteToClient(client, namelen, name);
  514. X          if (client->swapped)
  515. X          SwapPropInfo(prop_info);
  516. !         (void) WriteToClient(client, lenpropdata, (char *) prop_info);
  517. X          if (pFontInfo == &fontInfo) {
  518. X          fsfree(fontInfo.props);
  519. X          fsfree(fontInfo.isStringProp);
  520. X          }
  521. X          fsfree(prop_info);
  522. X          --c->current.max_names;
  523. X          if (c->current.max_names < 0)
  524. X          abort();
  525. --- 977,1001 ----
  526. X          reply->nReplies = numFonts;
  527. X          reply->header = hdr;
  528. X          WriteReplyToClient(client, sizeof(fsListFontsWithXInfoReply), reply);
  529. X          if (client->swapped)
  530. X          SwapPropInfo(prop_info);
  531. !         if (client->major_version > 1)
  532. !         {
  533. !         (void)WriteToClientUnpadded(client, lenpropdata, (char *) prop_info);
  534. !         (void)WriteToClientUnpadded(client, namelen, name);
  535. !         (void)WriteToClientUnpadded(client,
  536. !                         padlength[(lenpropdata+namelen)&3],
  537. !                         padding);
  538. !         } else {
  539. !         (void) WriteToClient(client, namelen, name);
  540. !         (void) WriteToClient(client, lenpropdata, (char *) prop_info);
  541. !         }
  542. X          if (pFontInfo == &fontInfo) {
  543. X          fsfree(fontInfo.props);
  544. X          fsfree(fontInfo.isStringProp);
  545. X          }
  546. X          fsfree(prop_info);
  547. X          --c->current.max_names;
  548. X          if (c->current.max_names < 0)
  549. X          abort();
  550. ***************
  551. *** 997,1019 ****
  552. X      }
  553. X      }
  554. X  
  555. X      if (err == Successful) {
  556. !     reply = c->reply;
  557. !     length = sizeof(fsListFontsWithXInfoReply);
  558. X      if (c->length < length) {
  559. !         reply = (fsListFontsWithXInfoReply *) fsrealloc(c->reply, length);
  560. !         if (reply) {
  561. !         c->reply = reply;
  562. X          c->length = length;
  563. X          } else
  564. X          err = AllocError;
  565. X      }
  566. X      if (err == Successful) {
  567. !         bzero((char *) reply, sizeof(fsListFontsWithXInfoReply));
  568. !         reply->type = FS_Reply;
  569. !         reply->sequenceNumber = client->sequence;
  570. !         reply->length = sizeof(fsListFontsWithXInfoReply) >> 2;
  571. !         WriteReplyToClient(client, length, reply);
  572. X      }
  573. X      }
  574. X      if (err != Successful)
  575. --- 1002,1032 ----
  576. X      }
  577. X      }
  578. X  
  579. +     /*
  580. +      * send the final reply
  581. +      */
  582. X      if (err == Successful) {
  583. !     fsGenericReply *final_reply;
  584. !     final_reply = (fsGenericReply *)c->reply;
  585. !     if (client->major_version > 1)
  586. !         length = sizeof(fsGenericReply);
  587. !     else
  588. !         length = sizeof(fsListFontsWithXInfoReply);
  589. X      if (c->length < length) {
  590. !         final_reply = (fsGenericReply *) fsrealloc(c->reply, length);
  591. !         if (final_reply) {
  592. !         c->reply = (fsListFontsWithXInfoReply *)final_reply;
  593. X          c->length = length;
  594. X          } else
  595. X          err = AllocError;
  596. X      }
  597. X      if (err == Successful) {
  598. !         final_reply->type = FS_Reply;
  599. !         final_reply->data1 = 0; /* notes that this is final */
  600. !         final_reply->sequenceNumber = client->sequence;
  601. !         final_reply->length = length >> 2;
  602. !         WriteReplyToClient(client, length, final_reply);
  603. X      }
  604. X      }
  605. X      if (err != Successful)
  606. ***************
  607. *** 1128,1138 ****
  608. X  find_old_font(id)
  609. X      FSID        id;
  610. X  {
  611. !     ClientFontPtr cfp;
  612. !     cfp = (ClientFontPtr) LookupIDByType(SERVER_CLIENT, id, RT_NONE);
  613. !     return cfp->font;
  614. X  }
  615. X  
  616. X  Font
  617. --- 1141,1147 ----
  618. X  find_old_font(id)
  619. X      FSID        id;
  620. X  {
  621. !     return (FontPtr) LookupIDByType(SERVER_CLIENT, id, RT_NONE);
  622. X  }
  623. X  
  624. X  Font
  625. ***************
  626. *** 1160,1166 ****
  627. X  
  628. X  init_fs_handlers(fpe, block_handler)
  629. X      FontPathElementPtr fpe;
  630. !     int         (*block_handler) ();
  631. X  {
  632. X      /* if server has reset, make sure the b&w handlers are reinstalled */
  633. X      if (last_server_gen < serverGeneration) {
  634. --- 1169,1175 ----
  635. X  
  636. X  init_fs_handlers(fpe, block_handler)
  637. X      FontPathElementPtr fpe;
  638. !     void         (*block_handler) ();
  639. X  {
  640. X      /* if server has reset, make sure the b&w handlers are reinstalled */
  641. X      if (last_server_gen < serverGeneration) {
  642. ***************
  643. *** 1184,1190 ****
  644. X  
  645. X  remove_fs_handlers(fpe, block_handler, all)
  646. X      FontPathElementPtr fpe;
  647. !     int         (*block_handler) ();
  648. X      Bool        all;
  649. X  {
  650. X      if (all) {
  651. --- 1193,1199 ----
  652. X  
  653. X  remove_fs_handlers(fpe, block_handler, all)
  654. X      FontPathElementPtr fpe;
  655. !     void        (*block_handler) ();
  656. X      Bool        all;
  657. X  {
  658. X      if (all) {
  659. *** /tmp/da29246    Tue Jul 14 18:08:53 1992
  660. --- mit/fonts/server/difs/Imakefile    Tue Jul 14 18:08:52 1992
  661. ***************
  662. *** 1,13 ****
  663. ! XCOMM $XConsortium: Imakefile,v 1.8 91/07/17 16:06:01 gildea Exp $
  664. X  #undef ServerDefines
  665. X  #include <Server.tmpl>
  666. X  
  667. X  SRCS =    main.c dispatch.c extensions.c globals.c events.c tables.c \
  668. !     fontinfo.c swapreq.c swaprep.c resource.c \
  669. X      fonts.c difsutils.c cache.c initfonts.c atom.c
  670. X  
  671. X  OBJS =  main.o dispatch.o extensions.o globals.o events.o tables.o \
  672. !     fontinfo.o swapreq.o swaprep.o resource.o \
  673. X      fonts.o difsutils.o cache.o initfonts.o atom.o
  674. X  
  675. X  
  676. --- 1,13 ----
  677. ! XCOMM $XConsortium: Imakefile,v 1.9 92/05/12 18:08:03 gildea Exp $
  678. X  #undef ServerDefines
  679. X  #include <Server.tmpl>
  680. X  
  681. X  SRCS =    main.c dispatch.c extensions.c globals.c events.c tables.c \
  682. !     fontinfo.c charinfo.c swapreq.c swaprep.c resource.c \
  683. X      fonts.c difsutils.c cache.c initfonts.c atom.c
  684. X  
  685. X  OBJS =  main.o dispatch.o extensions.o globals.o events.o tables.o \
  686. !     fontinfo.o charinfo.o swapreq.o swaprep.o resource.o \
  687. X      fonts.o difsutils.o cache.o initfonts.o atom.o
  688. X  
  689. X  
  690. *** /tmp/da29310    Tue Jul 14 18:08:58 1992
  691. --- mit/fonts/server/difs/swaprep.c    Tue Jul 14 18:08:57 1992
  692. ***************
  693. *** 1,4 ****
  694. ! /* $XConsortium: swaprep.c,v 1.5 91/07/27 02:30:02 keith Exp $ */
  695. X  /*
  696. X   * font server reply swapping
  697. X   */
  698. --- 1,4 ----
  699. ! /* $XConsortium: swaprep.c,v 1.7 92/05/28 16:43:00 gildea Exp $ */
  700. X  /*
  701. X   * font server reply swapping
  702. X   */
  703. ***************
  704. *** 7,32 ****
  705. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  706. X   * Massachusetts Institute of Technology
  707. X   *
  708. !  * Permission to use, copy, modify, and distribute this protoype software
  709. !  * and its documentation to Members and Affiliates of the MIT X Consortium
  710. !  * any purpose and without fee is hereby granted, provided
  711. X   * that the above copyright notice appear in all copies and that both that
  712. X   * copyright notice and this permission notice appear in supporting
  713. X   * documentation, and that the names of Network Computing Devices, Digital or
  714. !  * MIT not be used in advertising or publicity pertaining to distribution of
  715. !  * the software without specific, written prior permission.
  716. X   *
  717. !  * NETWORK COMPUTING DEVICES, DIGITAL AND MIT DISCLAIM ALL WARRANTIES WITH
  718. !  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  719. !  * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, DIGITAL OR MIT BE
  720. !  * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  721. !  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  722. !  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  723. !  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  724. !  *
  725. !  * $NCDId: @(#)swaprep.c,v 4.2 1991/06/27 16:34:43 lemke Exp $
  726. !  *
  727. X   */
  728. X  #include    "FSproto.h"
  729. X  #include    "clientstr.h"
  730. X  #include    "misc.h"
  731. --- 7,30 ----
  732. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  733. X   * Massachusetts Institute of Technology
  734. X   *
  735. !  * Permission to use, copy, modify, distribute, and sell this software and
  736. !  * its documentation for any purpose is hereby granted without fee, provided
  737. X   * that the above copyright notice appear in all copies and that both that
  738. X   * copyright notice and this permission notice appear in supporting
  739. X   * documentation, and that the names of Network Computing Devices, Digital or
  740. !  * M.I.T. not be used in advertising or publicity pertaining to distribution
  741. !  * of the software without specific, written prior permission.
  742. X   *
  743. !  * NETWORK COMPUTING DEVICES, DIGITAL AND M.I.T. DISCLAIM ALL WARRANTIES WITH
  744. !  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  745. !  * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
  746. !  * DIGITAL OR M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  747. !  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  748. !  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  749. !  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  750. !  * THIS SOFTWARE.
  751. X   */
  752. X  #include    "FSproto.h"
  753. X  #include    "clientstr.h"
  754. X  #include    "misc.h"
  755. ***************
  756. *** 321,330 ****
  757. X  }
  758. X  
  759. X  void
  760. ! SQueryXExtents8Reply(client, size, pRep)
  761. X      ClientPtr   client;
  762. X      int         size;
  763. !     fsQueryXExtents8Reply *pRep;
  764. X  {
  765. X      int         n;
  766. X  
  767. --- 319,328 ----
  768. X  }
  769. X  
  770. X  void
  771. ! SQueryXExtentsReply(client, size, pRep)
  772. X      ClientPtr   client;
  773. X      int         size;
  774. !     fsQueryXExtents8Reply *pRep; /* QueryXExtents16Reply is the same */
  775. X  {
  776. X      int         n;
  777. X  
  778. ***************
  779. *** 335,344 ****
  780. X  }
  781. X  
  782. X  void
  783. ! SQueryXBitmaps8Reply(client, size, pRep)
  784. X      ClientPtr   client;
  785. X      int         size;
  786. !     fsQueryXBitmaps8Reply *pRep;
  787. X  {
  788. X      int         n;
  789. X  
  790. --- 333,342 ----
  791. X  }
  792. X  
  793. X  void
  794. ! SQueryXBitmapsReply(client, size, pRep)
  795. X      ClientPtr   client;
  796. X      int         size;
  797. !     fsQueryXBitmaps8Reply *pRep; /* QueryXBitmaps16Reply is the same */
  798. X  {
  799. X      int         n;
  800. X  
  801. ***************
  802. *** 376,382 ****
  803. X  
  804. X      pInfoT = pInfoTBase = (char *) ALLOCATE_LOCAL(size);
  805. X      if (!pInfoT) {
  806. !     client->noClientException = -1;
  807. X      return;
  808. X      }
  809. X      SwapConnSetupAccept(pConnSetup, (fsConnSetupAccept *) pInfoT);
  810. --- 374,380 ----
  811. X  
  812. X      pInfoT = pInfoTBase = (char *) ALLOCATE_LOCAL(size);
  813. X      if (!pInfoT) {
  814. !     client->noClientException = -2;
  815. X      return;
  816. X      }
  817. X      SwapConnSetupAccept(pConnSetup, (fsConnSetupAccept *) pInfoT);
  818. *** /tmp/da29353    Tue Jul 14 18:09:02 1992
  819. --- mit/fonts/server/difs/swapreq.c    Tue Jul 14 18:09:02 1992
  820. ***************
  821. *** 1,4 ****
  822. ! /* $XConsortium: swapreq.c,v 1.3 91/07/16 20:23:43 keith Exp $ */
  823. X  /*
  824. X   * swapped requests
  825. X   */
  826. --- 1,4 ----
  827. ! /* $XConsortium: swapreq.c,v 1.5 92/05/28 16:43:04 gildea Exp $ */
  828. X  /*
  829. X   * swapped requests
  830. X   */
  831. ***************
  832. *** 7,31 ****
  833. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  834. X   * Massachusetts Institute of Technology
  835. X   *
  836. !  * Permission to use, copy, modify, and distribute this protoype software
  837. !  * and its documentation to Members and Affiliates of the MIT X Consortium
  838. !  * any purpose and without fee is hereby granted, provided
  839. X   * that the above copyright notice appear in all copies and that both that
  840. X   * copyright notice and this permission notice appear in supporting
  841. X   * documentation, and that the names of Network Computing Devices, Digital or
  842. !  * MIT not be used in advertising or publicity pertaining to distribution of
  843. !  * the software without specific, written prior permission.
  844. X   *
  845. !  * NETWORK COMPUTING DEVICES, DIGITAL AND MIT DISCLAIM ALL WARRANTIES WITH
  846. !  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  847. !  * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, DIGITAL OR MIT BE
  848. !  * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  849. !  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  850. !  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  851. !  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  852. !  *
  853. !  * $NCDId: @(#)swapreq.c,v 4.2 1991/06/27 16:34:49 lemke Exp $
  854. !  *
  855. X   */
  856. X  
  857. X  #include    "misc.h"
  858. --- 7,28 ----
  859. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  860. X   * Massachusetts Institute of Technology
  861. X   *
  862. !  * Permission to use, copy, modify, distribute, and sell this software and
  863. !  * its documentation for any purpose is hereby granted without fee, provided
  864. X   * that the above copyright notice appear in all copies and that both that
  865. X   * copyright notice and this permission notice appear in supporting
  866. X   * documentation, and that the names of Network Computing Devices, Digital or
  867. !  * M.I.T. not be used in advertising or publicity pertaining to distribution
  868. !  * of the software without specific, written prior permission.
  869. X   *
  870. !  * NETWORK COMPUTING DEVICES, DIGITAL AND M.I.T. DISCLAIM ALL WARRANTIES WITH
  871. !  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  872. !  * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
  873. !  * DIGITAL OR M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  874. !  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  875. !  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  876. !  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  877. !  * THIS SOFTWARE.
  878. X   */
  879. X  
  880. X  #include    "misc.h"
  881. ***************
  882. *** 250,279 ****
  883. X  }
  884. X  
  885. X  int
  886. ! SProcQueryXExtents8(client)
  887. X      ClientPtr   client;
  888. X  {
  889. X      char        n;
  890. X  
  891. !     REQUEST(fsQueryXExtents8Req);
  892. X      swaps(&stuff->length, n);
  893. X      swapl(&stuff->fid, n);
  894. X  
  895. !     return ((*ProcVector[FS_QueryXExtents8]) (client));
  896. X  }
  897. X  
  898. X  int
  899. ! SProcQueryXBitmaps8(client)
  900. X      ClientPtr   client;
  901. X  {
  902. X      char        n;
  903. X  
  904. !     REQUEST(fsQueryXBitmaps8Req);
  905. X      swaps(&stuff->length, n);
  906. X      swapl(&stuff->fid, n);
  907. X      swapl(&stuff->format, n);
  908. X  
  909. !     return ((*ProcVector[FS_QueryXBitmaps8]) (client));
  910. X  }
  911. X  
  912. X  SwapConnClientPrefix(pCCP)
  913. --- 247,278 ----
  914. X  }
  915. X  
  916. X  int
  917. ! SProcQueryXExtents(client)
  918. X      ClientPtr   client;
  919. X  {
  920. X      char        n;
  921. X  
  922. !     REQUEST(fsQueryXExtents8Req); /* 8 and 16 are the same here */
  923. X      swaps(&stuff->length, n);
  924. X      swapl(&stuff->fid, n);
  925. +     swapl(&stuff->num_ranges, n);
  926. X  
  927. !     return ((*ProcVector[stuff->reqType]) (client));
  928. X  }
  929. X  
  930. X  int
  931. ! SProcQueryXBitmaps(client)
  932. X      ClientPtr   client;
  933. X  {
  934. X      char        n;
  935. X  
  936. !     REQUEST(fsQueryXBitmaps8Req); /* 8 and 16 are the same here */
  937. X      swaps(&stuff->length, n);
  938. X      swapl(&stuff->fid, n);
  939. X      swapl(&stuff->format, n);
  940. +     swapl(&stuff->num_ranges, n);
  941. X  
  942. !     return ((*ProcVector[stuff->reqType]) (client));
  943. X  }
  944. X  
  945. X  SwapConnClientPrefix(pCCP)
  946. *** /tmp/da29375    Tue Jul 14 18:09:04 1992
  947. --- mit/fonts/server/difs/tables.c    Tue Jul 14 18:09:04 1992
  948. ***************
  949. *** 1,4 ****
  950. ! /* $XConsortium: tables.c,v 1.3 91/07/16 20:23:45 keith Exp $ */
  951. X  /*
  952. X   * all the dispatch, error, event and reply vectors
  953. X   */
  954. --- 1,4 ----
  955. ! /* $XConsortium: tables.c,v 1.5 92/05/28 16:43:08 gildea Exp $ */
  956. X  /*
  957. X   * all the dispatch, error, event and reply vectors
  958. X   */
  959. ***************
  960. *** 7,42 ****
  961. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  962. X   * Massachusetts Institute of Technology
  963. X   *
  964. !  * Permission to use, copy, modify, and distribute this protoype software
  965. !  * and its documentation to Members and Affiliates of the MIT X Consortium
  966. !  * any purpose and without fee is hereby granted, provided
  967. X   * that the above copyright notice appear in all copies and that both that
  968. X   * copyright notice and this permission notice appear in supporting
  969. X   * documentation, and that the names of Network Computing Devices, Digital or
  970. !  * MIT not be used in advertising or publicity pertaining to distribution of
  971. !  * the software without specific, written prior permission.
  972. X   *
  973. !  * NETWORK COMPUTING DEVICES, DIGITAL AND MIT DISCLAIM ALL WARRANTIES WITH
  974. !  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  975. !  * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, DIGITAL OR MIT BE
  976. !  * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  977. !  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  978. !  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  979. !  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  980. !  *
  981. !  * $NCDId: @(#)tables.c,v 4.2 1991/06/27 16:34:38 lemke Exp $
  982. !  *
  983. X   */
  984. - #include    "globals.h"
  985. X  
  986. X  extern int  ProcInitialConnection(), ProcEstablishConnection();
  987. X  
  988. ! extern int  ProcSetAuthorization(), ProcGetAuthorization(),
  989. X              ProcSetResolution(), ProcGetResolution(), ProcNoop(),
  990. X              ProcListExtensions(), ProcQueryExtension(),
  991. X              ProcListFonts(), ProcListFontsWithXInfo(),
  992. !             ProcOpenBitmapFont(), ProcQueryXInfo(), ProcQueryXExtents8(),
  993. !             ProcQueryXBitmaps8(), ProcCloseFont(),
  994. X              ProcListCatalogues(), ProcSetCatalogues(), ProcGetCatalogues(),
  995. X              ProcSetEventMask(), ProcGetEventMask(),
  996. X              ProcCreateAC(), ProcFreeAC();
  997. --- 7,40 ----
  998. X   * Portions Copyright 1987 by Digital Equipment Corporation and the
  999. X   * Massachusetts Institute of Technology
  1000. X   *
  1001. !  * Permission to use, copy, modify, distribute, and sell this software and
  1002. !  * its documentation for any purpose is hereby granted without fee, provided
  1003. X   * that the above copyright notice appear in all copies and that both that
  1004. X   * copyright notice and this permission notice appear in supporting
  1005. X   * documentation, and that the names of Network Computing Devices, Digital or
  1006. !  * M.I.T. not be used in advertising or publicity pertaining to distribution
  1007. !  * of the software without specific, written prior permission.
  1008. X   *
  1009. !  * NETWORK COMPUTING DEVICES, DIGITAL AND M.I.T. DISCLAIM ALL WARRANTIES WITH
  1010. !  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  1011. !  * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
  1012. !  * DIGITAL OR M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  1013. !  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  1014. !  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  1015. !  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  1016. !  * THIS SOFTWARE.
  1017. X   */
  1018. X  
  1019. + #include "globals.h"
  1020. X  extern int  ProcInitialConnection(), ProcEstablishConnection();
  1021. X  
  1022. ! extern int  ProcSetAuthorization(),
  1023. X              ProcSetResolution(), ProcGetResolution(), ProcNoop(),
  1024. X              ProcListExtensions(), ProcQueryExtension(),
  1025. X              ProcListFonts(), ProcListFontsWithXInfo(),
  1026. !             ProcOpenBitmapFont(), ProcQueryXInfo(), ProcQueryXExtents(),
  1027. !             ProcQueryXBitmaps(), ProcCloseFont(),
  1028. X              ProcListCatalogues(), ProcSetCatalogues(), ProcGetCatalogues(),
  1029. X              ProcSetEventMask(), ProcGetEventMask(),
  1030. X              ProcCreateAC(), ProcFreeAC();
  1031. ***************
  1032. *** 43,53 ****
  1033. X  
  1034. X  extern int  SProcSimpleRequest(), SProcResourceRequest(),
  1035. X          SProcListCatalogues(),
  1036. !             SProcSetResolution(), SProcGetResolution(),
  1037. !             SProcListExtensions(), SProcQueryExtension(),
  1038. X              SProcListFonts(), SProcListFontsWithXInfo(),
  1039. !             SProcOpenBitmapFont(), SProcQueryXExtents8(),
  1040. !             SProcQueryXBitmaps8(),
  1041. X              SProcCreateAC();
  1042. X  
  1043. X  extern void SErrorEvent();
  1044. --- 41,51 ----
  1045. X  
  1046. X  extern int  SProcSimpleRequest(), SProcResourceRequest(),
  1047. X          SProcListCatalogues(),
  1048. !             SProcSetResolution(),
  1049. !             SProcQueryExtension(),
  1050. X              SProcListFonts(), SProcListFontsWithXInfo(),
  1051. !             SProcOpenBitmapFont(), SProcQueryXExtents(),
  1052. !             SProcQueryXBitmaps(),
  1053. X              SProcCreateAC();
  1054. X  
  1055. X  extern void SErrorEvent();
  1056. ***************
  1057. *** 58,65 ****
  1058. X              SQueryExtensionReply(),
  1059. X              SListFontsReply(), SListFontsWithXInfoReply(),
  1060. X              SOpenBitmapFontReply(),
  1061. !             SQueryXInfoReply(), SQueryXExtents8Reply(),
  1062. !             SQueryXBitmaps8Reply(),
  1063. X              SGetEventMaskReply(), SCreateACReply(), SGetResolutionReply(),
  1064. X              SOpenBitmapFontReply();
  1065. X  
  1066. --- 56,63 ----
  1067. X              SQueryExtensionReply(),
  1068. X              SListFontsReply(), SListFontsWithXInfoReply(),
  1069. X              SOpenBitmapFontReply(),
  1070. !             SQueryXInfoReply(), SQueryXExtentsReply(),
  1071. !             SQueryXBitmapsReply(),
  1072. X              SGetEventMaskReply(), SCreateACReply(), SGetResolutionReply(),
  1073. X              SOpenBitmapFontReply();
  1074. X  
  1075. ***************
  1076. *** 90,99 ****
  1077. X      ProcListFontsWithXInfo,
  1078. X      ProcOpenBitmapFont,        /* 15 */
  1079. X      ProcQueryXInfo,
  1080. !     ProcQueryXExtents8,
  1081. !     ProcQueryXExtents8,
  1082. !     ProcQueryXBitmaps8,
  1083. !     ProcQueryXBitmaps8,        /* 20 */
  1084. X      ProcCloseFont,
  1085. X      0,
  1086. X      0,
  1087. --- 88,97 ----
  1088. X      ProcListFontsWithXInfo,
  1089. X      ProcOpenBitmapFont,        /* 15 */
  1090. X      ProcQueryXInfo,
  1091. !     ProcQueryXExtents,
  1092. !     ProcQueryXExtents,
  1093. !     ProcQueryXBitmaps,
  1094. !     ProcQueryXBitmaps,        /* 20 */
  1095. X      ProcCloseFont,
  1096. X      0,
  1097. X      0,
  1098. ***************
  1099. *** 104,110 ****
  1100. X  {
  1101. X      SProcSimpleRequest,        /* 0 */
  1102. X      SProcSimpleRequest,
  1103. !     ProcQueryExtension,
  1104. X      SProcListCatalogues,
  1105. X      SProcSimpleRequest,        /* SetCatalogues */
  1106. X      SProcSimpleRequest,        /* 5 */
  1107. --- 102,108 ----
  1108. X  {
  1109. X      SProcSimpleRequest,        /* 0 */
  1110. X      SProcSimpleRequest,
  1111. !     SProcQueryExtension,
  1112. X      SProcListCatalogues,
  1113. X      SProcSimpleRequest,        /* SetCatalogues */
  1114. X      SProcSimpleRequest,        /* 5 */
  1115. ***************
  1116. *** 119,128 ****
  1117. X      SProcListFontsWithXInfo,
  1118. X      SProcOpenBitmapFont,    /* 15 */
  1119. X      SProcResourceRequest,
  1120. !     SProcQueryXExtents8,
  1121. !     SProcQueryXExtents8,
  1122. !     SProcQueryXBitmaps8,
  1123. !     SProcQueryXBitmaps8,    /* 20 */
  1124. X      SProcResourceRequest,
  1125. X      0,
  1126. X      0,
  1127. --- 117,126 ----
  1128. X      SProcListFontsWithXInfo,
  1129. X      SProcOpenBitmapFont,    /* 15 */
  1130. X      SProcResourceRequest,
  1131. !     SProcQueryXExtents,
  1132. !     SProcQueryXExtents,
  1133. !     SProcQueryXBitmaps,
  1134. !     SProcQueryXBitmaps,        /* 20 */
  1135. X      SProcResourceRequest,
  1136. X      0,
  1137. X      0,
  1138. ***************
  1139. *** 160,169 ****
  1140. X      SListFontsWithXInfoReply,
  1141. X      SOpenBitmapFontReply,    /* 15 */
  1142. X      SQueryXInfoReply,
  1143. !     SQueryXExtents8Reply,
  1144. !     SQueryXExtents8Reply,
  1145. !     SQueryXBitmaps8Reply,
  1146. !     SQueryXBitmaps8Reply,    /* 20 */
  1147. X      NotImplemented,        /* Close */
  1148. X      NotImplemented,
  1149. X      NotImplemented
  1150. --- 158,167 ----
  1151. X      SListFontsWithXInfoReply,
  1152. X      SOpenBitmapFontReply,    /* 15 */
  1153. X      SQueryXInfoReply,
  1154. !     SQueryXExtentsReply,
  1155. !     SQueryXExtentsReply,
  1156. !     SQueryXBitmapsReply,
  1157. !     SQueryXBitmapsReply,    /* 20 */
  1158. X      NotImplemented,        /* Close */
  1159. X      NotImplemented,
  1160. X      NotImplemented
  1161. *** /dev/null    Tue Jul 14 18:06:05 1992
  1162. --- mit/fonts/server/difs/charinfo.c    Tue Jul 14 18:09:06 1992
  1163. ***************
  1164. *** 0 ****
  1165. --- 1,592 ----
  1166. + /* $XConsortium: charinfo.c,v 1.6 92/05/28 15:57:19 gildea Exp $ */
  1167. + /*
  1168. +  * Copyright 1990, 1991 Network Computing Devices;
  1169. +  * Portions Copyright 1987 by Digital Equipment Corporation and the
  1170. +  * Massachusetts Institute of Technology
  1171. +  *
  1172. +  * Permission to use, copy, modify, distribute, and sell this software and
  1173. +  * its documentation for any purpose is hereby granted without fee, provided
  1174. +  * that the above copyright notice appear in all copies and that both that
  1175. +  * copyright notice and this permission notice appear in supporting
  1176. +  * documentation, and that the names of Network Computing Devices, Digital or
  1177. +  * M.I.T. not be used in advertising or publicity pertaining to distribution
  1178. +  * of the software without specific, written prior permission.
  1179. +  *
  1180. +  * NETWORK COMPUTING DEVICES, DIGITAL AND M.I.T. DISCLAIM ALL WARRANTIES WITH
  1181. +  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  1182. +  * MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES,
  1183. +  * DIGITAL OR M.I.T. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  1184. +  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  1185. +  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  1186. +  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
  1187. +  * THIS SOFTWARE.
  1188. +  */
  1189. + /*
  1190. +  * Defines GetExtents() and GetBitmaps(), which are
  1191. +  * called from routines in fontinfo.c.
  1192. +  * This file was once on the other side of
  1193. +  * the font library interface as util/fsfuncs.c.
  1194. +  */
  1195. + #include <X11/Xos.h>
  1196. + #include "misc.h"
  1197. + #include "fontstruct.h"
  1198. + #include "clientstr.h"
  1199. + #define FSMD_H
  1200. + #include "FSproto.h"
  1201. + extern void TwoByteSwap();
  1202. + extern void FourByteSwap();
  1203. + #define GLWIDTHBYTESPADDED(bits,nbytes) \
  1204. +     ((nbytes) == 1 ? (((bits)+7)>>3)        /* pad to 1 byte */ \
  1205. +     :(nbytes) == 2 ? ((((bits)+15)>>3)&~1)  /* pad to 2 bytes */ \
  1206. +     :(nbytes) == 4 ? ((((bits)+31)>>3)&~3)  /* pad to 4 bytes */ \
  1207. +     :(nbytes) == 8 ? ((((bits)+63)>>3)&~7)  /* pad to 8 bytes */ \
  1208. +     : 0)
  1209. + #define GLYPH_SIZE(ch, nbytes)          \
  1210. +     GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \
  1211. +             (ch)->metrics.leftSideBearing, (nbytes))
  1212. + #define n2dChars(pfi)   (((pfi)->lastRow - (pfi)->firstRow + 1) * \
  1213. +                          ((pfi)->lastCol - (pfi)->firstCol + 1))
  1214. + static CharInfoRec  junkDefault;
  1215. + static int
  1216. + getCharInfos (pfont, num_ranges, range, ink_metrics, nump, retp)
  1217. +     FontPtr    pfont;
  1218. +     int        num_ranges;
  1219. +     fsRange    *range;
  1220. +     Bool    ink_metrics;
  1221. +     int        *nump;        /* return */
  1222. +     CharInfoPtr    **retp;        /* return */
  1223. + {
  1224. +     CharInfoPtr    *xchars, *xci;
  1225. +     int        nchars;
  1226. +     FontInfoPtr pinfo = &pfont->info;
  1227. +     unsigned int r, c;
  1228. +     unsigned char   ch[2];
  1229. +     int         firstCol = pinfo->firstCol;
  1230. +     int         firstRow = pinfo->firstRow;
  1231. +     int         lastRow = pinfo->lastRow;
  1232. +     int         lastCol = pinfo->lastCol;
  1233. +     int        minCol, maxCol;
  1234. +     int         num_cols = lastCol - firstCol + 1;
  1235. +     fsRange    local_range, *rp;
  1236. +     int        i;
  1237. +     FontEncoding    encoding;
  1238. +     int        err;
  1239. +     unsigned long   glyphCount;
  1240. +     unsigned short  defaultCh;
  1241. +     CharInfoPtr        defaultPtr;
  1242. +     int (*metrics_func) ();
  1243. +     
  1244. +     /*
  1245. +      * compute nchars
  1246. +      */
  1247. +     if (num_ranges == 0) {
  1248. +     if (lastRow)
  1249. +         nchars = n2dChars(pinfo);
  1250. +     else
  1251. +         nchars = lastCol - firstCol + 1;
  1252. +     local_range.min_char.low = firstCol;
  1253. +     local_range.min_char.high = firstRow;
  1254. +     local_range.max_char.low = lastCol;
  1255. +     local_range.max_char.high = lastRow;
  1256. +     range = &local_range;
  1257. +     num_ranges = 1;
  1258. +     } else {
  1259. +     nchars = 0;
  1260. +     for (i = 0, rp = range; i < num_ranges; i++, rp++) {
  1261. +         if (rp->min_char.high > rp->max_char.high)
  1262. +         return BadCharRange;
  1263. +         if (rp->min_char.high == rp->max_char.high)
  1264. +         {
  1265. +         if (rp->min_char.low > rp->max_char.low)
  1266. +             return BadCharRange;
  1267. +         nchars += rp->max_char.low - rp->min_char.low + 1;
  1268. +         }
  1269. +         else
  1270. +         {
  1271. +         nchars += lastRow - rp->min_char.low + 1;
  1272. +         nchars += (rp->max_char.high - rp->min_char.high - 1) * num_cols;
  1273. +         nchars += rp->max_char.low - firstRow + 1;
  1274. +         }
  1275. +     }
  1276. +     }
  1277. +     xchars = (CharInfoPtr *) fsalloc (sizeof (CharInfoPtr) * nchars);
  1278. +     if (!xchars)
  1279. +     return AllocError;
  1280. +     if (ink_metrics)
  1281. +     metrics_func = pfont->get_metrics;
  1282. +     else
  1283. +     metrics_func = pfont->get_glyphs;
  1284. +     xci = xchars;
  1285. +     encoding = Linear16Bit;
  1286. +     if (lastRow)
  1287. +     encoding = TwoD16Bit;
  1288. +     defaultCh = pinfo->defaultCh;
  1289. +     ch[0] = defaultCh >> 8;
  1290. +     ch[1] = defaultCh & 0xff;
  1291. +     /* get the default character */
  1292. +     (*metrics_func) (pfont, 1, ch, encoding,
  1293. +               &glyphCount, &defaultPtr);
  1294. +     if (glyphCount != 1)
  1295. +     defaultPtr = 0;
  1296. +     
  1297. +     /* for each range, get each character individually, undoing the
  1298. +      default character substitution so we get zero metrics for
  1299. +      non-existent characters. */
  1300. +     for (i = 0, rp = range; i < num_ranges; i++, rp++) {
  1301. +     for (r = rp->min_char.high; r <= rp->max_char.high; r++)
  1302. +     {
  1303. +         minCol = firstCol;
  1304. +         if (r == rp->min_char.high)
  1305. +         minCol = rp->min_char.low;
  1306. +         maxCol = lastCol;
  1307. +         if (r == rp->max_char.high)
  1308. +         maxCol = rp->max_char.low;
  1309. +         for (c = minCol; c <= maxCol; c++) {
  1310. +         ch[0] = r;
  1311. +         ch[1] = c;
  1312. +         err = (*metrics_func) (pfont, 1, ch, encoding,
  1313. +                         &glyphCount, xci);
  1314. +         if (err != Successful)
  1315. +         {
  1316. +             fsfree (xchars);
  1317. +             return err;
  1318. +         }
  1319. +         if (glyphCount != 1 || 
  1320. +             *xci == defaultPtr && defaultCh != ((r<<8)+c))
  1321. +             *xci = &junkDefault;
  1322. +         xci++;
  1323. +         }
  1324. +     }
  1325. +     }
  1326. +     *retp = xchars;
  1327. +     *nump = nchars;
  1328. +     return Successful;
  1329. + }
  1330. + int
  1331. + GetExtents(client, pfont, flags, num_ranges, range, num_extents, data)
  1332. +     ClientPtr     client;
  1333. +     FontPtr     pfont;
  1334. +     Mask        flags;
  1335. +     unsigned long num_ranges;
  1336. +     fsRange    *range;
  1337. +     unsigned long *num_extents;    /* return */
  1338. +     fsCharInfo **data;        /* return */
  1339. + {
  1340. +     unsigned long size;
  1341. +     fsCharInfo *ci,
  1342. +     *pci;
  1343. +     CharInfoPtr    *xchars, *xcharsFree, xci;
  1344. +     int        nchars;
  1345. +     int        err;
  1346. +     
  1347. +     if (flags & LoadAll)
  1348. +     num_ranges = 0;
  1349. +     err = getCharInfos (pfont, num_ranges, range,
  1350. +             client->major_version > 1 ? TRUE : FALSE,
  1351. +             &nchars, &xchars);
  1352. +     if (err != Successful)
  1353. +     return err;
  1354. +     
  1355. +     size = sizeof(fsCharInfo) * nchars;
  1356. +     pci = ci = (fsCharInfo *) fsalloc(size);
  1357. +     if (!ci) {
  1358. +     fsfree (xchars);
  1359. +     return AllocError;
  1360. +     }
  1361. +     
  1362. +     *num_extents = nchars;
  1363. +     xcharsFree = xchars;
  1364. +     
  1365. +     while (nchars--) {
  1366. +     xci = *xchars++;
  1367. +     pci->ascent = xci->metrics.ascent;
  1368. +     pci->descent = xci->metrics.descent;
  1369. +     pci->left = xci->metrics.leftSideBearing;
  1370. +     pci->right = xci->metrics.rightSideBearing;
  1371. +     pci->width = xci->metrics.characterWidth;
  1372. +     pci->attributes = 0;
  1373. +     pci++;
  1374. +     }
  1375. +     
  1376. +     fsfree (xcharsFree);
  1377. +     
  1378. +     *data = ci;
  1379. +     
  1380. +     return Successful;
  1381. + }
  1382. + static int
  1383. + packGlyphs (client, pfont, format, flags, num_ranges, range, tsize, num_glyphs,
  1384. +         offsets, data, freeData)
  1385. +     ClientPtr   client;
  1386. +     FontPtr     pfont;
  1387. +     int         format;
  1388. +     Mask        flags;
  1389. +     unsigned long num_ranges;
  1390. +     fsRange    *range;
  1391. +     int        *tsize;
  1392. +     unsigned long *num_glyphs;
  1393. +     fsOffset  **offsets;
  1394. +     pointer    *data;
  1395. +     int        *freeData;
  1396. + {
  1397. +     int         i;
  1398. +     fsOffset    *lengths, *l;
  1399. +     unsigned long size = 0;
  1400. +     pointer     gdata,
  1401. +     gd;
  1402. +     int         bitorder, byteorder, scanlinepad, scanlineunit, mappad;
  1403. +     int        height, dstbpr, charsize;
  1404. +     int        dst_off, src_off;
  1405. +     Bool    contiguous, reformat;
  1406. +     int        nchars;
  1407. +     int         src_glyph_pad = pfont->glyph;
  1408. +     int         src_bit_order = pfont->bit;
  1409. +     int         src_byte_order = pfont->byte;
  1410. +     int         err;
  1411. +     int        max_ascent, max_descent;
  1412. +     int        min_left, max_right;
  1413. +     int        srcbpr;
  1414. +     int        lshift = 0, rshift = 0, dst_left_bytes = 0, src_left_bytes = 0;
  1415. +     unsigned char   *srcp;
  1416. +     unsigned char   *dstp;
  1417. +     unsigned char   bits1, bits2;
  1418. +     int            width;
  1419. +     int            src_extra;
  1420. +     int            dst_extra;
  1421. +     int            r, w;
  1422. +     CharInfoPtr    *bitChars, *bitCharsFree, bitc;
  1423. +     CharInfoPtr    *inkChars, *inkCharsFree = 0, inkc;
  1424. +     FontInfoPtr    pinfo = &pfont->info;
  1425. +     xCharInfo    *bitm, *inkm;
  1426. +     
  1427. +     err = CheckFSFormat(format, (fsBitmapFormatMask) ~ 0,
  1428. +             &bitorder, &byteorder, &scanlineunit, &scanlinepad, &mappad);
  1429. +     
  1430. +     if (err != Successful)
  1431. +     return err;
  1432. +     
  1433. +     if (flags & LoadAll)
  1434. +     num_ranges = 0;
  1435. +     
  1436. +     err = getCharInfos (pfont, num_ranges, range, FALSE, &nchars, &bitCharsFree);
  1437. +     
  1438. +     if (err != Successful)
  1439. +     return err;
  1440. +     
  1441. +     /* compute dstbpr for padded out fonts */
  1442. +     reformat = bitorder != src_bit_order || byteorder != src_byte_order;
  1443. +     /* we need the ink metrics when shrink-wrapping a TE font (sigh),
  1444. +      * but only for protocol version > 1 */
  1445. +     if (mappad != BitmapFormatImageRectMax &&
  1446. +     pinfo->inkMetrics &&
  1447. +     client->major_version > 1)
  1448. +     {
  1449. +     err = getCharInfos (pfont, num_ranges, range, TRUE, &nchars, &inkCharsFree);
  1450. +     if (err != Successful)
  1451. +     {
  1452. +         fsfree (bitCharsFree);
  1453. +         return err;
  1454. +     }
  1455. +     reformat = TRUE;
  1456. +     }
  1457. +     /* get space for glyph offsets */
  1458. +     lengths = (fsOffset *) fsalloc(sizeof(fsOffset) * nchars);
  1459. +     if (!lengths) {
  1460. +     fsfree (bitCharsFree);
  1461. +     fsfree (inkCharsFree);
  1462. +     return AllocError;
  1463. +     }
  1464. +     
  1465. +     switch (mappad)
  1466. +     {
  1467. +     case BitmapFormatImageRectMax:
  1468. +     max_ascent = FONT_MAX_ASCENT(pinfo);
  1469. +     max_descent = FONT_MAX_DESCENT(pinfo);
  1470. +     height = max_ascent + max_descent;
  1471. +     /* do font ascent and font descent match bitmap bounds ? */
  1472. +     if (height != pinfo->minbounds.ascent + pinfo->minbounds.descent)
  1473. +         reformat = TRUE;
  1474. +     /* fall through */
  1475. +     case BitmapFormatImageRectMaxWidth:
  1476. +     min_left = FONT_MIN_LEFT(pinfo);
  1477. +     max_right = FONT_MAX_RIGHT(pinfo);
  1478. +     if (min_left != pinfo->maxbounds.leftSideBearing)
  1479. +         reformat = TRUE;
  1480. +     if (max_right != pinfo->maxbounds.rightSideBearing)
  1481. +         reformat = TRUE;
  1482. +     dstbpr = GLWIDTHBYTESPADDED(max_right - min_left, scanlinepad);
  1483. +     break;
  1484. +     case BitmapFormatImageRectMin:
  1485. +     break;
  1486. +     }
  1487. +     if (mappad == BitmapFormatImageRectMax)
  1488. +     charsize = dstbpr * height;
  1489. +     size = 0;
  1490. +     gdata = 0;
  1491. +     contiguous = TRUE;
  1492. +     l = lengths;
  1493. +     inkChars = inkCharsFree;
  1494. +     bitChars = bitCharsFree;
  1495. +     for (i = 0; i < nchars; i++)
  1496. +     {
  1497. +         inkc = bitc = *bitChars++;
  1498. +     /* when ink metrics != bitmap metrics, use ink metrics */
  1499. +     if (inkChars)
  1500. +         inkc = *inkChars++;
  1501. +         l->position = size;
  1502. +         if (bitc && bitc->bits) {
  1503. +         if (!gdata)
  1504. +         gdata = (pointer) bitc->bits;
  1505. +         if ((char *) gdata + size != bitc->bits)
  1506. +         contiguous = FALSE;
  1507. +         if (mappad == BitmapFormatImageRectMin)
  1508. +         dstbpr = GLYPH_SIZE(inkc, scanlinepad);
  1509. +         if (mappad != BitmapFormatImageRectMax)
  1510. +         {
  1511. +         height = inkc->metrics.ascent + inkc->metrics.descent;
  1512. +         charsize = height * dstbpr;
  1513. +         }
  1514. +         l->length = charsize;
  1515. +         size += charsize;
  1516. +     }
  1517. +     else
  1518. +         l->length = 0;
  1519. +     l++;
  1520. +     }
  1521. +     if (contiguous && !reformat)
  1522. +     {
  1523. +     *num_glyphs = nchars;
  1524. +     *freeData = FALSE;
  1525. +     *data = gdata;
  1526. +     *tsize = size;
  1527. +     *offsets = lengths;
  1528. +     fsfree (bitCharsFree);
  1529. +     fsfree (inkCharsFree);
  1530. +     return Successful;
  1531. +     }
  1532. +     if (size)
  1533. +     {
  1534. +     gdata = (pointer) fsalloc(size);
  1535. +     if (!gdata) {
  1536. +         fsfree (bitCharsFree);
  1537. +         fsfree (inkCharsFree);
  1538. +         fsfree (lengths);
  1539. +         return AllocError;
  1540. +     }
  1541. +     bzero ((char *) gdata, size);
  1542. +     }
  1543. +     else
  1544. +     gdata = NULL;
  1545. +     
  1546. +     *freeData = TRUE;
  1547. +     l = lengths;
  1548. +     gd = gdata;
  1549. +     
  1550. +     /* finally do the work */
  1551. +     bitChars = bitCharsFree;
  1552. +     inkChars = inkCharsFree;
  1553. +     for (i = 0; i < nchars; i++, l++) 
  1554. +     {
  1555. +     inkc = bitc = *bitChars++;
  1556. +     if (inkChars)
  1557. +         inkc = *inkChars++;
  1558. +     /* ignore missing chars */
  1559. +     if (l->length == 0)
  1560. +         continue;
  1561. +     
  1562. +     bitm = &bitc->metrics;
  1563. +     inkm = &inkc->metrics;
  1564. +     /* start address for the destination of bits for this char */
  1565. +     dstp = gd;
  1566. +     /* adjust destination and calculate shift offsets */
  1567. +     switch (mappad) {
  1568. +     case BitmapFormatImageRectMax:
  1569. +         /* leave the first padded rows blank */
  1570. +         dstp += dstbpr * (max_ascent - inkm->ascent);
  1571. +         /* fall thru */
  1572. +     case BitmapFormatImageRectMaxWidth:
  1573. +         dst_off = inkm->leftSideBearing - min_left;
  1574. +         break;
  1575. +     case BitmapFormatImageRectMin:
  1576. +         dst_off = 0;
  1577. +         dstbpr = GLYPH_SIZE(inkc, scanlinepad);
  1578. +         break;
  1579. +     }
  1580. +     srcbpr = GLYPH_SIZE (bitc, src_glyph_pad);
  1581. +     srcp = (unsigned char *) bitc->bits;
  1582. +     /* adjust source */
  1583. +     src_off = 0;
  1584. +     if (inkm != bitm)
  1585. +     {
  1586. +         srcp += (bitm->ascent - inkm->ascent) * srcbpr;
  1587. +         src_off = inkm->leftSideBearing - bitm->leftSideBearing;
  1588. +     }
  1589. +     dst_left_bytes = dst_off >> 3;
  1590. +     dst_off &= 7;
  1591. +     src_left_bytes = src_off >> 3;
  1592. +     src_off &= 7;
  1593. +     /* minimum of source/dest bytes per row */
  1594. +     width = srcbpr;
  1595. +     if (srcbpr > dstbpr)
  1596. +         width = dstbpr;
  1597. +     /* extra bytes in source and dest for padding */
  1598. +     src_extra = srcbpr - width - src_left_bytes;
  1599. +     dst_extra = dstbpr - width - dst_left_bytes;
  1600. +     
  1601. + #define MSBBitLeft(b,c)    ((b) << (c))
  1602. + #define MSBBitRight(b,c)    ((b) >> (c))
  1603. + #define LSBBitLeft(b,c)    ((b) >> (c))
  1604. + #define LSBBitRight(b,c)    ((b) << (c))
  1605. +     if (dst_off == src_off)
  1606. +     {
  1607. +         if (srcbpr == dstbpr && src_left_bytes == dst_left_bytes)
  1608. +         {
  1609. +         r = (inkm->ascent + inkm->descent) * width;
  1610. SHAR_EOF
  1611. true || echo 'restore of fix-13 failed'
  1612. fi
  1613. echo 'End of  part 4'
  1614. echo 'File fix-13 is continued in part 5'
  1615. echo 5 > _shar_seq_.tmp
  1616. exit 0
  1617. -- 
  1618. ---
  1619. Senior Systems Scientist        mail: dcmartin@msi.com
  1620. Molecular Simulations, Inc.        uucp: uunet!dcmartin
  1621. 796 North Pastoria Avenue        at&t: 408/522-9236
  1622.