From: Richard W.M. Jones Date: Sat, 26 Apr 2014 16:37:18 +0000 (+0100) Subject: Minor updates to the manual page. X-Git-Tag: v1.1~24 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=cdd5f93d5c8b51d8e80e2ccf45f1f4a90c79f6a6;p=miniexpect.git Minor updates to the manual page. --- diff --git a/miniexpect.pod b/miniexpect.pod index f17cda9..0ab4a4a 100644 --- a/miniexpect.pod +++ b/miniexpect.pod @@ -18,21 +18,23 @@ miniexpect - A very simple expect library for C. } mexp_close (h); - cc prog.c -o prog -lminiexpect + cc prog.c -o prog -lminiexpect -lpcre =head1 DESCRIPTION -miniexpect is a very simple expect-like library for C. +Miniexpect is a very simple expect-like library for C. Expect is a +way to control an external program that wants to be run interactively. -It has a saner interface than libexpect, and doesn't depend on Tcl. -It is also thread safe, const-correct and uses modern C standards. +Miniexpect has a saner interface than libexpect, and doesn't depend on +Tcl. It is also thread safe, const-correct and uses modern C +standards. -It is standalone, except that it requires the PCRE (Perl Compatible -Regular Expressions) library from http://www.pcre.org/. The PCRE -dependency is fundamental because we want to offer the most powerful -regular expression syntax to match on, but more importantly because -PCRE has a convenient way to detect partial matches which made this -library very simple to implement. +Miniexpect is a standalone library, except for a single dependency: it +requires the PCRE (Perl Compatible Regular Expressions) library from +L. The PCRE dependency is fundamental because +we want to offer the most powerful regular expression syntax to match +on, but more importantly because PCRE has a convenient way to detect +partial matches which made this library very simple to implement. This manual page documents the API. Examples of how to use the API can be found in the source directory. @@ -261,7 +263,7 @@ compiler, you can just use a local variable instead. char *errptr; int offset; pcre *password_re, *prompt_re; - int ovecsize = 12; + const int ovecsize = 12; int ovector[ovecsize]; password_re = pcre_compile ("assword", 0, &errptr, &offset, NULL); @@ -302,8 +304,25 @@ B This returns the number of bytes, if the whole message was written OK. If there was an error, -1 is returned and the error is available in -C. Note that this function will not do a partial write. If it -cannot write all the data, then it will return an error. +C. + +Notes: + +=over 4 + +=item * + +C will not do a partial write. If it cannot write all +the data, then it will return an error. + +=item * + +This function does not write a newline automatically. If you want to +send a command followed by a newline you have to do something like: + + mexp_printf (h, "exit\n"); + +=back =head1 SOURCE