Commit 2d50ad0b authored by Lionel Gauthier's avatar Lionel Gauthier

list init

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4830 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent d3d70215
......@@ -200,8 +200,8 @@ typedef struct MIH_C_Link_Configure_Thresholds_request
LIST(MIH_C_LINK_CFG_PARAM, LinkConfigureParameterList) /*!< \brief A list of link threshold parameters.*/
}__attribute__((__packed__))MIH_C_Link_Configure_Thresholds_request_t;
TYPEDEF_LIST(MIH_C_LINK_CFG_STATUS, 16);
#define MIH_C_LINK_CFG_STATUS_LIST_LENGTH 16
TYPEDEF_LIST(MIH_C_LINK_CFG_STATUS, MIH_C_LINK_CFG_STATUS_LIST_LENGTH);
/*! \struct MIH_C_Link_Configure_Thresholds_confirm
* \brief Structure defining the Link_Configure_Thresholds.confirm MIH_LINK_SAP primitive (see IEEE Std 802.21-2008 7.3.13.2 Link_Configure_Thresholds.confirm)
*/
......
......@@ -546,13 +546,18 @@ u_int16_t MIH_C_LIST_LENGTH_get_encode_length(u_int16_t lengthP);
DATA_TYPE_NAME ## _encode(bbP, &listP->val[index++]);\
}\
}\
};\
inline void DATA_TYPE_NAME ## _LIST_init(DATA_TYPE_NAME ## _LIST_T *listP) {\
listP->length = 0;\
memset(listP->val, 0, MAX_LENGTH*sizeof(DATA_TYPE_NAME ## _T));\
};
#else
#define TYPEDEF_LIST(DATA_TYPE_NAME, MAX_LENGTH) typedef struct DATA_TYPE_NAME ## _LIST { u_int16_t length; DATA_TYPE_NAME ## _T val[MAX_LENGTH];} DATA_TYPE_NAME ## _LIST_T;\
extern unsigned int DATA_TYPE_NAME ## _LIST2String(DATA_TYPE_NAME ## _LIST_T *listP, char* bufP);\
extern void DATA_TYPE_NAME ## _LIST_decode(Bit_Buffer_t *bbP, DATA_TYPE_NAME ## _LIST_T *listP);\
extern void DATA_TYPE_NAME ## _LIST_encode(Bit_Buffer_t *bbP, DATA_TYPE_NAME ## _LIST_T *listP);
extern void DATA_TYPE_NAME ## _LIST_encode(Bit_Buffer_t *bbP, DATA_TYPE_NAME ## _LIST_T *listP);\
extern void DATA_TYPE_NAME ## _LIST_init(DATA_TYPE_NAME ## _LIST_T *listP);
#endif
#define LIST(DATA_TYPE_NAME, VAR_NAME) DATA_TYPE_NAME ## _LIST_T VAR_NAME ## _list;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment