当前位置: 首页>>代码示例>>C++>>正文


C++ PRMSG函数代码示例

本文整理汇总了C++中PRMSG函数的典型用法代码示例。如果您正苦于以下问题:C++ PRMSG函数的具体用法?C++ PRMSG怎么用?C++ PRMSG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了PRMSG函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TRANS

static int
TRANS(Os2Write)(XtransConnInfo ciptr, char *buf, int size)
{
    int ret;
    APIRET rc;
    ULONG nWritten;
    PRMSG(2,"Os2Write(%d,%x,%d)\n", ciptr->fd, buf, size );
    rc = DosWrite(ciptr->fd, buf, size, &nWritten);
    if (rc == 0){
         ret = nWritten;
         if(nWritten == 0) {
                 errno=EAGAIN;
                 ret = -1;
                 }
         }
    else if ((rc == 39) || (rc == 112)){
        errno = EAGAIN;
        ret = -1;
        }
    else if ((rc == 109) || (rc == 230) || (rc == 233)){
        errno = EPIPE;
        ret = -1;
        }
    else if (rc == 6){
         errno=EBADF;
         ret = -1;
         }
    else {
        PRMSG(2,"(Os2Write)Unknown return code from DosWrite, fd %d rc=%d\n", ciptr->fd,rc,0 );
        errno = EINVAL;
        ret = -1;
        }
    return (ret);
}
开发者ID:HoMeCracKeR,项目名称:MacOSX-SDKs,代码行数:34,代码来源:Xtransos2.c

示例2: TRANS

static XtransConnInfo
TRANS(DNETOpenCOTSServer) (Xtransport *thistrans, char *protocol, 
			   char *host, char *port)

{
    XtransConnInfo	ciptr;

    PRMSG (2,"DNETOpenCOTSServer(%s,%s,%s)\n", protocol, host, port);

    if ((ciptr = (XtransConnInfo) xcalloc (
	1, sizeof(struct _XtransConnInfo))) == NULL)
    {
	PRMSG (1, "DNETOpenCOTSServer: malloc failed\n", 0, 0, 0);
	return NULL;
    }

    if ((ciptr->fd = socket (AF_DECnet, SOCK_STREAM, 0)) < 0)
    {
	xfree ((char *) ciptr);
	return NULL;
    }

    ciptr->index = 0;		/* only one form of DECnet */

    return (ciptr);
}
开发者ID:aosm,项目名称:X11,代码行数:26,代码来源:Xtransdnet.c

示例3: TRANS

int
TRANS(Connect) (XtransConnInfo ciptr, char *address)

{
    char	*protocol;
    char	*host;
    char	*port;
    int		ret;

    PRMSG (2,"Connect(%d,%s)\n", ciptr->fd, address, 0);

    if (TRANS(ParseAddress) (address, &protocol, &host, &port) == 0)
    {
	PRMSG (1,"Connect: Unable to Parse address %s\n",
	       address, 0, 0);
	return -1;
    }

    if (!port || !*port)
    {
	PRMSG (1,"Connect: Missing port specification in %s\n",
	      address, 0, 0);
	if (protocol) xfree (protocol);
	if (host) xfree (host);
	return -1;
    }

    ret = ciptr->transptr->Connect (ciptr, host, port);

    if (protocol) xfree (protocol);
    if (host) xfree (host);
    if (port) xfree (port);
    
    return ret;
}
开发者ID:idunham,项目名称:tinyxlib,代码行数:35,代码来源:Xtrans.c

示例4: TRANS

int
TRANS(NoListen) (char * protocol)
	
{
   Xtransport *trans;
   int i = 0, ret = 0;
   
   if ((trans = TRANS(SelectTransport)(protocol)) == NULL) 
   {
	PRMSG (1,"TransNoListen: unable to find transport: %s\n", 
	       protocol, 0, 0);

	return -1;
   }
   if (trans->flags & TRANS_ALIAS) {
       if (trans->nolisten)
	   while (trans->nolisten[i]) {
	       ret |= TRANS(NoListen)(trans->nolisten[i]);
	       i++;
       }
   }

   trans->flags |= TRANS_NOLISTEN;
   return ret;
}
开发者ID:DukedDroid,项目名称:reicast-emulator,代码行数:25,代码来源:Xtrans.c

示例5: TRANS

int
TRANS(WSAStartup) (void)
{
    static WSADATA wsadata;

    PRMSG (2,"WSAStartup()\n", 0, 0, 0);

    if (!wsadata.wVersion && WSAStartup(0x0101, &wsadata))
        return 1;
    return 0;
}
开发者ID:HoMeCracKeR,项目名称:MacOSX-SDKs,代码行数:11,代码来源:Xtransutil.c


注:本文中的PRMSG函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。