aboutsummaryrefslogtreecommitdiff
path: root/sys/qpoe/qpdeletef.x
blob: b7c41189b015eb4c11fd0aedb4e6abeb61f12950 (plain) (blame)
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
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

include	<syserr.h>
include	"qpoe.h"

# QP_DELETEF -- Delete a header parameter.  It is an error if the named header
# parameter does not exist.  Deletions are permanent once the datafile is
# updated.

procedure qp_deletef (qp, param)

pointer	qp			#I QPOE descriptor
char	param[ARB]		#I parameter name

pointer	sym
pointer	qp_gpsym()
errchk	qp_gpsym, syserrs

begin
	# Access the named parameter.
	sym = qp_gpsym (qp, param)
	if (sym == NULL)
	    call syserrs (SYS_QPUKNPAR, param)
	else if (and (S_FLAGS(sym), SF_DELETED) != 0)
	    return

	# If the parameter value is stored in its own lfile, delete it.
	if (S_LFILE(sym) > LF_STATICPARS)
	    call fm_lfdelete (QP_FM(qp), S_LFILE(sym))

	# Set the delete bit in the symbol descriptor.
	S_FLAGS(sym) = or (S_FLAGS(sym), SF_DELETED)

	QP_MODIFIED(qp) = YES
end