/***************************************************************************** * * Copyright (C) 1999-2000 SCADA Technology Control Co., Ltd. All rights reserved. * * 2001/11/3 * * 全局性的共同性的错误代码宏定义, 以"ERROR_"开头 * 公共的错误代码从1开始到0xffff结束. * * * * $Name: $ * * $Revision: 1.2 $ * * $Date: 2006/08/04 03:37:33 $ * * $State: Exp $ * * $Log: global_errno.h,v $ * Revision 1.2 2006/08/04 03:37:33 zhuzhenhua * no message * * Revision 1.12 2003/09/17 15:00:37 scada * 添加错误代码: ERROR_MKDIR/ERROR_OPEN/ERROR_EXIST * * Revision 1.11 2003/08/01 06:38:01 scada * 定义在Windows操作系统上没有定义的, 但是SYSV(unix)系统上定义了的操作代码的基值 * * Revision 1.10 2003/06/05 03:56:15 jehu * 将注释修改为符合doxgen工具提取开发文档 * * Revision 1.9 2003/01/15 10:25:41 scada * update thread dead lock * * Revision 1.8 2003/01/02 03:14:29 scada * trim substitution line * * Revision 1.7 2002/12/06 01:05:04 scada * for NT * * Revision 1.6 2002/12/04 07:47:36 scada * for NT * * Revision 1.5 2002/10/24 09:07:33 scada * avoid conflict between ERROR_AUTHSERV_BASE and ERROR_RTDBM_BASE * * Revision 1.4 2002/10/10 07:31:27 jehu * *** empty log message *** * * Revision 1.3 2002/10/09 13:01:29 harold * add errno base macro ERROR_RTDBM_BASE * * Revision 1.2 2002/09/18 09:13:38 harold * revised errors and warning under solaris/CC environment * * Revision 1.1.1.1 2002/08/21 07:16:36 harold * temporarily import * * Revision 1.23 2002/07/26 13:07:55 scada * 为写文件fputs调用失败添加一个全局错误代码=>ERROR_FPUTS * * Revision 1.22 2002/07/23 06:59:04 scada * 使所有模块的错误代码的低16bit不等于0, 以免和进程返回成功码(低8bit)冲突 * * Revision 1.21 2002/07/12 10:01:47 harold * add module errno base: ERROR_MISRELAY_BASE * * Revision 1.20 2002/06/03 08:47:05 harold * add tracable module librmtcalc and rmtcalc * * Revision 1.19 2002/05/14 06:53:02 harold * add ERROR_DBRW_BASE for dbrw module * * Revision 1.18 2002/04/12 08:58:38 harold * global_errno.h * * Revision 1.17 2002/04/12 01:01:32 harold * add ERROR_RECV and ERROR_TIMEOUT * * Revision 1.16 2002/04/09 13:19:36 harold * *** empty log message *** * * Revision 1.15 2002/04/05 07:27:59 harold * add error code ERROR_EXECV, ERROR_PTHREAD_CREATE * * Revision 1.14 2002/04/03 06:59:18 harold * add EXP_STRCASECMP and EXP_STRNCASECMP for compare two string ignoring case * * Revision 1.13 2002/04/02 15:54:48 harold * revise unkown linux-g++ compile error by copying the older tru64-cxx version * * Revision 1.12 2002/03/29 00:56:27 harold * *** empty log message *** * * Revision 1.11 2002/03/20 03:39:56 harold * no message * * Revision 1.2 2002/03/17 15:33:51 harold * changed for iccp v0.9 * * Revision 1.1.1.1 2002/03/15 13:43:17 harold * no message * * Revision 1.2 2002/03/15 13:10:03 harold * *** empty log message *** * * Revision 1.1.1.1 2002/03/15 08:17:07 harold * no message * * Revision 1.11 2002/03/11 11:02:53 harold * *** empty log message *** * * Revision 1.10 2002/03/05 07:41:18 harold * *** empty log message *** * * Revision 1.9 2002/03/05 03:01:34 harold * *** empty log message *** * * Revision 1.8 2002/02/28 00:53:17 harold * *** empty log message *** * * Revision 1.7 2002/02/27 13:04:29 harold * no message * * Revision 1.6 2002/02/25 07:30:21 harold * no message * * Revision 1.5 2002/01/25 09:11:19 harold * no message * * Revision 1.4 2002/01/22 08:55:06 harold * modify2002-01-22-16:46 * * Revision 1.3 2002/01/21 13:44:51 harold * no message * * Revision 1.2 2002/01/18 10:01:39 harold * 添加"读取配置文件函数库"错误代码基值定义 * * Revision 1.1.1.1 2001/12/24 09:33:23 harold * no message * * Revision 1.2 2001/12/24 06:39:57 harold * 为了适应不同的操作系统, 不同的CPU类型, 及不同的编译器, * 对头文件做了相应的修改, 同时添加了一些宏定义, 如: * HAVE__FUNCTION__, __OS__, __PLATFORM__,__TIMEZONE__等等. * * *****************************************************************************/ #ifndef __GLOBAL_ERROR_H__ADSFQEWRUPOHJCVLKJZHCVLKBAFLQWHPHFJJWTHNALSJFPQWJPH #define __GLOBAL_ERROR_H__ADSFQEWRUPOHJCVLKJZHCVLKBAFLQWHPHFJJWTHNALSJFPQWJPH /*! * \if developer_doc * \file * * \brief 全局性的共同性的错误代码宏定义, 以"ERROR_"开头,公共的错误代码从1开始到0xffff结束. * * id: $Id: global_errno.h,v 1.2 2006/08/04 03:37:33 zhuzhenhua Exp $ * * \author 杨小波 prcharold@sina.com.cn develop1@szscada.com * \endif */ /*! * 函数执行成功 */ #define SUCCESS 0 #ifndef OS_WINDOWS # ifndef ERROR_SUCCESS # define ERROR_SUCCESS (SUCCESS) # endif //end of ERROR_SUCCESS #endif // end of defined(__unix) /*! * 非错误性质的函数调用返回, 比如寻找缓冲区未找到等 */ #define ERROR_FAIL 1 /*! * 致命错误, 应该重新启动进程 */ #define ERROR_FATAL 2 /*! * 警告信息 */ #define ERROR_WARNING 3 /*! * 一些提示信息 */ #define ERROR_TIPINFO 4 /*! * 功能未实现 */ #define ERROR_NOT_IMPLEMENT 5 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // 下面定义了各种库或者可执行模块中的错误代码基值 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /*! * 公共错误码的基础值 */ #define ERROR_BASE 10 /*! * 定义在Windows操作系统上没有定义的, 但是SYSV(unix)系统上定义了的操作代码的基值 * 要求常规的错误代码不能超过0xfff */ //#ifndef __unix //# define ERROR_SYSV_BASE (ERROR_BASE + 0xfff) //# include //#endif /*! * 实时数据库模块中的错误代码的基础值 */ #define ERROR_RTDB_BASE (0x10001) /*! * 历史库模块中的错误代码基础值 */ #define ERROR_HDB_BASE (0x20001) /*! * 调试记录模块中的错误代码基础值 */ #define ERROR_DBG_BASE (0x30001) /*! * 与Windows及旧Windows工作站软件上的日期时间兼容的日期时间处理库 * 中的错误代码基础值 */ #define ERROR_XTIME_BASE (0x40001) /*! * 网络通信模块中的错误代码基础值 */ #define ERROR_NET_BASE (0x50001) /*! * 网络写库函数模块错误代码基值 */ #define ERROR_NET_WRITER_BASE (0x60001) /*! * DATASERV服务进程模块中的错误代码基值 */ #define ERROR_DATASERV_BASE (0x70001) /*! * 配置文件读写库模块中的错误代码基值 */ #define ERROR_CONF_BASE (0x80001) /*! * 事故追忆模块中的错误代码基值 */ #define ERROR_PDR_BASE (0x90001) /*! * 软件跟踪模块中的错误代码基值 */ #define ERROR_TRACE_BASE (0xA0001) /*! * 时间服务模块错误代码基值 */ #define ERROR_TMSERV_BASE (0xB0001) /*! * 报警库错误代码基值 */ #define ERROR_ALM_BASE (0xC0001) /*! * ICCP模块错误代码基值 */ #define ERROR_ICCP_BASE (0xD0001) /*! * telectrl模块的错误代码基值 */ #define ERROR_TELECTRL_BASE (0xE0001) /*! * dbrw模块的错误代码基值 */ #define ERROR_DBRW_BASE (0xF0001) /*! * 计算模块(libcal, cal, librmtcalc, rmtcalc)中的错误代码基值 */ #define ERROR_CALC_BASE (0x100001) /*! * Misserver中继服务模块中错误代码基值 */ #define ERROR_MISRELAY_BASE (0x110001) /*! * AUTHSERV服务进程模块中的错误代码基值 */ #define ERROR_AUTHSERV_BASE (0x120001) /*! * rtdbm之模块dbstudio/rtattr_s中的错误处理代码定义 */ #define ERROR_RTDBM_BASE (0x130001) //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // 下面定义了最基本的错误代码, 则整个系统中公用 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /*! * 不可预料的错误 */ #define ERROR_UNEXPECTED (ERROR_BASE + 1) /*! * 代码在执行过程中, 发生异常, 没有明确指明发生了何种异常 */ #define ERROR_EXCEPTION (ERROR_BASE + 2) /*! * 代码在执行过程中, 发生访问冲突异常 */ #define ERROR_EXCEPTION_ACCESS_VIOLATION (ERROR_BASE + 3) /*! * 给函数传递的参数错误, 如缓冲区长度不合理(非期望的长度), * 又如, 序号值没有在给定的范围内等等. */ #define ERROR_PARAMETER (ERROR_BASE + 4) /*! * 在期望正确的指针参数时, 发现真正的指针参数为NULL */ #define ERROR_POINTER (ERROR_BASE + 5) /*! * 内存分配不成功 */ #define ERROR_MEMORY_ALLOC (ERROR_BASE + 6) /*! * 找不到指定的环境变量 */ #define ERROR_ENVIRONMENT_VARIABLE (ERROR_BASE + 7) /*! * 指定键值的IPC对象不存在, 即还未创建. */ #define ERROR_IPC_OBJECT_EXISTED (ERROR_BASE + 8) /*! * 打开文件调用fopen失败 */ #define ERROR_FOPEN (ERROR_BASE + 9) /*! * 对文件内容调用fread失败. */ #define ERROR_FREAD (ERROR_BASE + 10) /*! * 映射共享内存到进程地址空间失败(shmat) */ #define ERROR_SHMAT (ERROR_BASE + 11) /*! * 取出进程空间中对共享内存的映射失败(shmdt) */ #define ERROR_SHMDT (ERROR_BASE + 13) /*! * 信号量操作失败(semctl) */ #define ERROR_SEMCTL (ERROR_BASE + 14) /*! * 系统没有足够的内存. */ #define ERROR_NO_MEMORY (ERROR_BASE + 15) /*! * 原始字节流队列已满 */ #define ERROR_RAW_STREAM_QUEUE_IS_FULL (ERROR_BASE + 16) /*! * 原始字节流队列已删除 */ #define ERROR_RAW_STREAM_QUEUE_IS_DELETE (ERROR_BASE + 17) /*! * 原始字节流队列中没有足够的数据 */ #define ERROR_RAW_STREAM_QUEUE_NOT_ENOUGH_BYTE (ERROR_BASE + 18) /*! * 动态连接库装载失败(dlopen) */ #define ERROR_SHLIB_DLOPEN (ERROR_BASE + 19) /*! * 调用msgctl删除消息队列失败 */ #define ERROR_MSGCTL_RMID (ERROR_BASE + 20) /*! * 调用msgget创建消息队列ipc对象失败 */ #define ERROR_MSGGET_CREATE (ERROR_BASE + 21) /*! * 无效的消息队列ipc对象的id */ #define ERROR_MSG_QUEUE_ID (ERROR_BASE + 22) /*! * 从消息队列接收消息发生不可预料的错误 */ #define ERROR_MSGRCV (ERROR_BASE + 23) /*! * 消息队列中当前被接收的消息超过给定的缓冲区 */ #define ERROR_MSGRCV_TOO_BIG_ITEM (ERROR_BASE + 24) /*! * 欲操作的消息队列已经被删除(不存在, 需要重新创建) */ #define ERROR_MSG_QUEUE_REMOVED (ERROR_BASE + 25) /*! * 消息队列中没有消息 */ #define ERROR_MSGRCV_NO_MSG (ERROR_BASE + 26) /*! * 调用msgget引用消息队列失败. */ #define ERROR_MSGGET_REFER (ERROR_BASE + 27) /*! * 调用SHMCTL获取共享内存属性失败 */ #define ERROR_SHMCTL_STAT (ERROR_BASE + 28) /*! * 用于共享内存的挂接进程数目不为零而不能删除它. */ #define ERROR_DELETE_ATTACHED_SHM (ERROR_BASE + 29) /*! * 调用shmctl删除共享内存失败 */ #define ERROR_SHMCTL_RMID (ERROR_BASE + 30) /*! * 调用shmctl锁定共享内存失败 */ #define ERROR_SHMCTL_LOCK (ERROR_BASE + 31) /*! * 调用shmctl解除共享内存锁定失败 */ #define ERROR_SHMCTL_UNLOCK (ERROR_BASE + 32) /*! * 调用semctl删除信号量组失败 */ #define ERROR_SEMCTL_RMID (ERROR_BASE + 33) /*! * 调用shmget引用给定键值的共享内存区域失败 */ #define ERROR_SHMGET_REFER (ERROR_BASE + 34) /*! * 调用shmget创建给定键值的共享内存区域失败 */ #define ERROR_SHMGET_CREATE (ERROR_BASE + 35) /*! * 无效的进程内共享内存映射地址 */ #define ERROR_SHM_ADDR_INVALID (ERROR_BASE + 36) /*! * 调用semop函数失败 */ #define ERROR_SEMOP (ERROR_BASE + 37) /*! * 不存在指定的文件 */ #define ERROR_NO_FILE (ERROR_BASE + 38) /*! * 调用stat取文件属性失败 */ #define ERROR_STAT (ERROR_BASE + 39) /*! * 调用shmget失败, 创建一个新的信号量组失败 */ #define ERROR_SEMGET_CREATE (ERROR_BASE + 40) /*! * 调用shmget失败, 创建一个新的信号量组失败 */ #define ERROR_SEMGET_REFER (ERROR_BASE + 41) /*! * 调用fwrite失败 */ #define ERROR_FWRITE (ERROR_BASE + 42) /*! * 参数中指定的缓冲区长度不够 */ #define ERROR_BUFFER_LENGTH (ERROR_BASE + 43) /*! * 无效的属性号 */ #define ERROR_ATTR_NO (ERROR_BASE + 44) /*! * 错误的SCADA日期时间串(这里仅指示日期时间串的格式错误, 不表明 * 其包含的日期时间值的正确与否 */ #define ERROR_SCADA_DT_STRING (ERROR_BASE + 45) /*! * 缓冲区中的参数不完整(非自洽) */ #define ERROR_BUFFER_INTEGRALITY (ERROR_BASE + 46) /*! * 调用gethostname函数失败 */ #define ERROR_GETHOSTNAME (ERROR_BASE + 47) /*! * 调用gethostbyname函数失败 */ #define ERROR_GETHOSTBYNAME (ERROR_BASE + 48) /*! * 调用sendto非阻塞型失败 */ #define ERROR_SENDTO (ERROR_BASE + 49) /*! * 接收到的消息的长度与与其预期的长度不等. */ #define ERROR_MSG_UNEXPECTED_LENGTH (ERROR_BASE + 50) /*! * 接收到的消息的类型与预期的不相同. */ #define ERROR_MSG_UNEXPECTED_TYPE (ERROR_BASE + 51) /*! * 调用socket创建套接字失败 */ #define ERROR_SOCKET (ERROR_BASE + 52) /*! * 调用bind绑定套接字失败 */ #define ERROR_BIND (ERROR_BASE + 53) /*! * 调用fcntl失败 */ #define ERROR_FCNTL (ERROR_BASE + 54) /*! * 调用setsockopt失败 */ #define ERROR_SETSOCKOPT (ERROR_BASE + 55) /*! * 调用getsockopt失败 */ #define ERROR_GETSOCKOPT (ERROR_BASE + 56) /*! * 调用connect建立网络连接失败 */ #define ERROR_CONNECT (ERROR_BASE + 57) /*! * 调用read意外失败 */ #define ERROR_READ (ERROR_BASE + 58) /*! * 调用write意外失败 */ #define ERROR_WRITE (ERROR_BASE + 59) /*! * 调用select函数意外失败 */ #define ERROR_SELECT (ERROR_BASE + 60) /*! * 调用listen函数失败 */ #define ERROR_LISTEN (ERROR_BASE + 61) /*! * 执行fork调用失败 */ #define ERROR_FORK (ERROR_BASE + 62) /*! * 执行execve调用失败 */ #define ERROR_EXECVE (ERROR_BASE + 63) /*! * 执行execv调用失败 */ #define ERROR_EXECV (ERROR_BASE + 64) /*! * 创建线程失败pthread_create调用失败 */ #define ERROR_PTHREAD_CREATE (ERROR_BASE + 65) #define ERROR_CREATE_THREAD ERROR_PTHREAD_CREATE /*! * 调用recv接收套接字上的数据失败 */ #define ERROR_RECV (ERROR_BASE + 66) /*! * 因为超时而失败 */ #if defined(OS_LINUX) #ifndef ERROR_TIMEOUT #define ERROR_TIMEOUT (ERROR_BASE + 67) #endif //end of ERROR_TIMEOUT #endif // end of defined(__unix) /*! * 调用send失败 */ #define ERROR_SEND (ERROR_BASE + 68) /*! * 调用select后, 发现异常fdset集合中异常事件. */ #define ERROR_SELECT_EXCEPTION (ERROR_BASE + 69) /*! * 当select探测到读事件, 但是随后读操作中仅读到0个字节 */ #define ERROR_READ_ZERO (ERROR_BASE + 70) /*! * 当select探测到写事件, 但是随后写操作中仅写入0个字节 */ #define ERROR_WRITE_ZERO (ERROR_BASE + 71) /*! * 当select探测接收事件, 但是随后接收操作中仅接收到0个字节 */ #define ERROR_RECV_ZERO (ERROR_BASE + 72) /*! * 当select探测可以发送事件, 但是随后发送操作中仅发送了0个字节 */ #define ERROR_SEND_ZERO (ERROR_BASE + 73) /*! * 不存在指定的目标 */ #define ERROR_NOT_EXIST (ERROR_BASE + 74) /*! * 事务操作提交失败 */ #define ERROR_COMMIT (ERROR_BASE + 75) /*! * 事务操作撤销/回滚失败 */ #define ERROR_ROLLBACK (ERROR_BASE + 76) /*! * 调用fputs写文件失败 */ #define ERROR_FPUTS (ERROR_BASE + 77) /*! * 调用mkdir失败 */ #define ERROR_MKDIR (ERROR_BASE + 78) /*! * 调用OPEN失败 */ #define ERROR_OPEN (ERROR_BASE + 79) /*! * 指定目标已经存在 */ #define ERROR_EXIST (ERROR_BASE + 80) /*! * 调用fseek失败 */ #define ERROR_FSEEK (ERROR_BASE + 81) /*! * 调用rename/MoveFile/MoveFileEx失败 */ #define ERROR_RENAME (ERROR_BASE + 82) /*! * 无需运行cpfile.exe(当cpfile.exe在主服务器上时,返回本错误) */ #define ERROR_RUN_CPFILE_TCP_C_ON_PRAMIRY_HOST (ERROR_BASE + 83) /*! * 从消息队列中接收到无效的实时/历史数据请求数据帧类型 */ #define ERROR_AUTHSERV_UNKNOWN_NET_FRAME (ERROR_AUTHSERV_BASE + 1) #endif //__GLOBAL_ERROR_H__ADSFQEWRUPOHJCVLKJZHCVLKBAFLQWHPHFJJWTHNALSJFPQWJPH