1
0
mirror of https://github.com/fumiama/base16384.git synced 2026-06-23 08:40:25 +08:00

新的设计

This commit is contained in:
fumiama
2021-04-07 23:27:36 +08:00
parent 8f0e25dad3
commit 2f4a121bbd
7 changed files with 319 additions and 153 deletions

View File

@@ -0,0 +1,34 @@
//base16384.c
//MIT fumiama 20200416
#include <stdio.h>
#include <stdlib.h>
#include "base16384.h"
#define CHOICE argv[1][1]
#define READ argv[2]
#define WRITE argv[3]
int main(int argc, char **argv){
FILE *fp = NULL;
FILE *fpo = NULL;
if(argc != 4){
fputs("Usage: -[e|d] inputfile outputfile\n", stderr);
fputs(" -e encode\n", stderr);
fputs(" -d decode\n", stderr);
exit(EXIT_FAILURE);
}
fp = fopen(READ, "rb");
fpo = fopen(WRITE, "wb");
if(!fp || !fpo){
fputs("IO error!", stderr);
exit(EXIT_FAILURE);
}
switch(CHOICE){
case 'e': encode(fp, fpo); break;
case 'd': decode(fp, fpo); break;
default: break;
}
return 0;
}