shrub/g/x.c

74 lines
1.1 KiB
C
Raw Normal View History

2014-09-11 04:01:32 +04:00
/* g/x.c
2014-09-05 23:55:16 +04:00
**
** This file is in the public domain.
*/
#include "all.h"
2014-09-06 00:13:24 +04:00
/* u3_cx_good(): test for u3_none.
2014-09-05 23:55:16 +04:00
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_cx_good(u3_weak som)
2014-09-05 23:55:16 +04:00
{
2014-09-06 00:13:24 +04:00
if ( u3_none == som ) {
return u3_cm_bail(c3__exit);
2014-09-05 23:55:16 +04:00
}
else return som;
}
2014-09-06 00:13:24 +04:00
/* u3_cx_at (u3at): fragment.
2014-09-05 23:55:16 +04:00
*/
2014-09-06 00:13:24 +04:00
u3_noun
u3_cx_at(u3_noun axe, u3_noun som)
2014-09-05 23:55:16 +04:00
{
2014-09-06 00:13:24 +04:00
u3_weak pro = u3_cr_at(axe, som);
2014-09-05 23:55:16 +04:00
2014-09-06 00:13:24 +04:00
if ( u3_none == pro ) {
return u3_cm_bail(c3__exit);
2014-09-05 23:55:16 +04:00
} else return pro;
}
2014-09-06 00:13:24 +04:00
/* u3_cx_cell():
2014-09-05 23:55:16 +04:00
**
** Divide `a` as a cell `[b c]`.
*/
void
2014-09-06 00:13:24 +04:00
u3_cx_cell(u3_noun a,
u3_noun* b,
u3_noun* c)
2014-09-05 23:55:16 +04:00
{
2014-09-06 00:13:24 +04:00
if ( u3_no == u3_cr_cell(a, b, c) ) {
u3_cm_bail(c3__exit);
2014-09-05 23:55:16 +04:00
}
}
2014-09-06 00:13:24 +04:00
/* u3_cx_trel():
2014-09-05 23:55:16 +04:00
**
** Divide `a` as a trel `[b c d]`, or bail.
*/
void
2014-09-06 00:13:24 +04:00
u3_cx_trel(u3_noun a,
u3_noun* b,
u3_noun* c,
u3_noun* d)
2014-09-05 23:55:16 +04:00
{
2014-09-06 00:13:24 +04:00
if ( u3_no == u3_cr_trel(a, b, c, d) ) {
u3_cm_bail(c3__exit);
2014-09-05 23:55:16 +04:00
}
}
2014-09-06 00:13:24 +04:00
/* u3_cx_qual():
2014-09-05 23:55:16 +04:00
**
** Divide `a` as a quadruple `[b c d e]`.
*/
void
2014-09-06 00:13:24 +04:00
u3_cx_qual(u3_noun a,
u3_noun* b,
u3_noun* c,
u3_noun* d,
u3_noun* e)
2014-09-05 23:55:16 +04:00
{
2014-09-06 00:13:24 +04:00
if ( u3_no == u3_cr_qual(a, b, c, d, e) ) {
u3_cm_bail(c3__exit);
2014-09-05 23:55:16 +04:00
}
}