home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume15 / xmail / part03 / defs.h next >
C/C++ Source or Header  |  1991-10-29  |  6KB  |  165 lines

  1. /*
  2.  * xmail - X window system interface to the mail program
  3.  *
  4.  * Copyright 1989 The University of Texas at Austin
  5.  *
  6.  * Author:    Po Cheung
  7.  * Date:    March 10, 1989
  8.  *
  9.  * Permission to use, copy, modify, and distribute this software and
  10.  * its documentation for any purpose and without fee is hereby granted,
  11.  * provided that the above copyright notice appear in all copies and that
  12.  * both that copyright notice and this permission notice appear in
  13.  * supporting documentation.  The University of Texas at Austin makes no 
  14.  * representations about the suitability of this software for any purpose.  
  15.  * It is provided "as is" without express or implied warranty.
  16.  *
  17.  * Copyright 1990,1991 by National Semiconductor Corporation
  18.  *
  19.  * Permission to use, copy, modify, and distribute this software and its
  20.  * documentation for any purpose is hereby granted without fee, provided that
  21.  * the above copyright notice appear in all copies and that both that
  22.  * copyright notice and this permission notice appear in supporting
  23.  * documentation, and that the name of National Semiconductor Corporation not
  24.  * be used in advertising or publicity pertaining to distribution of the
  25.  * software without specific, written prior permission.
  26.  *
  27.  * NATIONAL SEMICONDUCTOR CORPORATION MAKES NO REPRESENTATIONS ABOUT THE
  28.  * SUITABILITY OF THIS SOFTWARE FOR ANY PURPOSE.  IT IS PROVIDED "AS IS"
  29.  * WITHOUT EXPRESS OR IMPLIED WARRANTY.  NATIONAL SEMICONDUCTOR CORPORATION
  30.  * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED
  31.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
  32.  * EVENT SHALL NATIONAL SEMICONDUCTOR CORPORATION BE LIABLE FOR ANY SPECIAL,
  33.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  34.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  35.  * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  36.  * PERFORMANCE OF THIS SOFTWARE.
  37.  *
  38.  * Author:  Michael C. Wagnitz - National Semiconductor Corporation
  39. */
  40.  
  41.  
  42. #include <stdio.h>
  43. #if XtSpecificationRelease > 4
  44. #else
  45. #include <sys/types.h>
  46. #endif
  47. #include <sys/param.h>
  48. #include <X11/Xos.h>
  49.  
  50. #if XtSpecificationRelease > 4
  51. #ifndef    X_NOT_STDC_ENV
  52. #include <stdlib.h>
  53. #else
  54. char    *malloc(), *realloc(), *calloc();
  55. #endif
  56. #if defined(macII) && !defined(__STDC__)   /* stdlib.h fails to define these */
  57. char    *malloc(), *realloc(), *calloc();
  58. #endif    /* macII */
  59. #endif
  60.  
  61. #include <X11/IntrinsicP.h>
  62. #include <X11/StringDefs.h>
  63. #include <X11/Shell.h>
  64. #include <X11/Xatom.h>
  65. #include <X11/Xaw/Cardinals.h>
  66. #include <X11/Xaw/Paned.h>
  67. #include <X11/Xaw/Form.h>
  68. #include <X11/Xaw/AsciiText.h>
  69. #include <X11/Xaw/TextP.h>
  70. #include <X11/Xaw/Box.h>
  71. #include <X11/Xaw/List.h>
  72. #include <X11/Xaw/Command.h>
  73. #include <X11/Xaw/Dialog.h>
  74. #include <X11/Xaw/Label.h>
  75.  
  76. #if XtSpecificationRelease > 4
  77. #include <X11/Xfuncs.h>            /* for bcopy, et.al. */
  78. #else
  79. #define    _XawTextActionsTable        textActionsTable
  80. #define    _XawTextActionsTableCount    textActionsTableCount
  81. #endif
  82.  
  83. #define    TITLE        "xmail 1."    /* program title and version string */
  84. #define    StartPos     6        /* size of 'File: ' (del stop point) */
  85. #define    LASTCH(s)    (s[ *s ? strlen(s) - 1 : 0])
  86. #define    CHARHEIGHT(X)    (X->max_bounds.descent + X->max_bounds.ascent)
  87. #define    APPEND        True        /* used in writeTo function logic */
  88. #define    REPLACE        False
  89. #define    WATCH        True        /* used in SetCursor function logic */
  90. #define    NORMAL        False
  91.  
  92. #ifndef    DEFAULT_MAILER
  93. #define    DEFAULT_MAILER    "/usr/ucb/Mail"
  94. #endif
  95.  
  96. #if defined(SYSV) && !defined(SIGCHLD)
  97. #define    SIGCHLD        SIGCLD
  98. #endif
  99.  
  100. typedef struct {
  101.     XFontStruct    *textFont;        /* font to use when displaying text */
  102.     XFontStruct    *helpFont;        /* font to use when displaying help */
  103.     XFontStruct    *buttonFont;        /* font to use when making buttons */
  104.     String    iconGeometry;        /* xmail icon geometry */
  105.     String    MFileName;        /* mail option -f filename */
  106.     String    editorCommand;        /* optional xmail send edit command */
  107.     Dimension    shellWidth;        /* xmail window width */
  108.     Dimension    fileBoxWidth;        /* file window box width */
  109.     Dimension    indexHeight;        /* index window height */
  110.     Dimension    textHeight;        /* text window height */
  111.     Dimension    buttonWidth;        /* command button width */
  112.     Dimension    buttonHeight;        /* command button height */
  113.     Dimension    commandHSpace;        /* command horizontal spacing */
  114.     Dimension    commandVSpace;        /* command vertical spacing */
  115.     Dimension    commandHeight;        /* command window height */
  116.     Dimension    helpWidth;        /* width of the help text popup */
  117.     Dimension    helpHeight;        /* height of the help text popup */
  118.     Dimension    helpX;            /* help x offset from textWindow */
  119.     Dimension    helpY;            /* help y offset from textWindow */
  120.     Dimension    menuX;            /* menu x offset from parent */
  121.     Dimension    menuY;            /* menu y offset from parent */
  122.     Boolean    bellRing;        /* xmail audible bell option */
  123.     Boolean    expert;            /* do not confirm destructive acts */
  124.     Boolean    iconic;            /* xmail starts in withdrawn state */
  125.     Boolean    mailopt_n;        /* mail option -n */
  126.     Boolean    mailopt_U;        /* mail option -U */
  127.     Boolean    Show_Last;        /* xmail show latest option -ls */
  128.     Boolean    Show_Info;        /* Do (or don't) show info messages */
  129.     Boolean    No_X_Hdr;        /* don't show xface header option -nx */
  130.     int        borderWidth;        /* default or specified border width */
  131. } XmailResources;
  132.  
  133.  
  134. /*
  135. ** structure sent to AddMenuButton()
  136. */
  137. typedef struct    menuList_str
  138.     {
  139.     String        label;
  140.     XtCallbackProc    func;
  141.     String        data;
  142.     } menuList, *menuList_p;
  143.  
  144. /*
  145. ** structure used by AddHelpText() and ShowHelp()
  146. */
  147. typedef struct    helpList_str
  148.     {
  149.     int        indx;
  150.     String        name[27];
  151.     Widget        text[27];
  152.     } helpList, *helpList_p;
  153.  
  154.  
  155. typedef struct {
  156.     char            *pat;        /* regular expression */
  157.     char            *buf;        /* buffer for compiled regexp */
  158. } PatternRec, *PatternRecPtr;
  159.  
  160.  
  161. typedef struct {
  162.     char            *name;        /* recipient name */
  163.     char            *alias;        /* alias for name */
  164. } AliasRec, *AliasRecPtr;
  165.