path: root/doc
authorSergey Poznyakoff <>2011-07-01 15:59:30 (GMT)
committer Sergey Poznyakoff <>2011-07-01 15:59:30 (GMT)
commit6c28bd628ede02dfb6e8a5520d0b43cd19c03b57 (patch) (side-by-side diff)
tree1430e744ceddadc5bb73300ebc13ae4ff1049569 /doc
parenta01d5e230db6f61a6efd3384f1eafe184944c45d (diff)
Update the docs.
Diffstat (limited to 'doc') (more/less context) (ignore whitespace changes)
2 files changed, 68 insertions, 6 deletions
diff --git a/doc/grecs_error.3 b/doc/grecs_error.3
index 4f82dc5..1c2b62f 100644
--- a/doc/grecs_error.3
+++ b/doc/grecs_error.3
@@ -14,7 +14,7 @@
.\" You should have received a copy of the GNU General Public License
.\" along with Grecs. If not, see <>.
-.TH GRECS_ERROR 3 "May 4, 2011" "GRECS" "Grecs User Reference"
+.TH GRECS_ERROR 3 "July 1, 2011" "GRECS" "Grecs User Reference"
grecs_error, grecs_warning \- grecs error reporting functions
@@ -86,19 +86,73 @@ System error code, or \fB0\fR, if no system error occurred.
.I msg
Formatted message.
-The \fBgrecs_locus_t\fR structure is defined as:
+The \fBgrecs_locus_t\fR structure consists of two \fBpoints\fR, each
+point describing the beginning and the end of the input fragment in
.in +5
-typedef struct {
+struct grecs_locus_point {
char *file;
- int line;
+ unsigned line;
+ unsigned col;
+typedef struct {
+ struct grecs_locus_point beg;
+ struct grecs_locus_point end;
} grecs_locus_t;
The \fBfile\fR member points to the file name, and the \fBline\fR
-member contains the input line number.
+member contains the input line number and the \fBcol\fR member
+contains the column number. Both lines and columns are numbered from
+On output, the \fBgrecs_locus_t\fR structure is formatted as follows:
+.sp +5
+If \fBBEGFILE\fR equals \fBENDFILE\fR in the sense of
+.BR strcmp (3),
+then the output is contracted to:
+.sp +5
+Furthermore, if \fBBEGLINE\fR equals \fBENDLINE\fR, then the format
+.sp +5
+Finally, if \fBBEGCOL\fR\ equals \fBENDCOL\fR, the output is
+simplified to
+.sp +5
+If \fBbeg.col\fR is \fB0\fR, then only the \fBbeg\fR part is
+.sp +5
diff --git a/doc/grecs_parse.3 b/doc/grecs_parse.3
index dff6759..a8b70ca 100644
--- a/doc/grecs_parse.3
+++ b/doc/grecs_parse.3
@@ -14,7 +14,7 @@
.\" You should have received a copy of the GNU General Public License
.\" along with Grecs. If not, see <>.
-.TH GRECS_PARSE 3 "May 7, 2011" "GRECS" "Grecs User Reference"
+.TH GRECS_PARSE 3 "July 1, 2011" "GRECS" "Grecs User Reference"
grecs_parse \- parse a configuration file.
@@ -46,6 +46,7 @@ typedef struct grecs_node {
struct grecs_node *next;
struct grecs_node *prev;
char *ident;
+ grecs_locus_t idloc;
union {
struct grecs_value *value;
struct grecs_symtab *texttab;
@@ -99,6 +100,9 @@ pidfile "/var/run/mypid";
will have \fBident\fR pointing to the string \fB/var/run/mypid\fR.
+The \fIidloc\fR contains the location of the identifier portion in the
+input file. Notice, that it differs from \fBlocus\fR described above.
The \fBv\fR union keeps data which depend on the type of this node.
The \fBv.texttab\fR member is defined only for the root node (type
\fBgrecs_node_root\fR). It points to a symbol table which holds shared
@@ -112,6 +116,7 @@ the value associated with this statement. A value is defined as:
.in +5
typedef struct grecs_value {
int type;
+ grecs_locus_t locus;
union {
struct grecs_list *list;
char *string;
@@ -138,6 +143,9 @@ The list value is pointed to by \fBv.list\fR.
The array itself is stored in \fBv.arg.v\fR. The \fBv.arg.c\fR member
contains the number of elements in the array.
+The \fBlocus\fR member contains the location of this value in the
+input file.
On success, a pointer to the root node. On error, \fBNULL\fR.

Return to:

Send suggestions and report system problems to the System administrator.