Source:NetHack 5.0.0/src/objects.c

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to objects.c from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/src/objects.c#line12]], for example.

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1. /* NetHack 5.0	objects.c	$NHDT-Date: 1596498192 2020/08/03 23:43:12 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.66 $ */
2. /* Copyright (c) Mike Threepoint, 1989.                           */
3. /* NetHack may be freely redistributed.  See license for details. */
4. 
5. #include "config.h"
6. #include "weight.h"
7. #include "obj.h"
8. 
9. #include "prop.h"
10. #include "skills.h"
11. #include "color.h"
12. #include "objclass.h"
13. 
14. static struct objdescr obj_descr_init[NUM_OBJECTS + 1] = {
15. #define OBJECTS_DESCR_INIT
16. #include "objects.h"
17. #undef OBJECTS_DESCR_INIT
18. };
19. 
20. static struct objclass obj_init[NUM_OBJECTS + 1] = {
21. #define OBJECTS_INIT
22. #include "objects.h"
23. #undef OBJECTS_INIT
24. };
25. 
26. void objects_globals_init(void); /* in hack.h but we're using config.h */
27. 
28. struct objdescr obj_descr[SIZE(obj_descr_init)];
29. struct objclass objects[SIZE(obj_init)];
30. 
31. void
32. objects_globals_init(void)
33. {
34.     memcpy(obj_descr, obj_descr_init, sizeof(obj_descr));
35.     memcpy(objects, obj_init, sizeof(objects));
36. }
37. 
38. /*objects.c*/