TTY: switch tty_insert_flip_char
[deliverable/linux.git] / include / linux / tty_flip.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_TTY_FLIP_H
2#define _LINUX_TTY_FLIP_H
3
227434f8 4extern int tty_buffer_request_room(struct tty_port *port, size_t size);
2f693357
JS
5extern int tty_insert_flip_string_flags(struct tty_port *port,
6 const unsigned char *chars, const char *flags, size_t size);
7extern int tty_insert_flip_string_fixed_flag(struct tty_port *port,
8 const unsigned char *chars, char flag, size_t size);
9extern int tty_prepare_flip_string(struct tty_port *port,
10 unsigned char **chars, size_t size);
11extern int tty_prepare_flip_string_flags(struct tty_port *port,
12 unsigned char **chars, char **flags, size_t size);
e1a25090 13void tty_schedule_flip(struct tty_struct *tty);
33f0f88f 14
92a19f9c 15static inline int tty_insert_flip_char(struct tty_port *port,
e1a25090 16 unsigned char ch, char flag)
1da177e4 17{
92a19f9c 18 struct tty_buffer *tb = port->buf.tail;
33b37a33 19 if (tb && tb->used < tb->size) {
33f0f88f
AC
20 tb->flag_buf_ptr[tb->used] = flag;
21 tb->char_buf_ptr[tb->used++] = ch;
22 return 1;
1da177e4 23 }
92a19f9c 24 return tty_insert_flip_string_flags(port, &ch, &flag, 1);
1da177e4
LT
25}
26
2832fc11
AC
27static inline int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars, size_t size)
28{
2f693357 29 return tty_insert_flip_string_fixed_flag(tty->port, chars, TTY_NORMAL, size);
2832fc11
AC
30}
31
1da177e4 32#endif /* _LINUX_TTY_FLIP_H */
This page took 1.076412 seconds and 5 git commands to generate.