home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 329_01 / read.me < prev    next >
Text File  |  1990-11-29  |  3KB  |  92 lines

  1. CSUBST version 2.5
  2.  
  3. This is a programme for extracting or changing the names of 
  4. identifiers and strings in C source code. 
  5. It can help you adapt a programme so that its English messages 
  6. can be changed to Italian, for example.
  7.  
  8. It can be easily adapted to other programming languages than C
  9. because the C dependent part is written in Lex. It can even 
  10. be worthwhile to apply it unchanged to English text.
  11.  
  12. Usage: CSUBST -S subst_file source_files...
  13.  in substitution mode
  14.  Note: the "-S" is redundant.
  15.  
  16. or CSUBST -X cfiles ...
  17.  in extraction mode,
  18. or CSUBST -F workfile -X
  19. or CSUBST -ntruncation_length -Mignore_file source_file
  20. where:
  21. *  cfiles is the name of a C source file.
  22. *  subst_file is a file with pairs of identifiers or strings separated
  23.   by spaces or newlines.
  24. * workfile is the name of a file in which there are filenames
  25. * truncation_length is a positive integer
  26. * ignore_file is a file containing list of names not to be truncated
  27.  
  28.  The following few lines are the beginning of a 
  29.     substitution file:
  30.  
  31.    root racine
  32.    node noeud
  33.    "Hello world" 
  34.     "Salut la terre"
  35.    "Goodbye cruel world"
  36.     "Au revoir, O monde cruel"
  37.    ...
  38.  
  39. Be careful! Other tokens are either ignored or not allowed.
  40.  
  41.  
  42. In substitution mode the source file is read and identifiers 
  43. are replaced if they appear as the left part of a substitution 
  44. in the subst_file. They are replaced by the corresponding 
  45. right hand identifier. The result is sent to the standard output
  46. and can therefore be redirected to a file.
  47. If you look at the sources you will see that the variable Mode will start
  48. as READ_SUBSTS and then switch to APPLY_SUBSTS.
  49.  
  50. In extraction mode the source file is scanned and a sorted table of
  51. the identifiers is sent to the standard output. The purpose of this is
  52. to help you write a substitution file.
  53.  
  54. The last feature to have been added concerns printing
  55. files while truncating identifiers. By way of example consider:
  56. csubst -n8 -Mmacnames.dat foo.c
  57. will print foo.c truncating identifier names to 8 characters (or whatever
  58. you supply) except for those names that figure in macnames.dat.
  59. In macnames you would probably want to put all the names of the 
  60. macros that are defined outside foo.c. csubst is not yet "smart" enough
  61. to look up the include files so as to tell what identifiers are macros
  62. but it will recognise those that are defined in the current file (foo.c).
  63.  
  64. The source files are
  65. csubst.l -- the lex file for the programme
  66. lexyy.c --  a file generated by flex from csubst.l
  67. cs_main.c -- the file containing the main()
  68. cs_hash.c -- the module that handles the list of substitutions
  69. makefile.tbc -- a makefile for Turbo C on MSDOS
  70. makefile.mwc -- a makefile for Mark Williams C on Atari TOS 
  71. makefile.ztc -- a makefile for Zortech C on DOS
  72. csubst.mak -- a makefile for Quick C
  73. read.me -- this file
  74. cs_xtrct.c -- the code for handling extraction mode.
  75. csubst.h -- manifest constants
  76. skeleton.h -- include file for lexyy.c 
  77. skelcom.h  -- include file for lexyy.c 
  78. st_lexyy.c -- lexyy.c for atari ST
  79.  
  80. You won't need lex or flex unless you modify csubst.l.
  81.  
  82. This programme is shareware, but almost freeware:
  83. If you found this programme useful then send me a colourful postcard
  84. with the words "Happy Birthday" (or equivalent) so that it arrives
  85. at my address around the first of January 1991. After that date
  86. this is public domain.
  87.  
  88. Henri de Feraudy
  89. 27 rue Chef de Ville
  90. 92140 Clamart 
  91. France
  92.