X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fmt%2Fss_pack.c;h=831c9b1d2ca284988ba49377c76c5c3233dfbc74;hb=5d74fef7c9fe6b65a965ceac6bfe812872dab323;hp=7441a6c75b8aaeaaf2798cc105d8f2cdc27dab28;hpb=829bbd114f1c3dc00c1da47bca0a8207c049df3f;p=o-du%2Fl2.git diff --git a/src/mt/ss_pack.c b/src/mt/ss_pack.c index 7441a6c75..831c9b1d2 100644 --- a/src/mt/ss_pack.c +++ b/src/mt/ss_pack.c @@ -89,32 +89,31 @@ */ #ifdef ANSI -PUBLIC S16 SPkS8 +S16 SPkS8 ( S8 val, /* value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SPkS8(val, mBuf) +S16 SPkS8(val, mBuf) S8 val; /* value */ Buffer *mBuf; /* message buffer */ #endif { S16 ret; /* return code */ - TRC1(SPkS8) ret = SAddPreMsg((Data) val, mBuf); #if (ERRCLASS & ERRCLS_ADD_RES) if (ret != ROK) SSLOGERROR(ERRCLS_ADD_RES, ESS242, (ErrVal)ret, "SAddPreMsg() failed"); #endif - RETVALUE(ret); + return (ret); } /* end of SPkS8 */ /* * -* Fun: SPkU8 +* Fun: oduUnpackUInt8 * * Desc: This function packs an unsigned 8 bit value into a message. * @@ -129,26 +128,25 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SPkU8 +S16 oduUnpackUInt8 ( U8 val, /* value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SPkU8(val, mBuf) +S16 oduUnpackUInt8(val, mBuf) U8 val; /* value */ Buffer *mBuf; /* message buffer */ #endif { S16 ret; /* return code */ - TRC1(SPkU8) ret = SAddPreMsg((Data) val, mBuf); #if (ERRCLASS & ERRCLS_ADD_RES) if (ret != ROK) SSLOGERROR(ERRCLS_ADD_RES, ESS243, (ErrVal)ret, "SAddPreMsg() failed"); #endif - RETVALUE(ret); -} /* end of SPkU8 */ + return (ret); +} /* end of oduUnpackUInt8 */ /* * @@ -167,13 +165,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SPkS16 +S16 SPkS16 ( S16 val, /* value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SPkS16(val, mBuf) +S16 SPkS16(val, mBuf) S16 val; /* value */ Buffer *mBuf; /* message buffer */ #endif @@ -181,7 +179,6 @@ Buffer *mBuf; /* message buffer */ Data pkArray[2]; /* array for packing */ S16 ret; /* return code */ - TRC1(SPkS16) #ifndef FCSPKINT /* backward compatibility, packing order */ pkArray[0] = (Data) GetHiByte(val); pkArray[1] = (Data) GetLoByte(val); @@ -194,13 +191,13 @@ Buffer *mBuf; /* message buffer */ if (ret != ROK) SSLOGERROR(ERRCLS_ADD_RES, ESS244, (ErrVal)ret, "SAddPreMsgMult() failed"); #endif - RETVALUE(ret); + return (ret); } /* end of SPkS16 */ /* * -* Fun: SPkU16 +* Fun: oduUnpackUInt16 * * Desc: This function packs an unsigned 16 bit value into a message. * @@ -215,13 +212,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SPkU16 +S16 oduUnpackUInt16 ( U16 val, /* value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SPkU16(val, mBuf) +S16 oduUnpackUInt16(val, mBuf) U16 val; /* value */ Buffer *mBuf; /* message buffer */ #endif @@ -229,7 +226,6 @@ Buffer *mBuf; /* message buffer */ Data pkArray[2]; /* array for packing */ S16 ret; /* return code */ - TRC1(SPkU16) #ifndef FCSPKINT /* backward compatibility, packing order */ pkArray[0] = (Data) GetHiByte(val); pkArray[1] = (Data) GetLoByte(val); @@ -242,8 +238,8 @@ Buffer *mBuf; /* message buffer */ if (ret != ROK) SSLOGERROR(ERRCLS_ADD_RES, ESS245, (ErrVal)ret, "SAddPreMsgMult() failed"); #endif - RETVALUE(ret); -} /* end of SPkU16 */ + return (ret); +} /* end of oduUnpackUInt16 */ /* @@ -263,13 +259,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SPkS32 +S16 SPkS32 ( S32 val, /* value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SPkS32(val, mBuf) +S16 SPkS32(val, mBuf) S32 val; /* value */ Buffer *mBuf; /* message buffer */ #endif @@ -278,7 +274,6 @@ Buffer *mBuf; /* message buffer */ Data pkArray[4]; /* packing array */ S16 ret; /* return code */ - TRC1(SPkS32) #ifndef FCSPKINT /* backward compatibility, packing order */ tmp = (U16) GetHiWord(val); pkArray[0] = (Data) GetHiByte(tmp); @@ -299,13 +294,13 @@ Buffer *mBuf; /* message buffer */ if (ret != ROK) SSLOGERROR(ERRCLS_ADD_RES, ESS246, (ErrVal)ret, "SAddPreMsgMult() failed"); #endif - RETVALUE(ret); + return (ret); } /* end of SPkS32 */ /* * -* Fun: SPkU32 +* Fun: oduUnpackUInt32 * * Desc: This function packs an unsigned 32 bit value into a message. * @@ -320,13 +315,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SPkU32 +S16 oduUnpackUInt32 ( U32 val, /* value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SPkU32(val, mBuf) +S16 oduUnpackUInt32(val, mBuf) U32 val; /* value */ Buffer *mBuf; /* message buffer */ #endif @@ -335,7 +330,6 @@ Buffer *mBuf; /* message buffer */ Data pkArray[4]; /* packing array */ S16 ret; /* return code */ - TRC1(SPkU32) #ifndef FCSPKINT /* backward compatibility, packing order */ tmp = (U16) GetHiWord(val); pkArray[0] = (Data) GetHiByte(tmp); @@ -356,8 +350,8 @@ Buffer *mBuf; /* message buffer */ if (ret != ROK) SSLOGERROR(ERRCLS_ADD_RES, ESS247, (ErrVal)ret, "SAddPreMsgMult() failed"); #endif - RETVALUE(ret); -} /* end of SPkU32 */ + return (ret); +} /* end of oduUnpackUInt32 */ /*ss038.103 1. Added Floating point support*/ #ifdef SS_FLOAT @@ -378,13 +372,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SPkF32 +S16 SPkF32 ( F32 val, /* value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SPkF32(val, mBuf) +S16 SPkF32(val, mBuf) F32 val; /* value */ Buffer *mBuf; /* message buffer */ #endif @@ -397,8 +391,6 @@ Buffer *mBuf; /* message buffer */ S8 pkArray[15]; /* packing array */ #endif /*FCSPKINT*/ - TRC1(SPkF32) - sprintf(tmpArray, "%.7e", val); #ifndef FCSPKINT /* backward compatibility, packing order */ @@ -417,7 +409,7 @@ Buffer *mBuf; /* message buffer */ if (ret != ROK) SSLOGERROR(ERRCLS_ADD_RES, ESS248, (ErrVal)ret, "SAddPreMsgMult() failed"); #endif - RETVALUE(ret); + return (ret); } /* end of SPkF32 */ /* @@ -437,13 +429,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SPkF64 +S16 SPkF64 ( F64 val, /* value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SPkF64(val, mBuf) +S16 SPkF64(val, mBuf) F64 val; /* value */ Buffer *mBuf; /* message buffer */ #endif @@ -457,8 +449,6 @@ Buffer *mBuf; /* message buffer */ S8 pkArray[25]; /* packing array */ #endif /*FCSPKINT*/ - TRC1(SPkF64) - sprintf(tmpArray, "%.16le", val); #ifndef FCSPKINT /* backward compatibility, packing order */ @@ -477,7 +467,7 @@ Buffer *mBuf; /* message buffer */ if (ret != ROK) SSLOGERROR(ERRCLS_ADD_RES, ESS249, (ErrVal)ret, "SAddPreMsgMult() failed"); #endif - RETVALUE(ret); + return (ret); } /* end of SPkF64 */ #endif /* SS_FLOAT */ @@ -497,20 +487,19 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SUnpkS8 +S16 SUnpkS8 ( S8 *val, /* pointer to value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SUnpkS8(val, mBuf) +S16 SUnpkS8(val, mBuf) S8 *val; /* pointer to value */ Buffer *mBuf; /* message buffer */ #endif { Data tmp; /* temporary value */ S16 ret; /* return code */ - TRC1(SUnpkS8) /* ss021.103 - Addition of data pointer check */ #if (ERRCLASS & ERRCLS_INT_PAR) @@ -518,7 +507,7 @@ Buffer *mBuf; /* message buffer */ if (!val) { SSLOGERROR(ERRCLS_INT_PAR, ESS250, ERRZERO, "SUnpkS8 : Null value"); - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -528,13 +517,13 @@ Buffer *mBuf; /* message buffer */ SSLOGERROR(ERRCLS_DEBUG, ESS251, (ErrVal)ret, "SRemPreMsg() failed"); #endif *val = (S8) tmp; - RETVALUE(ret); + return (ret); } /* end of SUnpkS8 */ /* * -* Fun: SUnpkU8 +* Fun: oduPackUInt8 * * Desc: This function unpacks an unsigned 8 bit value from a message. * @@ -547,28 +536,27 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SUnpkU8 +S16 oduPackUInt8 ( U8 *val, /* pointer to value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SUnpkU8(val, mBuf) +S16 oduPackUInt8(val, mBuf) U8 *val; /* pointer to value */ Buffer *mBuf; /* message buffer */ #endif { Data tmp; /* temporary value */ S16 ret; /* return code */ - TRC1(SUnpkU8) /* ss021.103 - Addition of data pointer check */ #if (ERRCLASS & ERRCLS_INT_PAR) /* check data pointer */ if (!val) { - SSLOGERROR(ERRCLS_INT_PAR, ESS252, ERRZERO, "SUnpkU8 : Null value"); - RETVALUE(RFAILED); + SSLOGERROR(ERRCLS_INT_PAR, ESS252, ERRZERO, "oduPackUInt8 : Null value"); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -578,8 +566,8 @@ Buffer *mBuf; /* message buffer */ SSLOGERROR(ERRCLS_DEBUG, ESS253, (ErrVal)ret, "SRemPreMsg() failed"); #endif *val = (U8) tmp; - RETVALUE(ret); -} /* end of SUnpkU8 */ + return (ret); +} /* end of oduPackUInt8 */ /* * @@ -596,13 +584,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SUnpkS16 +S16 SUnpkS16 ( S16 *val, /* pointer to value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SUnpkS16(val, mBuf) +S16 SUnpkS16(val, mBuf) S16 *val; /* pointer to value */ Buffer *mBuf; /* message buffer */ #endif @@ -610,7 +598,6 @@ Buffer *mBuf; /* message buffer */ U16 tmp16; /* temporary value */ Data unpkArray[2]; /* unpacking array */ S16 ret; /* return code */ - TRC1(SUnpkS16) /* ss021.103 - Addition of data pointer check */ #if (ERRCLASS & ERRCLS_INT_PAR) @@ -618,7 +605,7 @@ Buffer *mBuf; /* message buffer */ if (!val) { SSLOGERROR(ERRCLS_INT_PAR, ESS254, ERRZERO, "SUnpkS16 : Null value"); - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -636,13 +623,13 @@ Buffer *mBuf; /* message buffer */ tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[1]); #endif *val = (S16) tmp16; - RETVALUE(ret); + return (ret); } /* end of SUnpkS16 */ /* * -* Fun: SUnpkU16 +* Fun: oduPackUInt16 * * Desc: This function unpacks an unsigned 16 bit value from a message. * @@ -655,13 +642,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SUnpkU16 +S16 oduPackUInt16 ( U16 *val, /* pointer to value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SUnpkU16(val, mBuf) +S16 oduPackUInt16(val, mBuf) U16 *val; /* pointer to value */ Buffer *mBuf; /* message buffer */ #endif @@ -669,15 +656,14 @@ Buffer *mBuf; /* message buffer */ U16 tmp16; /* temporary value */ Data unpkArray[2]; /* unpacking array */ S16 ret; /* return code */ - TRC1(SUnpkU16) /* ss021.103 - Addition of data pointer check */ #if (ERRCLASS & ERRCLS_INT_PAR) /* check data pointer */ if (!val) { - SSLOGERROR(ERRCLS_INT_PAR, ESS256, ERRZERO, "SUnpkU16 : Null value"); - RETVALUE(RFAILED); + SSLOGERROR(ERRCLS_INT_PAR, ESS256, ERRZERO, "oduPackUInt16 : Null value"); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -695,8 +681,8 @@ Buffer *mBuf; /* message buffer */ tmp16 = (U16) PutLoByte(tmp16, (U8) unpkArray[1]); #endif *val = tmp16; - RETVALUE(ret); -} /* end of SUnpkU16 */ + return (ret); +} /* end of oduPackUInt16 */ /* @@ -714,13 +700,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SUnpkS32 +S16 SUnpkS32 ( S32 *val, /* pointer to value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SUnpkS32(val, mBuf) +S16 SUnpkS32(val, mBuf) S32 *val; /* pointer to value */ Buffer *mBuf; /* message buffer */ #endif @@ -729,7 +715,6 @@ Buffer *mBuf; /* message buffer */ U32 tmp32; /* temporary value */ Data unpkArray[4]; /* unpacking array */ S16 ret; /* return code */ - TRC1(SUnpkS32) /* ss021.103 - Addition of data pointer check */ #if (ERRCLASS & ERRCLS_INT_PAR) @@ -737,7 +722,7 @@ Buffer *mBuf; /* message buffer */ if (!val) { SSLOGERROR(ERRCLS_INT_PAR, ESS258, ERRZERO, "SUnpkS32 : Null value"); - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -764,13 +749,13 @@ Buffer *mBuf; /* message buffer */ tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16); #endif *val = (S32) tmp32; - RETVALUE(ret); + return (ret); } /* end of SUnpkS32 */ /* * -* Fun: SUnpkU32 +* Fun: oduPackUInt32 * * Desc: This function unpacks an unsigned 32 bit value from a message. * @@ -783,13 +768,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SUnpkU32 +S16 oduPackUInt32 ( U32 *val, /* pointer to value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SUnpkU32(val, mBuf) +S16 oduPackUInt32(val, mBuf) U32 *val; /* pointer to value */ Buffer *mBuf; /* message buffer */ #endif @@ -800,15 +785,14 @@ Buffer *mBuf; /* message buffer */ #ifdef ERRCLASS S16 ret; /* return code */ #endif /* ERRCLASS */ - TRC1(SUnpkU32) /* ss021.103 - Addition of data pointer check */ #if (ERRCLASS & ERRCLS_INT_PAR) /* check data pointer */ if (!val) { - SSLOGERROR(ERRCLS_INT_PAR, ESS260, ERRZERO, "SUnpkU32 : Null value"); - RETVALUE(RFAILED); + SSLOGERROR(ERRCLS_INT_PAR, ESS260, ERRZERO, "oduPackUInt32 : Null value"); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -836,8 +820,8 @@ Buffer *mBuf; /* message buffer */ tmp32 = (U32) PutLoWord(tmp32, (U16) tmp16); #endif *val = tmp32; - RETVALUE(ret); -} /* end of SUnpkU32 */ + return (ret); +} /* end of oduPackUInt32 */ /*ss038.103 1. Added Floating point support*/ #ifdef SS_FLOAT @@ -856,13 +840,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SUnpkF32 +S16 SUnpkF32 ( F32 *val, /* pointer to value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SUnpkF32(val, mBuf) +S16 SUnpkF32(val, mBuf) F32 *val; /* pointer to value */ Buffer *mBuf; /* message buffer */ #endif @@ -875,14 +859,12 @@ Buffer *mBuf; /* message buffer */ S8 unpkArray[15]; /* unpacking array */ #endif /* FCSPKINT */ - TRC1(SUnpkF32) - #if (ERRCLASS & ERRCLS_INT_PAR) /* check data pointer */ if (!val) { SSLOGERROR(ERRCLS_INT_PAR, ESS262, ERRZERO, "SUnpkF32 : Null value"); - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -903,7 +885,7 @@ Buffer *mBuf; /* message buffer */ sscanf(tmpArray, "%f", val); #endif - RETVALUE(ret); + return (ret); } /* end of SUnpkF32 */ @@ -922,13 +904,13 @@ Buffer *mBuf; /* message buffer */ */ #ifdef ANSI -PUBLIC S16 SUnpkF64 +S16 SUnpkF64 ( F64 *val, /* pointer to value */ Buffer *mBuf /* message buffer */ ) #else -PUBLIC S16 SUnpkF64(val, mBuf) +S16 SUnpkF64(val, mBuf) F64 *val; /* pointer to value */ Buffer *mBuf; /* message buffer */ #endif @@ -942,14 +924,12 @@ Buffer *mBuf; /* message buffer */ S8 unpkArray[25]; /* unpacking array */ #endif /* FCSPKINT */ - TRC1(SUnpkF64) - #if (ERRCLASS & ERRCLS_INT_PAR) /* check data pointer */ if (!val) { SSLOGERROR(ERRCLS_INT_PAR, ESS264, ERRZERO, "SUnpkF64 : Null value"); - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -970,7 +950,7 @@ Buffer *mBuf; /* message buffer */ sscanf(tmpArray, "%lf", val); #endif - RETVALUE(ret); + return (ret); } /* end of SUnpkF64 */ #endif /* SS_FLOAT */