ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/misc.C
(Generate patch)

Comparing rxvt-unicode/src/misc.C (file contents):
Revision 1.55 by sf-exg, Mon Jan 10 14:07:19 2011 UTC vs.
Revision 1.59 by sf-exg, Wed Nov 12 12:12:02 2014 UTC

4 * 4 *
5 * All portions of code are copyright by their respective author/s. 5 * All portions of code are copyright by their respective author/s.
6 * Copyright (c) 1996 mj olesen <olesen@me.QueensU.CA> Queen's Univ at Kingston 6 * Copyright (c) 1996 mj olesen <olesen@me.QueensU.CA> Queen's Univ at Kingston
7 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> 7 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de>
8 * Copyright (c) 1998-2000 Geoff Wing <gcw@pobox.com> 8 * Copyright (c) 1998-2000 Geoff Wing <gcw@pobox.com>
9 * Copyright (c) 2003-2006 Marc Lehmann <pcg@goof.com> 9 * Copyright (c) 2003-2006 Marc Lehmann <schmorp@schmorp.de>
10 * 10 *
11 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by 12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or 13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version. 14 * (at your option) any later version.
15 * 15 *
16 * This program is distributed in the hope that it will be useful, 16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *----------------------------------------------------------------------*/ 24 *----------------------------------------------------------------------*/
25 25
26#include "../config.h" /* NECESSARY */ 26#include "../config.h" /* NECESSARY */
27#include "rxvt.h" /* NECESSARY */ 27#include "rxvt.h" /* NECESSARY */
28
29#include <new>
30
31// alas new/delete cannot be specified as inline in C++11 (see 17.6.4.6)
32void *
33operator new (size_t s)
34#if !ECB_CPP11
35 throw (std::bad_alloc)
36#endif
37{
38 return rxvt_malloc (s);
39}
40
41void
42operator delete (void *p)
43#if ECB_CPP11
44 noexcept
45#else
46 throw ()
47#endif
48{
49 free (p);
50}
28 51
29char * 52char *
30rxvt_wcstombs (const wchar_t *str, int len) 53rxvt_wcstombs (const wchar_t *str, int len)
31{ 54{
32 if (len < 0) len = wcslen (str); 55 if (len < 0) len = wcslen (str);
327 if (!p) 350 if (!p)
328 rxvt_fatal ("memory allocation failure. aborting.\n"); 351 rxvt_fatal ("memory allocation failure. aborting.\n");
329 352
330 return p; 353 return p;
331} 354}
355
356KeySym
357rxvt_XKeycodeToKeysym (Display *dpy, KeyCode code, int index)
358{
359 int size;
360 KeySym *mapping = XGetKeyboardMapping (dpy, code, 1, &size);
361 KeySym keysym = IN_RANGE_EXC (index, 0, size) ? mapping[index] : NoSymbol;
362 XFree (mapping);
363 return keysym;
364}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines