Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

input_common.c File Reference

Implementation file for the low level input library. More...

#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <wchar.h>
#include <sys/select.h>
#include "fallback.h"
#include "util.h"
#include "common.h"
#include "wutil.h"
#include "input_common.h"
#include "env_universal.h"

Defines

#define WAIT_ON_ESCAPE   10
 Time in milliseconds to wait for another byte to be available for reading after is read before assuming that escape key was pressed, and not an escape sequence.

Functions

void input_common_init (int(*ih)())
 Init the library.
void input_common_destroy ()
 Free memory used by the library.
static wint_t readb ()
 Internal function used by input_common_readch to read one byte from fd 1.
wchar_t input_common_readch (int timed)
 Function used by input_readch to read bytes from stdin until enough bytes have been read to convert them to a wchar_t.
void input_common_unreadch (wint_t ch)
 Push a character or a readline function onto the stack of unread characters that input_readch will return before actually reading from fd 0.

Variables

static wint_t lookahead_arr [1024]
 Characters that have been read and returned by the sequence matching code.
static int lookahead_count = 0
 Number of entries in lookahead_arr.
static int(* interrupt_handler )()
 Callback function for handling interrupts on reading.


Detailed Description

Implementation file for the low level input library.


Function Documentation

wchar_t input_common_readch int  timed  ) 
 

Function used by input_readch to read bytes from stdin until enough bytes have been read to convert them to a wchar_t.

Conversion is done using mbrtowc. If a character has previously been read and then 'unread' using input_common_unreadch, that character is returned. If timed is true, readch2 will wait at most WAIT_ON_ESCAPE milliseconds for a character to be available for reading before returning with the value WEOF.

static wint_t readb  )  [static]
 

Internal function used by input_common_readch to read one byte from fd 1.

This function should only be called by input_common_readch().


Generated on Sun Jan 13 02:52:55 2008 for fish by  doxygen 1.4.4