ftp.nice.ch/pub/next/tools/cdrom/pCD.0.34.N.bs.tar.gz#/pCD0.3.4/hpcdtoppm.0.4/error.c

This is error.c in view mode; [Download] [Up]

/* hpcdtoppm (Hadmut's pcdtoppm) v0.4
*  Copyright (c) 1992, 1993 by Hadmut Danisch (danisch@ira.uka.de).
*  Permission to use and distribute this software and its
*  documentation for noncommercial use and without fee is hereby granted,
*  provided that the above copyright notice appear in all copies and that
*  both that copyright notice and this permission notice appear in
*  supporting documentation. It is not allowed to sell this software in 
*  any way. This software is not public domain.
*/

#include "hpcdtoppm.h"
#define X(a,b) ((a == b) ? "->" : "  ")

void error(e)
  enum ERRORS e;
 {
  
  switch(e)
   {case E_NONE:   return;
    case E_IMP:    fprintf(stderr,"Sorry, Not yet implemented.\n"); break;
    case E_READ:   fprintf(stderr,"Error while reading.\n"); break;
    case E_WRITE:  fprintf(stderr,"Error while writing.\n"); break;
    case E_INTERN: fprintf(stderr,"Internal error.\n"); break;
    case E_ARG:    fprintf(stderr,"Error in Arguments !\n\n"); 
                   fprintf(stderr,"Usage: hpcdtoppm [options] pcd-file [ppm-file]\n\n");
                   fprintf(stderr,"Opts:         [ -> = Default ] \n\n");

                   fprintf(stderr,"     -x     Overskip mode (tries to improve color quality.)\n");
                   fprintf(stderr,"     -s     Apply simple sharpness-operator on the Luma-channel.\n");
                   fprintf(stderr,"     -d     Show differential picture only.\n");
                   fprintf(stderr,"     -i     Give some (buggy) informations from fileheader.\n");
                   fprintf(stderr,"     -m     Show the decoding steps to stderr.\n");
                   fprintf(stderr,"     -crop  Try to cut off the black frame.\n");
                   fprintf(stderr,"     -pos   Print file position of image to stderr.\n");
                   fprintf(stderr,"     -rep   Try to jump over defects in the Huffman Code.\n");
                   fprintf(stderr,"     -vert  Flip image vert.\n");
                   fprintf(stderr,"     -hori  Flip image horiz.\n");
                   fprintf(stderr,"\n");

                   fprintf(stderr," %s  -n     Don't rotate.\n",                                 X(T_DEFAULT,T_NONE));
                   fprintf(stderr," %s  -r     Rotate clockwise for portraits.\n" ,              X(T_DEFAULT,T_RIGHT));
                   fprintf(stderr," %s  -l     Rotate counter-clockwise for portraits.\n",       X(T_DEFAULT,T_LEFT));
                   fprintf(stderr," %s  -a     Try to find out orientation automatically.\n",    X(T_DEFAULT,T_AUTO));
                   fprintf(stderr,"\n");

                   fprintf(stderr," %s  -ppm   output rgb  (ppm-format). \n",                    X(O_DEFAULT,O_PPM));
                   fprintf(stderr," %s  -pgm   output gray (pgm-format). \n",                    X(O_DEFAULT,O_PGM));
                   fprintf(stderr," %s  -ycc   output ycc  (ppm-format). \n",                    X(O_DEFAULT,O_YCC));
                   fprintf(stderr," %s  -ps    output postscript (rgb). \n",                     X(O_DEFAULT,O_PS));
                   fprintf(stderr," %s  -eps   output encapsulated postscript (rgb). \n",        X(O_DEFAULT,O_EPS));
                   fprintf(stderr," %s  -psg   output postscript (grayscale). \n",               X(O_DEFAULT,O_PSG));
                   fprintf(stderr," %s  -epsg  output encapsulated postscript (grayscale). \n",  X(O_DEFAULT,O_EPSG));
                   fprintf(stderr,"     -pl f  Postscript paper left position    [ Def:  %8.3f ]\n",DEF_PAPER_LEFT);
                   fprintf(stderr,"     -pb f  Postscript paper bottom position  [ Def:  %8.3f ]\n",DEF_PAPER_BOTTOM);
                   fprintf(stderr,"     -pw f  Postscript paper width            [ Def:  %8.3f ]\n",DEF_PAPER_WIDTH);
                   fprintf(stderr,"     -ph f  Postscript paper height           [ Def:  %8.3f ]\n",DEF_PAPER_HEIGHT);
                   fprintf(stderr,"\n");

                   fprintf(stderr," %s  -c0    don't correct (linear).\n", X(C_DEFAULT,C_LINEAR));
                   fprintf(stderr," %s  -c-    correct darker.\n",         X(C_DEFAULT,C_DARK));
                   fprintf(stderr," %s  -c+    correct brighter.\n",       X(C_DEFAULT,C_BRIGHT));
                   fprintf(stderr,"\n");

                   fprintf(stderr," %s  -0     Extract thumbnails from Overview file.\n",        X(S_DEFAULT,S_Over));
                   fprintf(stderr," %s  -C d   Extract contact sheet from Overview file, d images width.\n",X(S_DEFAULT,S_Contact)); 
                   fprintf(stderr," %s  -1     Extract  128x192   from Image file.\n",           X(S_DEFAULT,S_Base16));
                   fprintf(stderr," %s  -2     Extract  256x384   from Image file.\n",           X(S_DEFAULT,S_Base4));
                   fprintf(stderr," %s  -3     Extract  512x768   from Image file.\n",           X(S_DEFAULT,S_Base));
                   fprintf(stderr," %s  -4     Extract 1024x1536  from Image file.\n",           X(S_DEFAULT,S_4Base));
                   fprintf(stderr," %s  -5     Extract 2048x3072  from Image file.\n",           X(S_DEFAULT,S_16Base));
                   fprintf(stderr,"\n");

                   break;
    case E_OPT:    fprintf(stderr,"These Options are not allowed together.\n");break;
    case E_MEM:    fprintf(stderr,"Not enough memory !\n"); break;
    case E_HUFF:   fprintf(stderr,"Error in Huffman-Code-Table\n"); break;
    case E_SEQ:    fprintf(stderr,"Error in Huffman-Sequence\n"); break;
    case E_SEQ1:   fprintf(stderr,"Error1 in Huffman-Sequence\n"); break;
    case E_SEQ2:   fprintf(stderr,"Error2 in Huffman-Sequence\n"); break;
    case E_SEQ3:   fprintf(stderr,"Error3 in Huffman-Sequence\n"); break;
    case E_SEQ4:   fprintf(stderr,"Error4 in Huffman-Sequence\n"); break;
    case E_SEQ5:   fprintf(stderr,"Error5 in Huffman-Sequence\n"); break;
    case E_SEQ6:   fprintf(stderr,"Error6 in Huffman-Sequence\n"); break;
    case E_SEQ7:   fprintf(stderr,"Error7 in Huffman-Sequence\n"); break;
    case E_POS:    fprintf(stderr,"Error in file-position\n"); break;
    case E_OVSKIP: fprintf(stderr,"Can't read this resolution in overskip-mode\n"); break;
    case E_TAUTO:  fprintf(stderr,"Can't determine the orientation in overview mode\n");break;
    case E_TCANT:  fprintf(stderr,"Sorry, can't determine orientation for this file.\n");
                   fprintf(stderr,"Please give orientation parameters. \n");break;
    default:       fprintf(stderr,"Unknown error %d ???\n",e);break;
   }
  close_all();
  exit(9);
 }


These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.