47 lines
1.2 KiB
C
Raw Normal View History

2023-02-08 23:58:35 +08:00
#include "param_demo.h"
#include <string.h>
2023-02-08 23:58:35 +08:00
#include <stdio.h>
int main()
{
InitParam(true);
2023-02-08 23:58:35 +08:00
ShowAllParam();
2023-02-28 21:58:18 +08:00
g_test = 80;
g_test_3 = -20.5;
2023-02-08 23:58:35 +08:00
SaveParam(false);
ReloadParam(false);
2023-02-08 23:58:35 +08:00
int ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 50, PARAM_DEF);
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 101, PARAM_DEF);
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 101, PARAM_NONE);
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 101, PARAM_MIN_MAX);
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 1, PARAM_MIN_MAX);
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
PARAM_STR_SET_NEW_VALUE(g_test_str, "123aa9", PARAM_NONE);
printf("ret = %d, g_test_str = %s\n", ret, g_test_str);
PARAM_STR_SET_NEW_VALUE(g_test_str, "123aa1245249", PARAM_DEF);
printf("ret = %d, g_test_str = %s\n", ret, g_test_str);
PARAM_STR_SET_NEW_VALUE(g_test_str, "123aa945457", PARAM_MIN_MAX);
printf("ret = %d, g_test_str = %s\n", ret, g_test_str);
ShowAllParam();
return 0;
2023-02-08 23:58:35 +08:00
}