w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

nouiutil.c
Go to the documentation of this file.
1 /* Copyright (C) 2000-2012 by George Williams */
2 /*
3  * Redistribution and use in source and binary forms, with or without
4  * modification, are permitted provided that the following conditions are met:
5 
6  * Redistributions of source code must retain the above copyright notice, this
7  * list of conditions and the following disclaimer.
8 
9  * Redistributions in binary form must reproduce the above copyright notice,
10  * this list of conditions and the following disclaimer in the documentation
11  * and/or other materials provided with the distribution.
12 
13  * The name of the author may not be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15 
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
19  * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 #include "uiinterface.h"
28 #include "splinefont.h"
29 
30 static void NOUI_IError(const char *format,...) {
31  va_list ap;
32  char buffer[400], *str;
34  fprintf(stderr, "Internal Error: " );
35  vsnprintf(buffer,sizeof(buffer),format,ap);
36  str = buffer;
37  fprintf(stderr,"%s",str);
38  if ( str[strlen(str)-1]!='\n' )
39  putc('\n',stderr);
40  va_end(ap);
41 }
42 
43 static void NOUI__LogError(const char *format,va_list ap) {
44  char buffer[400], *str;
45  vsnprintf(buffer,sizeof(buffer),format,ap);
46  str = buffer;
47  fprintf(stderr,"%s",str);
48  if ( str[strlen(str)-1]!='\n' )
49  putc('\n',stderr);
50 }
51 
52 static void NOUI_LogError(const char *format,...) {
53  va_list ap;
54 
57  va_end(ap);
58 }
59 
60 static void NOUI_post_notice(const char *title,const char *statement,...) {
61  va_list ap;
64  va_end(ap);
65 }
66 
67 static void NOUI_post_error(const char *title,const char *statement,...) {
68  va_list ap;
71  va_end(ap);
72 }
73 
74 static int NOUI_ask(const char *title, const char **answers,
75  int def, int cancel,const char *question,...) {
76 return( def );
77 }
78 
79 static int NOUI_choose(const char *title, const char **choices,int cnt, int def,
80  const char *question,...) {
81 return( def );
82 }
83 
84 static int NOUI_choose_multiple(char *title, const char **choices,char *sel,
85  int cnt, char *buts[2], const char *question,...) {
86 return( -1 );
87 }
88 
89 static char *NOUI_ask_string(const char *title, const char *def,
90  const char *question,...) {
91 return( (char *) def );
92 }
93 
94 static char *NOUI_open_file(const char *title, const char *defaultfile,
95  const char *initial_filter) {
96 return( NULL );
97 }
98 
99 static char *NOUI_saveas_file(const char *title, const char *defaultfile,
100  const char *initial_filter) {
101 return( copy(defaultfile) );
102 }
103 
104 static void NOUI_progress_start(int delay, const char *title, const char *line1,
105  const char *line2, int tot, int stages) {
106 }
107 
108 static void NOUI_void_void_noop(void) {
109 }
110 
111 static void NOUI_void_int_noop(int useless) {
112 }
113 
114 static int NOUI_int_int_noop(int useless) {
115 return( true );
116 }
117 
118 static void NOUI_void_str_noop(const char * useless) {
119 }
120 
121 static int NOUI_alwaystrue(void) {
122 return( true );
123 }
124 
125 static int NOUI_DefaultStrokeFlags(void) {
126 return( sf_correctdir );
127 }
128 
129 static struct ui_interface noui_interface = {
130  NOUI_IError,
134  NOUI_ask,
135  NOUI_choose,
138  NOUI_ask_string, /* password */
141 
156 
158 
160 };
#define ap
char * def
Definition: definitions.c:41
static void copy(GlyphCachePtr *root)
Definition: gcache.c:378
void cancel(short *num, short *denom, short lowest)
Definition: globals.c:49
#define putc
Definition: jbib.h:20
#define NULL
Definition: ftobjs.h:61
#define fprintf
Definition: mendex.h:64
#define vsnprintf
Definition: snprintf.c:40
static int format
Definition: pbmclean.c:15
static int cnt
Definition: pkout.c:166
static char * NOUI_saveas_file(const char *title, const char *defaultfile, const char *initial_filter)
Definition: nouiutil.c:99
static void NOUI_void_str_noop(const char *useless)
Definition: nouiutil.c:118
static int NOUI_choose_multiple(char *title, const char **choices, char *sel, int cnt, char *buts[2], const char *question,...)
Definition: nouiutil.c:84
static void NOUI_void_void_noop(void)
Definition: nouiutil.c:108
static void NOUI_void_int_noop(int useless)
Definition: nouiutil.c:111
static struct ui_interface noui_interface
Definition: nouiutil.c:129
static int NOUI_alwaystrue(void)
Definition: nouiutil.c:121
static void NOUI_progress_start(int delay, const char *title, const char *line1, const char *line2, int tot, int stages)
Definition: nouiutil.c:104
static void NOUI_LogError(const char *format,...)
Definition: nouiutil.c:52
static void NOUI_IError(const char *format,...)
Definition: nouiutil.c:30
static char * NOUI_open_file(const char *title, const char *defaultfile, const char *initial_filter)
Definition: nouiutil.c:94
static void NOUI_post_notice(const char *title, const char *statement,...)
Definition: nouiutil.c:60
static void NOUI__LogError(const char *format, va_list ap)
Definition: nouiutil.c:43
static int NOUI_int_int_noop(int useless)
Definition: nouiutil.c:114
static char * NOUI_ask_string(const char *title, const char *def, const char *question,...)
Definition: nouiutil.c:89
static int NOUI_ask(const char *title, const char **answers, int def, int cancel, const char *question,...)
Definition: nouiutil.c:74
static void NOUI_post_error(const char *title, const char *statement,...)
Definition: nouiutil.c:67
static int NOUI_DefaultStrokeFlags(void)
Definition: nouiutil.c:125
static int NOUI_choose(const char *title, const char **choices, int cnt, int def, const char *question,...)
Definition: nouiutil.c:79
@ sf_correctdir
Definition: splinefont.h:2400
static void statement(LexState *ls)
Definition: lparser.c:1538
#define str(s)
Definition: sh6.c:399
Definition: utils.c:300
*job_name strlen((char *) job_name) - 4)
char line2[BUFSIZ]
Definition: texfix.c:35
@ title
Definition: preamble.c:50
#define va_start(pvar)
Definition: varargs.h:30
#define va_end(pvar)
Definition: varargs.h:38
char * va_list
Definition: varargs.h:22
#define buffer
Definition: xmlparse.c:611