--- rxvt-unicode/src/misc.C 2006/01/16 16:19:19 1.34 +++ rxvt-unicode/src/misc.C 2006/01/21 23:50:33 1.37 @@ -165,13 +165,7 @@ } char * -rxvt_strdup (const char *str) -{ - return str ? strdup (str) : 0; -} - -char * -rxvt_r_basename (const char *str) +rxvt_r_basename (const char *str) NOTHROW { char *base = strrchr (str, '/'); @@ -182,7 +176,7 @@ * Print an error message */ void -rxvt_vlog (const char *fmt, va_list arg_ptr) +rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW { char msg[1024]; @@ -195,7 +189,7 @@ } void -rxvt_log (const char *fmt,...) +rxvt_log (const char *fmt,...) NOTHROW { va_list arg_ptr; @@ -208,7 +202,7 @@ * Print an error message */ void -rxvt_warn (const char *fmt,...) +rxvt_warn (const char *fmt,...) NOTHROW { va_list arg_ptr; @@ -220,7 +214,7 @@ } void -rxvt_fatal (const char *fmt,...) +rxvt_fatal (const char *fmt,...) THROW ((class rxvt_failure_exception)) { va_list arg_ptr; @@ -233,11 +227,10 @@ rxvt_exit_failure (); } -class rxvt_failure_exception rxvt_failure_exception; - void -rxvt_exit_failure () +rxvt_exit_failure () THROW ((class rxvt_failure_exception)) { + static class rxvt_failure_exception rxvt_failure_exception; throw (rxvt_failure_exception); } @@ -250,7 +243,7 @@ * return: strlen (S2) */ int -rxvt_Str_match (const char *s1, const char *s2) +rxvt_Str_match (const char *s1, const char *s2) NOTHROW { int n = strlen (s2); @@ -258,7 +251,7 @@ } const char * -rxvt_Str_skip_space (const char *str) +rxvt_Str_skip_space (const char *str) NOTHROW { if (str) while (*str && isspace (*str)) @@ -272,7 +265,7 @@ * in place. */ char * -rxvt_Str_trim (char *str) +rxvt_Str_trim (char *str) NOTHROW { char *r, *s; @@ -319,7 +312,7 @@ * returns the converted string length */ int -rxvt_Str_escaped (char *str) +rxvt_Str_escaped (char *str) NOTHROW { char ch, *s, *d; int i, num, append = 0; @@ -395,7 +388,7 @@ * Caller should free each entry and array when done */ char ** -rxvt_splitcommastring (const char *cs) +rxvt_splitcommastring (const char *cs) NOTHROW { int l, n, p; const char *s, *t; @@ -426,7 +419,7 @@ } void -rxvt_freecommastring (char **cs) +rxvt_freecommastring (char **cs) NOTHROW { for (int i = 0; cs[i]; ++i) free (cs[i]); @@ -448,7 +441,7 @@ * FILE is either semi-colon or zero terminated */ char * -rxvt_File_search_path (const char *pathlist, const char *file, const char *ext) +rxvt_File_search_path (const char *pathlist, const char *file, const char *ext) NOTHROW { int maxpath, len; const char *p, *path; @@ -520,7 +513,7 @@ } char * -rxvt_File_find (const char *file, const char *ext, const char *path) +rxvt_File_find (const char *file, const char *ext, const char *path) NOTHROW { char *f; @@ -538,50 +531,4 @@ } #endif -/*----------------------------------------------------------------------* - * miscellaneous drawing routines - */ - -/* - * Draw top/left and bottom/right border shadows around windows - */ -#ifdef RXVT_SCROLLBAR -void -rxvt_Draw_Shadow (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int h) -{ - int shadow; - - shadow = (w == 0 || h == 0) ? 1 : 2; - w += x - 1; - h += y - 1; - for (; shadow-- > 0; x++, y++, w--, h--) - { - XDrawLine (display, win, topShadow, x, y, w, y); - XDrawLine (display, win, topShadow, x, y, x, h); - XDrawLine (display, win, botShadow, w, h, w, y + 1); - XDrawLine (display, win, botShadow, w, h, x + 1, h); - } -} -#endif - -// should not be used in interactive programs, for obvious reasons -void rxvt_usleep (int usecs) -{ -#if HAVE_NANOSLEEP - struct timespec ts; - - ts.tv_sec = 0; - ts.tv_nsec = usecs * 1000; - nanosleep (&ts, NULL); -#else - /* use select for timing */ - struct timeval tv; - - tv.tv_sec = 0; - tv.tv_usec = usecs; - select (0, NULL, NULL, NULL, &tv); -#endif -} - -/*----------------------- end-of-file (C source) -----------------------*/