博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
cnaiapi.h头文件
阅读量:763 次
发布时间:2019-03-24

本文共 2463 字,大约阅读时间需要 8 分钟。

转载: 留着怕自己找不着了。

//以下是转载内容:

最后还是自己找到了,就写上来好了,应该有人跟我一样有问题的,貌似要加两个头文件:

第一个:cnaiapi.h

/* cnaiapi.h */#ifndef _CNAIAPI_H_#define _CNAIAPI_H_#if defined(LINUX) || defined(SOLARIS)#include 
#include
#include
#include
#include
#endif /* defined(LINUX) || defined(SOLARIS) */#if defined(WIN32)#include
#include "cnaiapi_win32.h"#endif /* defined(WIN32) */#include
typedef short appnum;typedef long computer;typedef int connection;struct port2sock { short port; int sock;};#define P2S_SIZE 64 /* number of entries in port to socket map table */#define LISTEN_Q_LEN 5appnum appname_to_appnum(char *appname);computer cname_to_comp(char *cname);connection await_contact(appnum a);connection make_contact(computer c, appnum a);int send_eof(connection c);void cnaiapi_init(void);#if defined(LINUX) || defined(SOLARIS)extern pthread_mutex_t await_contact_mutex, cname_mutex, appname_mutex;#elif defined(WIN32)extern HANDLE await_contact_mutex, cname_mutex, appname_mutex;#endif#endif /* !defined(_CNAIAPI_H_) */

第二个:cnaiapi_win32.h

/* cnaiapi_win32.h */#include 
#define read _read#define write _write#define STDIN_FILENO 0#define STDOUT_FILENO 1

盗链:只有cnaiapi.h没有windows32

/*-------------------------------------------------------------------------------------------*/ * * Program: echoserver * Purpose: wait for a connection from an echoclient and echo data * Usage:   echoserver 
* *--------------------------------------------------- /* cnaiapi.h */#ifndef _CNAIAPI_H_#define _CNAIAPI_H_#if defined(LINUX) || defined(SOLARIS)#include
#include
#include
#include
#include
#endif /* defined(LINUX) || defined(SOLARIS) */#if defined(WIN32)#include
#include
#endif /* defined(WIN32) */#include
typedef shortappnum;typedef longcomputer;typedef intconnection;struct port2sock {shortport;intsock;};#define P2S_SIZE 64 /* number of entries in port to socket map table*/#define LISTEN_Q_LEN 5appnumappname_to_appnum(char *appname);computercname_to_comp(char *cname);connectionawait_contact(appnum a);connectionmake_contact(computer c, appnum a);intsend_eof(connection c);void cnaiapi_init(void);#if defined(LINUX) || defined(SOLARIS)extern pthread_mutex_t await_contact_mutex, cname_mutex, appname_mutex;#elif defined(WIN32)extern HANDLE await_contact_mutex, cname_mutex, appname_mutex;#endif#endif /* !defined(_CNAIAPI_H_) */
你可能感兴趣的文章