home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume33 / problem / part01 / utilities.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-19  |  3.4 KB  |  87 lines

  1. /*
  2. ** utilities.h - functions in utilities.C
  3. **
  4. ** utilities.h utilities.h 1.27   Delta'd: 17:42:55 10/8/92   Mike Lijewski, CNSF
  5. **
  6. ** Copyright (c) 1991, 1992 Cornell University
  7. ** All rights reserved.
  8. **
  9. ** Redistribution and use in source and binary forms are permitted
  10. ** provided that: (1) source distributions retain this entire copyright
  11. ** notice and comment, and (2) distributions including binaries display
  12. ** the following acknowledgement:  ``This product includes software
  13. ** developed by Cornell University'' in the documentation or other
  14. ** materials provided with the distribution and in all advertising
  15. ** materials mentioning features or use of this software. Neither the
  16. ** name of the University nor the names of its contributors may be used
  17. ** to endorse or promote products derived from this software without
  18. ** specific prior written permission.
  19. **
  20. ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  21. ** IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  22. ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  23. */
  24.  
  25. #ifndef __UTILITIES_H
  26. #define __UTILITIES_H
  27.  
  28. #include <stdio.h>
  29. #include "classes.h"
  30.  
  31. //
  32. // possible response for yes_or_no command
  33. //
  34. enum Response { No, Yes };
  35.  
  36. extern void         adjust_window();
  37. extern void         block_tstp_and_winch();
  38. extern void         cleanup(int);
  39. extern void         display_string(const char *str, int len =0, int offset =0); 
  40. extern void         eat_a_character(const char *msg, void (*redisplay)(),int=0);
  41. extern void         error(const char *format, ...);
  42. extern void         exec_with_system(const char *cmd, int prompt = 1);
  43. extern int          execute(const char *file, const char *argv[]);
  44. extern const char  *expand_tilde(char *str);
  45. extern char        *fgetline(FILE *fp, int size);
  46. extern char        *get_prob_number(const DList *dl);
  47. extern void         initialize();
  48. extern void         initial_listing(DList *dl);
  49. extern void         leftshift_current_line(DList *dl);
  50. extern int          lines_displayed(DList *dl);
  51. extern int          read_and_exec_perm(const char *file);
  52. extern void         rightshift_current_line(DList *dl);
  53. extern void         lock_file(int fd);
  54. extern void         message(const char *fmt, const char *str = 0);
  55. extern char        *prompt(const char *msg, void (*redisplay)());
  56. extern int          read_file(FILE *, char** &, int, int, int = 0);
  57. extern long         seconds_in_date(const char *date);
  58. extern void         set_signals();
  59. extern const char  *temporary_file();
  60. extern const char **tokenize(const char *line, const char *separators);
  61. extern void         unblock_tstp_and_winch();
  62. extern void         unlock_file(int fd);
  63. extern void         unset_signals();
  64. extern void         update_modeline(const char *head=0, const char *tail=0);
  65. extern void         update_screen_line(const char *oldl, const char *newl, int y);
  66. extern const char  *username();
  67. extern void         winch(int);
  68. extern void         write_to_pipe(int fd, const char *data, int size);
  69. extern int          yes_or_no(const char *msg,
  70.                               void (*redisplay)(),
  71.                               Response defResponse,
  72.                               int standout);
  73.  
  74. // has the window size changed?
  75. extern int windowSizeChanged;
  76.  
  77. // is the message window dirty?
  78. extern int message_window_dirty;
  79.  
  80. // the current modeline
  81. extern char *current_modeline;
  82.  
  83. // max - the maximum of two integer arguments.
  84. inline int max(int x, int y) { return x >= y ? x : y; }
  85.  
  86. #endif /*__UTILITIES_H*/
  87.