/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Fluent Bit * ========== * Copyright (C) 2015-2022 The Fluent Bit Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef FLB_RA_KEY_H #define FLB_RA_KEY_H #include #include #include #include #include #include enum ra_types { FLB_RA_BOOL = 0, FLB_RA_INT, FLB_RA_FLOAT, FLB_RA_STRING, FLB_RA_NULL }; /* condition value types */ typedef union { bool boolean; int64_t i64; double f64; flb_sds_t string; } ra_val; /* Represent any value object */ struct flb_ra_value { int type; msgpack_object o; ra_val val; }; struct flb_ra_value *flb_ra_key_to_value(flb_sds_t ckey, msgpack_object map, struct mk_list *subkeys); void flb_ra_key_value_destroy(struct flb_ra_value *v); int flb_ra_key_value_get(flb_sds_t ckey, msgpack_object map, struct mk_list *subkeys, msgpack_object **start_key, msgpack_object **out_key, msgpack_object **out_val); int flb_ra_key_strcmp(flb_sds_t ckey, msgpack_object map, struct mk_list *subkeys, char *str, int len); int flb_ra_key_regex_match(flb_sds_t ckey, msgpack_object map, struct mk_list *subkeys, struct flb_regex *regex, struct flb_regex_search *result); int flb_ra_key_value_append(struct flb_ra_parser *rp, msgpack_object obj, msgpack_object *in_val, msgpack_packer *mp_pck); int flb_ra_key_value_update(struct flb_ra_parser *rp, msgpack_object obj, msgpack_object *in_key, msgpack_object *in_val, msgpack_packer *mp_pck); #endif