bool option(const char* str, const char* shortopt, const char* longopt);
-void disconnect(int sock);
+void disconnect(void);
int get_ioport() {
#ifdef PC98
return 0;
}
-void disconnect(int sock) {
+void disconnect(void) {
while((inp(get_ioport() + 5) & 0x20) == 0)
;
delay(100);
int rcli_init(void);
char* readline_sock(void);
void writeline(const char*);
+void disconnect(void);
bool option(const char* str, const char* shortopt, const char* longopt) {
char* dos_shortopt = __dw_strcat("/", shortopt);
argc = _argc;
argv = _argv;
int st = rcli_init();
+ bool ready = false;
if(st != 0) return st;
while(1) {
char* resp = readline_sock();
char* arg = has_arg ? resp + i + 1 : NULL;
if(__dw_strcaseequ(resp, "READY")) {
printf("Connection is ready\n");
+ ready = true;
+ break;
} else if(__dw_strcaseequ(resp, "ATTR") && has_arg) {
int start = 0;
for(i = 0;; i++) {
}
free(resp);
}
+ if(ready){
+ writeline("QUIT");
+ while(true){
+ char* resp = readline_sock();
+ if(resp == NULL) break;
+ free(resp);
+ }
+ }
return 0;
}