/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* connect stream library implementation definitions
*/
#ifndef _CSLIB_H
#define _CSLIB_H
typedef struct
{
unsigned long addr;
unsigned long port;
} Inet_t;
struct Server_s;
#define _CS_PRIVATE_ \
int db; /* csdb() state */ \
int interrupt; /* last interrupt */ \
int nostream; /* cspeek() state */ \
int nosocket; /* cspeek() state */ \
#include <cs.h>
#include <debug.h>
#include <errno.h>
#include <sig.h>
#include <tok.h>
#include <ast_tty.h>
#include <cs_lib.h>
#if CS_LIB_V10
#define FDARG(f) (&(f))
extern int conn_ld;
#else
#if CS_LIB_SOCKET
#if CS_LIB_SOCKET_UN
#if _sys_sockio
#else
#endif
#endif
#if _sys_un
#endif
#endif
#if _hdr_netinet_in
#endif
#if _hdr_netinet_tcp
#endif
#if _hdr_netdb
#include <netdb.h>
#endif
#endif
#if CS_LIB_STREAM
#include <stropts.h>
#define FDARG(f) (f)
#endif
#endif
#if CS_LIB_STREAM || CS_LIB_V10
{
long count;
long pid;
};
#endif
#ifndef IPPORT_RESERVED
#endif
#ifndef IPPORT_USERRESERVED
#endif
#if !defined(htons) && !_lib_htons
#define htons(x) (x)
#endif
#if !defined(htonl) && !_lib_htonl
#define htonl(x) (x)
#endif
#if !defined(ntohs) && !_lib_ntohs
#define ntohs(x) (x)
#endif
#if !defined(ntohl) && !_lib_ntohl
#define ntohl(x) (x)
#endif
#if !defined(FAPPEND)
#if _sys_file
#endif
#endif
#endif
#endif
#else
#define setauth(f,t) (0)
#define getauth(f,t) (0)
#endif
#endif
#ifdef SIGPIPE
#if _lib_sigblock
#define csprotect(h) do if (!((h)->flags & CS_PIPE_BLOCKED)) { (h)->flags |= CS_PIPE_BLOCKED; sigblock(sigmask(SIGPIPE)); errorf((h)->id, NiL, -99, "protect"); } while (0)
#else
#define csprotect(h) do if (!((h)->flags & CS_PIPE_BLOCKED)) { Handler_t f; (h)->flags |= CS_PIPE_BLOCKED; if ((f = signal(SIGPIPE, SIG_IGN)) != SIG_DFL) signal(SIGPIPE, f); errorf((h)->id, NiL, -99, "protect"); } while (0)
#endif
#else
#define csprotect(h) do if (!((h)->flags & CS_PIPE_BLOCKED)) { (h)->flags |= CS_PIPE_BLOCKED; errorf((h)->id, NiL, -99, "protect"); } while (0)
#endif
#define CS_KEY_SEND 0
#ifndef ENOTDIR
#endif
#ifndef EROFS
#endif
#ifndef errno
extern int errno;
#endif
#if CS_LIB_SOCKET
#else
#define csdb(h)
#endif
#if CS_LIB_V10
extern int fmount(int, int, const char*, int);
#endif
#if CS_LIB_STREAM
extern int fattach(int, const char*);
#endif
#endif