aboutsummaryrefslogtreecommitdiff
path: root/doc/argot_format_locus.3
diff options
context:
space:
mode:
Diffstat (limited to 'doc/argot_format_locus.3')
-rw-r--r--doc/argot_format_locus.394
1 files changed, 94 insertions, 0 deletions
diff --git a/doc/argot_format_locus.3 b/doc/argot_format_locus.3
new file mode 100644
index 0000000..52bfc3d
--- /dev/null
+++ b/doc/argot_format_locus.3
@@ -0,0 +1,94 @@
1.\" This file is part of argot -*- nroff -*-
2.\" Copyright (C) 2007-2016 Sergey Poznyakoff
3.\"
4.\" Grecs is free software; you can redistribute it and/or modify
5.\" it under the terms of the GNU General Public License as published by
6.\" the Free Software Foundation; either version 3, or (at your option)
7.\" any later version.
8.\"
9.\" Grecs is distributed in the hope that it will be useful,
10.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.\" GNU General Public License for more details.
13.\"
14.\" You should have received a copy of the GNU General Public License
15.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
16.\"
17.TH ARGOT_FORMAT_LOCUS 3 "May 19, 2011" "ARGOT" "Grecs User Reference"
18.SH NAME
19argot_format_locus \- format and output source file location
20.SH SYNOPSIS
21.nf
22.B #include <argot.h>
23.sp
24.BI "void argot_format_locus(argot_locus_t " "*locus" ","
25.ti +17
26.BI "struct argot_format_closure " "*clos" );
27.sp
28.BI "void argot_print_locus(argot_locus_t " "*locus" ", FILE " "*fp" );
29
30.SH DESCRIPTION
31\fBargot_print_locus\fR formats the location from \fIlocus\fR in the
32human-readable form and outputs it using the format closure
33\fIclos\fR. The closure is defined as:
34.sp
35.nf
36.in +5
37struct argot_format_closure
38{
39 int (*fmtfun)(const char *str, void *data);
40 void *data;
41};
42.in
43.fi
44.PP
45While formatting the location, the formatter function \fBfmtfun\fR can
46be called one or more times. On each invocation, it is supplied with
47the string to be output as its first argument, and pointer to
48\fBdata\fR as the second one.
49.PP
50\fBargot_print_locus\fR is an alternative interface, which formats the
51location from \fIlocus\fR in the human-readable form and outputs it to
52file \fBfp\fR.
53.PP
54In both cases, the location is formatted as follows: the file name,
55followed by a semicolon, followed by the line number.
56.PP
57If \fIlocus\fR is \fBNULL\fR, both functions return without
58doing anything.
59.SH "RETURN VALUE"
60None.
61.SH NOTES
62This are auxiliary functions used by
63.BR argot_format_node (3)
64and
65.BR argot_print_node (3),
66correspondingly. They are is seldom needed in user programs.
67.SH "SEE ALSO"
68.BR argot_format_node (3),
69.BR argot_print_node (3).
70.SH AUTHORS
71Sergey Poznyakoff
72.SH "BUG REPORTS"
73Report bugs to <gray+argot@gnu.org.ua>.
74.SH COLOPHON
75The \fBGrecs\fR library is constantly changing, so this manual page
76may be incorrect or out-of-date. For the latest copy of \fBGrecs\fR
77documentation, visit <http://www.gnu.org.ua/software/argot>.
78.SH COPYRIGHT
79Copyright \(co 2011 Sergey Poznyakoff
80.br
81.na
82License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
83.br
84.ad
85This is free software: you are free to change and redistribute it.
86There is NO WARRANTY, to the extent permitted by law.
87.\" Local variables:
88.\" eval: (add-hook 'write-file-hooks 'time-stamp)
89.\" time-stamp-start: ".TH [A-Z_][A-Z0-9_]* [0-9] \""
90.\" time-stamp-format: "%:B %:d, %:y"
91.\" time-stamp-end: "\""
92.\" time-stamp-line-limit: 20
93.\" end:
94

Return to:

Send suggestions and report system problems to the System administrator.