summaryrefslogblamecommitdiffstats
path: root/cpukit/libcsupport/src/termios_num2baud.c
blob: 3725609135e28e815cf5c56b0b3dbf9d3bf6bd91 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                           



                    
                        
                               


                                           
 

                                 



                   


                                                                          

                      
/*
 *  COPYRIGHT (c) 1989-2008.
 *  On-Line Applications Research Corporation (OAR).
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 *
 *  $Id$
 */

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <sys/termios.h>
#include <rtems/termiostypes.h>
#include <rtems/assoc.h>

extern rtems_assoc_t termios_assoc_table[];

int rtems_termios_number_to_baud(
  int32_t baud
)
{
  int termios_baud;

  termios_baud = rtems_assoc_remote_by_local( termios_assoc_table, baud );
  if ( termios_baud == 0 && baud != 0 )
    return -1;
  return termios_baud;
}