Check-in [96244a5839]

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

Overview
Comment:Finish doxygen for module interfaces. Could write a main page, but theres probably no need.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 96244a58398849f154d085633c736673db93de95
User & Date: darrenbane 2014-02-07 15:14:09.706
Context
2014-02-07
16:28
Forgot to include own modules header file check-in: 63f34fd1ce user: darrenbane tags: trunk
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
Changes
Unified Diff Ignore Whitespace Patch
Deleted hdr/ftypes.h.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* (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 _FTYPES_H_
#define _FTYPES_H_

void	listdefs(void);
void	printl(label *, FILE *);

#endif
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
































Added hdr/list.h.


























>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
/** @file
 * @brief Routines to list definitions in verbose mode.
 */

#ifndef _LIST_H_
#define _LIST_H_

/**
 * @brief List details of all labels, of all types, to stderr.
 */
void	listdefs(void);

#endif
Added hdr/printl.h.






























>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/** @file
 * @brief Routines to print a label according to a format.
 */

#ifndef _PRINTL_H_
#define _PRINTL_H_

/**
 * @brief Print a label.
 * @param lab label to print.
 * @param out file handle to output on.
 */
void	printl(label *lab, FILE *out);

#endif
Changes to hdr/types.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
54
55
56







/* (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 _TYPES_H_
#define _TYPES_H_

#include <sys/queue.h>



#define	rg		register


#define	us		unsigned

/*** Header levels ***/
#define	NLEVELS	20


typedef us int levels[NLEVELS];

/*** Header format ***/
typedef char *format;

/*** Label type: name and current header levels ***/
typedef struct type {
	char   *t_name;
	levels	t_levels;
	format	t_format;
        LIST_HEAD(, label) labelhead;
        LIST_ENTRY(type) link;
}	type;

/*** Label definition ***/
typedef struct label {
	char   *l_name;
	type   *l_type;
	levels	l_levels;
	us int	l_bottom;		/* Last significant level */
	char   *l_file;			/* File where defined */
	long	l_line;			/* line   "      "    */
        LIST_ENTRY(label) link;
}	label;

/*** Action routine ***/
typedef int (*func) ();

/*** Command keyword ***/
typedef struct keyword {
	char   *k_name;
	func	k_action;
	us int	k_minargs;
	us int	k_maxargs;
}	keyword;

#endif
>
>
>
>
>
>
>














>
>
|
>
>


|

>
>


|


|

|
|
|
|
|


|

|
|
|
|
|
|
|


|


|

|
|
|
|



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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/** @file
 * @brief Concrete data types.
 * 
 * On the one hand, having these all in the same file isn't
 * good modularity. On the other hand, I don't want to write
 * loads of setters and getters.
 */
/* (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 _TYPES_H_
#define _TYPES_H_

#include <sys/queue.h>

/** This used to be "register", but I think the compiler will
 * do a better job. */
#define	rg

/** @todo Remove this */
#define	us		unsigned

/** Max no. of header levels */
#define	NLEVELS	20

/** Type for header levels member of label struct */
typedef us int levels[NLEVELS];

/** Header format */
typedef char *format;

/** Label type */
typedef struct type {
	char   *t_name;	/**< name */
	levels	t_levels;	/**< current header levels */
	format	t_format;   /**< format */
        LIST_HEAD(, label) labelhead;   /**< list of labels of this type */
        LIST_ENTRY(type) link;  /**< next type in list of types */
}	type;

/** Label definition */
typedef struct label {
	char   *l_name; /**< Name */
	type   *l_type; /**< Back-reference to label type */
	levels	l_levels;   /**< Counter for label no. at different levels */
	us int	l_bottom;		/**< Last significant level */
	char   *l_file;			/**< File where defined */
	long	l_line;			/**< line where defined */
        LIST_ENTRY(label) link; /**< Next label in list of labels */
}	label;

/** Action routine for keyword processing */
typedef int (*func) ();

/** Command keyword, to come after ".L=" at the start of an input line */
typedef struct keyword {
	char   *k_name; /**< How is the keyword spelt */
	func	k_action;   /**< Function pointer for action to take */
	us int	k_minargs;  /**< Min no. of args for k_action */
	us int	k_maxargs;  /**< Max no. of args for k_action */
}	keyword;

#endif
Changes to src/list.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* (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.
 */

/* list.c:
 *	list definitions in verbose mode
 */

#include	<lbl.h>

void	listtype(type *);

extern char *def_format;
extern LIST_HEAD(, type) typehead;










<
<
<
<







1
2
3
4
5
6
7
8
9




10
11
12
13
14
15
16
/* (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.
 */





#include	<lbl.h>

void	listtype(type *);

extern char *def_format;
extern LIST_HEAD(, type) typehead;

Changes to src/printl.c.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* (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.
 */

/* printl.c:
 *	print a label according to a format
 */

#include        <err.h>
#include	<lbl.h>

void	printr(char, us int, FILE *);
static void printd(us int, FILE *);
static void printa(char, us int, FILE *);
static void auxprinta(char, us int, FILE *);









<
<
<
<







1
2
3
4
5
6
7
8
9




10
11
12
13
14
15
16
/* (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.
 */





#include        <err.h>
#include	<lbl.h>

void	printr(char, us int, FILE *);
static void printd(us int, FILE *);
static void printa(char, us int, FILE *);
static void auxprinta(char, us int, FILE *);