chiark / gitweb /
Adjust colours early so that we don't have to keep all RGBs in RAM
[ypp-sc-tools.main.git] / pctb / convert.c
index 4ded228f9d130ffb7a40bfb2758872afe6678b4f..1f1385057d152a1bf1e28bd7d74ae3e818d4b164 100644 (file)
@@ -36,28 +36,12 @@ const char *get_vardir(void) { return "."; }
 const char *get_libdir(void) { return "."; }
 
 
-enum mode {
-  mf_findwindow=      00001,
-  mf_screenshot=      00010,
-  mf_readscreenshot=  00020,
-  mf_analyse=         00100,
-  mfm_special=        07000,
-  
-  mode_findwindow=    00001,
-  mode_screenshot=    00011,
-  mode_analyse=       00120,
-  mode_showcharset=   01000,
-
-  mode_all=           00111,
-};
-
 enum outmodekind {
   omk_unset, omk_upload, omk_str, omk_raw, omk_none
 };
 static enum outmodekind o_outmode_kind;
 static const char *o_outmode_str= 0;
 
-static enum mode o_mode= mode_all;
 static char *o_screenshot_fn;
 static const char *o_serv_pctb, *o_serv_dict_fetch, *o_serv_dict_submit;
 
@@ -68,6 +52,7 @@ int o_quiet;
 
 static pid_t screenshot_compressor=-1;
 
+enum mode o_mode= mode_all;
 enum flags o_flags=
    ff_charset_allowedit |
    ff_dict_fetch|ff_dict_submit|ff_dict_pirate;
@@ -361,7 +346,7 @@ static void vprogress_core(int spinner, const char *fmt, va_list al) {
   int r;
   
   if (o_quiet) return;
-  if (!isatty(2)) return;
+  if (!debug_flags && !isatty(2)) return;
   
   if (last_progress_len)
     putc('\r',stderr);