Check-in [e935f89ffc]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Further Doxygenation
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e935f89ffc368709b642758be76f585879ed4a32
User & Date: darrenbane 2014-01-17 23:05:31
Context
2014-02-07
15:14
Finish doxygen for module interfaces. Could write a main page, but theres probably no need. check-in: 96244a5839 user: darrenbane tags: trunk
2014-01-17
23:05
Further Doxygenation check-in: e935f89ffc user: darrenbane tags: trunk
2014-01-15
22:42
Start Doxygen, for functions initially. The first step in writing module interface specs. check-in: de01476232 user: darrenbane tags: trunk
Changes

Changes to hdr/ftypes.h.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 *	purposes without the express written permission of the
 *	author.
 */

#ifndef _FTYPES_H_
#define _FTYPES_H_

char   *maybe_loc(void);
void	setsignals(void);
void	scan(char *, FILE *);
void	listdefs(void);
void	rescan(void);
void	printl(label *, FILE *);

#endif







<
<
<

<



6
7
8
9
10
11
12



13

14
15
16
 *	purposes without the express written permission of the
 *	author.
 */

#ifndef _FTYPES_H_
#define _FTYPES_H_




void	listdefs(void);

void	printl(label *, FILE *);

#endif

Changes to hdr/lbl.h.






1
2
3
4
5
6
7
..
10
11
12
13
14
15
16

17
18

19


20


21


22
23








24





/* (C) C.D.F. Miller, Heriot-Watt University, March 1984
 *
 *	Permission is hereby given to reproduce or modify this
 *	software freely, provided that this notice be retained,
 *	and that no use be made of the software for commercial
 *	purposes without the express written permission of the
 *	author.
................................................................................
#ifndef _LBL_H_
#define _LBL_H_

#include	<stdio.h>
#include	<types.h>
#include	<ftypes.h>


#define	STDFORM	"%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1"


#define	MAGIC1	'\01'


#define MAGIC2	'\02'


#define M_FILE	'F'


#define M_DELIM	'D'









#endif
>
>
>
>
>







 







>


>

>
>

>
>

>
>


>
>
>
>
>
>
>
>

1
2
3
4
5
6
7
8
9
10
11
12
..
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
/** @file
 * @brief Config settings & misc. utilities.
 * 
 * These are bundled in with the main program for now.
 */
/* (C) C.D.F. Miller, Heriot-Watt University, March 1984
 *
 *	Permission is hereby given to reproduce or modify this
 *	software freely, provided that this notice be retained,
 *	and that no use be made of the software for commercial
 *	purposes without the express written permission of the
 *	author.
................................................................................
#ifndef _LBL_H_
#define _LBL_H_

#include	<stdio.h>
#include	<types.h>
#include	<ftypes.h>

/** Standard format for labels */
#define	STDFORM	"%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1.%1"

/** First character to indicate a new directive in the temporary file */
#define	MAGIC1	'\01'

/** Second character to indicate a new directive in the temporary file */
#define MAGIC2	'\02'

/** In the temporary file, set the current input filename */
#define M_FILE	'F'

/** In the temporary file, set the delimiter or switch it off altogether */
#define M_DELIM	'D'

/**
 * @brief Get the current location in the input file.
 * 
 * If we're not processing an input file, the result is an empty string.
 * @return a string describing the current location
 */
char *maybe_loc(void);

#endif

Added hdr/rescan.h.





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/** @file
 * @brief Routines to read temporary file, substituting for defined labels.
 */

#ifndef _RESCAN_H_
#define _RESCAN_H_

/**
 * @brief Second pass to parse the temporary file, follow any directives,
 *        and produce output.
 */
void rescan(void);

#endif

Added hdr/scan.h.











































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
/** @file
 * @brief Scan an input file, recording label-definitions, etc.
 * 
 * All special actions are introduced by a line starting
 * @verbatim
.<macro>
@endverbatim
 * where @a macro is "L=" unless redefined in the command-line.
 * Actions are
 * <DL>
 * <DT>.L= <em>type level label</em></DT>
 * <DD>
 * define @a label by incrementing the @a levelth
 * index of label-type @a type, e.g.
 * @verbatim
.L= table 1 profits_1983
@endverbatim
 * </DD>
 * <DT>.L= delimiter @a char</DT>
 * <DD>
 * redefines the delimiter for the subsequent text.
 * </DD>
 * <DT>.L= format <em>type string</em></DT>
 * <DD>
 * defines a format for displaying the given label @a type;
 * the latest definition in the input will be used for
 * ALL occurrences, including preceding ones.
 * e.g.
 * @verbatim
.L= format appendix %A-%1
@endverbatim
 * </DD>
 * <DT>.L= next <em>type value value ...</em></DT>
 * <DD>
 * set the value of the next label generated for @a type;
 * the @a values give successive levels, with omitted
 * trailing values defaulting to 0.
 * </DD>
 * </DL>
 */

#ifndef _SCAN_H_
#define _SCAN_H_

/**
 * @brief First pass to parse the input file and output a temporary file
 *        with directives.
 * @param fname the name of the input file to process
 * @param f a file handle opened to read fname
 */
