From 03c399c656ca3cc0d206d15e2f0d217f045d3ee2 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 16 May 2002 20:03:57 +0000 Subject: New e-sexp callback function to get a user_tag label value. 2002-05-16 Jeffrey Stedfast * camel-filter-search.c (get_label): New e-sexp callback function to get a user_tag label value. svn path=/trunk/; revision=16937 --- camel/camel-filter-search.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'camel/camel-filter-search.c') diff --git a/camel/camel-filter-search.c b/camel/camel-filter-search.c index 02362b7e2b..dd47bf386e 100644 --- a/camel/camel-filter-search.c +++ b/camel/camel-filter-search.c @@ -94,6 +94,7 @@ static ESExpResult *get_score (struct _ESExp *f, int argc, struct _ESExpResult * static ESExpResult *get_source (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); static ESExpResult *get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); static ESExpResult *shell_exec (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); +static ESExpResult *get_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms); /* builtin functions */ static struct { @@ -123,6 +124,7 @@ static struct { { "get-source", (ESExpFunc *) get_source, 0 }, { "get-size", (ESExpFunc *) get_size, 0 }, { "shell-exec", (ESExpFunc *) shell_exec, 0 }, + { "get-label", (ESExpFunc *) get_label, 0 }, }; @@ -511,6 +513,17 @@ get_size (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageS return r; } +static ESExpResult * +get_label (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) +{ + ESExpResult *r; + + r = e_sexp_result_new (f, ESEXP_RES_INT); + r->value.number = atoi (camel_tag_get (&fms->info->user_tags, "label")); + + return r; +} + static int run_command (struct _ESExp *f, int argc, struct _ESExpResult **argv, FilterMessageSearch *fms) { -- cgit v1.2.3