diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-11-26 19:57:02 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-11-26 19:57:02 +0000 |
commit | ecf0ef4f0a678ec5b0c58d086417aaeb0f971148 (patch) | |
tree | 4de953a3f4c21561512b1cc75aee282a8f064236 /libsystem.html | |
parent | 0d897de7695b764b2dabd18aab09776b42ee3ec3 (diff) | |
download | netpbm-mirror-ecf0ef4f0a678ec5b0c58d086417aaeb0f971148.tar.gz netpbm-mirror-ecf0ef4f0a678ec5b0c58d086417aaeb0f971148.tar.xz netpbm-mirror-ecf0ef4f0a678ec5b0c58d086417aaeb0f971148.zip |
miscellaneous update
git-svn-id: http://svn.code.sf.net/p/netpbm/code/userguide@4787 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'libsystem.html')
-rw-r--r-- | libsystem.html | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/libsystem.html b/libsystem.html index 4ccf57cd..9ef36a14 100644 --- a/libsystem.html +++ b/libsystem.html @@ -398,8 +398,8 @@ another address in your process' memory. <p>The Standard Input feeder for this is called <b>pm_feed_from_memory</b>. The Standard Output accepter is <b>pm_accept_to_memory</b>. -<p>For both of these, the argument is the address of a <b>struct -bufferDesc</b>, which is defined as follows: +<p>For both of these, the argument is a pointer to a <b>struct bufferDesc</b>, +which is defined as follows: <pre> struct bufferDesc { @@ -424,6 +424,47 @@ able to write everything to a pipe that it wanted to, case. +<h3>File Stream</h3> + +<p>These routines are for using an actual file as input or output. + I.e. Standard Input comes from a file and Standard Output goes to a file. + You open the file and create a libc file stream (type FILE) from it and pass + that stream object to the standard input feeder or standard output accepter. + +<p>When you do this (using output as an example), your process writes to + Standard Output, which is a pipe, the standard output accepter then reads + from that pipe into a buffer, and then the standard output accepter writes + from that buffer to your file. You could alternatively just arrange for the + Standard Input or Output of your process to be the file and skip a copy, but + it might be more complex coding. + +<p>Note that if the calling program's Standard Output is already set up + as the file to which you want your process' output to go, you + don't need this. All you have to do is decline to specify a Standard + Output accepter (use NULL in place of the Standard Output accepter pointer) + and your process' output will go there. + +<p>The Standard Input feeder for this is called <b>pm_feed_from_filestream</b>. +The Standard Output accepter is <b>pm_accept_to_filestream</b>. + +<p>For both of these, the argument is a pointer to a Standard C library + FILE object. + +<p>Example: + + <pre> + <code> + int termStatus; + FILE * myFileP; + myFileP = fopen("tmp/myfile", "r"); + pm_system2(pm_feed_from_filestream, myFileP, + NULL, NULL, + "grep myword", &termstatus); + </code> + </pre> + +<p>These routines were new in Netpbm 11.05 (December 2023). + <h3>Pamtuple</h3> <p>These routines are for when you have images in memory in the data |