aboutsummaryrefslogtreecommitdiff
path: root/doc/grecs_format_locus.3
blob: 6701784f3177953910547795effec253cac63ef9 (plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
.\" This file is part of grecs -*- nroff -*-
.\" Copyright (C) 2007, 2009-2012, 2015 Sergey Poznyakoff
.\"
.\" Grecs is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3, or (at your option)
.\" any later version.
.\"
.\" Grecs is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with Grecs.  If not, see <http://www.gnu.org/licenses/>.
.\"
.TH GRECS_FORMAT_LOCUS 3 "May 19, 2011" "GRECS" "Grecs User Reference"
.SH NAME
grecs_format_locus \- format and output source file location
.SH SYNOPSIS
.nf
.B #include <grecs.h>
.sp
.BI "void grecs_format_locus(grecs_locus_t " "*locus" ","
.ti +17
.BI  "struct grecs_format_closure " "*clos" );
.sp
.BI "void grecs_print_locus(grecs_locus_t " "*locus" ", FILE " "*fp" );

.SH DESCRIPTION
\fBgrecs_print_locus\fR formats the location from \fIlocus\fR in the
human-readable form and outputs it using the format closure
\fIclos\fR. The closure is defined as:
.sp
.nf
.in +5
struct grecs_format_closure
{
	int (*fmtfun)(const char *str, void *data);
	void *data;
};
.in
.fi
.PP
While formatting the location, the formatter function \fBfmtfun\fR can
be called one or more times. On each invocation, it is supplied with
the string to be output as its first argument, and pointer to
\fBdata\fR as the second one.
.PP
\fBgrecs_print_locus\fR is an alternative interface, which formats the
location from \fIlocus\fR in the human-readable form and outputs it to
file \fBfp\fR.
.PP
In both cases, the location is formatted as follows: the file name,
followed by a semicolon, followed by the line number.
.PP
If \fIlocus\fR is \fBNULL\fR, both functions return without
doing anything.
.SH "RETURN VALUE"
None.
.SH NOTES
This are auxiliary functions used by
.BR grecs_format_node (3)
and
.BR grecs_print_node (3),
correspondingly. They are is seldom needed in user programs.
.SH "SEE ALSO"
.BR grecs_format_node (3),
.BR grecs_print_node (3).
.SH AUTHORS
Sergey Poznyakoff
.SH "BUG REPORTS"
Report bugs to <gray+grecs@gnu.org.ua>.
.SH COLOPHON
The \fBGrecs\fR library is constantly changing, so this manual page
may be incorrect or out-of-date.  For the latest copy of \fBGrecs\fR
documentation, visit <http://www.gnu.org.ua/software/grecs>.
.SH COPYRIGHT
Copyright \(co 2011 Sergey Poznyakoff
.br
.na
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
.ad
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH [A-Z_][A-Z0-9_]* [0-9] \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 20
.\" end:

Return to:

Send suggestions and report system problems to the System administrator.