dprompt.h revision 302408
1114402Sru/*-
2114402Sru * Copyright (c) 2013-2014 Devin Teske <dteske@FreeBSD.org>
3114402Sru * All rights reserved.
4114402Sru *
5114402Sru * Redistribution and use in source and binary forms, with or without
6114402Sru * modification, are permitted provided that the following conditions
7114402Sru * are met:
8114402Sru * 1. Redistributions of source code must retain the above copyright
9114402Sru *    notice, this list of conditions and the following disclaimer.
10114402Sru * 2. Redistributions in binary form must reproduce the above copyright
11114402Sru *    notice, this list of conditions and the following disclaimer in the
12114402Sru *    documentation and/or other materials provided with the distribution.
13114402Sru *
14114402Sru * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15114402Sru * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16114402Sru * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17114402Sru * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18114402Sru * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19151497Sru * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20114402Sru * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21114402Sru * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22114402Sru * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23114402Sru * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24114402Sru * SUCH DAMAGE.
25114402Sru *
26114402Sru * $FreeBSD: stable/11/lib/libdpv/dprompt.h 274116 2014-11-04 23:46:01Z dteske $
27114402Sru */
28114402Sru
29114402Sru#ifndef _DPROMPT_H_
30114402Sru#define _DPROMPT_H_
31114402Sru
32114402Sru#include <sys/cdefs.h>
33114402Sru
34114402Sru#include "dpv.h"
35114402Sru
36114402Sru/* Display characteristics */
37114402Sru#define ENV_MSG_DONE	"msg_done"
38114402Sru#define ENV_MSG_FAIL	"msg_fail"
39114402Sru#define ENV_MSG_PENDING	"msg_pending"
40114402Sruextern int display_limit;
41114402Sruextern int label_size;
42114402Sruextern int pbar_size;
43114402Sru
44114402Sru__BEGIN_DECLS
45114402Sruvoid	dprompt_clear(void);
46114402Sruvoid	dprompt_dprint(int _fd, const char *_prefix, const char *_append,
47114402Sru	    int _overall);
48114402Sruvoid	dprompt_free(void);
49114402Sruvoid	dprompt_init(struct dpv_file_node *_file_list);
50114402Sruvoid	dprompt_libprint(const char *_prefix, const char *_append,
51114402Sru	    int _overall);
52114402Sruvoid	dprompt_recreate(struct dpv_file_node *_file_list,
53114402Sru	    struct dpv_file_node *_curfile, int _pct);
54114402Sruint	dprompt_add(const char *_format, ...);
55114402Sruint	dprompt_sprint(char * restrict _str, const char *_prefix,
56114402Sru	    const char *_append);
57114402Sru__END_DECLS
58114402Sru
59114402Sru#endif /* !_DPROMPT_H_ */
60114402Sru