home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / forut062.zip / ForUtil-0.62 / commons / lib_commons.h < prev    next >
C/C++ Source or Header  |  1997-01-23  |  3KB  |  107 lines

  1. /*****
  2. * lib_commons.h : public header file for f77 common scanning/searching stuff
  3. *
  4. * This file Version    $Revision: 1.5 $
  5. *
  6. * Creation date:    Fri Mar 15 03:02:11 GMT+0100 1996
  7. * Last modification:     $Date: 1996/08/27 19:13:14 $
  8. * By:            $Author: koen $
  9. * Current State:    $State: Exp $
  10. *
  11. * Author:        koen
  12. * (C)Copyright 1995 Ripley Software Development
  13. * All Rights Reserved
  14. *****/
  15. /*****
  16. * $Header: /usr/local/rcs/ForUtil/Commons/RCS/lib_commons.h,v 1.5 1996/08/27 19:13:14 koen Exp koen $
  17. *****/
  18. /*****
  19. * ChangeLog 
  20. * $Log: lib_commons.h,v $
  21. * Revision 1.5  1996/08/27 19:13:14  koen
  22. * ForUtil V0.62 update
  23. *
  24. * Revision 1.4  1996/07/30 01:57:03  koen
  25. * checkin for ForUtil 0.57
  26. *
  27. * Revision 1.3  1996/05/06 00:32:26  koen
  28. * Adapted for MSDOS.
  29. *
  30. * Revision 1.2  1996/04/25 02:27:20  koen
  31. * Cleanup and comments added.
  32. *
  33. * Revision 1.1  1996/03/15 04:16:39  koen
  34. * Initial Revision
  35. *
  36. *****/ 
  37.  
  38. #ifndef _lib_commons_h_
  39. #define _lib_commons_h_
  40.  
  41. /* standard needed includes */
  42. #include <stdio.h>
  43. #include <stdlib.h>
  44. #include <string.h>
  45. #include <sys/types.h>
  46. #include <gdbm.h>
  47. #include <sys/stat.h>
  48. #include <signal.h>
  49.  
  50. /* database file permissions */
  51. #ifndef __MSDOS__
  52. #define DBM_PERM (S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)
  53. #else
  54. #define DBM_PERM 0644
  55. #endif
  56.  
  57. /* keys for database information */
  58. #define DBM_ID_TOKEN        "__cmmndbId"
  59. #define DBM_UPDATE_TOKEN    "__cmmndbUpd"
  60. #define DBM_INFO_TOKEN        "__cmmndbInfo"
  61.  
  62. #ifndef __MSDOS__
  63. #ifdef SIGBUS 
  64. #define ATTACH_SIGNALS { \
  65.         signal(SIGBUS, sig_handler); \
  66.         signal(SIGSEGV, sig_handler); \
  67.         signal(SIGALRM, sig_handler); \
  68.         signal(SIGUSR1, sig_handler); \
  69.         signal(SIGQUIT, sig_handler); \
  70.         signal(SIGINT, sig_handler); }
  71. #else
  72. #define ATTACH_SIGNALS { \
  73.         signal(SIGSEGV, sig_handler); \
  74.         signal(SIGALRM, sig_handler); \
  75.         signal(SIGUSR1, sig_handler); \
  76.         signal(SIGQUIT, sig_handler); \
  77.         signal(SIGINT, sig_handler); }
  78. #endif    /* SIGBUS */
  79. #else
  80. #define ATTACH_SIGNALS { \
  81.         signal(SIGSEGV, sig_handler); \
  82.         signal(SIGUSR1, sig_handler); \
  83.         signal(SIGINT, sig_handler); }
  84. #endif /* __MSDOS__ */
  85.  
  86. /* default database name */
  87. #define DEF_DB    "commons.gdbm"
  88. #define COMMON_LOCATION    "COMMON_DATABASE"
  89. /* actually obsolete, but can be used to create separate databases */
  90. #define COMMON_PRIVATE_LOCATION "COMMON_PRIVATE_DATABASE"
  91. #define COMMON_MACHINE_LOCATION "COMMON_MACHINE_DATABASE"
  92.  
  93. /* scans a the block text for variable names */
  94. extern int scan_block(char *text, int line_num);
  95.  
  96. /* find out where the database files are located */
  97. extern char *get_database_location(char *db_env);
  98.  
  99. /* write and print the header of the file given */
  100. extern void print_commondb_header(GDBM_FILE db_file);
  101. extern void write_commondb_header(GDBM_FILE db_file, char *outfile);
  102. extern void write_commondb_dirinfo(GDBM_FILE db_file, char *dir);
  103. extern void write_commondb_update_info(GDBM_FILE db_file, int entries);
  104.  
  105. /* Don't add anything after this endif! */
  106. #endif /* _lib_commons_h_ */
  107.