Add support for "full" star globbing patterns in event names and filters
[lttng-tools.git] / src / lib / lttng-ctl / filter / filter-visitor-ir-validate-string.c
index 34b4b194b5083de014de21c1610c8a1e482bcc97..5c0a58efbe01ad625f04b4180744238fbf2b1a05 100644 (file)
@@ -26,6 +26,9 @@
 #include <assert.h>
 #include <errno.h>
 #include <inttypes.h>
+
+#include <common/macros.h>
+
 #include "filter-ast.h"
 #include "filter-parser.h"
 #include "filter-ir.h"
@@ -74,13 +77,9 @@ int validate_string(struct ir_op *node)
                if (node->data_type == IR_DATA_STRING) {
                        const char *str;
 
-                       assert(node->u.load.u.string);
-                       str = node->u.load.u.string;
+                       assert(node->u.load.u.string.value);
+                       str = node->u.load.u.string.value;
 
-                       /*
-                        * Make sure that if a non-escaped wildcard is
-                        * present, it is the last character of the string.
-                        */
                        for (;;) {
                                enum parse_char_result res;
 
@@ -92,20 +91,6 @@ int validate_string(struct ir_op *node)
                                str++;
 
                                switch (res) {
-                               case PARSE_CHAR_WILDCARD:
-                               {
-                                       if (*str) {
-                                               /*
-                                                * Found a wildcard followed by non-null
-                                                * character; unsupported.
-                                                */
-                                               ret = -EINVAL;
-                                               fprintf(stderr,
-                                                       "Wildcards may only be used as the last character of a string in a filter.\n");
-                                               goto end_load;
-                                       }
-                                       break;
-                               }
                                case PARSE_CHAR_UNKNOWN:
                                        ret = -EINVAL;
                                        fprintf(stderr,
@@ -142,6 +127,7 @@ end_load:
        }
 }
 
+LTTNG_HIDDEN
 int filter_visitor_ir_validate_string(struct filter_parser_ctx *ctx)
 {
        return validate_string(ctx->ir_root);
This page took 0.025418 seconds and 5 git commands to generate.