24 static const char* padStr =
"pad";
39 if( ur_is(data, UT_BLOCK) || ur_is(data, UT_PAREN) )
58 colWidth = ur_int(fi.
it);
67 else if( ur_isStringType(
ur_type(di.
it) ) )
79 dlen = si.
end - si.
it;
83 si.
end = si.
it + limit;
88 for( plen = -colWidth - dlen; plen > 0; --plen )
95 for( plen = colWidth - dlen; plen > 0; --plen )
116 atomPad =
ur_intern( ut, padStr, strlen(padStr) );
117 if( ur_atom(fi.
it) == atomPad )
119 if( ++fi.
it == fi.
end )
121 if( ur_is(fi.
it, UT_CHAR) )
123 else if( ur_is(fi.
it, UT_INT) )
124 pad = ur_int(fi.
it) +
'0';
139 ur_initSeries(&tmp, UT_BLOCK, ef->userBuf);
140 return _formatString(ut, ut->stack.
ptr.
cell + ef->dat.i, &tmp,
163 const UCell* data = a1+1;
164 if (ur_is(data, UT_BLOCK) || ur_is(data, UT_PAREN))
166 EvalFrame* ef = boron_reframeReduce(ut, data, res, _formatReduced);
167 ef->invoke.dat.i = a1 - ut->stack.
ptr.
cell;
168 return CFUNC_REFRAMED;
171 return _formatString(ut, a1, data, res);
#define CFUNC(name)
Macro to define C functions.
Definition boron.h:57
#define ur_strFree
A string is a simple array.
Definition urlan.h:629
UBuffer * ur_makeStringCell(UThread *, int enc, int size, UCell *cell)
Generate a single string and set cell to reference it.
Definition string.c:104
void ur_strAppendChar(UBuffer *, int)
Append a single UCS2 character to a string.
Definition string.c:611
void ur_strInit(UBuffer *, int enc, int size)
Initialize buffer to type UT_STRING.
Definition string.c:430
void ur_strAppend(UBuffer *, const UBuffer *strB, UIndex itB, UIndex endB)
Append another string buffer to this string.
Definition string.c:899
void ur_seriesSlice(const UThread *, USeriesIter *si, const UCell *cell)
Set USeriesIter to series slice.
Definition env.c:1338
UIndex it
Start position.
Definition urlan.h:338
UAtom ur_intern(UThread *, const char *name, int len)
Add a single atom to the shared environment.
Definition env.c:596
const UCell * end
End position.
Definition urlan.h:388
void ur_toText(UThread *, const UCell *cell, UBuffer *str)
Append textual representation of cell to a string.
Definition env.c:1118
UIndex end
End position.
Definition urlan.h:339
const UCell * it
Start position.
Definition urlan.h:387
@ UR_OK
Returned to indicate successful evaluation/operation.
Definition urlan.h:118
#define ur_foreach(bi)
Loop over all members of an iterator struct.
Definition urlan.h:760
const UBuffer * ur_blockIt(const UThread *ut, UBlockIt *bi, const UCell *blkCell)
Set UBlockIt to the start and end of a block slice.
Definition env.c:1388
const UBuffer * buf
Buffer pointer.
Definition urlan.h:337
#define ur_buffer(n)
Macro to get buffer known to be in thread dataStore.
Definition urlan.h:750
#define ur_type(c)
Return UrlanDataType of cell.
Definition urlan.h:695
Iterator for const UCell array.
Definition urlan.h:386
The UBuffer struct holds information about a resource, usually a chunk of memory.
Definition urlan.h:266
UIndex used
This typically holds the number of elements in the buffer.
Definition urlan.h:271
UCell * cell
Array of cells.
Definition urlan.h:275
union UBuffer::@312146223224040072236377336057316010374162171270 ptr
This typically holds a pointer to a chunk of memory.
int16_t n[UR_COORD_MAX]
Holds six, 16-bit integers.
Definition urlan.h:195
UIndex buf
Buffer id.
Definition urlan.h:228
Iterator for const series of any type.
Definition urlan.h:336
The UThread struct stores the data specific to a thread of execution.
Definition urlan.h:309
A cell holds a single value of a simple type or a reference (often to a UBuffer) for a complex type.
Definition urlan.h:248
UCellCoord coord
For coord! type.
Definition urlan.h:253
UCellSeries series
For binary!, bitset!, string!, file!, block!, paren!, path! types.
Definition urlan.h:255
UStatus
Definition urlan.h:116