79166a599f16eb59cff176099fb8611ded59d466 kent Tue Aug 6 11:51:11 2019 -0700 Adding new rqlEvalCoerceToString for things that want to evaluate a string rather than a boolean expression. diff --git src/inc/rql.h src/inc/rql.h index 9549c83..9491dd8 100644 --- src/inc/rql.h +++ src/inc/rql.h @@ -135,17 +135,21 @@ void rqlCheckFieldsExist(struct rqlStatement *rql, struct hash *fieldsThatExist, char *fieldSource); /* Check that all fields referenced in an rql statement actually exist. * fieldsThatExist is a hash of field names, and fieldSource is where they came from. */ typedef char* (*RqlEvalLookup)(void *record, char *key); /* Callback for rqlEvalOnRecord to lookup a variable value. */ struct rqlEval rqlEvalOnRecord(struct rqlParse *p, void *record, RqlEvalLookup lookup, struct lm *lm); /* Evaluate parse tree on record, using lm for memory for string operations. */ struct rqlEval rqlEvalCoerceToBoolean(struct rqlEval r); /* Return TRUE if it's a nonempty string or a non-zero number. */ +struct rqlEval rqlEvalCoerceToString(struct rqlEval r, char *buf, int bufSize); +/* Return a version of r with .val.s filled in with something reasonable even + * if r input is not a string */ + #endif /* RQL_H */