00001 /***************************************************************************** 00002 * * 00003 * OpenNI 1.0 Alpha * 00004 * Copyright (C) 2010 PrimeSense Ltd. * 00005 * * 00006 * This file is part of OpenNI. * 00007 * * 00008 * OpenNI is free software: you can redistribute it and/or modify * 00009 * it under the terms of the GNU Lesser General Public License as published * 00010 * by the Free Software Foundation, either version 3 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * OpenNI is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public License * 00019 * along with OpenNI. If not, see <http://www.gnu.org/licenses/>. * 00020 * * 00021 *****************************************************************************/ 00022 00023 00024 00025 00026 #ifndef __XN_STATUS_REGISTER_H__ 00027 #define __XN_STATUS_REGISTER_H__ 00028 00029 //--------------------------------------------------------------------------- 00030 // Includes 00031 //--------------------------------------------------------------------------- 00032 #include "XnStatus.h" 00033 00034 //--------------------------------------------------------------------------- 00035 // Structs 00036 //--------------------------------------------------------------------------- 00037 typedef struct XnErrorCodeData 00038 { 00040 XnUInt32 nCode; 00042 const XnChar* csName; 00044 const XnChar* csMessage; 00045 } XnErrorCodeData; 00046 00047 //--------------------------------------------------------------------------- 00048 // Exported Function Declaration 00049 //--------------------------------------------------------------------------- 00058 XN_C_API XnStatus xnRegisterErrorCodeMessages(XnUInt16 nGroup, XnUInt16 nFirst, XnUInt16 nCount, XnErrorCodeData* pErrorCodeData); 00059 00060 //--------------------------------------------------------------------------- 00061 // Macros 00062 //--------------------------------------------------------------------------- 00063 #undef XN_STATUS_MESSAGE_MAP_START_FROM 00064 #undef XN_STATUS_MESSAGE 00065 #undef XN_STATUS_MESSAGE_MAP_END_FROM 00066 00067 #define _XN_ERROR_GROUP_NAME(group, first) _s_##group##first##_errors 00068 00069 #define XN_STATUS_MESSAGE_MAP_START_FROM(group, first) \ 00070 static XnErrorCodeData _XN_ERROR_GROUP_NAME(group, first)[] = \ 00071 { \ 00072 { first, XN_STRINGIFY(group) "_OK", XN_STRINGIFY(group) " OK" }, 00073 00075 #define XN_STATUS_MESSAGE(csName, csMessage) \ 00076 { 0, XN_STRINGIFY(csName), csMessage }, 00077 00079 #define XN_STATUS_MESSAGE_MAP_END_FROM(group, first) \ 00080 }; \ 00081 static XnStatus s_##group##first##_result = xnRegisterErrorCodeMessages(group, first, sizeof(_XN_ERROR_GROUP_NAME(group, first)) / sizeof(XnErrorCodeData), _XN_ERROR_GROUP_NAME(group, first)); 00082 00083 #define XN_STATUS_REGISTER 00084 00085 #endif //__XN_STATUS_REGISTER_H__