aboutsummaryrefslogtreecommitdiff
path: root/pkg/system/help/t_hdbexamine.x
blob: 8046848e7e6155194600d7fd918b92a02f6d4aae (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	<error.h>
include	"help.h"


# HDBEXAMINE -- Examine the help database.

procedure t_hdbexamine()

pointer	sp, helpdb
bool	streq(), clgetb()
int	envgets()
string	s_helpdb "helpdb"

begin
	call smark (sp)
	call salloc (helpdb, SZ_HELPDB, TY_CHAR)

	# Fetch the name of the help database file to be examined.  If the
	# name is "helpdb", the filename is taken from the environment.

	call clgstr (s_helpdb, Memc[helpdb], SZ_HELPDB)
	if (streq (Memc[helpdb], s_helpdb))
	    if (envgets (s_helpdb, Memc[helpdb], SZ_HELPDB) <= 0)
		call syserrs (SYS_ENVNF, s_helpdb)

	# Examine the structure and contents of the database, printing the
	# results on the standard output.

	call hdb_examine (STDOUT, Memc[helpdb], clgetb ("verbose"))

	call sfree (sp)
end