home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / programm / utility / resgrep0.lzh / ResGrep / src / export.h next >
C/C++ Source or Header  |  1992-04-11  |  3KB  |  110 lines

  1. #ifndef CC_EXPORT_H
  2. #define CC_EXPORT_H
  3. //
  4. // export.h
  5. //
  6. // The classdefinitions for the export of data from ResGrep.
  7. //
  8. // 23.03.1992 Andre    written.
  9. //
  10.  
  11. #include <stdio.h>
  12. #include "list.h"
  13.  
  14. #ifndef FALSE
  15. #define FALSE 0
  16. #endif
  17. #ifndef TRUE
  18. #define TRUE (~FALSE)
  19. #endif
  20.  
  21. typedef enum boolean
  22. {
  23.    false=FALSE, true=TRUE
  24. } bool;
  25.  
  26. enum send
  27. {
  28.    Clipboard, File
  29. };
  30.  
  31. class convert;
  32.  
  33. typedef int (convert::*exportfunc)(FILE *, unsigned long);
  34.  
  35. class convert :  public node
  36. {
  37.    // The type is placed in node::pack, the conversion name in node::name.
  38.    char  *command;   // The command (or the ARexx skript) to be executed.
  39.    bool   isARexx;   // True is Command is an ARexx skript. (The skript is
  40.              // directly send to the ARexx-Host.)
  41.    send   sendto;
  42.    char  *filename;  // The filename the data is written to. (Only set if
  43.              // 'sendto' is equal 'File'.)
  44.    bool   builtin;   // True if function is builtin (can't be removed).
  45.    int      funcnum;   // Number of Function
  46.  public:
  47.    convert(unsigned long theType,
  48.        int thefuncnum,
  49.        char *theName="raw data",
  50.        char *theCommand=NULL, bool theIsARexx=true,
  51.        send theSendTo=Clipboard, char *theFilename=NULL,
  52.        bool thebuiltin=true);
  53.    ~convert(void);
  54.  
  55.    // exportfunc export;
  56.    void docommand(void);
  57.    void ReadText(void);
  58.  
  59.    int getfuncnum(void);
  60.  
  61.    // 'export()' is one of:
  62.  
  63.                              // Number
  64.    int rawdata(FILE *fp, unsigned long DataOffset);      // 0
  65.    int text2ascii(FILE *fp, unsigned long DataOffset);   // 1
  66.    int text2ftxt(FILE *fp, unsigned long DataOffset);    // 2
  67.    int snd28svx(FILE *fp, unsigned long DataOffset);     // 3
  68.  
  69.    friend void editconv(void);
  70.    friend void UpdateWindow(node *,int );
  71.    friend void savesettings(void);
  72.    friend int exportres(unsigned long theType, FILE *fp, unsigned long DataOffset);
  73. };
  74.  
  75. void initexport(void);
  76. void editconv(void);
  77.  
  78. #define NUM_EXPORTFUNC    4
  79. extern exportfunc exportfunctions[];
  80.  
  81. // Funktionen aus settings.cc
  82. void savesettings(void);
  83. void savesettingsas(void);
  84. void loadsettings(void);
  85. void freeconvert(list *c);
  86.  
  87. // Funktionen aus Output.cc
  88. void ResError(char *text);
  89. void ResWarning(char *text);
  90. void ResMessage(char *text);
  91. int  ResAsk(char *text, char *wahl);
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98. // Errors from export functions
  99. #define ERR_NO              0
  100. #define ERR_NO_CONVERS          1
  101. #define ERR_FILE_CORRUPTED    2
  102. #define ERR_NO_MEMORY          3
  103. #define ERR_FILE_OPEN          4
  104. #define ERR_WRITE          5
  105. #define ERR_NO_CLIPBOARD      6
  106. #define ERR_NO_FILE          7
  107. #define ERR_OPENIFF          8
  108.  
  109. #endif
  110.