def.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
* All Rights Reserved
*
*
* Copyright (c) 1985-2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
/*
* University Copyright- Copyright (c) 1982, 1986, 1988
* The Regents of the University of California
* All Rights Reserved
*
* University Acknowledgment- Portions of this document are derived from
* software developed by the University of California, Berkeley, and its
* contributors.
*/
#ifndef _MAILX_DEF_H
#define _MAILX_DEF_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <signal.h>
#include <stdio.h>
#include <fcntl.h>
#include <string.h>
#include <termio.h>
#include <setjmp.h>
#include <time.h>
#include <maillock.h>
#include <ctype.h>
#include <errno.h>
#ifndef preSVr4
# include <unistd.h>
# include <stdlib.h>
# include <ulimit.h>
# include <wait.h>
#endif
#ifdef VMUNIX
#endif
#include "local.h"
#include "uparm.h"
/*
* mailx -- a modified version of a University of California at Berkeley
* mail program
*/
#define NOSTR ((char *) 0) /* Nill string pointer */
#define NOSTRPTR ((char **) 0) /* Nill pointer to string pointer */
#define NOINTPTR ((int *) 0) /* Nill pointer */
struct message {
long m_size; /* Bytes in the message */
long m_lines; /* Lines in the message */
long m_clen; /* Content-Length of the mesg */
short m_flag; /* flags, see below */
char m_text; /* TRUE if the contents is text */
/* False otherwise */
};
typedef struct fplst {
} NODE;
/*
* flag bits.
*/
/*
* Format of the command description table.
* The actual table is declared and initialized
* in lex.c
*/
struct cmd {
char *c_name; /* Name of command */
int (*c_func)(void *); /* Implementor of the command */
short c_argtype; /* Type of arglist (see below) */
short c_msgflag; /* Required flags of messages */
short c_msgmask; /* Relevant flags of messages */
};
/* can't initialize unions */
/*
* Argument types.
*/
#define MSGLIST 0 /* Message list type */
#define P 040 /* Autoprint dot after command */
#define I 0100 /* Interactive command bit */
#define M 0200 /* Legal from send mode bit */
#define W 0400 /* Illegal when read only bit */
#define F 01000 /* Is a conditional command */
#define T 02000 /* Is a transparent command */
#define R 04000 /* Cannot be called from collect */
/*
* Oft-used mask values
*/
/*
* Structure used to return a break down of a head
* line
*/
struct headline {
char *l_from; /* The name of the sender */
char *l_tty; /* His tty string (if any) */
char *l_date; /* The entire date string */
};
/* Mask of all header lines */
/*
* Structure used to pass about the current
* state of the user-typed message header.
*/
struct header {
char *h_to; /* Dynamic "To:" string */
char *h_subject; /* Subject string */
char *h_cc; /* Carbon copies string */
char *h_bcc; /* Blind carbon copies */
char *h_defopt; /* Default options */
char **h_others; /* Other header lines */
int h_seq; /* Sequence for optimization */
};
/*
* Structure of namelist nodes used in processing
* the recipients of mail and aliases and all that
* kind of stuff.
*/
struct name {
short n_type; /* From which list it came */
char *n_name; /* This fella's name */
char *n_full; /* Full name */
};
/*
* Structure of a variable node. All variables are
* kept on a singly-linked list of these, rooted by
* "variables"
*/
struct var {
char *v_name; /* The variable's name */
char *v_value; /* And it's current value */
};
struct mgroup {
char *ge_name; /* This person's user name */
};
struct grouphead {
char *g_name; /* Name of this group */
};
#define TRUE 1
#define FALSE 0
#ifndef MFMODE
#endif
/*
* Structure of the hash table of ignored header fields
*/
struct ignore {
char *i_field; /* This ignored field */
};
#ifdef preSVr4
struct utimbuf {
};
#else
# include <utime.h>
#endif
/*
* Token values returned by the scanner used for argument lists.
* Also, sizes of scanner-related things.
*/
#define TEOL 0 /* End of the command line */
/*
* Constants for conditional commands. These describe whether
* we should be executing stuff or not.
*/
#define CANY 0 /* Execute in send or receive mode */
/*
* Flags for msend().
*/
/*
* don't have it, fork(2) will do . . .
*/
#endif
#ifndef SIGRETRO
#define sigchild()
#endif
/*
* 4.2bsd signal interface help...
*/
#ifdef VMUNIX
#else
#ifndef preSVr4
/* SVr4 version of sigset() in fio.c */
#define longjmp siglongjmp
#define jmp_buf sigjmp_buf
#else
#define OLD_BSD_SIGS
#endif
#endif
/*
* Truncate a file to the last character written. This is
* useful just before closing an old file that was opened
*/
/*
* The pointers for the string allocation routines,
* there are NSPACE independent areas.
* The first holds STRINGSIZE bytes, the next
* twice as much, and so on.
*/
struct strings {
char *s_topFree; /* Beginning of this area */
char *s_nextFree; /* Next alloctable place here */
unsigned s_nleft; /* Number of bytes left here */
};
/* The following typedefs must be used in SVR4 */
#ifdef preSVr4
#ifndef sun
typedef int gid_t;
typedef int uid_t;
typedef int mode_t;
typedef int pid_t;
#endif
#endif
#define STSIZ 40
#define TMPSIZ 14
/*
* Forward declarations of routine types to keep lint and cc happy.
*/
extern char *Getf(register char *s);
extern void Verhogen(void);
extern int alternates(char **namelist);
extern void announce(void);
extern void commands(void);
extern int deassign(register char *s);
extern int docomma(char *s);
extern int elsecmd(void);
extern int endifcmd(void);
extern int first(int f, int m);
extern void flush(void);
extern void hangup(int);
extern int help(void);
extern void holdsigs(void);
extern int inc(void);
extern void inithost(void);
extern void lockmail(void);
extern void minit(void);
extern int newfileinfo(int start);
extern int null(char *e);
extern int pcmdlist(void);
extern int pdot(void);
extern void printgroup(char name[]);
extern int pversion(char *e);
extern void relsesigs(void);
extern int removefile(char name[]);
extern int replysender(int *msgvec);
extern int rexit(int e);
extern char *safeexpand(char name[]);
int fuzzy);
extern void savedead(int s);
extern int screensize(void);
#ifndef sigchild
extern void sigchild(void);
#endif
#ifndef sigset
extern void (*sigset())();
#endif
extern void sreset(void);
extern void stop(int s);
extern void tinit(void);
extern int tmail(void);
extern void unlockmail(void);
extern int unretfield(char *list[]);
extern int unstack(void);
/*
* These functions are defined in libmail.a
*/
#ifdef __cplusplus
extern "C" {
#endif
extern char *maildomain(void);
extern void touchlock(void);
extern char *xgetenv(char *);
extern int xsetenv(char *);
#ifdef __cplusplus
}
#endif
/*
* Standard functions from the C library.
*/
#ifdef preSVr4
extern long atol();
extern char *getcwd();
extern char *calloc();
extern char *getenv();
extern void exit();
extern void free();
extern char *malloc();
extern long ulimit();
extern int utime();
extern int wait();
extern int fputs();
#endif
#ifdef __cplusplus
}
#endif
#endif /* _MAILX_DEF_H */