home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / C / Games / Xconq 7.1.0 / src / xconq-7.1.0 / Ad2c / ad2c.man next >
Encoding:
Text File  |  1996-07-07  |  2.3 KB  |  89 lines  |  [TEXT/R*ch]

  1. .TH ad2c 1 "19 Apr 1993"
  2. .SH NAME
  3. ad2c \- convert resource files to C declarations
  4. .SH SYNOPSIS
  5. .I ad2c
  6. [ files ]
  7. .SH DESCRIPTION
  8. .LP
  9. .I Ad2c
  10. converts X resource files into C declarations, appropriate for
  11. inclusion as fallback resources.  The program is a
  12. .IR sed (1)
  13. script which is effectively a finite state machine, escaping quotes
  14. and backslashes (and newlines where necessary), and adding quotes and
  15. commas as needed for array initialization.
  16. .LP
  17. It reads from the given files (or stdin if none are given) and writes
  18. the C declarations to stdout.
  19. .SH USAGE
  20. The following example shows a typical use of
  21. .I ad2c
  22. to ensure that an application always has the latest version of its
  23. resources compiled into the executable.  Suppose the application
  24. defaults file is named "Foobar.ad", for application
  25. .IR foobar .
  26. Then the following lines in a Makefile or Imakefile will indicate
  27. how and when to run
  28. .IR ad2c :
  29.  
  30. .nf
  31. .na
  32.     Foobar.ad.h: Foobar.ad
  33.             ad2c Foobar.ad >Foobar.ad.h
  34. .ad
  35. .fi
  36.  
  37. The resulting C strings should be included (say in "foobar.c"):
  38.  
  39. .nf
  40. .na
  41.     static char fallback_resources[] = {
  42.         #include "Foobar.ad.h"
  43.         NULL
  44.     };
  45. .ad
  46. .fi
  47.  
  48. This array of strings can then be given as a parameter to
  49. .IR XtAppInitialize (3X)
  50. or otherwise used to initialize the application's resources.  Running
  51. .I makedepend
  52. or adding the line
  53.  
  54. .nf
  55. .na
  56.     foobar.c: Foobar.ad.h
  57. .ad
  58. .fi
  59.  
  60. to the Makefile or Imakefile will ensure that "foobar.c" is
  61. recompiled when necessary (ie., whenever "Foobar.ad" changes).
  62. .SH "RETURN VALUE"
  63. .LP
  64. .I Ad2c
  65. returns as for
  66. .IR sed .
  67. .SH "SEE ALSO"
  68. sed(1)
  69. .SH DISCLAIMER
  70. .LP
  71. This software is provided as is with no warranty expressed or implied.
  72. I hope you find it useful, but I won't be held responsable for
  73. any damage that may occur from reading, compiling, installing or
  74. using it.
  75. .LP
  76. You are free to use any part of this code for other purposes. It
  77. would be nice if you could keep my name on some part of whatever the
  78. final product is.
  79. .SH AUTHOR
  80. .LP
  81. George Ferguson, ferguson@cs.rochester.edu.
  82. .LP
  83. Man page by Joseph Beckenbach, jerbil@ultra.com. Usage section added
  84. by George Ferguson. Example corrected by Tim Theisen, tim@cs.wisc.edu.
  85. Example further corrected by David Wojtowicz, davidw@vista.atmos.uiuc.edu.
  86. .LP
  87. Modified to work with Gnu and IBM sed by Charles Hannum,
  88. mycroft@gnu.ai.mit.edu.
  89.