ReactOS  0.4.14-dev-822-g065afd9
conio.h File Reference
#include "rect.h"
#include "conio_winsrv.h"
Include dependency graph for conio.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _CONSOLE_IO_OBJECT
 
struct  _CONSOLE_SCREEN_BUFFER_VTBL
 
struct  _CONSOLE_SCREEN_BUFFER
 
struct  _TEXTMODE_BUFFER_INFO
 
struct  _TEXTMODE_SCREEN_BUFFER
 
struct  _GRAPHICS_BUFFER_INFO
 
struct  _GRAPHICS_SCREEN_BUFFER
 
struct  _CONSOLE_INPUT_BUFFER
 
struct  _CONSOLE_INFO
 
struct  _TERMINAL_VTBL
 
struct  _TERMINAL
 
struct  _CONSOLE
 

Macros

#define _CONSRV_CONSOLE   _CONSOLE
 
#define CONSRV_CONSOLE   CONSOLE
 
#define PCONSRV_CONSOLE   PCONSOLE
 
#define DEFAULT_SCREEN_ATTRIB   (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)
 
#define DEFAULT_POPUP_ATTRIB
 
#define GetType(This)   (This)->Vtbl->GetType(This)
 
#define GetConsoleInputBufferMode(Console)   (Console)->InputBuffer.Mode
 

Typedefs

typedef enum _CONSOLE_IO_OBJECT_TYPE CONSOLE_IO_OBJECT_TYPE
 
typedef struct _CONSOLE_IO_OBJECT CONSOLE_IO_OBJECT
 
typedef struct _CONSOLE_IO_OBJECTPCONSOLE_IO_OBJECT
 
typedef struct _CONSOLE_SCREEN_BUFFER CONSOLE_SCREEN_BUFFER
 
typedef struct _CONSOLE_SCREEN_BUFFERPCONSOLE_SCREEN_BUFFER
 
typedef struct _CONSOLE_SCREEN_BUFFER_VTBL CONSOLE_SCREEN_BUFFER_VTBL
 
typedef struct _CONSOLE_SCREEN_BUFFER_VTBLPCONSOLE_SCREEN_BUFFER_VTBL
 
typedef struct _TEXTMODE_BUFFER_INFO TEXTMODE_BUFFER_INFO
 
typedef struct _TEXTMODE_BUFFER_INFOPTEXTMODE_BUFFER_INFO
 
typedef struct _TEXTMODE_SCREEN_BUFFER TEXTMODE_SCREEN_BUFFER
 
typedef struct _TEXTMODE_SCREEN_BUFFERPTEXTMODE_SCREEN_BUFFER
 
typedef struct _GRAPHICS_BUFFER_INFO GRAPHICS_BUFFER_INFO
 
typedef struct _GRAPHICS_BUFFER_INFOPGRAPHICS_BUFFER_INFO
 
typedef struct _GRAPHICS_SCREEN_BUFFER GRAPHICS_SCREEN_BUFFER
 
typedef struct _GRAPHICS_SCREEN_BUFFERPGRAPHICS_SCREEN_BUFFER
 
typedef struct _CONSOLE_INPUT_BUFFER CONSOLE_INPUT_BUFFER
 
typedef struct _CONSOLE_INPUT_BUFFERPCONSOLE_INPUT_BUFFER
 
typedef struct _TERMINAL TERMINAL
 
typedef struct _TERMINALPTERMINAL
 
typedef struct _CONSOLE_INFO CONSOLE_INFO
 
typedef struct _CONSOLE_INFOPCONSOLE_INFO
 
typedef struct _TERMINAL_VTBL TERMINAL_VTBL
 
typedef struct _TERMINAL_VTBLPTERMINAL_VTBL
 
typedef enum _CONSOLE_STATE CONSOLE_STATE
 
typedef enum _CONSOLE_STATEPCONSOLE_STATE
 
typedef struct _CONSOLEPCONSOLE
 
typedef struct _CONSOLE CONSOLE
 

Enumerations

enum  _CONSOLE_IO_OBJECT_TYPE {
  UNKNOWN = 0x00, TEXTMODE_BUFFER = 0x01, GRAPHICS_BUFFER = 0x02, SCREEN_BUFFER = 0x03,
  INPUT_BUFFER = 0x04, ANY_TYPE_BUFFER = 0x07, TEXTMODE_BUFFER = 0x01, GRAPHICS_BUFFER = 0x02,
  SCREEN_BUFFER = 0x03, INPUT_BUFFER = 0x04
}
 
