Check-in [de01476232]

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

Overview
Comment:Start Doxygen, for functions initially. The first step in writing module interface specs.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:de01476232994d14c9676087c65f72e0d1b2f153
User & Date: darrenbane 2014-01-15 22:42:53
Context
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
2014-01-10
23:21
Make a bit more similar to the usual BSD Makefiles check-in: d05c918e9a user: darrenbane tags: trunk
Changes

Changes to doc/Makefile.

1
2
3
4




5
6
7
8
9
10
11
12
13
14
15
16
.POSIX:
LBL= lbl
NROFF= nroff
PAGER?= cat





.PHONY: doc
doc:	lbl
	$(LBL) lbl | $(NROFF) -ms | $(PAGER)

.PHONY: man
man:	lbl.1
	$(NROFF) -man lbl.1 | $(PAGER)

.PHONY: example
example:	example.n
	lbl example.n | $(NROFF) -ms | $(PAGER)



<
>
>
>
>



|



|



|
1
2
3

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.POSIX:
LBL= lbl
NROFF= nroff


# Commands run by bsdmake don't seem to have a controlling tty. At
# least, "most" doesn't paginate. So user must run $PAGER themselves
# outside bsdmake.

.PHONY: doc
doc:	lbl
	$(LBL) lbl | $(NROFF) -ms

.PHONY: man
man:	lbl.1
	$(NROFF) -man lbl.1

.PHONY: example
example:	example.n
	lbl example.n | $(NROFF) -ms

Added hdr/build.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
/** @file
 * @brief Routines to build new labels and label-types.
 */

#ifndef _BUILD_H_
#define _BUILD_H_

/**
 * @brief Copy a string to a new block of memory.
 * 
 * If we run out of memory, the process exits.
 * @param str the string to copy
 * @return a pointer to the copy
 */
char *copy(char *str);

/**
 * @brief Allocate a new type struct and add it to the global list of types.
 * @param name the type name
 * @return a pointer to the new struct
 */
type *addtype(char *name);

/**
 * @brief Define a new label.
 * @param lbltype type of label to define. Will be created if it doesn't already exist.
 * @param lbllevel nesting level of label.
 * @param lblname name by which label will be referred to in cross-references.
 */
void addlbl(char *lbltype, char *lbllevel, char *lblname);

#endif

Added hdr/find.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
/** @file
 * @brief Routines to find a type entry and a label entry.
 */

#ifndef _FIND_H_
#define _FIND_H_

/**
 * Find a label by name.
 * @param tp the type of label to find
 * @param name the label name
 * @return a pointer to the label struct; or NULL if it can't be found
 */
label *findlabel(type *tp, char *name);

/**
 * Find a label type, optionally creating it if it doesn't exist.
 * @param name the type name
 * @param create whether or not to create the type if it doesn't exist
 * @return a pointer to the type struct
 */
type *findtype(char *name, int create);

#endif

Changes to hdr/ftypes.h.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 *	purposes without the express written permission of the
 *	author.
 */

#ifndef _FTYPES_H_
#define _FTYPES_H_

char   *copy();
label  *findlabel();
type   *addtype();
type   *findtype();
char   *maybe_loc(void);
void	setsignals(void);
void	scan(char *, FILE *);
void	listdefs(void);
void	rescan(void);
void	printl(label *, FILE *);
void	addlbl(char *, char *, char *);

char   *fgets();
char   *mktemp();

#endif







<
<
<
<






<

<
<
<

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

Changes to src/actions.c.

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 */

#include	<lbl.h>
#include	<ctype.h>
#include        <string.h>
#include        <stdlib.h>
#include        <err.h>



extern char *def_format;
extern int sflag;
extern FILE *tempfile;

/*ARGSUSED*/
void







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 */

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

extern char *def_format;
extern int sflag;
extern FILE *tempfile;

/*ARGSUSED*/
void

Changes to src/build.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
 *	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.
 */

/* build.c:
 *	routines to build new labels and label-types
 */

#include	<lbl.h>
#include	<ctype.h>
#include        <stdlib.h>
#include        <string.h>
#include        <err.h>
#include        <sysexits.h>



extern char *def_format;
extern char *filename;
extern long fileline;
extern LIST_HEAD(, type) typehead;

char   *







<
<
<
<






>
>







3
4
5
6
7
8
9




10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 *	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        <stdlib.h>
#include        <string.h>
#include        <err.h>
#include        <sysexits.h>
#include        "build.h"
#include        "find.h"

extern char *def_format;
extern char *filename;
extern long fileline;
extern LIST_HEAD(, type) typehead;

char   *

Changes to src/find.c.

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.
 */

/* find.c:
 *	routines to find a type entry and a label entry
 */

#include        <string.h>
#include	<lbl.h>



extern LIST_HEAD(, type) typehead;

type   *
findtype(name, create)
	rg char *name;
	rg int create;







<
<
<
<


>
>







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        <string.h>
#include	<lbl.h>
#include        "build.h"
#include        "find.h"

extern LIST_HEAD(, type) typehead;

type   *
findtype(name, create)
	rg char *name;
	rg int create;

Changes to src/rescan.c.

11
12
13
14
15
16
17

18
19
20
21
22
23
24
 *	read temporary file, substituting for defined labels
 */

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


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

extern char delimiter;
extern char *filename;







>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 *	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;

Changes to src/scan.c.

31
32
33
34
35
36
37

38
39
40
41
42
43
44
 *			trailing values defaulting to 0.
 */

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


void	process(char *);

extern char macroname[];
extern char *filename;
extern int sflag;
extern FILE *tempfile;







>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 *			trailing values defaulting to 0.
 */

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

void	process(char *);

extern char macroname[];
extern char *filename;
extern int sflag;
extern FILE *tempfile;