home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / kernserv / kern_loader_types.h < prev    next >
Text File  |  1991-09-16  |  2KB  |  85 lines

  1. /* 
  2.  * Copyright (c) 1989 NeXT, Inc.
  3.  *
  4.  * HISTORY
  5.  * 04-Apr-89  Gregg Kellogg (gk) at NeXT
  6.  *    Created.
  7.  *
  8.  */
  9.  
  10. #ifndef _KERN_LOADER_TYPES_
  11. #define _KERN_LOADER_TYPES_
  12.  
  13. #import <mach/port.h>
  14. #import <mach/boolean.h>
  15.  
  16. typedef char *printf_data_t;
  17. typedef char server_name_t[256];
  18. typedef server_name_t server_reloc_t;
  19. typedef server_name_t *server_name_array_t;
  20. typedef server_name_t *port_name_string_array_t;
  21. typedef boolean_t *boolean_array_t;
  22.  
  23. enum server_state {
  24.     Zombie = 0,
  25.     Allocating = 1,
  26.     Allocated = 2,
  27.     Loading = 3,
  28.     Loaded = 4,
  29.     Unloading = 5,
  30.     Deallocated = 6,
  31.     Detached = 7,
  32. };
  33.  
  34. typedef enum server_state server_state_t;
  35.  
  36. #define temp_server_state(s)    (   (s) == Allocating            \
  37.                  || (s) == Loading            \
  38.                  || (s) == Unloading)
  39.  
  40. static inline const char *server_state_string(server_state_t state)
  41. {
  42.     static const char * const strings[] = {
  43.         "Zombie",
  44.         "Allocating",
  45.         "Allocated",
  46.         "Loading",
  47.         "Loaded",
  48.         "Unloading",
  49.         "Deallocated",
  50.         "Detached",
  51.     };
  52.     return strings[state];
  53. };
  54.  
  55. /*
  56.  * Return error codes.
  57.  */
  58. #define KERN_LOADER_NO_PERMISSION    101
  59. #define KERN_LOADER_UNKNOWN_SERVER    102
  60. #define KERN_LOADER_SERVER_LOADED    103
  61. #define KERN_LOADER_SERVER_UNLOADED    104
  62. #define KERN_LOADER_NEED_SERVER_NAME    105
  63. #define KERN_LOADER_SERVER_EXISTS    106
  64. #define KERN_LOADER_PORT_EXISTS        107
  65. #define KERN_LOADER_SERVER_WONT_LINK    108
  66. #define KERN_LOADER_SERVER_WONT_LOAD    109
  67. #define KERN_LOADER_CANT_OPEN_SERVER    110
  68. #define KERN_LOADER_BAD_RELOCATABLE    111
  69. #define KERN_LOADER_MEM_ALLOC_PROBLEM    112
  70. #define KERN_LOADER_SERVER_DELETED    113
  71. #define KERN_LOADER_WONT_UNLOAD        114
  72. #define KERN_LOADER_DETACHED        115
  73.  
  74. /*
  75.  * Our name (for netname lookup)
  76.  */
  77. #define KERN_LOADER_NAME "server_loader"
  78.  
  79. /*
  80.  * Get port for communication with kern_loader.
  81.  */
  82. extern kern_retu' kern_loader_look_up(port_t *kern_loader_port);
  83.  
  84. #endif _KERN_LOADER_TYPES_
  85.