home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / A / PS / PROCPS-0.000 / PROCPS-0 / procps-0.97 / psdata.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-25  |  1.2 KB  |  61 lines

  1. /*
  2.  * psdata.h
  3.  *
  4.  */
  5.  
  6. /* #define    DEBUG    1 */
  7.  
  8.  
  9. #define    PSDATABASE    "/etc/psdatabase"
  10. #define    PS_MAGIC    "PSDATA.96"
  11. #define    SWAPPATH    "/dev/swap"
  12.  
  13.  
  14. struct dbtbl_s {
  15.     off_t        off;        /* offset in psdatabase */
  16.     int            nsym;        /* # symbols */
  17.     int            size;        /* size of array + strings */
  18. };
  19.  
  20. /*
  21.  * header of psdatabase
  22.  */
  23. struct psdb_hdr {
  24.     char        magic[16];
  25.     char        uts_release[8];
  26.     char        uts_version[8];
  27.     char        sys_path[128];    /* name of system binary */
  28.     char        swap_path[128];    /* name of swap device */
  29.     struct dbtbl_s    vars;        /* bss and data symbols */
  30.     struct dbtbl_s    fncs;        /* list of all functions */
  31.     struct dbtbl_s    ttys;        /* tty names */
  32. };
  33.  
  34. struct sym_s {
  35.     unsigned long    addr;        /* core address in kernel */
  36.     int            name;        /* offset from strings ptr */
  37. };
  38.  
  39. struct tbl_s {
  40.     struct sym_s    *tbl;
  41.     int            nsym;
  42.     char        *strings;    /* ptr to start of strings */
  43. };
  44.  
  45. extern struct tbl_s vars, fncs;
  46. extern struct psdb_hdr db_hdr;
  47. extern char *swappath[];
  48. extern char *ttynames;
  49.  
  50.  
  51. #ifdef DEBUG
  52. extern int Debug;
  53. #else
  54. #define Debug 0
  55. #endif
  56.  
  57. void *xmalloc(unsigned int);
  58. void *xrealloc(void *, unsigned int);
  59. int read_tbl(struct dbtbl_s *dbtbl, struct tbl_s *tbl);
  60.  
  61.