Mercurial > hg > xemacs-beta
view src/console-tty.h @ 4844:91b3d00e717f
Various cleanups for Dynarr code, from Unicode-internal ws
dynarr.c: Add comment explaining Dynarr_largest() use.
dynarr.c: In Dynarr_insert_many(), don't call Dynarr_resize() unless we
actually need to resize, and note that an assert() that we are
inserting at or below the current end could be wrong if code
wants to access stuff between `len' and `largest'.
dynarr.c: Don't just Dynarr_resize() to the right size; instead use
Dynarr_reset() then Dynarr_add_many(), so that the 'len' and
'largest' and such get set properly.
dynarr.c, faces.c, gutter.c, lisp.h, lread.c, lrecord.h, redisplay-output.c, redisplay.c: Rename Dynarr member 'cur' to 'len' since it's the length of
the dynarr, not really a pointer to a "current insertion point".
Use type_checking_assert() instead of just assert() in some places.
Add additional assertions (Dynarr_verify*()) to check that we're
being given positions within range. Use them in Dynarr_at,
Dynarr_atp, etc. New Dynarr_atp_allow_end() for retrieving a
pointer to a position that might be the element past the last one.
New Dynarr_past_lastp() to retrieve a pointer to the position
past the last one, using Dynarr_atp_allow_end(). Change code
appropriately to use it.
Rename Dynarr_end() to Dynarr_lastp() (pointer to the last
element) for clarity, and change code appropriately to use it.
Change code appropriately to use Dynarr_begin().
Rewrite Dynarr_add_many(). New version can accept a NULL pointer
to mean "reserve space but don't put anything in it". Used by
stack_like_malloc().
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 13 Jan 2010 04:07:42 -0600 |
parents | e22b0213b713 |
children | 8b2f75cecb89 |
line wrap: on
line source
/* Define TTY specific console, device, and frame object for XEmacs. Copyright (C) 1995 Board of Trustees, University of Illinois. Copyright (C) 1996, 2002 Ben Wing. This file is part of XEmacs. XEmacs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. XEmacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with XEmacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Synched up with: Not in FSF. */ /* Written by Chuck Thompson and Ben Wing. */ /* NOTE: Currently each TTY console can have only one device. Therefore, all stuff for both input and output is lumped into the console structure. If it ever becomes meaningful to have more than one device on a TTY console, the output stuff will have to get separated out. */ #ifndef INCLUDED_console_tty_h_ #define INCLUDED_console_tty_h_ #include "console.h" #include "systty.h" extern FILE *termscript; EXFUN (Fconsole_tty_controlling_process, 1); /****************** Prototypes from cm.c *******************/ /* #### Verify that all of these are still needed. */ void cm_cost_init (struct console *c); void cmputc (int c); void cmgoto (struct frame *f, int row, int col); extern struct console *cmputc_console; void send_string_to_tty_console (struct console *c, unsigned char *str, int len); /*************** Prototypes from console-tty.c ****************/ extern const struct sized_memory_description tty_console_data_description; /*************** Prototypes from objects-tty.c ****************/ extern const struct sized_memory_description tty_color_instance_data_description; extern const struct sized_memory_description tty_font_instance_data_description; /*************** Prototypes from redisplay-tty.c ****************/ enum term_init_status { TTY_UNABLE_OPEN_DATABASE, TTY_TYPE_UNDEFINED, TTY_TYPE_INSUFFICIENT, TTY_SIZE_UNSPECIFIED, TTY_INIT_SUCCESS }; int init_tty_for_redisplay (struct device *d, char *terminal_type); /* #### These should probably be methods. */ void set_tty_modes (struct console *c); void reset_tty_modes (struct console *c); /* Used in sysdep.c to properly clear and position the cursor when exiting. */ void tty_redisplay_shutdown (struct console *c); /* called from console-stream.c */ Lisp_Object tty_semi_canonicalize_console_connection (Lisp_Object connection, Error_Behavior errb); Lisp_Object tty_canonicalize_console_connection (Lisp_Object connection, Error_Behavior errb); Lisp_Object tty_semi_canonicalize_device_connection (Lisp_Object connection, Error_Behavior errb); Lisp_Object tty_canonicalize_device_connection (Lisp_Object connection, Error_Behavior errb); #endif /* INCLUDED_console_tty_h_ */