Просмотр исходного кода

ncd/modules/arithmetic.c: support non-ContinuousString strings

ambrop7 13 лет назад
Родитель
Сommit
7f7675b93c
1 измененных файлов с 22 добавлено и 11 удалено
  1. 22 11
      ncd/modules/arithmetic.c

+ 22 - 11
ncd/modules/arithmetic.c

@@ -332,57 +332,68 @@ static struct NCDModule modules[] = {
         .type = "num_lesser",
         .type = "num_lesser",
         .func_new2 = func_new_lesser,
         .func_new2 = func_new_lesser,
         .func_getvar2 = boolean_func_getvar2,
         .func_getvar2 = boolean_func_getvar2,
-        .alloc_size = sizeof(struct boolean_instance)
+        .alloc_size = sizeof(struct boolean_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_greater",
         .type = "num_greater",
         .func_new2 = func_new_greater,
         .func_new2 = func_new_greater,
         .func_getvar2 = boolean_func_getvar2,
         .func_getvar2 = boolean_func_getvar2,
-        .alloc_size = sizeof(struct boolean_instance)
+        .alloc_size = sizeof(struct boolean_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_lesser_equal",
         .type = "num_lesser_equal",
         .func_new2 = func_new_lesser_equal,
         .func_new2 = func_new_lesser_equal,
         .func_getvar2 = boolean_func_getvar2,
         .func_getvar2 = boolean_func_getvar2,
-        .alloc_size = sizeof(struct boolean_instance)
+        .alloc_size = sizeof(struct boolean_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_greater_equal",
         .type = "num_greater_equal",
         .func_new2 = func_new_greater_equal,
         .func_new2 = func_new_greater_equal,
         .func_getvar2 = boolean_func_getvar2,
         .func_getvar2 = boolean_func_getvar2,
-        .alloc_size = sizeof(struct boolean_instance)
+        .alloc_size = sizeof(struct boolean_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_equal",
         .type = "num_equal",
         .func_new2 = func_new_equal,
         .func_new2 = func_new_equal,
         .func_getvar2 = boolean_func_getvar2,
         .func_getvar2 = boolean_func_getvar2,
-        .alloc_size = sizeof(struct boolean_instance)
+        .alloc_size = sizeof(struct boolean_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_different",
         .type = "num_different",
         .func_new2 = func_new_different,
         .func_new2 = func_new_different,
         .func_getvar2 = boolean_func_getvar2,
         .func_getvar2 = boolean_func_getvar2,
-        .alloc_size = sizeof(struct boolean_instance)
+        .alloc_size = sizeof(struct boolean_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_add",
         .type = "num_add",
         .func_new2 = func_new_add,
         .func_new2 = func_new_add,
         .func_getvar2 = number_func_getvar2,
         .func_getvar2 = number_func_getvar2,
-        .alloc_size = sizeof(struct number_instance)
+        .alloc_size = sizeof(struct number_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_subtract",
         .type = "num_subtract",
         .func_new2 = func_new_subtract,
         .func_new2 = func_new_subtract,
         .func_getvar2 = number_func_getvar2,
         .func_getvar2 = number_func_getvar2,
-        .alloc_size = sizeof(struct number_instance)
+        .alloc_size = sizeof(struct number_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_multiply",
         .type = "num_multiply",
         .func_new2 = func_new_multiply,
         .func_new2 = func_new_multiply,
         .func_getvar2 = number_func_getvar2,
         .func_getvar2 = number_func_getvar2,
-        .alloc_size = sizeof(struct number_instance)
+        .alloc_size = sizeof(struct number_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_divide",
         .type = "num_divide",
         .func_new2 = func_new_divide,
         .func_new2 = func_new_divide,
         .func_getvar2 = number_func_getvar2,
         .func_getvar2 = number_func_getvar2,
-        .alloc_size = sizeof(struct number_instance)
+        .alloc_size = sizeof(struct number_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = "num_modulo",
         .type = "num_modulo",
         .func_new2 = func_new_modulo,
         .func_new2 = func_new_modulo,
         .func_getvar2 = number_func_getvar2,
         .func_getvar2 = number_func_getvar2,
-        .alloc_size = sizeof(struct number_instance)
+        .alloc_size = sizeof(struct number_instance),
+        .flags = NCDMODULE_FLAG_ACCEPT_NON_CONTINUOUS_STRINGS
     }, {
     }, {
         .type = NULL
         .type = NULL
     }
     }