home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.os.vms:17830 comp.lang.c:16374
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wupost!gumby!yale!yale.edu!ira.uka.de!ira.uka.de!gmd.de!Germany.EU.net!mcsun!sunic!seunet!front.se!samuel
- From: samuel@front.se
- Newsgroups: comp.os.vms,comp.lang.c
- Subject: Getting terminal width from VAX-C ?
- Message-ID: <1992Nov11.101009.87@front.se>
- Date: 11 Nov 92 10:10:09 MET
- Keywords: terminal_width
- Distribution: world
- Organization: Samuel Gustaf Siren
- Lines: 26
-
- Hello
- Does anybody out there know how to get the TERMINAL WIDTH from VAX-C ?
- I'm implementing in VAX-C on VMS 5.4.
- What I'm trying to do is the following :
-
- width = terminal_width(); /* Get terminal width */
- sprintf(buf,"...",...); /* Write data into buffer */
- if (strlen(buf) > width) /* Buffer too long ? */
- strcpy(buf+width-3,"..."); /* ==> 'Truncate' buffer */
- printf("%s\n",buf); /* Write [truncated] data to terminal */
-
- How do I implement the function "terminal_width()" ?
-
- thanx
- /SS
-
- +----------------------+--------------------------------------+
- | | / \ |
- | Samuel Gustaf Siren | __!_/_ |
- | SAMUEL@front.se | / \ | / \ |
- | | |/ || | \__oW)---------- |
- | All opinions and | !! / /\ \ |
- | questions are my | / / \ \ |
- | own /SS | // // |
- | | /| (( |
- +----------------------+--------------------------------------+
-