Annotation of OpenXM/src/asir-doc/int-parts/macro.texi, Revision 1.2
1.2 ! noro 1: @comment $OpenXM: OpenXM/src/asir-doc/int-parts/macro.texi,v 1.1 2001/04/23 05:45:35 noro Exp $
! 2: \JP @chapter $B%^%/%m(B, $BBg0hJQ?t(B
! 3: \EG @chapter Macros and global variables
1.1 noro 4:
5: @section macro
1.2 ! noro 6: \JP @samp{ca.h} $B$GDj5A$5$l$k<g$J%^%/%m$O<!$NDL$j$G$"$k(B.
! 7: \EG @samp{ca.h}
! 8: \JP @subsection $B0lHL%^%/%m(B
! 9: \EG @subsection General macros
1.1 noro 10: @table @code
11: @item MAX(a,b)
12: @code{((a) > (b) ? (a) : (b) )}
13: @item MIN(a,b)
14: @code{((a) > (b) ? (b) : (a) )}
15: @item ABS(a)
16: @code{((a)>0?(a):-(a))}
17: @item ID(p)
18: @code{((p)->id)}
19: @item BDY(p)
20: @code{((p)->body)}
21: @item NEXT(p)
22: @code{((p)->next)}
23: @item VR(p)
24: @code{((p)->v)}
25: @item NM(q)
26: @code{((q)->nm)}
27: @item DN(q)
28: @code{((q)->dn)}
29: @item SGN(q)
30: @code{((q)->sgn)}
31: @item PL(n)
32: @code{((n)->p)}
33: @item BD(n)
34: @code{((n)->b)}
35: @end table
36:
1.2 ! noro 37: \JP @subsection $B=R8l(B
! 38: \EG @subsection Predicates
1.1 noro 39: @table @code
40: @item NUM(a)
41: @code{ID(a)==O_Q}
42: @item INT(a)
43: @code{(!DN(a))}
44: @item UNIQ(a)
1.2 ! noro 45: \JP @code{a} $B$,M-M}?t$N(B 1 $B$KEy$7$$(B
! 46: \EG @code{a} is equal to 1 as a rational number.
1.1 noro 47: @item MUNIQ(a)
1.2 ! noro 48: \JP @code{a} $B$,M-M}?t$N(B -1 $B$KEy$7$$(B
! 49: \EG @code{a} is equal to -1 as a rational number.
1.1 noro 50: @item UNIN(a)
1.2 ! noro 51: \JP @code{a} $B$,<+A3?t$N(B 1 $B$KEy$7$$(B
! 52: \EG @code{a} is equal to 1 as a natural number.
1.1 noro 53: @end table
54:
1.2 ! noro 55: \JP @subsection $B%a%b%j3d$jEv$F4o(B
! 56: \EG @subsection Memory allocators
1.1 noro 57: @table @code
58: @item (char *) MALLOC(d)
1.2 ! noro 59: \JP @code{d} bytes $B$NNN0h$r3d$jEv$F$k(B.
! 60: \EG allocates a byte array of length @code{d} bytes.
1.1 noro 61: @item (char *) CALLOC(d,e)
1.2 ! noro 62: \JP @code{d * e} bytes $B$NNN0h$r3d$jEv$F$F(B, 0 $B$G=i4|2=$9$k(B.
! 63: \EG allocates a byte array of @code{d * e} bytes, and sets all that
! 64: region to 0.
1.1 noro 65: @item (N) NALLOC(d)
1.2 ! noro 66: \JP @code{d} $B7e$N<+A3?tMQ$NNN0h$r3d$jEv$F$k(B.
! 67: \EG allocates a region for a natural number of @code{d} digits.
1.1 noro 68: @end table
69: @noindent
1.2 ! noro 70: \JP $B$3$l$i$O$9$Y$FNN0h$N@hF,%]%$%s%?$rJV$9(B.
! 71: \EG These macros return a pointer to the allocate memory.
! 72:
1.1 noro 73: @subsection cell allocators
74: @table @code
75: @item NEWQ(q)
1.2 ! noro 76: \JP @code{q} $B$K(B \code{Q} $BMQ$NNN0h$r3d$jEv$F$k(B.
! 77: \EG
1.1 noro 78: @item NEWP(p)
1.2 ! noro 79: \JP @code{p} $B$K(B \code{P} $BMQ$NNN0h$r3d$jEv$F$k(B.
! 80: \EG
1.1 noro 81: @item NEWR(r)
1.2 ! noro 82: \JP @code{r} $B$K(B \code{R} $BMQ$NNN0h$r3d$jEv$F$k(B.
! 83: \EG
1.1 noro 84: @item NEWNODE(a)
1.2 ! noro 85: \JP @code{a} $B$K(B \code{NODE} $BMQ$NNN0h$r3d$jEv$F$k(B.
! 86: \EG
1.1 noro 87: @item NEWDC(dc)
1.2 ! noro 88: \JP @code{dc} $B$K(B \code{DCP} $BMQ$NNN0h$r3d$jEv$F$k(B.
! 89: \EG
1.1 noro 90: @item NEWV(v)
1.2 ! noro 91: \JP @code{v} $B$K(B \code{V} $BMQ$NNN0h$r3d$jEv$F$k(B.
! 92: \EG
1.1 noro 93: @item NEWVL(vl)
1.2 ! noro 94: \JP @code{vl} $B$K(B \code{VL} $BMQ$NNN0h$r3d$jEv$F$k(B.
! 95: \EG
1.1 noro 96: @end table
97: @noindent
1.2 ! noro 98: \BJP
1.1 noro 99: @code{NEWP()}, @code{NEWQ()}, @code{NEWR()} $B$K$*$$$F$O(B, $B%a%s%P(B @code{id}
100: $B$b$7$+$k$Y$-CM$K=i4|2=$5$l$k(B.
1.2 ! noro 101: \E
! 102: \BEG
! 103: \E
1.1 noro 104:
1.2 ! noro 105: \JP @section $B<g$JBg0hJQ?t(B
! 106: \EG @section Global variables
1.1 noro 107: @table @code
108: @item VL CO;
1.2 ! noro 109: \JP $B8=:_$NJQ?t=g=x(B.
! 110: \EG
1.1 noro 111: @item Q ONE;
1.2 ! noro 112: \JP $BM-M}?t$N(B 1.
! 113: \EG
1.1 noro 114: @item N ONEN;
1.2 ! noro 115: \JP $B<+A3?t$N(B 1.
! 116: \EG
1.1 noro 117: @item int prime[];
1.2 ! noro 118: \JP 4 $B7e$^$G$NAG?t(B($B>.(B->$BBg(B).
! 119: \EG
1.1 noro 120: @item int lprime[];
1.2 ! noro 121: \JP 8 $B7eDxEY$NAG?t(B 1000 $B8D(B($BBg(B->$B>.(B).
! 122: \EG
1.1 noro 123: @end table
124: @noindent
1.2 ! noro 125: \BJP
1.1 noro 126: @code{CO} $B$O(B, $B%f!<%6$,=i4|2=(B, $B$*$h$S?7$?$KJQ?t$,=P8=$7$?>l9g$K99?7$9$kI,(B
127: $BMW$,$"$k(B. $B$^$?(B, @code{ONER}, @code{ONE}, @code{ONEN}$B$O(B, $B5/F0;~$KH!?t(B
128: @code{nglob_init()} $B$K$h$j=i4|2=$9$kI,MW$,$"$k(B.
1.2 ! noro 129: \E
! 130: \BEG
! 131: \E
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>