~vorlon/ubuntu/raring/upstart/lp.1199778

Viewing all changes in revision 743.

  • Committer: Scott James Remnant
  • Date: 2007-06-20 22:25:02 UTC
  • Revision ID: scott@netsplit.com-20070620222502-rqg8aiw9kzt3h8t7
* init/parse_job.c (parse_on): New generic parsing function to deal
with event expressions, including operators, parentheses, etc.
(parse_on_operator): Function called by parse_on() to deal with an
operator or operand.
(parse_on_paren): Function called by parse_on() to deal with a
parenthesis.
(parse_on_operand): Function called by parse_on_operator() to deal
with a non-operator token.
(parse_on_collect): Function called by all of the above to collect
the operators on the stack and deposit them into the output box,
either for collection by a later operator or for returning from
parse_on().
(stanza_start, stanza_stop): Call the new parse_on() function to
deal with "start on" and "stop on", storing it in the appropriate
part of the job.
* init/tests/test_parse_job.c (test_parse_job): Replace list empty
checks for start_events/stop_events with NULL checks on the new
start_on/stop_on members.
(test_stanza_start, test_stanza_stop): Test new stanza code.
* init/errors.h (PARSE_EXPECTED_EVENT, PARSE_EXPECTED_OPERATOR)
(PARSE_MISMATCHED_PARENS): Add numerics and strings for the errors
that can be generated by parsing an event expression.
* init/conf.c (conf_reload_path): Handle the new errors properly,
including the line number where they occurred.
* logd/jobs.d/logd.in: Update "stop on" to work with the new parser.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: