home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / DCLAP 4j / Drtf / rtfmaps.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-17  |  1.4 KB  |  94 lines  |  [TEXT/R*ch]

  1. /* rtfmaps.h 
  2.    d.g.gilbert
  3.    converted run-time disk file charset maps to compile-time include files
  4.    in rtf2....
  5. */
  6.  
  7. #ifndef _RTFMAPS_
  8. #define _RTFMAPS_
  9.  
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13.  
  14. #ifndef rtfmapInternal
  15.  
  16. extern short mac_gen_CharCode[];
  17. extern short mac_sym_CharCode[];
  18. extern short ansi_gen_CharCode[];
  19. extern short ansi_sym_CharCode[];
  20. extern short pc_gen_CharCode[];
  21. extern short pc_sym_CharCode[];
  22. extern short pca_gen_CharCode[];
  23. extern short pca_sym_CharCode[];
  24.  
  25. short  RTFStdCharCode(char    *name);
  26. char * RTFStdCharName(short code);
  27.  
  28.  
  29. #else
  30.  
  31. #include "rtfchars.h"
  32.  
  33. static char    *stdCharName[] = {
  34. # include    "stdcharnames.h"
  35.      NULL
  36. };
  37.  
  38.  
  39. short mac_gen_CharCode[] = {
  40. # include "mac-gen.h"
  41. };
  42.  
  43. short mac_sym_CharCode[] = {
  44. # include "mac-sym.h"
  45. };
  46.  
  47. short ansi_gen_CharCode[] = {
  48. # include "ansi-gen.h"
  49. };
  50.  
  51. short ansi_sym_CharCode[] = {
  52. # include "ansi-sym.h"
  53. };
  54.  
  55. short pc_gen_CharCode[] = {
  56. # include "pc-gen.h"
  57. };
  58.  
  59. short *pc_sym_CharCode = ansi_sym_CharCode;
  60.  
  61. short pca_gen_CharCode[] = {
  62. # include "pca-gen.h"
  63. };
  64.  
  65. short *pca_sym_CharCode = ansi_sym_CharCode;
  66.  
  67.  
  68. char * RTFStdCharName(short code)
  69. {
  70.     if (code < 0 || code >= rtfSC_MaxChar)
  71.         return (NULL);
  72.     return (stdCharName[code]);
  73. }
  74.  
  75. short RTFStdCharCode (char    *name)
  76. {
  77.     short    i;
  78.  
  79.     for (i = 0; i < rtfSC_MaxChar; i++) {
  80.         if (strcmp (name, stdCharName[i]) == 0)
  81.             return (i);
  82.         }
  83.     return (-1);
  84. }
  85.  
  86.  
  87. #endif
  88.  
  89. #ifdef __cplusplus
  90. }
  91. #endif
  92.  
  93. #endif
  94.