From: Richard W.M. Jones Date: Fri, 25 Apr 2014 21:41:14 +0000 (+0100) Subject: miniexpect.h: Just some tidying up. X-Git-Tag: v1.1~29 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=b8b12f1ba3da64584d122b60a80b771bfa411bf6;p=miniexpect.git miniexpect.h: Just some tidying up. --- diff --git a/miniexpect.h b/miniexpect.h index 9a2fa3c..ba3607a 100644 --- a/miniexpect.h +++ b/miniexpect.h @@ -99,8 +99,9 @@ extern int mexp_close (mexp_h *h); /* The list of regular expressions passed to mexp_expect. */ struct mexp_regexp { - int r; /* The returned value from mexp_expect. - * Must be > 0. + int r; /* The returned value from mexp_expect + * if this regular expression matches. + * MUST be > 0. */ const pcre *re; /* The compiled regular expression. */ const pcre_extra *extra; /* See pcre_exec. */ @@ -109,16 +110,19 @@ struct mexp_regexp { typedef struct mexp_regexp mexp_regexp; enum mexp_status { - MEXP_EOF = -1, - MEXP_TIMEOUT = -2, - MEXP_ERROR = -3, - MEXP_PCRE_ERROR = -4, + MEXP_EOF = 0, + MEXP_TIMEOUT = -1, + MEXP_ERROR = -2, + MEXP_PCRE_ERROR = -3, }; /* Expect some output from the subprocess. Match the output against * the PCRE regular expression(s) in the list, and return which one * matched. * + * See example-sshpass.c for an example of how to pass in regular + * expressions. + * * This can return: * * MEXP_TIMEOUT: