lsystem.c (1ea316270f1f75922ac53976d5d8808a41442f46) lsystem.c (f6b74a7d164b5fada266d00e723155a178a4529f)
1/*
1/*
2 * Copyright (C) 1984-2015 Mark Nudelman
2 * Copyright (C) 1984-2017 Mark Nudelman
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Less License, as specified in the README file.
6 *
7 * For more information, see the README file.
8 */
9
10

--- 22 unchanged lines hidden (view full) ---

33
34#if HAVE_SYSTEM
35
36/*
37 * Pass the specified command to a shell to be executed.
38 * Like plain "system()", but handles resetting terminal modes, etc.
39 */
40 public void
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Less License, as specified in the README file.
6 *
7 * For more information, see the README file.
8 */
9
10

--- 22 unchanged lines hidden (view full) ---

33
34#if HAVE_SYSTEM
35
36/*
37 * Pass the specified command to a shell to be executed.
38 * Like plain "system()", but handles resetting terminal modes, etc.
39 */
40 public void
41lsystem(char *cmd, char *donemsg)
41lsystem(cmd, donemsg)
42 char *cmd;
43 char *donemsg;
42{
43 int inp;
44#if HAVE_SHELL
45 char *shell;
46 char *p;
47#endif
48 IFILE save_ifile;
49#if MSDOS_COMPILER && MSDOS_COMPILER!=WIN32C

--- 193 unchanged lines hidden (view full) ---

243 * If the mark is after the current screen, the section between
244 * the top line displayed and the mark is piped.
245 * If the mark is before the current screen, the section between
246 * the mark and the bottom line displayed is piped.
247 * If the mark is on the current screen, or if the mark is ".",
248 * the whole current screen is piped.
249 */
250 public int
44{
45 int inp;
46#if HAVE_SHELL
47 char *shell;
48 char *p;
49#endif
50 IFILE save_ifile;
51#if MSDOS_COMPILER && MSDOS_COMPILER!=WIN32C

--- 193 unchanged lines hidden (view full) ---

245 * If the mark is after the current screen, the section between
246 * the top line displayed and the mark is piped.
247 * If the mark is before the current screen, the section between
248 * the mark and the bottom line displayed is piped.
249 * If the mark is on the current screen, or if the mark is ".",
250 * the whole current screen is piped.
251 */
252 public int
251pipe_mark(int c, char *cmd)
253pipe_mark(c, cmd)
254 int c;
255 char *cmd;
252{
253 POSITION mpos, tpos, bpos;
254
255 /*
256 * mpos = the marked position.
257 * tpos = top of screen.
258 * bpos = bottom of screen.
259 */

--- 15 unchanged lines hidden (view full) ---

275 return (pipe_data(cmd, tpos, mpos));
276}
277
278/*
279 * Create a pipe to the given shell command.
280 * Feed it the file contents between the positions spos and epos.
281 */
282 public int
256{
257 POSITION mpos, tpos, bpos;
258
259 /*
260 * mpos = the marked position.
261 * tpos = top of screen.
262 * bpos = bottom of screen.
263 */

--- 15 unchanged lines hidden (view full) ---

279 return (pipe_data(cmd, tpos, mpos));
280}
281
282/*
283 * Create a pipe to the given shell command.
284 * Feed it the file contents between the positions spos and epos.
285 */
286 public int
283pipe_data(char *cmd, POSITION spos, POSITION epos)
287pipe_data(cmd, spos, epos)
288 char *cmd;
289 POSITION spos;
290 POSITION epos;
284{
285 FILE *f;
286 int c;
287 extern FILE *popen();
288
289 /*
290 * This is structured much like lsystem().
291 * Since we're running a shell program, we must be careful

--- 75 unchanged lines hidden ---
291{
292 FILE *f;
293 int c;
294 extern FILE *popen();
295
296 /*
297 * This is structured much like lsystem().
298 * Since we're running a shell program, we must be careful

--- 75 unchanged lines hidden ---