Logo 
Search:

Networking Articles

Submit Article
Home » Articles » Networking » TCP/IPRSS Feeds

TCP/IP program to print the indicated terminal capability on the given stream

Posted By: Milind Mishra     Category: Networking     Views: 1531

TCP/IP program to print the indicated terminal capability on the given stream.

Code for TCP/IP program to print the indicated terminal capability on the given stream in Networking

#include <newcurses.h>
#include <stdlib.h>
#include <stdio.h>

#define    TBUFSIZE    2048

int    xfputs(char *str, FILE *fp);

int
tcout(char *cap, FILE *tfp)
{
    static init;
    staticchar    *term;
    staticchar    tbuf[TBUFSIZE], buf[TBUFSIZE], *bp = buf;
    char        *sv;

    if (!init) {
        init = 1;
        term = getenv("TERM");
    }
    if (term == 0 || tgetent(&tbuf[0], term) != 1)
        return 0;
    if (sv = tgetstr(cap, &bp)) {
        xfputs(sv, tfp);
        return 1;
    }
    return 0;
}
  
Share: 



Milind Mishra
Milind Mishra author of TCP/IP program to print the indicated terminal capability on the given stream is from India.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!