📄 codehdr1.htm
字号:
<HTML><HEAD><TITLE>NETBOOK - Code Sample HDR1</TITLE></HEAD><BODY BGCOLOR="#FFFFFF"><P><TABLE BORDER="0" CELLPADDING="5" CELLSPACING="0" WIDTH="600"><TR> <TD WIDTH="112" VALIGN="TOP" BGCOLOR="#759AC4" CELLPADDING="0"><img src="../pgmatrls/sidebar.gif" width="112" height="410" usemap="#sidebar" ismap alt="" border="0" ><map name="sidebar"><area shape="rect" coords="0,325,100,364" href="../othrpags/page22.htm" ><area shape="rect" coords="0,287,100,326" href="../othrpags/page17.htm" ><area shape="rect" coords="0,248,100,287" href="../othrpags/page18.htm" ><area shape="rect" coords="0,364,100,404" href="../othrpags/code.htm" ><area shape="rect" coords="0,210,100,248" href="../othrpags/page15.htm" ><area shape="rect" coords="0,170,100,210" href="../othrpags/page03.htm" ><area shape="rect" coords="0,132,100,170" href="../othrpags/page10.htm" ><area shape="rect" coords="0,93,100,132" href="../index.htm" ><AREA SHAPE="DEFAULT" NOHREF></map> </TD><TD WIDTH="420" VALIGN="TOP" BGCOLOR="#FFFFFF"><CENTER><H1>Code Sample HDR1</H1></CENTER><PRE>/* cnaiapi.h */#ifndef _CNAIAPI_H_#define _CNAIAPI_H_#if defined(LINUX) || defined(SOLARIS)#include <sys/socket.h>#include <netinet/in.h>#include <netdb.h>#include <pthread.h>#include <unistd.h>#endif /* defined(LINUX) || defined(SOLARIS) */#if defined(WIN32)#include <winsock2.h>#include <cnaiapi_win32.h>#endif /* defined(WIN32) */#include <sys/types.h>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_) */</PRE><p><p><p><HR WIDTH=89% ALIGN=CENTER SIZE=2><center><h2>Item information</h2></center><p><TABLE CELLSPACING="0"><TD ALIGN="LEFT" VALIGN="TOP">Caption:</TD><TD ALIGN="LEFT"></TD><TR><TD ALIGN="LEFT">Code sample:</TD><TD ALIGN="LEFT">HDR1</td><tr><TD ALIGN="LEFT">Type:</TD><TD ALIGN="LEFT">code sample</TD><TR><TD ALIGN="LEFT">Item:</TD><TD ALIGN="LEFT"><A HREF="./codeHDR1.txt">Code sample HDR1</A> without caption</TD><TR><TD ALIGN="LEFT">Keywords:</TD><TD ALIGN="LEFT">network API</TR></TABLE></tr></TABLE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -