File: longhelp.h

package info (click to toggle)
fitsh 0.9.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,768 kB
  • ctags: 4,050
  • sloc: ansic: 53,352; makefile: 1,120; sh: 25
file content (64 lines) | stat: -rw-r--r-- 3,000 bytes parent folder | download
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
/*****************************************************************************/
/* longhelp.h								     */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Copyright (C) 2008; Pal, A. (apal@szofi.elte.hu)			     */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* Functions for creating nice ``long helps''				     */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*  This library 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 of the License, or	     */
/*  (at your option) any later version.					     */
/*									     */
/*  This program 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 the program.  If not, see <http://www.gnu.org/licenses/>.     */
/*****************************************************************************/

#ifndef	__LONGHELP_H_INCLUDED
#define	__LONGHELP_H_INCLUDED	1

/*****************************************************************************/

/* these are specific terms which are supported by the ``help2man'' utility. */
#define		LONGHELP_OPTIONS	{ "Options:", NULL }
#define		LONGHELP_EXAMPLES	{ "Examples:", NULL }

/*****************************************************************************/

typedef struct
 {	char	*options;
	char	*description;
 } longhelp_entry;

/*****************************************************************************/

/* 
   longhelp_fprint():
   Prints the (NULL,NULL)-terminated longhelp_entry array `entries` to the
   file stream referred by `fw`. The output is formatted for `width` width,
   if it is positive, ignored at all if `width` is zero and calculated
   automatically if it is negative (in this case, if `fw` refers to a terminal,
   the width is derived automatically from the terminal window size argument,
   otherwise the formatting is ignored).
*/
int	longhelp_fprint(FILE *fw,longhelp_entry *entries,int flags,int width);

/* longhelp_fprint_mediawiki():
   Prints the (NULL,NULL)-terminated longhelp_entry array `entries` to the
   file stream referred by `fw`, according to the formatting rules and
   markup used by MediaWiki. The output can then be copy-pasted to a Mediawiki
   edit form in order to provide a nice manual page in Mediawiki format.
*/
int	longhelp_fprint_mediawiki(FILE *fw,longhelp_entry *entry);

/*****************************************************************************/

#endif

/*****************************************************************************/