⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 soperr.c

📁 在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LEA_4S的驱动,位置速寻算法,语音芯片ISD4004的录放音驱动,LED页面管理等等.从启动代码到操作系统的移植以及到业
💻 C
字号:
/*
 * FILENAME: soperror.c
 *
 * Copyright  2000 By InterNiche Technologies Inc. All rights reserved
 *
 * soperror.c Implement a "perror()" like function for InterNiche 
 * sockets errors 
 *
 *
 * MODULE: MISCLIB
 *
 * ROUTINES: so_perror(), 
 *
 * PORTABLE: yes
 */


#include "ipport.h"     /* NetPort embedded system includes */

#ifdef INCLUDE_TCP
#ifndef MINI_TCP        /* not for NicheLite */
 
#include "tcpport.h"

char *   so_emessages[] =
{
   "",               /*  0 */
   "ENOBUFS",        /*  1 */
   "ETIMEDOUT",      /*  2 */
   "EISCONN",        /*  3 */
   "EOPNOTSUPP",     /*  4 */
   "ECONNABORTED",   /*  5 */
   "EWOULDBLOCK",    /*  6 */
   "ECONNREFUSED",   /*  7 */
   "ECONNRESET",     /*  8 */
   "ENOTCONN",       /*  9 */
   "EALREADY",       /* 10 */
   "EINVAL",         /* 11 */
   "EMSGSIZE",       /* 12 */
   "EPIPE",          /* 13 */
   "EDESTADDRREQ",   /* 14 */
   "ESHUTDOWN",      /* 15 */
   "ENOPROTOOPT",    /* 16 */
   "EHAVEOOB",       /* 17 */
   "ENOMEM",         /* 18 */
   "EADDRNOTAVAIL",  /* 19 */
   "EADDRINUSE",     /* 20 */
   "EAFNOSUPPORT",   /* 21 */
   "EINPROGRESS",    /* 22 */
   "ELOWER",         /* 23  lower layer (IP) error */
};


/* FUNCTION: so_perror()
 *
 * so_perror() - return a pointer to a static string which is a short 
 * mnemonic for the socket error message. 
 *
 * 
 * PARAM1: int ecode
 *
 * RETURNS: error text string
 */

char *   
so_perror(int ecode)
{
   if (ecode < (sizeof(so_emessages)/sizeof(char*)))
      return(so_emessages[ecode]);
   else
      return "";
}

#endif   /*  MINI_TCP */
#endif   /* INCLUDE_TCP */


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -