--- rxvt-unicode/src/rxvt.h 2007/12/12 09:33:48 1.329 +++ rxvt-unicode/src/rxvt.h 2007/12/28 11:39:02 1.339 @@ -81,6 +81,19 @@ # define STDERR_FILENO 2 #endif +#if !defined (EACCESS) && defined(EAGAIN) +# define EACCESS EAGAIN +#endif + +#ifndef EXIT_SUCCESS /* missing from */ +# define EXIT_SUCCESS 0 /* exit function success */ +# define EXIT_FAILURE 1 /* exit function failure */ +#endif + +#ifndef PATH_MAX +# define PATH_MAX 16384 +#endif + /****************************************************************************/ // exception thrown on fatal (per-instance) errors @@ -95,9 +108,10 @@ ***************************************************************************** */ // main.C -void * rxvt_malloc (size_t size); -void * rxvt_calloc (size_t number, size_t size); -void * rxvt_realloc (void *ptr, size_t size); +#define SET_LOCALE(locale) rxvt_set_locale (locale) +extern bool rxvt_set_locale (const char *locale) NOTHROW; +extern void rxvt_push_locale (const char *locale) NOTHROW; +extern void rxvt_pop_locale () NOTHROW; // misc.C char * rxvt_wcstombs (const wchar_t *str, int len = -1); @@ -116,13 +130,18 @@ char ** rxvt_splitcommastring (const char *cs) NOTHROW; void rxvt_freecommastring (char **cs) NOTHROW; +void * rxvt_malloc (size_t size); +void * rxvt_calloc (size_t number, size_t size); +void * rxvt_realloc (void *ptr, size_t size); + ///////////////////////////////////////////////////////////////////////////// // temporarily replace the process environment extern char **environ; extern char **rxvt_environ; // the original environ pointer -static inline void set_environ (stringvec *envv) +static inline void +set_environ (stringvec *envv) { #if ENABLE_PERL assert (envv); @@ -132,7 +151,8 @@ environ = (char **)envv->begin (); } -static inline void set_environ (char **envv) +static inline void +set_environ (char **envv) { #if ENABLE_PERL assert (envv); @@ -147,7 +167,6 @@ * STRUCTURES AND TYPEDEFS ***************************************************************************** */ -struct grwin_t; /* If we're using either the rxvt scrollbar, keep the * scrollColor resource. @@ -215,17 +234,6 @@ # define NO_MOUSE_REPORT_SCROLLBAR 1 #endif -/* now look for other badly set stuff */ - -#if !defined (EACCESS) && defined(EAGAIN) -# define EACCESS EAGAIN -#endif - -#ifndef EXIT_SUCCESS /* missing from */ -# define EXIT_SUCCESS 0 /* exit function success */ -# define EXIT_FAILURE 1 /* exit function failure */ -#endif - #define scrollBar_esc 30 #if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR) @@ -597,10 +605,6 @@ #define CBUFSIZ 2048 // size of command buffer #define UBUFSIZ 2048 // character buffer -#ifndef PATH_MAX -# define PATH_MAX 16384 -#endif - #if ENABLE_FRILLS # include typedef struct _mwmhints { @@ -660,9 +664,6 @@ #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) -// for m >= -n, ensure remainder lies between 0..n-1 -#define MOD(m,n) (((m) + (n)) % (n)) - #define LINENO(n) MOD (term_start + int(n), total_rows) #define ROW(n) row_buf [LINENO (n)] @@ -729,11 +730,6 @@ typedef callback log_callback; typedef callback getfd_callback; -#define SET_LOCALE(locale) rxvt_set_locale (locale) -extern bool rxvt_set_locale (const char *locale) NOTHROW; -extern void rxvt_push_locale (const char *locale) NOTHROW; -extern void rxvt_pop_locale () NOTHROW; - /****************************************************************************/ #define LINE_LONGER 0x0001 // line is continued on the next row @@ -745,7 +741,7 @@ struct line_t { text_t *t; // terminal the text rend_t *r; // rendition, uses RS_ flags - tlen_t_ l; // length of each text line, LINE_CONT == continued on next line + tlen_t_ l; // length of each text line uint32_t f; // flags bool is_longer () @@ -798,7 +794,7 @@ #define UNICODE_MASK 0x1fffffUL -#if UNICODE3 +#if UNICODE_3 # define COMPOSE_LO 0x40000000UL # define COMPOSE_HI 0x400fffffUL # define IS_COMPOSE(n) ((int32_t)(n) >= COMPOSE_LO) @@ -1049,9 +1045,9 @@ xevent_watcher rootwin_ev; #endif #ifdef HAVE_BG_PIXMAP - int update_background (); + void update_background (); #if TRACE_PIXMAPS - int trace_update_background (const char *file, int line); + void trace_update_background (const char *file, int line); # define update_background() trace_update_background (__FILE__, __LINE__) #endif void update_background_cb (ev::timer &w, int revents); @@ -1066,8 +1062,8 @@ #endif void child_cb (ev::child &w, int revents); ev::child child_ev; - void prepare_cb (ev::prepare &w, int revents); ev::prepare prepare_ev; void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev; + void refresh_check (); void flush (); void flush_cb (ev::timer &w, int revents); ev::timer flush_ev; bool pty_fill (); @@ -1104,10 +1100,10 @@ void tt_write (const char *data, unsigned int len); void pty_write (); - bool init (stringvec *argv, stringvec *envv) + void init (stringvec *argv, stringvec *envv) { this->argv = argv; - return init (argv->size (), argv->begin (), envv); + init (argv->size (), argv->begin (), envv); } void make_current () const // make this the "currently active" urxvt instance @@ -1192,7 +1188,7 @@ ~rxvt_term (); void destroy (); void emergency_cleanup (); - bool init (int argc, const char *const *argv, stringvec *envv); + void init (int argc, const char *const *argv, stringvec *envv); void recolour_cursor (); void resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent); void window_calc (unsigned int newwidth, unsigned int newheight);