#include #include #include #include int main() { FILE *stream; char buffer[LINE_MAX]; int run; int empty(char*); if ((stream = fopen("channel", "r+"))) run = 1; else { run = 0; perror("!.!..blad otwarcia lacza..!.!"); } while (run) { bzero((void*)buffer,LINE_MAX); fgets(buffer,LINE_MAX,stdin); if (!empty(buffer)) { fprintf(stream, "%s\n", buffer); fflush(stream); } else { fclose(stream); break; } fgets(buffer,LINE_MAX,stream); if (!empty(buffer)) { fprintf(stdout, "%s\n",buffer ); fflush(stream); } } return 0; } int empty(char * string) { while (*string) { if (isalnum(*string++)) { return 0; } } return 1; }