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

📄 abnf.c

📁 mgcp协议源代码和测试程序,还有一个编译器
💻 C
📖 第 1 页 / 共 5 页
字号:
}int EN_ParamConnectionMode(TCtx *ctx, TParamConnectionMode *ParamConnectionMode){  /* String Element: M */  if (EncodeString(ctx, 1, "M") != OK)    return FAIL;  /* String Element: : */  if (EncodeString(ctx, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (EncodeToken(ctx, 0, EN_WSP) != OK)    return FAIL;  /* Rule Element: ConnectionMode */  if (EN_ConnectionMode(ctx, &ParamConnectionMode->ConnectionMode) != OK)    return FAIL;  return OK;}void Free_ParamConnectionMode(TParamConnectionMode *ParamConnectionMode){  /* Free Rule: ConnectionMode */  Free_ConnectionMode(&ParamConnectionMode->ConnectionMode);}int DE_ParamRequestedEvents(TCtx *ctx, TParamRequestedEvents *ParamRequestedEvents){  /* String Element: R */  if (ParseString(ctx, 1, 1, "R") != OK)    return FAIL;  /* String Element: : */  if (ParseString(ctx, 1, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (ParseToken(ctx, 0, 655, DE_WSP) != OK)    return FAIL;  /* Opt Element: RequestedEvents */  while (1)  {    CtxSave(RequestedEvents, ctx);    ParamRequestedEvents->RequestedEvents.pRuleData = (TRequestedEvents*)AbnfAlloc(ctx, sizeof(TRequestedEvents));    /* Rule Element in Option */    if (DE_RequestedEvents(ctx, (TRequestedEvents*)ParamRequestedEvents->RequestedEvents.pRuleData) != OK)    {      CtxRestore(ctx, RequestedEvents);      break;    }    ParamRequestedEvents->RequestedEvents.flag = 1;    break;  }  return OK;}int EN_ParamRequestedEvents(TCtx *ctx, TParamRequestedEvents *ParamRequestedEvents){  /* String Element: R */  if (EncodeString(ctx, 1, "R") != OK)    return FAIL;  /* String Element: : */  if (EncodeString(ctx, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (EncodeToken(ctx, 0, EN_WSP) != OK)    return FAIL;  /* Opt Element: RequestedEvents */  if (ParamRequestedEvents->RequestedEvents.flag)  {    TRequestedEvents *RequestedEvents = (TRequestedEvents*)ParamRequestedEvents->RequestedEvents.pRuleData;    /* Rule Element in Option */    if (EN_RequestedEvents(ctx, RequestedEvents) != OK)      return FAIL;  }  return OK;}void Free_ParamRequestedEvents(TParamRequestedEvents *ParamRequestedEvents){  /* Free Option: RequestedEvents */  if(ParamRequestedEvents->RequestedEvents.flag)  {    Free_RequestedEvents((TRequestedEvents*)ParamRequestedEvents->RequestedEvents.pRuleData);    free(ParamRequestedEvents->RequestedEvents.pRuleData);  }}int DE_ParamSignalRequests(TCtx *ctx, TParamSignalRequests *ParamSignalRequests){  /* String Element: S */  if (ParseString(ctx, 1, 1, "S") != OK)    return FAIL;  /* String Element: : */  if (ParseString(ctx, 1, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (ParseToken(ctx, 0, 655, DE_WSP) != OK)    return FAIL;  /* Opt Element: SignalRequests */  while (1)  {    CtxSave(SignalRequests, ctx);    ParamSignalRequests->SignalRequests.pRuleData = (TSignalRequests*)AbnfAlloc(ctx, sizeof(TSignalRequests));    /* Rule Element in Option */    if (DE_SignalRequests(ctx, (TSignalRequests*)ParamSignalRequests->SignalRequests.pRuleData) != OK)    {      CtxRestore(ctx, SignalRequests);      break;    }    ParamSignalRequests->SignalRequests.flag = 1;    break;  }  return OK;}int EN_ParamSignalRequests(TCtx *ctx, TParamSignalRequests *ParamSignalRequests){  /* String Element: S */  if (EncodeString(ctx, 1, "S") != OK)    return FAIL;  /* String Element: : */  if (EncodeString(ctx, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (EncodeToken(ctx, 0, EN_WSP) != OK)    return FAIL;  /* Opt Element: SignalRequests */  if (ParamSignalRequests->SignalRequests.flag)  {    TSignalRequests *SignalRequests = (TSignalRequests*)ParamSignalRequests->SignalRequests.pRuleData;    /* Rule Element in Option */    if (EN_SignalRequests(ctx, SignalRequests) != OK)      return FAIL;  }  return OK;}void Free_ParamSignalRequests(TParamSignalRequests *ParamSignalRequests){  /* Free Option: SignalRequests */  if(ParamSignalRequests->SignalRequests.flag)  {    Free_SignalRequests((TSignalRequests*)ParamSignalRequests->SignalRequests.pRuleData);    free(ParamSignalRequests->SignalRequests.pRuleData);  }}int DE_ParamDigitMap(TCtx *ctx, TParamDigitMap *ParamDigitMap){  /* String Element: D */  if (ParseString(ctx, 1, 1, "D") != OK)    return FAIL;  /* String Element: : */  if (ParseString(ctx, 1, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (ParseToken(ctx, 0, 655, DE_WSP) != OK)    return FAIL;  /* Opt Element: DigitMap */  while (1)  {    CtxSave(DigitMap, ctx);    ParamDigitMap->DigitMap.pRuleData = (TDigitMap*)AbnfAlloc(ctx, sizeof(TDigitMap));    /* Rule Element in Option */    if (DE_DigitMap(ctx, (TDigitMap*)ParamDigitMap->DigitMap.pRuleData) != OK)    {      CtxRestore(ctx, DigitMap);      break;    }    ParamDigitMap->DigitMap.flag = 1;    break;  }  return OK;}int EN_ParamDigitMap(TCtx *ctx, TParamDigitMap *ParamDigitMap){  /* String Element: D */  if (EncodeString(ctx, 1, "D") != OK)    return FAIL;  /* String Element: : */  if (EncodeString(ctx, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (EncodeToken(ctx, 0, EN_WSP) != OK)    return FAIL;  /* Opt Element: DigitMap */  if (ParamDigitMap->DigitMap.flag)  {    TDigitMap *DigitMap = (TDigitMap*)ParamDigitMap->DigitMap.pRuleData;    /* Rule Element in Option */    if (EN_DigitMap(ctx, DigitMap) != OK)      return FAIL;  }  return OK;}void Free_ParamDigitMap(TParamDigitMap *ParamDigitMap){  /* Free Option: DigitMap */  if(ParamDigitMap->DigitMap.flag)  {    Free_DigitMap((TDigitMap*)ParamDigitMap->DigitMap.pRuleData);    free(ParamDigitMap->DigitMap.pRuleData);  }}int DE_ParamObservedEvents(TCtx *ctx, TParamObservedEvents *ParamObservedEvents){  /* String Element: O */  if (ParseString(ctx, 1, 1, "O") != OK)    return FAIL;  /* String Element: : */  if (ParseString(ctx, 1, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (ParseToken(ctx, 0, 655, DE_WSP) != OK)    return FAIL;  /* Opt Element: ObservedEvents */  while (1)  {    CtxSave(ObservedEvents, ctx);    ParamObservedEvents->ObservedEvents.pRuleData = (TSignalRequests*)AbnfAlloc(ctx, sizeof(TSignalRequests));    /* Rule Element in Option */    if (DE_SignalRequests(ctx, (TSignalRequests*)ParamObservedEvents->ObservedEvents.pRuleData) != OK)    {      CtxRestore(ctx, ObservedEvents);      break;    }    ParamObservedEvents->ObservedEvents.flag = 1;    break;  }  return OK;}int EN_ParamObservedEvents(TCtx *ctx, TParamObservedEvents *ParamObservedEvents){  /* String Element: O */  if (EncodeString(ctx, 1, "O") != OK)    return FAIL;  /* String Element: : */  if (EncodeString(ctx, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (EncodeToken(ctx, 0, EN_WSP) != OK)    return FAIL;  /* Opt Element: ObservedEvents */  if (ParamObservedEvents->ObservedEvents.flag)  {    TSignalRequests *ObservedEvents = (TSignalRequests*)ParamObservedEvents->ObservedEvents.pRuleData;    /* Rule Element in Option */    if (EN_SignalRequests(ctx, ObservedEvents) != OK)      return FAIL;  }  return OK;}void Free_ParamObservedEvents(TParamObservedEvents *ParamObservedEvents){  /* Free Option: ObservedEvents */  if(ParamObservedEvents->ObservedEvents.flag)  {    Free_SignalRequests((TSignalRequests*)ParamObservedEvents->ObservedEvents.pRuleData);    free(ParamObservedEvents->ObservedEvents.pRuleData);  }}int DE_ParamConnectionParameters(TCtx *ctx, TParamConnectionParameters *ParamConnectionParameters){  /* String Element: P */  if (ParseString(ctx, 1, 1, "P") != OK)    return FAIL;  /* String Element: : */  if (ParseString(ctx, 1, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (ParseToken(ctx, 0, 655, DE_WSP) != OK)    return FAIL;  /* Opt Element: ConnectionParameters */  while (1)  {    CtxSave(ConnectionParameters, ctx);    ParamConnectionParameters->ConnectionParameters.pRuleData = (TConnectionParameters*)AbnfAlloc(ctx, sizeof(TConnectionParameters));    /* Rule Element in Option */    if (DE_ConnectionParameters(ctx, (TConnectionParameters*)ParamConnectionParameters->ConnectionParameters.pRuleData) != OK)    {      CtxRestore(ctx, ConnectionParameters);      break;    }    ParamConnectionParameters->ConnectionParameters.flag = 1;    break;  }  return OK;}int EN_ParamConnectionParameters(TCtx *ctx, TParamConnectionParameters *ParamConnectionParameters){  /* String Element: P */  if (EncodeString(ctx, 1, "P") != OK)    return FAIL;  /* String Element: : */  if (EncodeString(ctx, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (EncodeToken(ctx, 0, EN_WSP) != OK)    return FAIL;  /* Opt Element: ConnectionParameters */  if (ParamConnectionParameters->ConnectionParameters.flag)  {    TConnectionParameters *ConnectionParameters = (TConnectionParameters*)ParamConnectionParameters->ConnectionParameters.pRuleData;    /* Rule Element in Option */    if (EN_ConnectionParameters(ctx, ConnectionParameters) != OK)      return FAIL;  }  return OK;}void Free_ParamConnectionParameters(TParamConnectionParameters *ParamConnectionParameters){  /* Free Option: ConnectionParameters */  if(ParamConnectionParameters->ConnectionParameters.flag)  {    Free_ConnectionParameters((TConnectionParameters*)ParamConnectionParameters->ConnectionParameters.pRuleData);    free(ParamConnectionParameters->ConnectionParameters.pRuleData);  }}int DE_ParamReasonCode(TCtx *ctx, TParamReasonCode *ParamReasonCode){  /* String Element: E */  if (ParseString(ctx, 1, 1, "E") != OK)    return FAIL;  /* String Element: : */  if (ParseString(ctx, 1, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (ParseToken(ctx, 0, 655, DE_WSP) != OK)    return FAIL;  /* Rule Element: ReasonCode */  if (DE_ReasonCode(ctx, &ParamReasonCode->ReasonCode) != OK)    return FAIL;  return OK;}int EN_ParamReasonCode(TCtx *ctx, TParamReasonCode *ParamReasonCode){  /* String Element: E */  if (EncodeString(ctx, 1, "E") != OK)    return FAIL;  /* String Element: : */  if (EncodeString(ctx, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (EncodeToken(ctx, 0, EN_WSP) != OK)    return FAIL;  /* Rule Element: ReasonCode */  if (EN_ReasonCode(ctx, &ParamReasonCode->ReasonCode) != OK)    return FAIL;  return OK;}void Free_ParamReasonCode(TParamReasonCode *ParamReasonCode){  /* Free Rule: ReasonCode */  Free_ReasonCode(&ParamReasonCode->ReasonCode);}int DE_ParamSpecificEndpointID(TCtx *ctx, TParamSpecificEndpointID *ParamSpecificEndpointID){  /* String Element: Z */  if (ParseString(ctx, 1, 1, "Z") != OK)    return FAIL;  /* String Element: : */  if (ParseString(ctx, 1, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (ParseToken(ctx, 0, 655, DE_WSP) != OK)    return FAIL;  /* Opt Element: SpecificEndpointID */  while (1)  {    CtxSave(SpecificEndpointID, ctx);    ParamSpecificEndpointID->SpecificEndpointID.pRuleData = (TEndpointName*)AbnfAlloc(ctx, sizeof(TEndpointName));    /* Rule Element in Option */    if (DE_EndpointName(ctx, (TEndpointName*)ParamSpecificEndpointID->SpecificEndpointID.pRuleData) != OK)    {      CtxRestore(ctx, SpecificEndpointID);      break;    }    ParamSpecificEndpointID->SpecificEndpointID.flag = 1;    break;  }  return OK;}int EN_ParamSpecificEndpointID(TCtx *ctx, TParamSpecificEndpointID *ParamSpecificEndpointID){  /* String Element: Z */  if (EncodeString(ctx, 1, "Z") != OK)    return FAIL;  /* String Element: : */  if (EncodeString(ctx, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (EncodeToken(ctx, 0, EN_WSP) != OK)    return FAIL;  /* Opt Element: SpecificEndpointID */  if (ParamSpecificEndpointID->SpecificEndpointID.flag)  {    TEndpointName *SpecificEndpointID = (TEndpointName*)ParamSpecificEndpointID->SpecificEndpointID.pRuleData;    /* Rule Element in Option */    if (EN_EndpointName(ctx, SpecificEndpointID) != OK)      return FAIL;  }  return OK;}void Free_ParamSpecificEndpointID(TParamSpecificEndpointID *ParamSpecificEndpointID){  /* Free Option: SpecificEndpointID */  if(ParamSpecificEndpointID->SpecificEndpointID.flag)  {    Free_EndpointName((TEndpointName*)ParamSpecificEndpointID->SpecificEndpointID.pRuleData);    free(ParamSpecificEndpointID->SpecificEndpointID.pRuleData);  }}int DE_ParamSecondEndpointID(TCtx *ctx, TParamSecondEndpointID *ParamSecondEndpointID){  /* String Element: Z2 */  if (ParseString(ctx, 1, 1, "Z2") != OK)    return FAIL;  /* String Element: : */  if (ParseString(ctx, 1, 1, ":") != OK)    return FAIL;  /* Token Element: WSP */  if (ParseToken(ctx, 0, 655, DE_WSP) != OK)    return FAIL;  /* Rule Element: SecondEndpointID */  if (DE_EndpointName(ctx, &ParamSecondEndpointID->SecondEndpointID) != OK)    return FAIL;  return OK;}int EN_ParamSecondEndpointID(TCtx *ctx, TParamSecondEndpointID *ParamSecondEndpointID){  /* String Element: Z2 */  if (EncodeString(ctx, 1, "Z2") != OK)    return FAIL;  /* String Element: : */  if (EncodeString(ctx, 1, ":") != OK)    return FAIL;

⌨️ 快捷键说明

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