enum  _CONSOLE_STATE {
  CONSOLE_INITIALIZING, CONSOLE_RUNNING, CONSOLE_TERMINATING, CONSOLE_IN_DESTRUCTION,
  CONSOLE_INITIALIZING, CONSOLE_RUNNING, CONSOLE_TERMINATING, CONSOLE_IN_DESTRUCTION
}
 

Functions

VOID NTAPI ConDrvPause (PCONSOLE Console)
 
VOID NTAPI ConDrvUnpause (PCONSOLE Console)
 
NTSTATUS ConSrvConsoleCtrlEvent (IN ULONG CtrlEvent, IN PCONSOLE_PROCESS_DATA ProcessData)
 
PCHAR_INFO ConioCoordToPointer (PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y)
 
NTSTATUS ConioResizeBuffer (PCONSOLE Console, PTEXTMODE_SCREEN_BUFFER ScreenBuffer, COORD Size)
 
int mk_wcwidth_cjk (wchar_t ucs)
 

Macro Definition Documentation

◆ _CONSRV_CONSOLE

#define _CONSRV_CONSOLE   _CONSOLE

Definition at line 25 of file conio.h.

◆ CONSRV_CONSOLE

#define CONSRV_CONSOLE   CONSOLE

Definition at line 26 of file conio.h.

◆ DEFAULT_POPUP_ATTRIB

#define DEFAULT_POPUP_ATTRIB
Value:
#define BACKGROUND_RED
Definition: blue.h:67
#define BACKGROUND_INTENSITY
Definition: blue.h:68
#define FOREGROUND_RED
Definition: blue.h:63
#define BACKGROUND_GREEN
Definition: blue.h:66
#define FOREGROUND_BLUE
Definition: blue.h:61

Definition at line 33 of file conio.h.

◆ DEFAULT_SCREEN_ATTRIB

#define DEFAULT_SCREEN_ATTRIB   (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED)

Definition at line 32 of file conio.h.

◆ GetConsoleInputBufferMode

#define GetConsoleInputBufferMode (   Console)    (Console)->InputBuffer.Mode

Definition at line 362 of file conio.h.

◆ GetType

#define GetType (   This)    (This)->Vtbl->GetType(This)

Definition at line 78 of file conio.h.

◆ PCONSRV_CONSOLE

#define PCONSRV_CONSOLE   PCONSOLE

Definition at line 27 of file conio.h.

Typedef Documentation

◆ CONSOLE

◆ CONSOLE_INFO

◆ CONSOLE_INPUT_BUFFER

◆ CONSOLE_IO_OBJECT

◆ CONSOLE_IO_OBJECT_TYPE

◆ CONSOLE_SCREEN_BUFFER

Definition at line 70 of file conio.h.

◆ CONSOLE_SCREEN_BUFFER_VTBL

◆ CONSOLE_STATE

◆ GRAPHICS_BUFFER_INFO

◆ GRAPHICS_SCREEN_BUFFER

◆ PCONSOLE

Definition at line 312 of file conio.h.

◆ PCONSOLE_INFO

◆ PCONSOLE_INPUT_BUFFER

◆ PCONSOLE_IO_OBJECT

◆ PCONSOLE_SCREEN_BUFFER

Definition at line 70 of file conio.h.

◆ PCONSOLE_SCREEN_BUFFER_VTBL

◆ PCONSOLE_STATE

◆ PGRAPHICS_BUFFER_INFO

◆ PGRAPHICS_SCREEN_BUFFER

◆ PTERMINAL

Definition at line 200 of file conio.h.

◆ PTERMINAL_VTBL

◆ PTEXTMODE_BUFFER_INFO

◆ PTEXTMODE_SCREEN_BUFFER

◆ TERMINAL

Definition at line 200 of file conio.h.

◆ TERMINAL_VTBL

◆ TEXTMODE_BUFFER_INFO

◆ TEXTMODE_SCREEN_BUFFER

Enumeration Type Documentation

◆ _CONSOLE_IO_OBJECT_TYPE

Enumerator
UNKNOWN 
TEXTMODE_BUFFER 
GRAPHICS_BUFFER 
SCREEN_BUFFER 
INPUT_BUFFER 
ANY_TYPE_BUFFER 
TEXTMODE_BUFFER 
GRAPHICS_BUFFER 
SCREEN_BUFFER 
INPUT_BUFFER 

Definition at line 38 of file conio.h.

