/* DocStream.c: Display complete HTML document using IFRAME */ #include #include int main(void) { char ch; char* cookie; cookie = getenv("LTERM_COOKIE"); /* Get security cookie */ if (cookie == NULL) cookie = ""; /* XMLTerm escape sequence signalling start of a HTML document */ printf("\033{1S%s\n", cookie); printf(" \
\ \ Please click a button
\ \ \ \
\ "); /* XMLTerm escape sequence signalling end of stream */ printf("%c", '\0'); while((ch = getchar())){ /* Poll for data generated by button click events */ switch (ch) { case 'b': printf("\033{S%s\nHello World!
%c", cookie, '\0'); break; case 'e': printf("\033{S%s\nHello World!
%c", cookie, '\0'); break; case 'q': return 0; break; default: break; } } return 0; }