static int put_string ( char *s) { char *out,*free_ptr=0; quiet = 0; out = free_ptr = clean(s, 1); while (*out) { register char c = *out++; if (c != '\\') { if (!write_char (c)){ free(free_ptr); return 0; } continue; } c = *out++; switch (c) { case 'd': sleep(1); break; case 'K': break_sequence(); break; case 'p': #if 0 /* FIXME!!! */ usleep(10000); /* 1/100th of a second (arg is microseconds) */ #else sleep(1); #endif break; default: if (!write_char (c)){ free(free_ptr); return 0; } break; } } free(free_ptr); return (1); }
int put_string(char *s) { quiet = 0; s = clean(s, 1); if (verbose) chat_logf("send (%v)", quiet ? "??????" : s); alarm(timeout); alarmed = 0; while (*s) { char c = *s++; if (c != '\\') { if (!write_char (c)) return 0; continue; } c = *s++; switch (c) { case 'd': sleep(1); break; case 'K': break_sequence(); break; case 'p': usleep(10000); /* 1/100th of a second (arg is microseconds) */ break; default: if (!write_char (c)) return 0; break; } } alarm(0); alarmed = 0; return (1); }