void scan(char *fname, FILE *f);

#endif

Added hdr/signals.h.



























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
/** @file
 * @brief Routines to provide clean-up after trapping external signals.
 */

#ifndef _SIGNALS_H_
#define _SIGNALS_H_

/**
 * @brief Set signal handlers for a program run.
 */
void setsignals(void);

#endif

Changes to src/lbl.c.

24
25
26
27
28
29
30




31
32
33
34
35
36
37
#include        <unistd.h>
#include        <stdlib.h>
#include        <err.h>
#include        <sysexits.h>
#include        <limits.h>
#include        <assert.h>
#include	<lbl.h>





extern int lflag;
extern int sflag;
extern char delimiter;
extern char macroname[];
extern char tempname[];
extern char *progname;







>
>
>
>







24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include        <unistd.h>
#include        <stdlib.h>
#include        <err.h>
#include        <sysexits.h>
#include        <limits.h>
#include        <assert.h>
#include	<lbl.h>
#include        "lbl.h"
#include        "signals.h"
#include        "scan.h"
#include        "rescan.h"

extern int lflag;
extern int sflag;
extern char delimiter;
extern char macroname[];
extern char tempname[];
extern char *progname;

Changes to src/rescan.c.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

19
20
21
22
23
24
25
 *	Permission is hereby given to reproduce or modify this
 *	software freely, provided that this notice be retained,
 *	and that no use be made of the software for commercial
 *	purposes without the express written permission of the
 *	author.
 */

/* rescan.c:
 *	read temporary file, substituting for defined labels
 */

#include	<lbl.h>
#include	<ctype.h>
#include        <string.h>
#include        <err.h>
#include        "find.h"


void	doreplace(void);
static void domagic(void);
static void getword(rg char *buffer);

extern char delimiter;
extern char *filename;







<
<
<
<





>







3
4
5
6
7
8
9




10
11
12
13
14
15
16
17
18
19
20
21
22
 *	Permission is hereby given to reproduce or modify this
 *	software freely, provided that this notice be retained,
 *	and that no use be made of the software for commercial
 *	purposes without the express written permission of the
 *	author.
 */





#include	<lbl.h>
#include	<ctype.h>
#include        <string.h>
#include        <err.h>
#include        "find.h"
#include        "rescan.h"

void	doreplace(void);
static void domagic(void);
static void getword(rg char *buffer);

extern char delimiter;
extern char *filename;

Changes to src/scan.c.

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
 *	Permission is hereby given to reproduce or modify this
 *	software freely, provided that this notice be retained,
 *	and that no use be made of the software for commercial
 *	purposes without the express written permission of the
 *	author.
 */

/* scan.c:
 *	scan an input file, recording label-definitions, etc.
 *	All special actions are introduced by a line starting
 *		.<macro>
 *	where <macro> is "L=" unless redefined in the command-line.
 *	Actions are
 *		.L= <type> <level> <label>
 *			define <label> by incrementing the <level>th
 *			index of label-type <type>, e.g.
 *			.L= table 1 profits_1983
 *		.L= delimiter <char>
 *			redefines the delimiter for the subsequent text.
 *		.L= format <type> <string>
 *			defines a format for displaying the given label <type>;
 *			the latest definition in the input will be used for
 *			ALL occurrences, including preceding ones.
 *			e.g.
 *			.L= format appendix %A-%1
 *		.L= next <type> <value> <value> ...
 *			set the value of the next label generated for <type>;
 *			the <value>s give successive levels, with omitted
 *			trailing values defaulting to 0.
 */

#include	<lbl.h>
#include	<ctype.h>
#include        <string.h>
#include        <err.h>
#include        "build.h"

void	process(char *);







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







3
4
5
6
7
8
9
























10
11
12
13
14
15
16
 *	Permission is hereby given to reproduce or modify this
 *	software freely, provided that this notice be retained,
 *	and that no use be made of the software for commercial
 *	purposes without the express written permission of the
 *	author.
 */

























#include	<lbl.h>
#include	<ctype.h>
#include        <string.h>
#include        <err.h>
#include        "build.h"

void	process(char *);

Changes to src/signals.c.

3
4
5
6
7
8
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
 *	Permission is hereby given to reproduce or modify this
 *	software freely, provided that this notice be retained,
 *	and that no use be made of the software for commercial
 *	purposes without the express written permission of the
 *	author.
 */

/* signals.c:
 *	provide clean-up after trapping external signals
 */

#include	<lbl.h>
#include	<signal.h>
#include        <unistd.h>


typedef void (*sig_t) (int);

extern char tempname[];

static void
onsignal(int unused)







<
<
<
<



>







3
4
5
6
7
8
9




10
11
12
13
14
15
16
17
18
19
20
 *	Permission is hereby given to reproduce or modify this
 *	software freely, provided that this notice be retained,
 *	and that no use be made of the software for commercial
 *	purposes without the express written permission of the
 *	author.
 */





#include	<lbl.h>
#include	<signal.h>
#include        <unistd.h>
#include        "signals.h"

typedef void (*sig_t) (int);

extern char tempname[];

static void
onsignal(int unused)