mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-04 22:30:09 +00:00
Added NRF
This commit is contained in:
parent
46f20cc979
commit
d0673e3066
397 changed files with 85455 additions and 209 deletions
30
lib/sbi/openapi/model/patch_operation.c
Normal file
30
lib/sbi/openapi/model/patch_operation.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include "patch_operation.h"
|
||||
|
||||
char* OpenAPI_patch_operation_ToString(OpenAPI_patch_operation_e patch_operation)
|
||||
{
|
||||
const char *patch_operationArray[] = { "NULL", "add", "copy", "move", "_remove", "replace", "test" };
|
||||
size_t sizeofArray = sizeof(patch_operationArray) / sizeof(patch_operationArray[0]);
|
||||
if (patch_operation < sizeofArray)
|
||||
return (char *)patch_operationArray[patch_operation];
|
||||
else
|
||||
return (char *)"Unknown";
|
||||
}
|
||||
|
||||
OpenAPI_patch_operation_e OpenAPI_patch_operation_FromString(char* patch_operation)
|
||||
{
|
||||
int stringToReturn = 0;
|
||||
const char *patch_operationArray[] = { "NULL", "add", "copy", "move", "_remove", "replace", "test" };
|
||||
size_t sizeofArray = sizeof(patch_operationArray) / sizeof(patch_operationArray[0]);
|
||||
while (stringToReturn < sizeofArray) {
|
||||
if (strcmp(patch_operation, patch_operationArray[stringToReturn]) == 0) {
|
||||
return stringToReturn;
|
||||
}
|
||||
stringToReturn++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue