Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
637 B
1
Indexable
Never
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
CSR_encrypt() { printf("encrypt function\n"); }
CSR_decrypt() { printf("decrypt function\n"); }
main(int argc, char *argv[])
{
 char *prg=argv[0];
 char *opt=argv[1];
 char *msg=argv[2];
 if(argc==1) {
 fprintf(stderr, "%s: no option and massage\n", prg);
 exit(3);
 }
 if(argc==2) {
 fprintf(stderr, "%s: no option or message\n", prg);
 exit(2);
 }
 if(argc==3) {
 if(strcmp(opt,"-Ecsr")==0)
 CSR_encrypt();
 else if(strcmp(opt,"-Dcsr")==0)
 CSR_decrypt();
 else {
 fprintf(stderr, "%s: illegal option: %s\n", prg, opt);
 exit(1);
 }
 }
 exit(0);
}