home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / sun / volume1 / contool2.2 / part02 / contool.h next >
Encoding:
C/C++ Source or Header  |  1989-10-26  |  4.8 KB  |  133 lines

  1. /************************************************************************/
  2. /*    Copyright 1988, 1989 by Chuck Musciano and Harris Corporation    */
  3. /*                                    */
  4. /*    Permission to use, copy, modify, and distribute this software    */
  5. /*    and its documentation for any purpose and without fee is    */
  6. /*    hereby granted, provided that the above copyright notice    */
  7. /*    appear in all copies and that both that copyright notice and    */
  8. /*    this permission notice appear in supporting documentation, and    */
  9. /*    that the name of Chuck Musciano and Harris Corporation not be    */
  10. /*    used in advertising or publicity pertaining to distribution    */
  11. /*    of the software without specific, written prior permission.    */
  12. /*    Chuck Musciano and Harris Corporation make no representations    */
  13. /*    about the suitability of this software for any purpose.  It is    */
  14. /*    provided "as is" without express or implied warranty.  This     */
  15. /*    software may not be sold without the prior explicit permission    */
  16. /*    of Harris Corporation.                        */
  17. /************************************************************************/
  18.  
  19. /**************** Site dependent parameters ****************************/
  20.  
  21. /* Where the default contool icons are kept.  !Must end in '/'! */
  22.  
  23. #if !defined(ICON_DIRECTORY)
  24. #define        ICON_DIRECTORY        "./icons/"
  25. #endif
  26.  
  27. /* Where the Sun-provided fonts reside.  Probably already correct */
  28.  
  29. #define        BOLD_FONT        "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
  30. #define        REGULAR_FONT        "/usr/lib/fonts/fixedwidthfonts/screen.r.14"
  31.  
  32. /* The default icon names.  Alternate sets are shown, and you might want
  33.    to try these instead of the default set by uncommenting the desired set. */
  34.  
  35. /* This set gives a blinking stop sign when messages arrive. */
  36. #define        GOOD_ICON        "contool.icon"
  37. #define        BAD_ICON        "stopsign.icon"
  38. #define        INVERSE_ICON        "stopsign_inv.icon"
  39.  
  40. /* This set gives a terminal, labelled "Console", in a box.  The screen
  41.    flashes when messages arrive. */
  42. /* #define        GOOD_ICON    "contool.icon" */
  43. /* #define        BAD_ICON    "contool.icon" */
  44. /* #define        INVERSE_ICON    "contool_bad.icon" */
  45.  
  46. /* This set gives a terminal, without a box.  Again, the screen flashes
  47.    when messages arrive. */
  48. /* #define        GOOD_ICON    "console1.icon" */
  49. /* #define        BAD_ICON    "console1_bad.icon" */
  50. /* #define        INVERSE_ICON    "console1_flash.icon" */
  51.  
  52. /*************** End of site dependencies ******************************/
  53.  
  54. #ifndef TRUE
  55. #define        TRUE            1
  56. #define        FALSE            0
  57. #endif
  58.  
  59. #define        PRIVATE            static
  60. #define        PUBLIC            extern
  61. #define        EXPORT
  62.  
  63. #define        TOOL_LABEL        "<< Console Tool 2.2 >>"
  64.  
  65. #define        strsave(s)        ((char *) strcpy(malloc(strlen(s) + 1), s))
  66.  
  67. #define        BEEP_COUNT        3
  68. #define        TS_INTERVAL        60
  69.  
  70. #define        TEXT_SIZE_LIMIT        32768
  71. #define        TEXT_SIZE_FUZZ        1024
  72. #define        TEXT_DELETE_SIZE    1024
  73.  
  74. #define        INPUT_BUFFER_SIZE    4096
  75.  
  76. typedef    char    boolean;
  77. typedef    struct    f_data    f_rec, *f_ptr;
  78.  
  79. struct    f_data    {char        *start;        /* starting string */
  80.          char        *start_re;    /* starting compiled regular expression */
  81.          char        *end;        /* ending string */
  82.          char        *end_re;    /* starting compiled regular expression */
  83.          int        scircf;        /* used by regex */
  84.          int        ecircf;        /* used by regex */
  85.          boolean    valid;        /* filter expressions are valid */
  86.          boolean    beep;        /* number of times to beep */
  87.          boolean    flash;        /* make the icon blink */
  88.          boolean    open;        /* pop open the console window */
  89.          boolean    save;        /* save message in console */
  90.          boolean    stamp;        /* timestamp message */
  91.         };
  92.  
  93. PUBLIC    struct    pixrect    better_button_cross;
  94. PUBLIC    struct    pixrect    handle_pix;
  95. PUBLIC    struct    pixrect    nohandle_pix;
  96. PUBLIC    struct    pixrect    beep_0_pix;
  97. PUBLIC    struct    pixrect    beep_1_pix;
  98. PUBLIC    struct    pixrect    beep_2_pix;
  99. PUBLIC    struct    pixrect    beep_3_pix;
  100. PUBLIC    struct    pixrect    beep_4_pix;
  101. PUBLIC    struct    pixrect    open_pix;
  102. PUBLIC    struct    pixrect    close_pix;
  103. PUBLIC    struct    pixrect    flash_pix;
  104. PUBLIC    struct    pixrect    noflash_pix;
  105. PUBLIC    struct    pixrect    save_pix;
  106. PUBLIC    struct    pixrect    nosave_pix;
  107. PUBLIC    struct    pixrect    stamp_pix;
  108. PUBLIC    struct    pixrect    nostamp_pix;
  109. PUBLIC    struct    pixrect    single_pix;
  110. PUBLIC    struct    pixrect    range_pix;
  111. PUBLIC    struct    pixrect    stopsign_pix;
  112.  
  113. PUBLIC    char    filter_path[256];
  114. PUBLIC    int    pop_open;
  115. PUBLIC    int    beep_amount;
  116. PUBLIC    int    blink_icon;
  117. PUBLIC    int    do_time_stamp;
  118. PUBLIC    f_ptr    filters;
  119. PUBLIC    f_ptr    curr_filter;
  120.  
  121. PUBLIC    int    match_exp(/* char *exp, int circ, char *str */);
  122. PUBLIC    char    *compile_exp(/* f_ptr filter, char *start, char *end */);
  123. PUBLIC    int    getline(/* FILE *f, char *buf, int max */);
  124. PUBLIC    char    getopt(/* int *argc, char **argv, char *opts, char **parm*/);
  125. PUBLIC    char    *lower(/* char *str */);
  126. PUBLIC    int    verify(/* char *source, char *valid */);
  127. PUBLIC    char    **saveargs(/* int argc, char **argv */);
  128. PUBLIC    char    *open_psuedo_tty(/* FILE **master, char *m_mode, FILE **slave, char *s_mode */);
  129. PUBLIC    char    *index();
  130. PUBLIC    f_ptr    read_filters(/* char *path, void (*f)() */);
  131. PUBLIC    f_ptr    next_filter(/* f_ptr *base, int *curr, int *limit */);
  132. PUBLIC    char    **tokenize(/* char *line, int *count */);
  133.