File: cenvmark.c

package info (click to toggle)
iraf 2.18.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 86,000 kB
  • sloc: ansic: 115,890; fortran: 74,576; lisp: 18,888; yacc: 5,642; sh: 961; lex: 596; makefile: 509; asm: 159; csh: 54; xml: 33; sed: 4
file content (54 lines) | stat: -rw-r--r-- 1,413 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
*/

#define import_spp
#define	import_libc
#define	import_xnames
#include <iraf.h>


/* ENVMARK -- Mark the position of the "stack pointer" of the environment
** list.  A subsequent call to ENVFREE will unset all set environment
** operations since the corresponding mark.
*/
void
c_envmark (
  XINT	*envp			/* storage for saved stack pointer	*/
)
{
	ENVMARK (envp);
}


/* ENVFREE -- Free or unset all environment variables set since the matching
** call to ENVMARK.  The number of redefined variables uncovered by the free
** operation is returned as the function value.
*/
int
c_envfree (
  int	envp,			/* marker returned by envmark		*/
  int	userfcn			/* epa of user function for redefs	*/
)
{
	XINT  x_envp = envp;

	return (ENVFREE (&x_envp, (XINT *)&userfcn));
}


/* PRENVFREE -- Free or unset all environment variables set since the matching
** call to ENVMARK.  The number of redefined variables uncovered by the free
** operation is returned as the function value.  This call is equivalent to
** envfree except that it also updates the values of any uncovered redefinitions
** in the specified connected subprocesses.
*/
int
c_prenvfree (
  int	pid,			/* process pid, or 0 for all subprocs	*/
  int	envp			/* marker returned by envmark		*/
)
{
	XINT  x_pid = pid,  x_envp = envp;

	return (PRENVFREE (&x_pid, &x_envp));
}