aboutsummaryrefslogtreecommitdiff
path: root/pkg/images/imutil/src/t_sections.x
blob: 560e2a2feefc3f001a645ec6815e5f4c18491f63 (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
36
37
38
39
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

# SECTIONS -- Expand a image template into a list of images on the
# standard output and record the number of sections in a parameter.

procedure t_sections()

char	images[SZ_LINE]				# Image template
char	image[SZ_FNAME]
char	str[SZ_LINE]
int	option, list
int	clgwrd(), imtopen(), imtgetim(), imtlen()

begin
	call clgstr ("images", images, SZ_LINE)
	option = clgwrd ("option", str, SZ_LINE,
	    ",nolist,fullname,root,section,")
	list = imtopen (images)

	call clputi ("nimages", imtlen (list))

	while (imtgetim (list, image, SZ_FNAME) != EOF) {
	    switch (option) {
	    case 2:
	        call printf ("%s\n")
		    call pargstr (image)
	    case 3:
		call get_root (image, str, SZ_LINE)
	        call printf ("%s\n")
		    call pargstr (str)
	    case 4:
		call get_section (image, str, SZ_LINE)
	        call printf ("%s\n")
		    call pargstr (str)
	    }
	}

	call imtclose (list)
end