summaryrefslogtreecommitdiff
path: root/src/lib/eolian/database_function_parameter.c
blob: fde8c86b3711c7c1708a4e01f48ee29f8525f2da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <Eina.h>
#include "eolian_database.h"

Eolian_Function_Parameter *
database_parameter_add(Eolian_Type *type, const char *name, const char *description)
{
   Eolian_Function_Parameter *param = NULL;
   param = calloc(1, sizeof(*param));
   param->name = eina_stringshare_add(name);
   param->type = type;
   param->description = eina_stringshare_add(description);
   return param;
}

void
database_parameter_del(Eolian_Function_Parameter *pdesc)
{
   if (pdesc->base.file) eina_stringshare_del(pdesc->base.file);
   eina_stringshare_del(pdesc->name);

   database_type_del(pdesc->type);
   eina_stringshare_del(pdesc->description);
   free(pdesc);
}

void
database_parameter_const_attribute_set(Eolian_Function_Parameter *param, Eina_Bool is_get, Eina_Bool is_const)
{
   EINA_SAFETY_ON_NULL_RETURN(param);
   if (is_get)
      param->is_const_on_get = is_const;
   else
      param->is_const_on_set = is_const;
}

void
database_parameter_type_set(Eolian_Function_Parameter *param, Eolian_Type *types)
{
   EINA_SAFETY_ON_NULL_RETURN(param);
   param->type = types;
}

void
database_parameter_nonull_set(Eolian_Function_Parameter *param, Eina_Bool nonull)
{
   EINA_SAFETY_ON_NULL_RETURN(param);
   param->nonull = nonull;
}