mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-02 13:20:08 +00:00
[Release-17] Upgrade SBI to v17.x.0
This commit is contained in:
parent
969c116e77
commit
4d44b1843e
1687 changed files with 121604 additions and 9310 deletions
30
lib/sbi/openapi/model/user_consent.c
Normal file
30
lib/sbi/openapi/model/user_consent.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "user_consent.h"
|
||||
|
||||
char* OpenAPI_user_consent_ToString(OpenAPI_user_consent_e user_consent)
|
||||
{
|
||||
const char *user_consentArray[] = { "NULL", "CONSENT_NOT_GIVEN", "CONSENT_GIVEN" };
|
||||
size_t sizeofArray = sizeof(user_consentArray) / sizeof(user_consentArray[0]);
|
||||
if (user_consent < sizeofArray)
|
||||
return (char *)user_consentArray[user_consent];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_user_consent_e OpenAPI_user_consent_FromString(char* user_consent)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *user_consentArray[] = { "NULL", "CONSENT_NOT_GIVEN", "CONSENT_GIVEN" };
|
||||
size_t sizeofArray = sizeof(user_consentArray) / sizeof(user_consentArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(user_consent, user_consentArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue