589 |
typedef struct interval *INTERVAL; |
typedef struct interval *INTERVAL; |
590 |
|
|
591 |
/* Complain if object is not string or buffer type */ |
/* Complain if object is not string or buffer type */ |
592 |
#define CHECK_STRING_OR_BUFFER(x, i) \ |
#define CHECK_STRING_OR_BUFFER(x) \ |
593 |
{ if (!STRINGP ((x)) && !BUFFERP ((x))) \ |
{ if (!STRINGP ((x)) && !BUFFERP ((x))) \ |
594 |
x = wrong_type_argument (Qbuffer_or_string_p, (x)); } |
x = wrong_type_argument (Qbuffer_or_string_p, (x)); } |
595 |
|
|
1003 |
#define HASH_TABLE_P(OBJ) PSEUDOVECTORP (OBJ, PVEC_HASH_TABLE) |
#define HASH_TABLE_P(OBJ) PSEUDOVECTORP (OBJ, PVEC_HASH_TABLE) |
1004 |
#define GC_HASH_TABLE_P(x) GC_PSEUDOVECTORP (x, PVEC_HASH_TABLE) |
#define GC_HASH_TABLE_P(x) GC_PSEUDOVECTORP (x, PVEC_HASH_TABLE) |
1005 |
|
|
1006 |
#define CHECK_HASH_TABLE(x, i) \ |
#define CHECK_HASH_TABLE(x) \ |
1007 |
do \ |
do \ |
1008 |
{ \ |
{ \ |
1009 |
if (!HASH_TABLE_P ((x))) \ |
if (!HASH_TABLE_P ((x))) \ |
1416 |
#define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) |
#define EQ(x, y) (XFASTINT (x) == XFASTINT (y)) |
1417 |
#define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y)) |
#define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y)) |
1418 |
|
|
1419 |
#define CHECK_LIST(x, i) \ |
#define CHECK_LIST(x) \ |
1420 |
do { if (!CONSP ((x)) && !NILP (x)) x = wrong_type_argument (Qlistp, (x)); } while (0) |
do { if (!CONSP ((x)) && !NILP (x)) x = wrong_type_argument (Qlistp, (x)); } while (0) |
1421 |
|
|
1422 |
#define CHECK_STRING(x, i) \ |
#define CHECK_STRING(x) \ |
1423 |
do { if (!STRINGP ((x))) x = wrong_type_argument (Qstringp, (x)); } while (0) |
do { if (!STRINGP ((x))) x = wrong_type_argument (Qstringp, (x)); } while (0) |
1424 |
|
|
1425 |
#define CHECK_CONS(x, i) \ |
#define CHECK_CONS(x) \ |
1426 |
do { if (!CONSP ((x))) x = wrong_type_argument (Qconsp, (x)); } while (0) |
do { if (!CONSP ((x))) x = wrong_type_argument (Qconsp, (x)); } while (0) |
1427 |
|
|
1428 |
#define CHECK_SYMBOL(x, i) \ |
#define CHECK_SYMBOL(x) \ |
1429 |
do { if (!SYMBOLP ((x))) x = wrong_type_argument (Qsymbolp, (x)); } while (0) |
do { if (!SYMBOLP ((x))) x = wrong_type_argument (Qsymbolp, (x)); } while (0) |
1430 |
|
|
1431 |
#define CHECK_CHAR_TABLE(x, i) \ |
#define CHECK_CHAR_TABLE(x) \ |
1432 |
do { if (!CHAR_TABLE_P ((x))) \ |
do { if (!CHAR_TABLE_P ((x))) \ |
1433 |
x = wrong_type_argument (Qchar_table_p, (x)); } while (0) |
x = wrong_type_argument (Qchar_table_p, (x)); } while (0) |
1434 |
|
|
1435 |
#define CHECK_VECTOR(x, i) \ |
#define CHECK_VECTOR(x) \ |
1436 |
do { if (!VECTORP ((x))) x = wrong_type_argument (Qvectorp, (x)); } while (0) |
do { if (!VECTORP ((x))) x = wrong_type_argument (Qvectorp, (x)); } while (0) |
1437 |
|
|
1438 |
#define CHECK_VECTOR_OR_CHAR_TABLE(x, i) \ |
#define CHECK_VECTOR_OR_CHAR_TABLE(x) \ |
1439 |
do { if (!VECTORP ((x)) && !CHAR_TABLE_P ((x))) \ |
do { if (!VECTORP ((x)) && !CHAR_TABLE_P ((x))) \ |
1440 |
x = wrong_type_argument (Qvector_or_char_table_p, (x)); \ |
x = wrong_type_argument (Qvector_or_char_table_p, (x)); \ |
1441 |
} while (0) |
} while (0) |
1442 |
|
|
1443 |
#define CHECK_BUFFER(x, i) \ |
#define CHECK_BUFFER(x) \ |
1444 |
do { if (!BUFFERP ((x))) x = wrong_type_argument (Qbufferp, (x)); } while (0) |
do { if (!BUFFERP ((x))) x = wrong_type_argument (Qbufferp, (x)); } while (0) |
1445 |
|
|
1446 |
#define CHECK_WINDOW(x, i) \ |
#define CHECK_WINDOW(x) \ |
1447 |
do { if (!WINDOWP ((x))) x = wrong_type_argument (Qwindowp, (x)); } while (0) |
do { if (!WINDOWP ((x))) x = wrong_type_argument (Qwindowp, (x)); } while (0) |
1448 |
|
|
1449 |
/* This macro rejects windows on the interior of the window tree as |
/* This macro rejects windows on the interior of the window tree as |
1453 |
A window of any sort, leaf or interior, is dead iff the buffer, |
A window of any sort, leaf or interior, is dead iff the buffer, |
1454 |
vchild, and hchild members are all nil. */ |
vchild, and hchild members are all nil. */ |
1455 |
|
|
1456 |
#define CHECK_LIVE_WINDOW(x, i) \ |
#define CHECK_LIVE_WINDOW(x) \ |
1457 |
do { \ |
do { \ |
1458 |
if (!WINDOWP ((x)) \ |
if (!WINDOWP ((x)) \ |
1459 |
|| NILP (XWINDOW ((x))->buffer)) \ |
|| NILP (XWINDOW ((x))->buffer)) \ |
1460 |
x = wrong_type_argument (Qwindow_live_p, (x)); \ |
x = wrong_type_argument (Qwindow_live_p, (x)); \ |
1461 |
} while (0) |
} while (0) |
1462 |
|
|
1463 |
#define CHECK_PROCESS(x, i) \ |
#define CHECK_PROCESS(x) \ |
1464 |
do { if (!PROCESSP ((x))) x = wrong_type_argument (Qprocessp, (x)); } while (0) |
do { if (!PROCESSP ((x))) x = wrong_type_argument (Qprocessp, (x)); } while (0) |
1465 |
|
|
1466 |
#define CHECK_NUMBER(x, i) \ |
#define CHECK_NUMBER(x) \ |
1467 |
do { if (!INTEGERP ((x))) x = wrong_type_argument (Qintegerp, (x)); } while (0) |
do { if (!INTEGERP ((x))) x = wrong_type_argument (Qintegerp, (x)); } while (0) |
1468 |
|
|
1469 |
#define CHECK_NATNUM(x, i) \ |
#define CHECK_NATNUM(x) \ |
1470 |
do { if (!NATNUMP (x)) x = wrong_type_argument (Qwholenump, (x)); } while (0) |
do { if (!NATNUMP (x)) x = wrong_type_argument (Qwholenump, (x)); } while (0) |
1471 |
|
|
1472 |
#define CHECK_MARKER(x, i) \ |
#define CHECK_MARKER(x) \ |
1473 |
do { if (!MARKERP ((x))) x = wrong_type_argument (Qmarkerp, (x)); } while (0) |
do { if (!MARKERP ((x))) x = wrong_type_argument (Qmarkerp, (x)); } while (0) |
1474 |
|
|
1475 |
#define CHECK_NUMBER_COERCE_MARKER(x, i) \ |
#define CHECK_NUMBER_COERCE_MARKER(x) \ |
1476 |
do { if (MARKERP ((x))) XSETFASTINT (x, marker_position (x)); \ |
do { if (MARKERP ((x))) XSETFASTINT (x, marker_position (x)); \ |
1477 |
else if (!INTEGERP ((x))) x = wrong_type_argument (Qinteger_or_marker_p, (x)); } while (0) |
else if (!INTEGERP ((x))) x = wrong_type_argument (Qinteger_or_marker_p, (x)); } while (0) |
1478 |
|
|
1479 |
#define XFLOATINT(n) extract_float((n)) |
#define XFLOATINT(n) extract_float((n)) |
1480 |
|
|
1481 |
#define CHECK_FLOAT(x, i) \ |
#define CHECK_FLOAT(x) \ |
1482 |
do { if (!FLOATP (x)) \ |
do { if (!FLOATP (x)) \ |
1483 |
x = wrong_type_argument (Qfloatp, (x)); } while (0) |
x = wrong_type_argument (Qfloatp, (x)); } while (0) |
1484 |
|
|
1485 |
#define CHECK_NUMBER_OR_FLOAT(x, i) \ |
#define CHECK_NUMBER_OR_FLOAT(x) \ |
1486 |
do { if (!FLOATP (x) && !INTEGERP (x)) \ |
do { if (!FLOATP (x) && !INTEGERP (x)) \ |
1487 |
x = wrong_type_argument (Qnumberp, (x)); } while (0) |
x = wrong_type_argument (Qnumberp, (x)); } while (0) |
1488 |
|
|
1489 |
#define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x, i) \ |
#define CHECK_NUMBER_OR_FLOAT_COERCE_MARKER(x) \ |
1490 |
do { if (MARKERP (x)) XSETFASTINT (x, marker_position (x)); \ |
do { if (MARKERP (x)) XSETFASTINT (x, marker_position (x)); \ |
1491 |
else if (!INTEGERP (x) && !FLOATP (x)) \ |
else if (!INTEGERP (x) && !FLOATP (x)) \ |
1492 |
x = wrong_type_argument (Qnumber_or_marker_p, (x)); } while (0) |
x = wrong_type_argument (Qnumber_or_marker_p, (x)); } while (0) |
1493 |
|
|
1494 |
#define CHECK_OVERLAY(x, i) \ |
#define CHECK_OVERLAY(x) \ |
1495 |
do { if (!OVERLAYP ((x))) x = wrong_type_argument (Qoverlayp, (x));} while (0) |
do { if (!OVERLAYP ((x))) x = wrong_type_argument (Qoverlayp, (x));} while (0) |
1496 |
|
|
1497 |
/* Since we can't assign directly to the CAR or CDR fields of a cons |
/* Since we can't assign directly to the CAR or CDR fields of a cons |
1498 |
cell, use these when checking that those fields contain numbers. */ |
cell, use these when checking that those fields contain numbers. */ |
1499 |
#define CHECK_NUMBER_CAR(x, i) \ |
#define CHECK_NUMBER_CAR(x) \ |
1500 |
do { \ |
do { \ |
1501 |
Lisp_Object tmp = XCAR (x); \ |
Lisp_Object tmp = XCAR (x); \ |
1502 |
CHECK_NUMBER (tmp, (i)); \ |
CHECK_NUMBER (tmp); \ |
1503 |
XSETCAR ((x), tmp); \ |
XSETCAR ((x), tmp); \ |
1504 |
} while (0) |
} while (0) |
1505 |
|
|
1506 |
#define CHECK_NUMBER_CDR(x, i) \ |
#define CHECK_NUMBER_CDR(x) \ |
1507 |
do { \ |
do { \ |
1508 |
Lisp_Object tmp = XCDR (x); \ |
Lisp_Object tmp = XCDR (x); \ |
1509 |
CHECK_NUMBER (tmp, (i)); \ |
CHECK_NUMBER (tmp); \ |
1510 |
XSETCDR ((x), tmp); \ |
XSETCDR ((x), tmp); \ |
1511 |
} while (0) |
} while (0) |
1512 |
|
|