1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Defined macros to override tcXXX / cfXXX functions with tc2 equivalent.

They become:

  tcsetattr --> tc2setatter
  tcgetattr --> tc2getattr
  cfsetispeed --> cf2setispeed
  cfgetispeed --> cf2getispeed

Also defined:

  cfsetospeed_custom, cfsetispeed_custom

And

  cfgetospeed_custom, cfgetispeed_custom
This commit is contained in:
Nick Patavalis
2015-08-19 09:39:53 +03:00
parent 2741018a66
commit fa16dbc429

View File

@ -26,10 +26,22 @@
#include <termios.h>
/* Replace termios function, with termios2 functions */
#define tcsetattr tc2setattr
#define tcgetattr tc2getattr
#define cfsetispeed cf2setispeed
#define cfgetispeed cf2getispeed
/* And define these new ones */
#define cfsetospeed_custom cf2setospeed_custom
#define cfsetispeed_custom cf2setispeed_custom
#define cfgetospeed_custom(tiop) ((tiop)->c_ospeed)
#define cfgetispeed_custom(tiop) ((tiop)->c_ispeed)
/* Replacements for the standard tcsetattr(3), tcgetattr(3)
* functions. Same interface, but these use the new termios2 kernel
* interface (new ioctl's) which allow custom baud-rate
* definitions. */
* functions. Same user interface, but these use the new termios2
* kernel interface (new ioctl's) which allow custom baud-rate
* setting. */
int tc2setattr(int fd, int optional_actions, const struct termios *tios);
int tc2getattr(int fd, struct termios *tios);