#941 Move OG_COMPUTER_NAME_MAXLEN to dbi.h

This parameter is actually a database related parameter so now it is renamed to
OG_DB_COMPUTER_NAME_MAXLEN.
master
Roberto Hueso Gómez 2020-06-24 11:05:28 +02:00 committed by OpenGnSys Support Team
parent 4397ea8a40
commit 9c8e5c7102
2 changed files with 3 additions and 4 deletions

View File

@ -22,13 +22,11 @@
#include <jansson.h> #include <jansson.h>
#include <time.h> #include <time.h>
#define OG_COMPUTER_NAME_MAXLEN 100
struct og_computer { struct og_computer {
unsigned int id; unsigned int id;
unsigned int center; unsigned int center;
unsigned int room; unsigned int room;
char name[OG_COMPUTER_NAME_MAXLEN + 1]; char name[OG_DB_COMPUTER_NAME_MAXLEN + 1];
unsigned int procedure_id; unsigned int procedure_id;
}; };
@ -75,7 +73,7 @@ static int og_dbi_get_computer_info(struct og_computer *computer,
computer->procedure_id = dbi_result_get_uint(result, "idproautoexec"); computer->procedure_id = dbi_result_get_uint(result, "idproautoexec");
strncpy(computer->name, strncpy(computer->name,
dbi_result_get_string(result, "nombreordenador"), dbi_result_get_string(result, "nombreordenador"),
OG_COMPUTER_NAME_MAXLEN); OG_DB_COMPUTER_NAME_MAXLEN);
dbi_result_free(result); dbi_result_free(result);
og_dbi_close(dbi); og_dbi_close(dbi);

View File

@ -18,6 +18,7 @@ struct og_dbi {
struct og_dbi *og_dbi_open(struct og_dbi_config *config); struct og_dbi *og_dbi_open(struct og_dbi_config *config);
void og_dbi_close(struct og_dbi *db); void og_dbi_close(struct og_dbi *db);
#define OG_DB_COMPUTER_NAME_MAXLEN 100
#define OG_DB_IMAGE_NAME_MAXLEN 50 #define OG_DB_IMAGE_NAME_MAXLEN 50
#define OG_DB_FILESYSTEM_MAXLEN 16 #define OG_DB_FILESYSTEM_MAXLEN 16
#define OG_DB_INT8_MAXLEN 8 #define OG_DB_INT8_MAXLEN 8