librpc/ndr: apply some const to ndr_push_union_blob()
[samba.git] / source3 / rpc_server / mdssvc / sparql_parser_test.c
blob0a0f62523ab67330ccad7831207c152b38ea5727
1 #include "includes.h"
2 #include "mdssvc.h"
3 #include "rpc_server/mdssvc/sparql_parser.tab.h"
4 #include "rpc_server/mdssvc/mdssvc_tracker.h"
6 /*
7 * Examples:
9 * $ ./spotlight2sparql '_kMDItemGroupId=="11"'
10 * ...
11 * $ ./spotlight2sparql '*=="test*"cwd||kMDItemTextContent=="test*"cwd'
12 * ...
15 int main(int argc, char **argv)
17 struct sl_tracker_query *tq = NULL;
18 bool ok;
19 struct sl_query *slq;
21 if (argc != 2) {
22 printf("usage: %s QUERY\n", argv[0]);
23 return 1;
26 slq = talloc_zero(NULL, struct sl_query);
27 if (slq == NULL) {
28 printf("talloc error\n");
29 return 1;
32 slq->query_string = argv[1];
33 slq->path_scope = "/foo/bar";
35 tq = talloc_zero(slq, struct sl_tracker_query);
36 if (tq == NULL) {
37 printf("talloc error\n");
38 return 1;
40 slq->backend_private = tq;
42 ok = map_spotlight_to_sparql_query(slq);
43 printf("%s\n", ok ? tq->sparql_query : "*mapping failed*");
45 talloc_free(slq);
46 return ok ? 0 : 1;