xref: /freebsd/lib/libdpv/dpv.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
1eee6300fSDevin Teske.\" Copyright (c) 2013-2018 Devin Teske
2041394f3SDevin Teske.\" All rights reserved.
3041394f3SDevin Teske.\"
4041394f3SDevin Teske.\" Redistribution and use in source and binary forms, with or without
5041394f3SDevin Teske.\" modification, are permitted provided that the following conditions
6041394f3SDevin Teske.\" are met:
7041394f3SDevin Teske.\" 1. Redistributions of source code must retain the above copyright
8041394f3SDevin Teske.\"    notice, this list of conditions and the following disclaimer.
9041394f3SDevin Teske.\" 2. Redistributions in binary form must reproduce the above copyright
10041394f3SDevin Teske.\"    notice, this list of conditions and the following disclaimer in the
11041394f3SDevin Teske.\"    documentation and/or other materials provided with the distribution.
12041394f3SDevin Teske.\"
13041394f3SDevin Teske.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14041394f3SDevin Teske.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15041394f3SDevin Teske.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16041394f3SDevin Teske.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17041394f3SDevin Teske.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18041394f3SDevin Teske.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19041394f3SDevin Teske.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20041394f3SDevin Teske.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21041394f3SDevin Teske.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22041394f3SDevin Teske.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23041394f3SDevin Teske.\" SUCH DAMAGE.
24041394f3SDevin Teske.\"
255d8a5640SDevin Teske.Dd March 13, 2018
26041394f3SDevin Teske.Dt DPV 3
27041394f3SDevin Teske.Os
28041394f3SDevin Teske.Sh NAME
29041394f3SDevin Teske.Nm dpv
30041394f3SDevin Teske.Nd dialog progress view library
31041394f3SDevin Teske.Sh LIBRARY
32041394f3SDevin Teske.Lb libdpv
33041394f3SDevin Teske.Sh SYNOPSIS
34041394f3SDevin Teske.In dpv.h
35041394f3SDevin Teske.Ft int
36041394f3SDevin Teske.Fo dpv
3719be69c5SDevin Teske.Fa "struct dpv_config *config"
3819be69c5SDevin Teske.Fa "struct dpv_file_node *file_list"
39041394f3SDevin Teske.Fc
40041394f3SDevin Teske.Ft void
41041394f3SDevin Teske.Fo dpv_free
42041394f3SDevin Teske.Fa "void"
43041394f3SDevin Teske.Fc
44041394f3SDevin Teske.Sh DESCRIPTION
45041394f3SDevin TeskeThe
46041394f3SDevin Teske.Nm
47041394f3SDevin Teskelibrary provides an interface for creating complex
48041394f3SDevin Teske.Dq gauge
49041394f3SDevin Teskewidgets for displaying progress on various actions.
50041394f3SDevin TeskeThe
51041394f3SDevin Teske.Nm
52041394f3SDevin Teskelibrary can display progress with one of
53041394f3SDevin Teske.Xr dialog 3 ,
54041394f3SDevin Teske.Xr dialog 1 ,
55041394f3SDevin Teskeor
56*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog .
57041394f3SDevin Teske.Pp
58041394f3SDevin TeskeThe
59041394f3SDevin Teske.Fn dpv
60041394f3SDevin Teske.Fa config
6119be69c5SDevin Teskeargument properties for configuring global display features:
62041394f3SDevin Teske.Bd -literal -offset indent
63041394f3SDevin Teskestruct dpv_config {
6480f7300dSDevin Teske    uint8_t          keep_tite;     /* Cleaner exit for scripts */
65041394f3SDevin Teske    enum dpv_display display_type;  /* Def. DPV_DISPLAY_LIBDIALOG */
66041394f3SDevin Teske    enum dpv_output  output_type;   /* Default DPV_OUTPUT_NONE */
67041394f3SDevin Teske    int              debug;         /* Enable debug on stderr */
68041394f3SDevin Teske    int              display_limit; /* Files/page. Default -1 */
69041394f3SDevin Teske    int              label_size;    /* Label size. Default 28 */
70041394f3SDevin Teske    int              pbar_size;     /* Mini-progress size */
71041394f3SDevin Teske    int              dialog_updates_per_second; /* Default 16 */
72041394f3SDevin Teske    int              status_updates_per_second; /* Default 2 */
73041394f3SDevin Teske    uint16_t         options;       /* Default 0 (none) */
74041394f3SDevin Teske    char             *title;        /* Widget title */
75041394f3SDevin Teske    char             *backtitle;    /* Widget backtitle */
76041394f3SDevin Teske    char             *aprompt;      /* Append. Default NULL */
77041394f3SDevin Teske    char             *pprompt;      /* Prefix. Default NULL */
78041394f3SDevin Teske    char             *msg_done;     /* Default `Done' */
79041394f3SDevin Teske    char             *msg_fail;     /* Default `Fail' */
80041394f3SDevin Teske    char             *msg_pending;  /* Default `Pending' */
81041394f3SDevin Teske    char             *output;       /* Output format string */
82041394f3SDevin Teske    const char       *status_solo;  /* dialog(3) solo-status format.
83041394f3SDevin Teske                                     * Default DPV_STATUS_SOLO */
84041394f3SDevin Teske    const char       *status_many;  /* dialog(3) many-status format.
85041394f3SDevin Teske                                     * Default DPV_STATUS_MANY */
86041394f3SDevin Teske
87041394f3SDevin Teske    /*
88041394f3SDevin Teske     * Function pointer; action to perform data transfer
89041394f3SDevin Teske     */
90041394f3SDevin Teske    int (*action)(struct dpv_file_node *file, int out);
91041394f3SDevin Teske};
92041394f3SDevin Teske
93041394f3SDevin Teskeenum dpv_display {
94041394f3SDevin Teske    DPV_DISPLAY_LIBDIALOG = 0, /* Use dialog(3) (default) */
95041394f3SDevin Teske    DPV_DISPLAY_STDOUT,        /* Use stdout */
96041394f3SDevin Teske    DPV_DISPLAY_DIALOG,        /* Use spawned dialog(1) */
97041394f3SDevin Teske    DPV_DISPLAY_XDIALOG,       /* Use spawned Xdialog(1) */
98041394f3SDevin Teske};
99041394f3SDevin Teske
100041394f3SDevin Teskeenum dpv_output {
101041394f3SDevin Teske    DPV_OUTPUT_NONE = 0, /* No output (default) */
102041394f3SDevin Teske    DPV_OUTPUT_FILE,     /* Read `output' member as file path */
103041394f3SDevin Teske    DPV_OUTPUT_SHELL,    /* Read `output' member as shell cmd */
104041394f3SDevin Teske};
105041394f3SDevin Teske.Ed
106041394f3SDevin Teske.Pp
107041394f3SDevin TeskeThe
108041394f3SDevin Teske.Va options
109041394f3SDevin Teskemember of the
110041394f3SDevin Teske.Fn dpv
111041394f3SDevin Teske.Fa config
112041394f3SDevin Teskeargument is a mask of bit fields indicating various processing options.
11319be69c5SDevin TeskePossible flags are:
114041394f3SDevin Teske.Bl -tag -width DPV_NO_OVERRUN
115041394f3SDevin Teske.It Dv DPV_TEST_MODE
116041394f3SDevin TeskeEnable test mode.
11719be69c5SDevin TeskeIn test mode,
11819be69c5SDevin Teskethe
119041394f3SDevin Teske.Fn action
120041394f3SDevin Teskecallback of the
121041394f3SDevin Teske.Fa config
122041394f3SDevin Teskeargument is not called but instead simulated-data is used to drive progress.
123041394f3SDevin TeskeAppends
124041394f3SDevin Teske.Dq [TEST MODE]
125041394f3SDevin Tesketo the status line
126041394f3SDevin Teske.Po
12719be69c5SDevin Tesketo override,
12819be69c5SDevin Teskeset the
129041394f3SDevin Teske.Va status_format
130041394f3SDevin Teskemember of the
131041394f3SDevin Teske.Fn dpv
132041394f3SDevin Teske.Fa config
133041394f3SDevin Teskeargument;
13419be69c5SDevin Teskefor example,
13519be69c5SDevin Tesketo
136041394f3SDevin Teske.Dv DPV_STATUS_DEFAULT
137041394f3SDevin Teske.Pc .
138041394f3SDevin Teske.It Dv DPV_WIDE_MODE
139041394f3SDevin TeskeEnable wide mode.
14019be69c5SDevin TeskeIn wide mode,
14119be69c5SDevin Teskethe length of the
142041394f3SDevin Teske.Va aprompt
143041394f3SDevin Teskeand
144041394f3SDevin Teske.Va pprompt
145041394f3SDevin Teskemembers of the
146041394f3SDevin Teske.Fn dpv
147041394f3SDevin Teske.Fa config
148041394f3SDevin Teskeargument will bump the width of the gauge widget.
149041394f3SDevin TeskePrompts wider than the maximum width will wrap
150041394f3SDevin Teske.Po
151041394f3SDevin Teskeunless using
152*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog ;
153041394f3SDevin Teskesee BUGS section below
154041394f3SDevin Teske.Pc .
155041394f3SDevin Teske.It Dv DPV_NO_LABELS
156041394f3SDevin TeskeDisables the display of labels associated with each transfer
157041394f3SDevin Teske.Po
158041394f3SDevin Teske.Va label_size
159041394f3SDevin Teskemember of
160041394f3SDevin Teske.Fn dpv
161041394f3SDevin Teske.Fa config
162041394f3SDevin Teskeargument is ignored
163041394f3SDevin Teske.Pc .
164041394f3SDevin Teske.It Dv DPV_USE_COLOR
165041394f3SDevin TeskeForce the use of color even if the
166041394f3SDevin Teske.Va display_type
167041394f3SDevin Teskedoes not support color
168041394f3SDevin Teske.Po
169041394f3SDevin Teske.Ev USE_COLOR
170041394f3SDevin Teskeenvironment variable is ignored
171041394f3SDevin Teske.Pc .
172041394f3SDevin Teske.It Dv DPV_NO_OVERRUN
17319be69c5SDevin TeskeWhen enabled,
17419be69c5SDevin Teskecallbacks for the current
175041394f3SDevin Teske.Vt dpv_file_node
176041394f3SDevin Teskeare terminated when
177041394f3SDevin Teske.Fn action
178041394f3SDevin Teskereturns 100 or greater
179041394f3SDevin Teske.Po
180041394f3SDevin Teskealleviates the need to change the
181041394f3SDevin Teske.Va status
182041394f3SDevin Teskeof the current
183041394f3SDevin Teske.Vt dpv_file_node
184041394f3SDevin Teskebut may also cause file truncation if the stream exceeds expected length
185041394f3SDevin Teske.Pc .
186041394f3SDevin Teske.El
187041394f3SDevin Teske.Pp
188041394f3SDevin TeskeThe
189041394f3SDevin Teske.Fa file_list
190041394f3SDevin Teskeargument to
191041394f3SDevin Teske.Fn dpv
192041394f3SDevin Teskeis a pointer to a
193041394f3SDevin Teske.Dq linked-list ,
19419be69c5SDevin Teskedescribed in
195041394f3SDevin Teske.In dpv.h :
196041394f3SDevin Teske.Bd -literal -offset indent
197041394f3SDevin Teskestruct dpv_file_node {
198041394f3SDevin Teske    enum dpv_status    status; /* status of read operation */
199041394f3SDevin Teske    char               *msg;   /* display instead of "Done/Fail" */
200041394f3SDevin Teske    char               *name;  /* name of file to read */
201041394f3SDevin Teske    char               *path;  /* path to file */
202041394f3SDevin Teske    long long          length; /* expected size */
203041394f3SDevin Teske    long long          read;   /* number units read (e.g., bytes) */
204041394f3SDevin Teske    struct dpv_file_node *next;/* pointer to next (end with NULL) */
205041394f3SDevin Teske};
206041394f3SDevin Teske.Ed
207041394f3SDevin Teske.Pp
208041394f3SDevin TeskeFor each of the items in the
209041394f3SDevin Teske.Fa file_list
210041394f3SDevin Teske.Dq linked-list
21119be69c5SDevin Teskeargument,
21219be69c5SDevin Teskethe
213041394f3SDevin Teske.Fn action
214041394f3SDevin Teskecallback member of the
215041394f3SDevin Teske.Fn dpv
216041394f3SDevin Teske.Fa config
217041394f3SDevin Teskeargument is called.
218041394f3SDevin TeskeThe
219041394f3SDevin Teske.Fn action
22019be69c5SDevin Teskefunction performs a
221041394f3SDevin Teske.Dq nominal
222041394f3SDevin Teskeaction on the file and return.
223041394f3SDevin TeskeThe return value of
224041394f3SDevin Teske.Vt int
225041394f3SDevin Teskerepresents the current progress percentage
226041394f3SDevin Teske.Pq 0-100
227041394f3SDevin Teskefor the current file.
228041394f3SDevin Teske.Pp
229041394f3SDevin TeskeThe
230041394f3SDevin Teske.Fn action
231041394f3SDevin Teskecallback provides two variables for each call.
232041394f3SDevin Teske.Fa file
233041394f3SDevin Teskeprovides a reference to the current
234041394f3SDevin Teske.Vt dpv_file_node
235041394f3SDevin Teskebeing processed.
236041394f3SDevin Teske.Fa out
23719be69c5SDevin Teskeprovides a file descriptor where the data goes.
238041394f3SDevin Teske.Pp
239041394f3SDevin TeskeIf the
240041394f3SDevin Teske.Va output
241041394f3SDevin Teskemember of the
242041394f3SDevin Teske.Fn dpv
243041394f3SDevin Teske.Fa config
244041394f3SDevin Teskeargument was set to DPV_OUTPUT_NONE
245041394f3SDevin Teske.Pq default ; when invoking Fn dpv ,
246041394f3SDevin Teskethe
247041394f3SDevin Teske.Fa out
248041394f3SDevin Teskefile descriptor of
249041394f3SDevin Teske.Fn action
25019be69c5SDevin Teskewill be zero and can be ignored.
251041394f3SDevin TeskeIf
252041394f3SDevin Teske.Fa output
253041394f3SDevin Teskewas set to DPV_OUTPUT_FILE,
254041394f3SDevin Teske.Fa out
255041394f3SDevin Teskewill be an open file descriptor to a file.
256041394f3SDevin TeskeIf
257041394f3SDevin Teske.Fa output
258041394f3SDevin Teskewas set to DPV_OUTPUT_SHELL,
259041394f3SDevin Teske.Fa out
260041394f3SDevin Teskewill be an open file descriptor to a pipe for a spawned shell program.
261041394f3SDevin TeskeWhen
262041394f3SDevin Teske.Fa out
26319be69c5SDevin Teskeis greater than zero,
26419be69c5SDevin Teskewrite data that has been read back to
265041394f3SDevin Teske.Fa out .
266041394f3SDevin Teske.Pp
267041394f3SDevin TeskeTo abort
268041394f3SDevin Teske.Fn dpv ,
269041394f3SDevin Teskeeither from the
270041394f3SDevin Teske.Fn action
27119be69c5SDevin Teskecallback or asynchronously from a signal handler,
27219be69c5SDevin Tesketwo globals are provided via
273041394f3SDevin Teske.In dpv.h :
274041394f3SDevin Teske.Bd -literal -offset indent
275041394f3SDevin Teskeextern int dpv_interrupt; /* Set to TRUE in interrupt handler */
276041394f3SDevin Teskeextern int dpv_abort;     /* Set to true in callback to abort */
277041394f3SDevin Teske.Ed
278041394f3SDevin Teske.Pp
279041394f3SDevin TeskeThese globals are not automatically reset and must be manually maintained.
28019be69c5SDevin TeskeDo not forget to reset these globals before subsequent invocations of
281041394f3SDevin Teske.Fn dpv
282041394f3SDevin Teskewhen making multiple calls from the same program.
283041394f3SDevin Teske.Pp
28419be69c5SDevin TeskeIn addition,
28519be69c5SDevin Teskethe
286041394f3SDevin Teske.Va status
287041394f3SDevin Teskemember of the
288041394f3SDevin Teske.Fn action
289041394f3SDevin Teske.Fa file
290041394f3SDevin Teskeargument can be used to control callbacks for the current file.
291041394f3SDevin TeskeThe
292041394f3SDevin Teske.Va status
29319be69c5SDevin Teskemember can be set to any of the below from
294041394f3SDevin Teske.In dpv.h :
295041394f3SDevin Teske.Bd -literal -offset indent
296041394f3SDevin Teskeenum dpv_status {
297041394f3SDevin Teske	DPV_STATUS_RUNNING = 0, /* Running (default) */
298041394f3SDevin Teske	DPV_STATUS_DONE,        /* Completed */
299041394f3SDevin Teske	DPV_STATUS_FAILED,      /* Oops, something went wrong */
300041394f3SDevin Teske};
301041394f3SDevin Teske.Ed
302041394f3SDevin Teske.Pp
303041394f3SDevin TeskeThe default
304041394f3SDevin Teske.Fa status
30519be69c5SDevin Teskeis zero,
30619be69c5SDevin TeskeDPV_STATUS_RUNNING,
30719be69c5SDevin Teskewhich keeps the callbacks coming for the current
308041394f3SDevin Teske.Fn file .
309041394f3SDevin TeskeSetting
310041394f3SDevin Teske.Ql file->status
311041394f3SDevin Tesketo anything other than DPV_STATUS_RUNNING will cause
312041394f3SDevin Teske.Fn dpv
31319be69c5SDevin Tesketo loop to the next file,
31419be69c5SDevin Teskeeffecting the next callback,
31519be69c5SDevin Teskeif any.
316041394f3SDevin Teske.Pp
317041394f3SDevin TeskeThe
318041394f3SDevin Teske.Fn action
319041394f3SDevin Teskecallback is responsible for calculating percentages and
320041394f3SDevin Teske.Pq recommended
321041394f3SDevin Teskemaintaining a
322041394f3SDevin Teske.Nm
323041394f3SDevin Teskeglobal counter so
324041394f3SDevin Teske.Fn dpv
325041394f3SDevin Teskecan display throughput statistics.
326041394f3SDevin TeskePercentages are reported through the
327041394f3SDevin Teske.Vt int
328041394f3SDevin Teskereturn value of the
329041394f3SDevin Teske.Fn action
330041394f3SDevin Teskecallback.
33119be69c5SDevin TeskeThroughput statistics are calculated from the below global
332041394f3SDevin Teske.Vt int
333041394f3SDevin Teskein
334041394f3SDevin Teske.In dpv.h :
335041394f3SDevin Teske.Bd -literal -offset indent
336041394f3SDevin Teskeextern int dpv_overall_read;
337041394f3SDevin Teske.Ed
338041394f3SDevin Teske.Pp
33919be69c5SDevin TeskeSet this to the number of bytes that have been read for all files.
340041394f3SDevin TeskeThroughput information is displayed in the status line
341041394f3SDevin Teske.Pq only available when using Xr dialog 3
342041394f3SDevin Teskeat the bottom of the screen.
343041394f3SDevin TeskeSee DPV_DISPLAY_LIBDIALOG above.
344041394f3SDevin Teske.Pp
345041394f3SDevin TeskeNote that
346041394f3SDevin Teske.Va dpv_overall_read
347041394f3SDevin Teskedoes not have to represent bytes.
34819be69c5SDevin TeskeFor example,
34919be69c5SDevin Teskethe
350041394f3SDevin Teske.Va status_format
35119be69c5SDevin Teskecan be changed to display something other than
352041394f3SDevin Teske.Dq Li bytes
353041394f3SDevin Teskeand increment
354041394f3SDevin Teske.Va dpv_overall_read
355041394f3SDevin Teskeaccordingly
35619be69c5SDevin Teske.Pq for example, counting lines .
357041394f3SDevin Teske.Pp
358041394f3SDevin TeskeWhen
359041394f3SDevin Teske.Fn dpv
36019be69c5SDevin Teskeis processing the current file,
36119be69c5SDevin Teskethe
362041394f3SDevin Teske.Va length
363041394f3SDevin Teskeand
364041394f3SDevin Teske.Va read
365041394f3SDevin Teskemembers of the
366041394f3SDevin Teske.Fn action
367041394f3SDevin Teske.Fa file
368041394f3SDevin Teskeargument are used for calculating the display of mini progress bars
369041394f3SDevin Teske.Po
37019be69c5SDevin Teskeif enabled;
37119be69c5SDevin Teskesee
372041394f3SDevin Teske.Va pbar_size
373041394f3SDevin Teskeabove
374041394f3SDevin Teske.Pc .
375041394f3SDevin TeskeIf the
376041394f3SDevin Teske.Va length
377041394f3SDevin Teskemember of the current
378041394f3SDevin Teske.Fa file
379041394f3SDevin Teskeis less than zero
380041394f3SDevin Teske.Pq indicating an unknown file length ,
381041394f3SDevin Teskea
382041394f3SDevin Teske.Xr humanize_number 3
383041394f3SDevin Teskeversion of the
384041394f3SDevin Teske.Va read
385041394f3SDevin Teskemember is used instead of a traditional progress bar.
386041394f3SDevin TeskeOtherwise a progress bar is calculated as percentage read to file length.
387041394f3SDevin Teske.Fn action
388041394f3SDevin Teskecallback must maintain these member values for mini-progress bars.
389041394f3SDevin Teske.Pp
390041394f3SDevin TeskeThe
391041394f3SDevin Teske.Fn dpv_free
392041394f3SDevin Teskefunction performs
393041394f3SDevin Teske.Xr free 3
394041394f3SDevin Teskeon private global variables initialized by
395041394f3SDevin Teske.Fn dpv .
396041394f3SDevin Teske.Sh ENVIRONMENT
39719be69c5SDevin TeskeThe below environment variables are referenced by
398041394f3SDevin Teske.Nm :
399041394f3SDevin Teske.Bl -tag -width ".Ev USE_COLOR"
400041394f3SDevin Teske.It Ev DIALOG
401041394f3SDevin TeskeOverride command string used to launch
402041394f3SDevin Teske.Xr dialog 1
403041394f3SDevin Teske.Pq requires Dv DPV_DISPLAY_DIALOG
404041394f3SDevin Teskeor
405*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog
406041394f3SDevin Teske.Pq requires Dv DPV_DISPLAY_XDIALOG ;
407041394f3SDevin Teskedefault is either
408041394f3SDevin Teske.Ql dialog
409041394f3SDevin Teske.Pq for Dv DPV_DISPLAY_DIALOG
410041394f3SDevin Teskeor
411041394f3SDevin Teske.Ql Xdialog
412041394f3SDevin Teske.Pq for Dv DPV_DISPLAY_XDIALOG .
413041394f3SDevin Teske.It Ev DIALOGRC
41419be69c5SDevin TeskeIf set and non-NULL,
41519be69c5SDevin Teskepath to
416041394f3SDevin Teske.Ql .dialogrc
417041394f3SDevin Teskefile.
418041394f3SDevin Teske.It Ev HOME
419041394f3SDevin TeskeIf
420041394f3SDevin Teske.Ql Ev $DIALOGRC
42119be69c5SDevin Teskeis either not set or NULL,
42219be69c5SDevin Teskeused as a prefix to
423041394f3SDevin Teske.Ql .dialogrc
42419be69c5SDevin Teske.Pq that is, Ql $HOME/.dialogrc .
425041394f3SDevin Teske.It Ev USE_COLOR
42619be69c5SDevin TeskeIf set and NULL,
42719be69c5SDevin Teskedisables the use of color when using
428*e1ae2a28SJens Schweikhardt.Xr dialog 1 .
429*e1ae2a28SJens SchweikhardtDoes not apply to
430*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog .
431041394f3SDevin Teske.It Ev msg_done Ev msg_fail Ev msg_pending
432041394f3SDevin TeskeInternationalization strings for overriding the default English strings
433041394f3SDevin Teske.Ql Done ,
434041394f3SDevin Teske.Ql Fail ,
435041394f3SDevin Teskeand
436041394f3SDevin Teske.Ql Pending
437041394f3SDevin Teskerespectively.
43819be69c5SDevin TeskeTo prevent their usage,
43919be69c5SDevin Teskeexplicitly set the
440041394f3SDevin Teske.Va msg_done ,
441041394f3SDevin Teske.Va msg_fail ,
442041394f3SDevin Teskeand
443041394f3SDevin Teske.Va msg_pending
444041394f3SDevin Teskemembers of
445041394f3SDevin Teske.Fn dpv
446041394f3SDevin Teske.Fa config
447041394f3SDevin Teskeargument to default macros
448041394f3SDevin Teske.Pq DPV_DONE_DEFAULT, DPV_FAIL_DEFAULT, and DPV_PENDING_DEFAULT
449041394f3SDevin Teskeor desired values.
450041394f3SDevin Teske.El
451041394f3SDevin Teske.Sh FILES
452041394f3SDevin Teske.Bl -tag -width ".Pa $HOME/.dialogrc" -compact
453041394f3SDevin Teske.It Pa $HOME/.dialogrc
454041394f3SDevin Teske.El
455041394f3SDevin Teske.Sh SEE ALSO
456041394f3SDevin Teske.Xr dialog 1 ,
457*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog ,
458c09eb466SJoel Dahl.Xr dialog 3
459041394f3SDevin Teske.Sh HISTORY
460041394f3SDevin TeskeThe
461041394f3SDevin Teske.Nm
462041394f3SDevin Teskelibrary first appeared in
4631f00a99aSDevin Teske.Fx 10.2 .
464041394f3SDevin Teske.Sh AUTHORS
465041394f3SDevin Teske.An Devin Teske Aq dteske@FreeBSD.org
466041394f3SDevin Teske.Sh BUGS
467*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog ,
468041394f3SDevin Teskewhen given both
469041394f3SDevin Teske.Ql Fl -title Ar title
470041394f3SDevin Teske.Po
471041394f3SDevin Teskesee above
472041394f3SDevin Teske.Ql Va title
473041394f3SDevin Teskemember of
474041394f3SDevin Teske.Va struct dpv_config
475041394f3SDevin Teske.Pc
476041394f3SDevin Teskeand
477041394f3SDevin Teske.Ql Fl -backtitle Ar backtitle
478041394f3SDevin Teske.Po
479041394f3SDevin Teskesee above
480041394f3SDevin Teske.Ql Va backtitle
481041394f3SDevin Teskemember of
482041394f3SDevin Teske.Va struct dpv_config
483041394f3SDevin Teske.Pc ,
484041394f3SDevin Teskedisplays the backtitle in place of the title and vice-versa.
485041394f3SDevin Teske.Pp
486*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog
487041394f3SDevin Teskedoes not wrap long prompt texts received after initial launch.
488041394f3SDevin TeskeThis is a known issue with the
489041394f3SDevin Teske.Ql --gauge
490041394f3SDevin Teskewidget in
491*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog .
49219be69c5SDevin TeskeEmbed escaped newlines within prompt text to force line breaks.
493041394f3SDevin Teske.Pp
494041394f3SDevin Teske.Xr dialog 1
495041394f3SDevin Teskedoes not display the first character after a series of escaped escape-sequences
49619be69c5SDevin Teske(for example, ``\\\\n'' produces ``\\'' instead of ``\\n'').
497041394f3SDevin TeskeThis is a known issue with
498041394f3SDevin Teske.Xr dialog 1
499041394f3SDevin Teskeand does not affect
500041394f3SDevin Teske.Xr dialog 3
501041394f3SDevin Teskeor
502*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog .
503041394f3SDevin Teske.Pp
50419be69c5SDevin TeskeIf an application ignores
505041394f3SDevin Teske.Ev USE_COLOR
506041394f3SDevin Teskewhen set and NULL before calling
50719be69c5SDevin Teske.Fn dpv
508041394f3SDevin Teskewith color escape sequences anyway,
509041394f3SDevin Teske.Xr dialog 3
510041394f3SDevin Teskeand
511041394f3SDevin Teske.Xr dialog 1
512041394f3SDevin Teskemay not render properly.
513041394f3SDevin TeskeWorkaround is to detect when
514041394f3SDevin Teske.Ev USE_COLOR
515041394f3SDevin Teskeis set and NULL and either not use color escape sequences at that time or use
516041394f3SDevin Teske.Xr unsetenv 3
517041394f3SDevin Tesketo unset
518041394f3SDevin Teske.Ev USE_COLOR ,
519041394f3SDevin Teskeforcing interpretation of color sequences.
520041394f3SDevin TeskeThis does not effect
521*e1ae2a28SJens Schweikhardt.Xr Xdialog 1 Pq Pa ports/x11/xdialog ,
522041394f3SDevin Teskewhich renders the color escape sequences as plain text.
523041394f3SDevin TeskeSee
524d4d112e3SJoel Dahl.Do
525041394f3SDevin Teskeembedded "\\Z" sequences
526041394f3SDevin Teske.Dc
527041394f3SDevin Teskein
528041394f3SDevin Teske.Xr dialog 1
529041394f3SDevin Teskefor additional information.
530