PSI sics-cvs-psi_pre-ansto

This commit is contained in:
2003-06-13 00:00:00 +00:00
committed by Douglas Clowes
parent 2e3ddfb6c6
commit 3ffd0d8af4
1099 changed files with 318432 additions and 0 deletions

44
tecs/coc_util.h Normal file
View File

@@ -0,0 +1,44 @@
#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_ */