Changeset af028338 in rtems


Ignore:
Timestamp:
Oct 25, 2005, 2:18:00 PM (14 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
79061679
Parents:
5b09777
Message:

Make many functions static.

Rename rtems_telnetd_maximum_ptys to rtems_pty_maximum_ptys.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/telnetd/pty.c

    r5b09777 raf028338  
    5858
    5959
    60 int ptys_initted=FALSE;
    61 pty_t *ptys;
    62 int rtems_telnetd_maximum_ptys;
    63 
    64 /* This procedure returns the devname for a pty slot free.
    65  * If not slot availiable (field socket>=0)
    66  *  then the socket argument is closed
    67  */
    68 
    69 char *  get_pty(int socket) {
     60static int ptys_initted=FALSE;
     61static pty_t *ptys;
     62
     63size_t rtems_pty_maximum_ptys;
     64
     65/* This procedure returns the devname for a free pty slot.
     66 * If no slot available (field socket>=0)
     67 * then the socket argument is closed
     68 */
     69
     70char *  rtems_pty_get(int socket) {
    7071        int ndx;
    7172        if (!ptys_initted) return NULL;
    72         for (ndx=0;ndx<rtems_telnetd_maximum_ptys;ndx++) {
     73        for (ndx=0;ndx<rtems_pty_maximum_ptys;ndx++) {
    7374                if (ptys[ndx].socket<0) {
    7475                        ptys[ndx].socket=socket;
     
    8889 *
    8990 */
    90 const char IAC_AYT_RSP[]="\r\nAYT? Yes, RTEMS-SHELL is here\r\n";
    91 const char IAC_BRK_RSP[]="<*Break*>";
    92 const char IAC_IP_RSP []="<*Interrupt*>";
     91static const char IAC_AYT_RSP[]="\r\nAYT? Yes, RTEMS-SHELL is here\r\n";
     92static const char IAC_BRK_RSP[]="<*Break*>";
     93static const char IAC_IP_RSP []="<*Interrupt*>";
    9394
    9495
     
    198199static int ptyPollWrite(int minor, const char * buf,int len) ;
    199200static int ptyPollRead(int minor) ;
    200 const rtems_termios_callbacks * pty_get_termios_handlers(int polled) ;
     201static const rtems_termios_callbacks * pty_get_termios_handlers(int polled) ;
    201202/*-----------------------------------------------------------*/
    202203/* Set the 'Hardware'                                        */
     
    204205static int
    205206ptySetAttributes(int minor,const struct termios *t) {
    206         if (minor<rtems_telnetd_maximum_ptys) {
     207        if (minor<rtems_pty_maximum_ptys) {     
    207208         ptys[minor].c_cflag=t->c_cflag;       
    208209        } else {
     
    216217        rtems_libio_open_close_args_t * args = arg;
    217218        struct termios t;
    218         if (minor<rtems_telnetd_maximum_ptys) {
     219        if (minor<rtems_pty_maximum_ptys) {     
    219220         if (ptys[minor].socket<0) return -1;           
    220221         ptys[minor].opened=TRUE;
     
    229230static int
    230231ptyShutdown(int major,int minor,void * arg) {
    231         if (minor<rtems_telnetd_maximum_ptys) {
     232        if (minor<rtems_pty_maximum_ptys) {     
    232233         ptys[minor].opened=FALSE;
    233234         if (ptys[minor].socket>=0) close(ptys[minor].socket);
     
    245246ptyPollWrite(int minor, const char * buf,int len) {
    246247        int count;
    247         if (minor<rtems_telnetd_maximum_ptys) {
     248        if (minor<rtems_pty_maximum_ptys) {     
    248249         if (ptys[minor].socket<0) return -1;           
    249250         count=write(ptys[minor].socket,buf,len);
     
    257258ptyPollRead(int minor) {
    258259        int result;
    259         if (minor<rtems_telnetd_maximum_ptys) {
     260        if (minor<rtems_pty_maximum_ptys) {     
    260261         if (ptys[minor].socket<0) return -1;           
    261262         result=read_pty(minor);
     
    276277};
    277278/*-----------------------------------------------------------*/
    278 const rtems_termios_callbacks * pty_get_termios_handlers(int polled) {
     279static const rtems_termios_callbacks * pty_get_termios_handlers(int polled) {
    279280        return &pty_poll_callbacks;
    280281}
    281282/*-----------------------------------------------------------*/
    282 void init_ptys(void) {
     283static void init_ptys(void) {
    283284        int ndx;
    284         ptys = malloc( sizeof(pty_t) * rtems_telnetd_maximum_ptys );
    285         for (ndx=0;ndx<rtems_telnetd_maximum_ptys;ndx++) {
     285        ptys = malloc( sizeof(pty_t) * rtems_pty_maximum_ptys );
     286        for (ndx=0;ndx<rtems_pty_maximum_ptys;ndx++) {
    286287                ptys[ndx].devname=malloc(strlen("/dev/ptyXX")+1);
    287288                sprintf(ptys[ndx].devname,"/dev/pty%X",ndx);
     
    326327   * Register the devices
    327328   */
    328   for (ndx=0;ndx<rtems_telnetd_maximum_ptys;ndx++) {
     329  for (ndx=0;ndx<rtems_pty_maximum_ptys;ndx++) {
    329330   status = rtems_io_register_name(ptys[ndx].devname, major, ndx);
    330331   if (status != RTEMS_SUCCESSFUL)
     
    334335  };
    335336  printk("Device: /dev/pty%X../dev/pty%X (%d)pseudo-terminals registered.\n",
    336       0,rtems_telnetd_maximum_ptys-1,rtems_telnetd_maximum_ptys);
     337      0,rtems_pty_maximum_ptys-1,rtems_pty_maximum_ptys);
    337338
    338339  return RTEMS_SUCCESSFUL;
Note: See TracChangeset for help on using the changeset viewer.