| 1 | /* -*- c-basic-offset: 2 -*- */cxx . . $ `<file>/storage/mroonga/vendor/groonga/lib/proc/proc_config.c`/ |
| 2 | /* |
| 3 | Copyright(C) 2016 Brazil |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License version 2.1 as published by the Free Software Foundation. |
| 8 | |
| 9 | This library is distributed in the hope that it will be useful, |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | Lesser General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU Lesser General Public |
| 15 | License along with this library; if not, write to the Free Software |
| 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA |
| 17 | */ |
| 18 | |
| 19 | #include "../grn_proc.h"cxx . . $ `<file>/storage/mroonga/vendor/groonga/lib/grn_proc.h`/ |
| 20 | |
| 21 | #include <groonga/plugin.h>cxx . . $ `<file>/storage/mroonga/vendor/groonga/include/groonga/plugin.h`/ |
| 22 | |
| 23 | static grn_objcxx . . $ grn_obj# * |
| 24 | command_config_getcxx . . $ command_config_get(fd082858389c8bb0).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 25 | int nargs, |
| 26 | grn_objcxx . . $ grn_obj# **args, |
| 27 | grn_user_datacxx . . $ grn_user_data# *user_data) |
| 28 | { |
| 29 | grn_objcxx . . $ grn_obj# *key; |
| 30 | const char *value; |
| 31 | uint32_tcxx . . $ uint32_t# value_size; |
| 32 | |
| 33 | key = grn_plugin_proc_get_varcxx . . $ grn_plugin_proc_get_var(3074f8d72b0d40ab).(ctx, user_data, "key", -1); |
| 34 | if (GRN_TEXT_LENcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1301:9`!(key) == 0) { |
| 35 | GRN_PLUGIN_ERRORcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/plugin.h:128:9`!(ctx, GRN_INVALID_ARGUMENT, |
| 36 | "[config][get] key is missing"); |
| 37 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 38 | } |
| 39 | |
| 40 | grn_config_getcxx . . $ grn_config_get(55f0c7275dd3feda).(ctx, |
| 41 | GRN_TEXT_VALUEcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1300:9`!(key), GRN_TEXT_LENcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1301:9`!(key), |
| 42 | &value, &value_size); |
| 43 | if (ctx->rccxx . . $ _grn_ctx#rc.) { |
| 44 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 45 | } |
| 46 | |
| 47 | grn_ctx_output_strcxx . . $ grn_ctx_output_str(ae297cf89bde2f1f).(ctx, value, value_size); |
| 48 | |
| 49 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 50 | } |
| 51 | |
| 52 | static grn_objcxx . . $ grn_obj# * |
| 53 | command_config_setcxx . . $ command_config_set(fd082858389c8bb0).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 54 | int nargs, |
| 55 | grn_objcxx . . $ grn_obj# **args, |
| 56 | grn_user_datacxx . . $ grn_user_data# *user_data) |
| 57 | { |
| 58 | grn_objcxx . . $ grn_obj# *key; |
| 59 | grn_objcxx . . $ grn_obj# *value; |
| 60 | |
| 61 | key = grn_plugin_proc_get_varcxx . . $ grn_plugin_proc_get_var(3074f8d72b0d40ab).(ctx, user_data, "key", -1); |
| 62 | if (GRN_TEXT_LENcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1301:9`!(key) == 0) { |
| 63 | GRN_PLUGIN_ERRORcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/plugin.h:128:9`!(ctx, GRN_INVALID_ARGUMENT, |
| 64 | "[config][set] key is missing"); |
| 65 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 66 | } |
| 67 | |
| 68 | value = grn_plugin_proc_get_varcxx . . $ grn_plugin_proc_get_var(3074f8d72b0d40ab).(ctx, user_data, "value", -1); |
| 69 | grn_config_setcxx . . $ grn_config_set(2afa6b044548fd83).(ctx, |
| 70 | GRN_TEXT_VALUEcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1300:9`!(key), GRN_TEXT_LENcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1301:9`!(key), |
| 71 | GRN_TEXT_VALUEcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1300:9`!(value), GRN_TEXT_LENcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1301:9`!(value)); |
| 72 | |
| 73 | grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(f33f77cd46f8f264).(ctx, ctx->rccxx . . $ _grn_ctx#rc. == GRN_SUCCESScxx . . $ GRN_SUCCESS.); |
| 74 | |
| 75 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 76 | } |
| 77 | |
| 78 | static grn_objcxx . . $ grn_obj# * |
| 79 | command_config_deletecxx . . $ command_config_delete(fd082858389c8bb0).(grn_ctxcxx . . $ grn_ctx# *ctx, |
| 80 | int nargs, |
| 81 | grn_objcxx . . $ grn_obj# **args, |
| 82 | grn_user_datacxx . . $ grn_user_data# *user_data) |
| 83 | { |
| 84 | grn_objcxx . . $ grn_obj# *key; |
| 85 | |
| 86 | key = grn_plugin_proc_get_varcxx . . $ grn_plugin_proc_get_var(3074f8d72b0d40ab).(ctx, user_data, "key", -1); |
| 87 | if (GRN_TEXT_LENcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1301:9`!(key) == 0) { |
| 88 | GRN_PLUGIN_ERRORcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/plugin.h:128:9`!(ctx, GRN_INVALID_ARGUMENT, |
| 89 | "[config][delete] key is missing"); |
| 90 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 91 | } |
| 92 | |
| 93 | grn_config_deletecxx . . $ grn_config_delete(7bd03b5ef0400a0e).(ctx, |
| 94 | GRN_TEXT_VALUEcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1300:9`!(key), GRN_TEXT_LENcxx . . $ `storage/mroonga/vendor/groonga/include/groonga/groonga.h:1301:9`!(key)); |
| 95 | |
| 96 | grn_ctx_output_boolcxx . . $ grn_ctx_output_bool(f33f77cd46f8f264).(ctx, ctx->rccxx . . $ _grn_ctx#rc. == GRN_SUCCESScxx . . $ GRN_SUCCESS.); |
| 97 | |
| 98 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 99 | } |
| 100 | |
| 101 | void |
| 102 | grn_proc_init_config_getcxx . . $ grn_proc_init_config_get(b578cd6e53d5fe91).(grn_ctxcxx . . $ grn_ctx# *ctx) |
| 103 | { |
| 104 | grn_expr_varcxx . . $ grn_expr_var# vars[1]; |
| 105 | |
| 106 | grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[0]), "key", -1); |
| 107 | grn_plugin_command_createcxx . . $ grn_plugin_command_create(2dfd920bb40f3149).(ctx, |
| 108 | "config_get", -1, |
| 109 | command_config_getcxx . . $ command_config_get(fd082858389c8bb0)., |
| 110 | 1, |
| 111 | vars); |
| 112 | } |
| 113 | |
| 114 | void |
| 115 | grn_proc_init_config_setcxx . . $ grn_proc_init_config_set(b578cd6e53d5fe91).(grn_ctxcxx . . $ grn_ctx# *ctx) |
| 116 | { |
| 117 | grn_expr_varcxx . . $ grn_expr_var# vars[2]; |
| 118 | |
| 119 | grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[0]), "key", -1); |
| 120 | grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[1]), "value", -1); |
| 121 | grn_plugin_command_createcxx . . $ grn_plugin_command_create(2dfd920bb40f3149).(ctx, |
| 122 | "config_set", -1, |
| 123 | command_config_setcxx . . $ command_config_set(fd082858389c8bb0)., |
| 124 | 2, |
| 125 | vars); |
| 126 | } |
| 127 | |
| 128 | void |
| 129 | grn_proc_init_config_deletecxx . . $ grn_proc_init_config_delete(b578cd6e53d5fe91).(grn_ctxcxx . . $ grn_ctx# *ctx) |
| 130 | { |
| 131 | grn_expr_varcxx . . $ grn_expr_var# vars[1]; |
| 132 | |
| 133 | grn_plugin_expr_var_initcxx . . $ grn_plugin_expr_var_init(680ef4125f11597f).(ctx, &(vars[0]), "key", -1); |
| 134 | grn_plugin_command_createcxx . . $ grn_plugin_command_create(2dfd920bb40f3149).(ctx, |
| 135 | "config_delete", -1, |
| 136 | command_config_deletecxx . . $ command_config_delete(fd082858389c8bb0)., |
| 137 | 1, |
| 138 | vars); |
| 139 | } |