home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / hf / dsp / dsp4tool / utils.h < prev   
Encoding:
C/C++ Source or Header  |  1992-11-07  |  990 b   |  37 lines

  1. /*  UTILS.H -- Header for the utility functions
  2.  *
  3.  *  Copyright (C) by Jarkko Vuori 1992
  4.  *  Author(s): J Vuori
  5.  *  Modification(s):
  6.  */
  7.  
  8. #define MAX_FILES   2
  9.  
  10. typedef enum { True = -1, False = 0 } Bool;
  11.  
  12. typedef enum {
  13.     p = 0x01,    // bit 0: data/pgm
  14.     x = 0x00,    // bit 1: x/y
  15.     y = 0x02
  16. } DATASPACE;
  17.  
  18. typedef struct {
  19.     unsigned char space;
  20.     unsigned      address,
  21.           len;
  22. } BLKHEADER;
  23.  
  24. typedef struct {
  25.     char                cmd;
  26.     Bool                numericArgument, fDescription;
  27.     char               *usage;
  28.     enum { Modify, ReadOnly, Last } fileModes[MAX_FILES+1];
  29.     char               *extension[MAX_FILES];
  30.     Bool            (cdecl *operation)(FILE *files[], ...);
  31. } CMDS;
  32.  
  33. unsigned  crc(unsigned char *blk, unsigned len);
  34. char     *AddExtension(char *FileName, char *Extension);
  35. int      ParseCommands(int argc, char *argv[], CMDS *cmds, int cmdcount, int desc_len, void (*usage)(void));
  36. Bool      ReadBlocks(FILE *fp, Bool (*block)(BLKHEADER *pHeader, long huge *data));
  37.