… | |
… | |
638 | XSetIOErrorHandler (rxvt_xioerror_handler); |
638 | XSetIOErrorHandler (rxvt_xioerror_handler); |
639 | |
639 | |
640 | XrmInitialize (); |
640 | XrmInitialize (); |
641 | } |
641 | } |
642 | |
642 | |
643 | /* ------------------------------------------------------------------------- * |
|
|
644 | * MEMORY ALLOCATION WRAPPERS * |
|
|
645 | * ------------------------------------------------------------------------- */ |
|
|
646 | void * |
|
|
647 | rxvt_malloc (size_t size) |
|
|
648 | { |
|
|
649 | void *p = malloc (size); |
|
|
650 | |
|
|
651 | if (!p) |
|
|
652 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
|
|
653 | |
|
|
654 | return p; |
|
|
655 | } |
|
|
656 | |
|
|
657 | void * |
|
|
658 | rxvt_calloc (size_t number, size_t size) |
|
|
659 | { |
|
|
660 | void *p = calloc (number, size); |
|
|
661 | |
|
|
662 | if (!p) |
|
|
663 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
|
|
664 | |
|
|
665 | return p; |
|
|
666 | } |
|
|
667 | |
|
|
668 | void * |
|
|
669 | rxvt_realloc (void *ptr, size_t size) |
|
|
670 | { |
|
|
671 | void *p = realloc (ptr, size); |
|
|
672 | |
|
|
673 | if (!p) |
|
|
674 | rxvt_fatal ("memory allocation failure. aborting.\n"); |
|
|
675 | |
|
|
676 | return p; |
|
|
677 | } |
|
|
678 | |
|
|
679 | /*----------------------------------------------------------------------*/ |
643 | /*----------------------------------------------------------------------*/ |
680 | /* |
644 | /* |
681 | * window size/position calculations for XSizeHint and other storage. |
645 | * window size/position calculations for XSizeHint and other storage. |
682 | * if width/height are non-zero then override calculated width/height |
646 | * if width/height are non-zero then override calculated width/height |
683 | */ |
647 | */ |