39 {
40  UNKNOWN = 0x00, // --> Unknown object
41  TEXTMODE_BUFFER = 0x01, // --> Output-type object for text SBs
42  GRAPHICS_BUFFER = 0x02, // --> Output-type object for graphics SBs
43  SCREEN_BUFFER = 0x03, // --> Any SB type
44  INPUT_BUFFER = 0x04, // --> Input-type object
45  ANY_TYPE_BUFFER = 0x07, // --> Any IO object
enum _CONSOLE_IO_OBJECT_TYPE CONSOLE_IO_OBJECT_TYPE

◆ _CONSOLE_STATE

Enumerator
CONSOLE_INITIALIZING 
CONSOLE_RUNNING 
CONSOLE_TERMINATING 
CONSOLE_IN_DESTRUCTION 
CONSOLE_INITIALIZING 
CONSOLE_RUNNING 
CONSOLE_TERMINATING 
CONSOLE_IN_DESTRUCTION 

Definition at line 302 of file conio.h.

303 {
304  CONSOLE_INITIALIZING, /* Console is initializing */
305  CONSOLE_RUNNING , /* Console running */
306  CONSOLE_TERMINATING , /* Console about to be destroyed (but still not) */
307  CONSOLE_IN_DESTRUCTION /* Console in destruction */
enum _CONSOLE_STATE * PCONSOLE_STATE
enum _CONSOLE_STATE CONSOLE_STATE

Function Documentation

◆ ConDrvPause()

VOID NTAPI ConDrvPause ( PCONSOLE  Console)

Definition at line 80 of file console.c.

81 {
82  /* In case we already have a pause event, just exit... */
83  if (Console->UnpauseEvent) return;
84 
85  /* ... otherwise create it */
86  NtCreateEvent(&Console->UnpauseEvent, EVENT_ALL_ACCESS,
88 }
NTSTATUS NTAPI NtCreateEvent(OUT PHANDLE EventHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN EVENT_TYPE EventType, IN BOOLEAN InitialState)
Definition: event.c:100
#define EVENT_ALL_ACCESS
Definition: isotest.c:82
smooth NULL
Definition: ftsmooth.c:416
CConsole Console

Referenced by ConioPause().

◆ ConDrvUnpause()

VOID NTAPI ConDrvUnpause ( PCONSOLE  Console)

Definition at line 91 of file console.c.

92 {
93  /* In case we already freed the event, just exit... */
94  if (!Console->UnpauseEvent) return;
95 
96  /* ... otherwise set and free it */
97  NtSetEvent(Console->UnpauseEvent, NULL);
98  NtClose(Console->UnpauseEvent);
99  Console->UnpauseEvent = NULL;
100 }
smooth NULL
Definition: ftsmooth.c:416
NTSTATUS NTAPI NtSetEvent(IN HANDLE EventHandle, OUT PLONG PreviousState OPTIONAL)
Definition: event.c:458
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3399
CConsole Console

Referenced by ConioUnpause().

◆ ConioCoordToPointer()

PCHAR_INFO ConioCoordToPointer ( PTEXTMODE_SCREEN_BUFFER  Buff,
ULONG  X,
ULONG  Y 
)

Definition at line 142 of file text.c.

143 {
144  return &Buff->Buffer[((Y + Buff->VirtualY) % Buff->ScreenBufferSize.Y) * Buff->ScreenBufferSize.X + X];
145 }
#define Y(I)
PCHAR_INFO Buffer
Definition: conio.h:154
#define X(b, s)

◆ ConioResizeBuffer()

NTSTATUS ConioResizeBuffer ( PCONSOLE  Console,
PTEXTMODE_SCREEN_BUFFER  ScreenBuffer,
COORD  Size 
)

Definition at line 259 of file text.c.

262 {
264  DWORD Offset = 0;
265  PCHAR_INFO ptr;
266  WORD CurrentAttribute;
267  USHORT CurrentY;
268  PCHAR_INFO OldBuffer;
269  DWORD i;
270  DWORD diff;
271 
272  /* Buffer size is not allowed to be smaller than the view size */
273  if (Size.X < ScreenBuffer->ViewSize.X || Size.Y < ScreenBuffer->ViewSize.Y)
275 
276  if (Size.X == ScreenBuffer->ScreenBufferSize.X && Size.Y == ScreenBuffer->ScreenBufferSize.Y)
277  {
278  // FIXME: Trigger a buffer resize event ??
279  return STATUS_SUCCESS;
280  }
281 
282  if (Console->FixedSize)
283  {
284  /*
285  * The console is in fixed-size mode, so we cannot resize anything
286  * at the moment. However, keep those settings somewhere so that
287  * we can try to set them up when we will be allowed to do so.
288  */
289  ScreenBuffer->OldScreenBufferSize = Size;
290  return STATUS_NOT_SUPPORTED; // STATUS_SUCCESS
291  }
292 
294  if (!Buffer) return STATUS_NO_MEMORY;
295 
296  DPRINT("Resizing (%d,%d) to (%d,%d)\n", ScreenBuffer->ScreenBufferSize.X, ScreenBuffer->ScreenBufferSize.Y, Size.X, Size.Y);
297  OldBuffer = ScreenBuffer->Buffer;
298 
299  for (CurrentY = 0; CurrentY < ScreenBuffer->ScreenBufferSize.Y && CurrentY < Size.Y; CurrentY++)
300  {
301  ptr = ConioCoordToPointer(ScreenBuffer, 0, CurrentY);
302  if (Size.X <= ScreenBuffer->ScreenBufferSize.X)
303  {
304  /* Reduce size */
305  RtlCopyMemory(Buffer + Offset, ptr, Size.X * sizeof(CHAR_INFO));
306  Offset += Size.X;
307  }
308  else
309  {
310  /* Enlarge size */
311  RtlCopyMemory(Buffer + Offset, ptr, ScreenBuffer->ScreenBufferSize.X * sizeof(CHAR_INFO));
312  Offset += ScreenBuffer->ScreenBufferSize.X;
313 
314  /* The attribute to be used is the one of the last cell of the current line */
315  CurrentAttribute = ConioCoordToPointer(ScreenBuffer,
316  ScreenBuffer->ScreenBufferSize.X - 1,
317  CurrentY)->Attributes;
318 
319  diff = Size.X - ScreenBuffer->ScreenBufferSize.X;
320 
321  /* Zero-out the new part of the buffer */
322  for (i = 0; i < diff; i++)
323  {
324  ptr = Buffer + Offset;
325  ptr->Char.UnicodeChar = L' ';
326  ptr->Attributes = CurrentAttribute;
327  ++Offset;
328  }
329  }
330  }
331 
332  if (Size.Y > ScreenBuffer->ScreenBufferSize.Y)
333  {
334  diff = Size.X * (Size.Y - ScreenBuffer->ScreenBufferSize.Y);
335 
336  /* Zero-out the new part of the buffer */
337  for (i = 0; i < diff; i++)
338  {
339  ptr = Buffer + Offset;
340  ptr->Char.UnicodeChar = L' ';
341  ptr->Attributes = ScreenBuffer->ScreenDefaultAttrib;
342  ++Offset;
343  }
344  }
345 
347  ConsoleFreeHeap(OldBuffer);
348  ScreenBuffer->ScreenBufferSize = ScreenBuffer->OldScreenBufferSize = Size;
349  ScreenBuffer->VirtualY = 0;
350 
351  /* Ensure cursor and window are within buffer */
352  if (ScreenBuffer->CursorPosition.X >= Size.X)
353  ScreenBuffer->CursorPosition.X = Size.X - 1;
354  if (ScreenBuffer->CursorPosition.Y >= Size.Y)
355  ScreenBuffer->CursorPosition.Y = Size.Y - 1;
356  if (ScreenBuffer->ViewOrigin.X > Size.X - ScreenBuffer->ViewSize.X)
357  ScreenBuffer->ViewOrigin.X = Size.X - ScreenBuffer->ViewSize.X;
358  if (ScreenBuffer->ViewOrigin.Y > Size.Y - ScreenBuffer->ViewSize.Y)
359  ScreenBuffer->ViewOrigin.Y = Size.Y - ScreenBuffer->ViewSize.Y;
360 
361  /*
362  * Trigger a buffer resize event
363  */
364  if (Console->InputBuffer.Mode & ENABLE_WINDOW_INPUT)
365  {
366  ULONG NumEventsWritten;
367  INPUT_RECORD er;
368 
370  er.Event.WindowBufferSizeEvent.dwSize = ScreenBuffer->ScreenBufferSize;
371 
372  // ConioProcessInputEvent(Console, &er);
374  &Console->InputBuffer,
375  TRUE,
376  &er,
377  1,
378  &NumEventsWritten);
379  }
380 
381  return STATUS_SUCCESS;
382 }
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
PCHAR_INFO ConioCoordToPointer(PTEXTMODE_SCREEN_BUFFER Buff, ULONG X, ULONG Y)
Definition: text.c:142
#define WINDOW_BUFFER_SIZE_EVENT
Definition: wincon.h:124
#define ConsoleAllocHeap(Flags, Size)
Definition: heap.h:14
WINDOW_BUFFER_SIZE_RECORD WindowBufferSizeEvent
Definition: wincon.h:265
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
static PVOID ptr
Definition: dispmode.c:27
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
#define InterlockedExchangePointer(Target, Value)
Definition: dshow.h:45
WORD Attributes
Definition: wincon.h:172
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define ENABLE_WINDOW_INPUT
Definition: wincon.h:78
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
NTSTATUS NTAPI ConDrvWriteConsoleInput(IN PCONSOLE Console, IN PCONSOLE_INPUT_BUFFER InputBuffer, IN BOOLEAN AppendToEnd, IN PINPUT_RECORD InputRecord, IN ULONG NumEventsToWrite, OUT PULONG NumEventsWritten OPTIONAL)
Definition: coninput.c:325
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
CConsole Console
WORD EventType
Definition: wincon.h:261
#define ConsoleFreeHeap(HeapBase)
Definition: heap.h:15
HANDLE ScreenBuffer
Definition: notevil.c:37
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
unsigned int ULONG
Definition: retypes.h:1
union _INPUT_RECORD::@3173 Event
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ ConSrvConsoleCtrlEvent()

NTSTATUS ConSrvConsoleCtrlEvent ( IN ULONG  CtrlEvent,
IN PCONSOLE_PROCESS_DATA  ProcessData 
)

Definition at line 860 of file console.c.

862 {
863  return ConSrvConsoleCtrlEventTimeout(CtrlEvent, ProcessData, 0);
864 }
NTSTATUS ConSrvConsoleCtrlEventTimeout(IN ULONG CtrlEvent, IN PCONSOLE_PROCESS_DATA ProcessData, IN ULONG Timeout)
Definition: console.c:809

◆ mk_wcwidth_cjk()

int mk_wcwidth_cjk ( wchar_t  ucs)

Definition at line 230 of file wcwidth.c.

231 {
232  /* sorted list of non-overlapping intervals of East Asian Ambiguous
233  * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */
234  static const struct interval ambiguous[] = {
235  { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 },
236  { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 },
237  { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 },
238  { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 },
239  { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED },
240  { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA },
241  { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 },
242  { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B },
243  { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 },
244  { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 },
245  { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 },
246  { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE },
247  { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 },
248  { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA },
249  { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 },
250  { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB },
251  { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB },
252  { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 },
253  { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 },
254  { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 },
255  { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 },
256  { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 },
257  { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 },
258  { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 },
259  { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC },
260  { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 },
261  { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 },
262  { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 },
263  { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 },
264  { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, { 0x21D2, 0x21D2 },
265  { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 },
266  { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220B, 0x220B },
267  { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 },
268  { 0x221A, 0x221A }, { 0x221D, 0x2220 }, { 0x2223, 0x2223 },
269  { 0x2225, 0x2225 }, { 0x2227, 0x222C }, { 0x222E, 0x222E },
270  { 0x2234, 0x2237 }, { 0x223C, 0x223D }, { 0x2248, 0x2248 },
271  { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 },
272  { 0x2264, 0x2267 }, { 0x226A, 0x226B }, { 0x226E, 0x226F },
273  { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 },
274  { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF },
275  { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, { 0x24EB, 0x254B },
276  { 0x2550, 0x2573 }, { 0x2580, 0x258F }, { 0x2592, 0x2595 },
277  { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, { 0x25B2, 0x25B3 },
278  { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, { 0x25C0, 0x25C1 },
279  { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, { 0x25CE, 0x25D1 },
280  { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, { 0x2605, 0x2606 },
281  { 0x2609, 0x2609 }, { 0x260E, 0x260F }, { 0x2614, 0x2615 },
282  { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 },
283  { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 },
284  { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F },
285  { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0xE000, 0xF8FF },
286  { 0xFFFD, 0xFFFD }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD }
287  };
288 
289  /* binary search in table of non-spacing characters */
290  if (bisearch(ucs, ambiguous,
291  sizeof(ambiguous) / sizeof(struct interval) - 1))
292  return 2;
293 
294  return mk_wcwidth(ucs);
295 }
int mk_wcwidth(wchar_t ucs)
Definition: wcwidth.c:122
static int bisearch(wchar_t ucs, const struct interval *table, int max)
Definition: wcwidth.c:70

Referenced by ConDrvFillConsoleOutput(), ConioWriteConsole(), IntWriteConsoleOutputStringUnicode(), and mk_wcswidth_cjk().