firstfile.c 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* Find the initialization functions of following files.
  2. This goes with initialize.h and lastfile.c.
  3. Copyright (C) 1986 Free Software Foundation, Inc.
  4. NO WARRANTY
  5. BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
  6. NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
  7. WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
  8. RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
  9. WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  10. BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  11. FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
  12. AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
  13. DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
  14. CORRECTION.
  15. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
  16. STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
  17. WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
  18. LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
  19. OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  20. USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
  21. DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
  22. A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
  23. PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
  24. DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  25. GENERAL PUBLIC LICENSE TO COPY
  26. 1. You may copy and distribute verbatim copies of this source file
  27. as you receive it, in any medium, provided that you conspicuously and
  28. appropriately publish on each copy a valid copyright notice "Copyright
  29. (C) 1986 Free Software Foundation, Inc."; and include following the
  30. copyright notice a verbatim copy of the above disclaimer of warranty
  31. and of this License.
  32. 2. You may modify your copy or copies of this source file or
  33. any portion of it, and copy and distribute such modifications under
  34. the terms of Paragraph 1 above, provided that you also do the following:
  35. a) cause the modified files to carry prominent notices stating
  36. that you changed the files and the date of any change; and
  37. b) cause the whole of any work that you distribute or publish,
  38. that in whole or in part contains or is a derivative of this
  39. program or any part thereof, to be freely distributed
  40. and licensed to all third parties on terms identical to those
  41. contained in this License Agreement (except that you may choose
  42. to grant more extensive warranty protection to third parties,
  43. at your option).
  44. 3. You may copy and distribute this program or any portion of it in
  45. compiled, executable or object code form under the terms of Paragraphs
  46. 1 and 2 above provided that you do the following:
  47. a) cause each such copy to be accompanied by the
  48. corresponding machine-readable source code, which must
  49. be distributed under the terms of Paragraphs 1 and 2 above; or,
  50. b) cause each such copy to be accompanied by a
  51. written offer, with no time limit, to give any third party
  52. free (except for a nominal shipping charge) a machine readable
  53. copy of the corresponding source code, to be distributed
  54. under the terms of Paragraphs 1 and 2 above; or,
  55. c) in the case of a recipient of this program in compiled, executable
  56. or object code form (without the corresponding source code) you
  57. shall cause copies you distribute to be accompanied by a copy
  58. of the written offer of source code which you received along
  59. with the copy you received.
  60. 4. You may not copy, sublicense, distribute or transfer this program
  61. except as expressly provided under this License Agreement. Any attempt
  62. otherwise to copy, sublicense, distribute or transfer this program is void and
  63. your rights to use the program under this License agreement shall be
  64. automatically terminated. However, parties who have received computer
  65. software programs from you with this License Agreement will not have
  66. their licenses terminated so long as such parties remain in full compliance.
  67. */
  68. /* This is a magical hack for finding, automatically,
  69. all the files that are linked together
  70. and calling an initialization function in each one
  71. without requiring the main file to know which other
  72. files there are.
  73. Call initialize_all_files to run the initialization functions
  74. of all the files. Each initialization function can enter
  75. the commands of its file into a global data base so that the
  76. contents of the file can be used.
  77. The files to be found must follow this file. Each of them
  78. must start START_FILE, before any other functions,
  79. and end with END_FILE, after any other functions.
  80. These macros are defined in initialize.h.
  81. In addition, each file must contain a function named
  82. `initialize', which will be called with no arguments.
  83. After the files to be found must come the file `lastfile'
  84. which ends the chain of calls. */
  85. #include "initialize.h"
  86. static initialize_next_file ();
  87. static initialize_dummy_1 ();
  88. static initialize_dummy_2 ();
  89. initialize_all_files ()
  90. {
  91. initialize_next_file ((char *) initialize_dummy_2
  92. - (char *) initialize_dummy_1);
  93. }
  94. /* The next two functions exist just so we can find
  95. out how long the first of them is.
  96. That tells us how long initialize_next_file is,
  97. since that function has the same definition as this one. */
  98. static
  99. initialize_dummy_1 (offset)
  100. int offset;
  101. {
  102. long addr = FILEADDR_ROUND ((int) initialize_next_file + offset);
  103. (*(void (*) ()) addr) (offset);
  104. }
  105. static
  106. initialize_dummy_2 ()
  107. {
  108. }
  109. /* This makes the function initialize_next_file. */
  110. END_FILE