home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / hf / dsp / dsp4tool / dlib.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-05  |  1.5 KB  |  41 lines

  1. /*  DLIB.C -- Edit/View DSP CARD 4 (FLASH) EPROM memory image
  2.  *
  3.  *  Copyright (C) by Alef Null 1992
  4.  *  Author(s): Jarkko Vuori, OH2LNS
  5.  *  Modification(s):
  6.  */
  7.  
  8.  
  9. #include <stdio.h>
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #include <sys\types.h>
  13. #include <sys\stat.h>
  14. #include "utils.h"
  15. #include "dlib.h"
  16.  
  17.  
  18. CMDS args[] = {
  19.     { 'C', True, True,    "-c<numarg> <rom_image> <load_image> [comment] - replace/add a new image",     { Modify, ReadOnly, Last }, { ".BIN", ".LOD" }, replace },
  20.     { 'D', True, False, "-d<numarg> <rom_image>                        - delete image",          { Modify, Last },         { ".BIN" },     NULL },
  21.     { 'B', False,True,    "-b         <rom_image> <load_image> [comment] - replace/add boot image",     { Modify, ReadOnly, Last }, { ".BIN", ".LOD" }, bootimage },
  22.     { 'P', True, False, "-p<numarg> <rom_image>                        - set autoboot program",      { Modify, Last },         { ".BIN" },     autoboot },
  23.     { 'L', False,False, "-l         <rom_image>                        - show rom_image status", { ReadOnly, Last },         { ".BIN" },     list },
  24. };
  25.  
  26.  
  27. static void usage(void) {
  28.     CMDS *p;
  29.  
  30.     fprintf(stderr, "usage: dlib -<command>[numarg] <rom_image> [<load_image>] [comment]\n");
  31.     for (p = args; p < &args[sizeof(args)/sizeof(CMDS)]; p++)
  32.     fprintf(stderr, "    %s\n", p->usage);
  33. }
  34.  
  35.  
  36. int cdecl main(int argc, char *argv[]) {
  37.     printf("DSP CARD 4 ROM library maintainer (%s)\n", __DATE__);
  38.  
  39.     return (ParseCommands(argc, argv, args, sizeof(args)/sizeof(CMDS), DESC_LEN, usage));
  40. }
  41.