All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
termio.h & conio.h
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login  |
|
|
termio.h & conio.h - Jan. 14, '03, 2:53:24 PM
|
|
|
WenSBau
Posts: 8
Joined: Oct. 24, '02,
Status: offline
|
The termio.h and conio.h files were not included with SFU would someone please tell me where I can download them.
THANKS!
|
|
|
RE: termio.h & conio.h - Jan. 15, '03, 11:56:54 AM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
You DON" T !!!
The files " termio.h" and " conio.h" are very old header files.
They are not standard files anymore.
There are new standards (well, they' ve been " new" for about 12 or 13 years now). You will need to port the program so that instead of " termio.h" you use " termios.h" and the newer matching API' s. Similar for " conio.h"
- Rodney
|
|
|
RE: termio.h & conio.h - Jan. 15, '03, 12:10:57 PM
|
|
|
WenSBau
Posts: 8
Joined: Oct. 24, '02,
Status: offline
|
OK the issue is that I' m porting some VERY old code and I discovered a solution. I created a header file with the folling contents (see below) and replaced it' s name where ever grep found termio.h.
#include <termios.h>
#include <sys/ioctl>
#define NCC 8
struct termio {
unsigned short c_iflag; //input modes
unsigned short c_oflag; //output modes
unsigned short c_cflag; /control modes
unsigned short c_lflag; //loacl modes
char c_line; //line discipline
unsigned char c_cc[NCC]; //control chars
};
Now the issue is that the gcc compiler can' t seem to locate termios.h or sys/ioctl.h. I know these files exist in /usr/include and /usr/include/sys. How do I get the compiler to find the header files in the paths their located in?
|
|
|
RE: termio.h & conio.h - Jan. 15, '03, 2:19:55 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
FYI:
The include directory " /usr/include" is already, automatically used when you compile. You normally don' t need to add it. The only time you need to add it is when you have specified to the compiler that you do not want the standard include files (" --nostdinc" ).
As for the structure declaration of " struct termio" you made: I hope you know that it does not match a " struct termios" . The program
will compile but you may at some point not get the intended result. Especially when the struct is passed to an API. You have ' unsigned short' s and a " char c_cc" of only 8. Termios uses longs and 22. The memory alignment problem will likely cause an issue.
|
|
|
RE: termio.h & conio.h - Jan. 15, '03, 2:48:44 PM
|
|
|
WenSBau
Posts: 8
Joined: Oct. 24, '02,
Status: offline
|
Yes I realize the structure I posted doesn' t match the one in termios. I posted the original termio struct which, is all I needed (the app included termio.h). Thanks for pointing out the differences I' m sure others will be thankful!
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|