libexplain  1.4.D001
libexplain/buffer/termio_baud.c
Go to the documentation of this file.
00001 /*
00002  * libexplain - Explain errno values returned by libc functions
00003  * Copyright (C) 2009, 2013 Peter Miller
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU Lesser General Public License as
00007  * published by the Free Software Foundation; either version 3 of the
00008  * License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Lesser General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Lesser General Public License
00016  * along with this program. If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00019 #include <libexplain/ac/linux/termios.h>
00020 
00021 #include <libexplain/buffer/termio_baud.h>
00022 #include <libexplain/parse_bits.h>
00023 #include <libexplain/sizeof.h>
00024 
00025 
00026 void
00027 explain_buffer_termio_baud(explain_string_buffer_t *sb, int value)
00028 {
00029     static const explain_parse_bits_table_t table[] =
00030     {
00031         { "B0", B0 },
00032         { "B50", B50 },
00033         { "B75", B75 },
00034         { "B110", B110 },
00035         { "B134", B134 },
00036         { "B150", B150 },
00037         { "B200", B200 },
00038         { "B300", B300 },
00039         { "B600", B600 },
00040         { "B1200", B1200 },
00041         { "B1800", B1800 },
00042         { "B2400", B2400 },
00043         { "B4800", B4800 },
00044         { "B9600", B9600 },
00045         { "B19200", B19200 },
00046         { "B38400", B38400 },
00047 #ifdef BOTHER
00048         { "BOTHER", BOTHER },
00049 #endif
00050 #ifdef B57600
00051         { "B57600", B57600 },
00052 #endif
00053 #ifdef B115200
00054         { "B115200", B115200 },
00055 #endif
00056 #ifdef B230400
00057         { "B230400", B230400 },
00058 #endif
00059 #ifdef B460800
00060         { "B460800", B460800 },
00061 #endif
00062 #ifdef B500000
00063         { "B500000", B500000 },
00064 #endif
00065 #ifdef B576000
00066         { "B576000", B576000 },
00067 #endif
00068 #ifdef B921600
00069         { "B921600", B921600 },
00070 #endif
00071 #ifdef B1000000
00072         { "B1000000", B1000000 },
00073 #endif
00074 #ifdef B1152000
00075         { "B1152000", B1152000 },
00076 #endif
00077 #ifdef B1500000
00078         { "B1500000", B1500000 },
00079 #endif
00080 #ifdef B2000000
00081         { "B2000000", B2000000 },
00082 #endif
00083 #ifdef B2500000
00084         { "B2500000", B2500000 },
00085 #endif
00086 #ifdef B3000000
00087         { "B3000000", B3000000 },
00088 #endif
00089 #ifdef B3500000
00090         { "B3500000", B3500000 },
00091 #endif
00092 #ifdef B4000000
00093         { "B4000000", B4000000 },
00094 #endif
00095     };
00096 
00097     explain_parse_bits_print_single(sb, value, table, SIZEOF(table));
00098 }
00099 
00100 
00101 /* vim: set ts=8 sw=4 et : */