aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-07-01 18:59:30 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-07-01 18:59:30 +0300
commit6c28bd628ede02dfb6e8a5520d0b43cd19c03b57 (patch)
tree1430e744ceddadc5bb73300ebc13ae4ff1049569 /doc
parenta01d5e230db6f61a6efd3384f1eafe184944c45d (diff)
downloadgrecs-6c28bd628ede02dfb6e8a5520d0b43cd19c03b57.tar.gz
grecs-6c28bd628ede02dfb6e8a5520d0b43cd19c03b57.tar.bz2
Update the docs.
Diffstat (limited to 'doc')
-rw-r--r--doc/grecs_error.364
-rw-r--r--doc/grecs_parse.310
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
@@ -16,3 +16,3 @@
.\"
-.TH GRECS_ERROR 3 "May 4, 2011" "GRECS" "Grecs User Reference"
+.TH GRECS_ERROR 3 "July 1, 2011" "GRECS" "Grecs User Reference"
.SH NAME
@@ -88,3 +88,5 @@ Formatted message.
.PP
-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
+question:
.sp
@@ -92,5 +94,10 @@ The \fBgrecs_locus_t\fR structure is defined as:
.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;
@@ -100,3 +107,50 @@ typedef struct {
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
+1.
+.PP
+On output, the \fBgrecs_locus_t\fR structure is formatted as follows:
+.sp
+.nf
+.in +5
+\fBBEGFILE\fR:\fBBEGLINE\fR.\fBBEGCOL\fR\-\fBENDFILE\fR:\fBENDLINE\fR.\fBENDCOL\fR
+.in
+.fi
+.PP
+If \fBBEGFILE\fR equals \fBENDFILE\fR in the sense of
+.BR strcmp (3),
+then the output is contracted to:
+.sp
+.nf
+.in +5
+\fBFILE\fR:\fBBEGLINE\fR.\fBBEGCOL\fR\-\fBENDLINE\fR.\fBENDCOL\fR
+.in
+.fi
+.PP
+Furthermore, if \fBBEGLINE\fR equals \fBENDLINE\fR, then the format
+is:
+.sp
+.nf
+.in +5
+\fBFILE\fR:\fBLINE\fR.\fBBEGCOL\fR\-\fBENDCOL\fR
+.in
+.fi
+.PP
+Finally, if \fBBEGCOL\fR\ equals \fBENDCOL\fR, the output is
+simplified to
+.sp
+.nf
+.in +5
+\fBFILE\fR:\fBLINE\fR.\fBCOL\fR
+.in
+.fi
+.PP
+If \fBbeg.col\fR is \fB0\fR, then only the \fBbeg\fR part is
+formatted:
+.sp
+.nf
+.in +5
+\fBFILE\fR:\fBLINE\fR
+.in
+.fi
.SH RETURN VALUE
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
@@ -16,3 +16,3 @@
.\"
-.TH GRECS_PARSE 3 "May 7, 2011" "GRECS" "Grecs User Reference"
+.TH GRECS_PARSE 3 "July 1, 2011" "GRECS" "Grecs User Reference"
.SH NAME
@@ -48,2 +48,3 @@ typedef struct grecs_node {
char *ident;
+ grecs_locus_t idloc;
union {
@@ -101,2 +102,5 @@ will have \fBident\fR pointing to the string \fB/var/run/mypid\fR.
.PP
+The \fIidloc\fR contains the location of the identifier portion in the
+input file. Notice, that it differs from \fBlocus\fR described above.
+.PP
The \fBv\fR union keeps data which depend on the type of this node.
@@ -114,2 +118,3 @@ typedef struct grecs_value {
int type;
+ grecs_locus_t locus;
union {
@@ -140,2 +145,5 @@ The array itself is stored in \fBv.arg.v\fR. The \fBv.arg.c\fR member
contains the number of elements in the array.
+.PP
+The \fBlocus\fR member contains the location of this value in the
+input file.
.SH RETURN VALUE

Return to:

Send suggestions and report system problems to the System administrator.