Files
sicspsi/tecs/coc_util.h
cvs 064ec37e9a - Rearranged directory structure for forking out ANSTO
- Refactored site specific stuff into a site module
- PSI specific stuff is now in the PSI directory.
- The old version has been tagged with pre-ansto
2003-06-20 10:18:47 +00:00

45 lines
952 B
C

#ifndef _COC_UTIL_H_
#define _COC_UTIL_H_
#include <netinet/in.h>
#include "myc_buf.h"
#define COC_CMD_LEN 256
#define COC_RES_LEN 16384
int CocCreateSockAdr(
struct sockaddr_in *sockaddrPtr, /* Socket address */
const char *host, /* Host. NULL implies INADDR_ANY */
int port); /* Port number */
/*
compose internet address
*/
void CocDelay(int msec);
/*
system independent delay function with msec resolution
*/
int CocSend(int fd, char *buf, int size);
/*
send a message
*/
int CocRecv(int fd, StrBuf *buf, int timeout, int *flag);
/*
receive message
if flag is NULL, a timeout generates an error
else *flag is set to zero between the select and the recv command
*/
#define COC_SEP '\0'
#define COC_DELAYED '\1'
#define COC_ERR '\2'
#define COC_TRM '\3'
#define COC_SYN0 '\4'
#define COC_SYN1 '\5'
#define COC_MAGIC '\6'
#define COC_CLRLOG '\7'
#endif /* _COC_UTIL_H_ */