The R Project SVN R

Rev

Rev 36820 | Rev 40704 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36820 Rev 36990
Line 38... Line 38...
38
 *
38
 *
39
 * do_paste uses two passes to paste the arguments (in CAR(args)) together.
39
 * do_paste uses two passes to paste the arguments (in CAR(args)) together.
40
 * The first pass calculates the width of the paste buffer,
40
 * The first pass calculates the width of the paste buffer,
41
 * then it is alloc-ed and the second pass stuffs the information in.
41
 * then it is alloc-ed and the second pass stuffs the information in.
42
 */
42
 */
43
SEXP do_paste(SEXP call, SEXP op, SEXP args, SEXP env)
43
SEXP attribute_hidden do_paste(SEXP call, SEXP op, SEXP args, SEXP env)
44
{
44
{
45
    SEXP ans, collapse, sep, x, tmpchar;
45
    SEXP ans, collapse, sep, x, tmpchar;
46
    int i, j, k, maxlen, nx, pwidth, sepw;
46
    int i, j, k, maxlen, nx, pwidth, sepw;
47
    char *s, *buf;
47
    char *s, *buf;
48
 
48
 
Line 141... Line 141...
141
    return ans;
141
    return ans;
142
}
142
}
143
 
143
 
144
/* format.default(x, trim, digits, nsmall, width, justify, na.encode, 
144
/* format.default(x, trim, digits, nsmall, width, justify, na.encode, 
145
                  scientific) */
145
                  scientific) */
146
SEXP do_format(SEXP call, SEXP op, SEXP args, SEXP env)
146
SEXP attribute_hidden do_format(SEXP call, SEXP op, SEXP args, SEXP env)
147
{
147
{
148
    SEXP l, x, y, swd;
148
    SEXP l, x, y, swd;
149
    int i, il, n, digits, trim = 0, nsmall = 0, wd = 0, adj = -1, na, sci = 0;
149
    int i, il, n, digits, trim = 0, nsmall = 0, wd = 0, adj = -1, na, sci = 0;
150
    int w, d, e;
150
    int w, d, e;
151
    int wi, di, ei;
151
    int wi, di, ei;
Line 321... Line 321...
321
 *				   1,2: exponential with 2/3 digit expon.
321
 *				   1,2: exponential with 2/3 digit expon.
322
 *
322
 *
323
 * for complex : 2 x 3 integers for (Re, Im)
323
 * for complex : 2 x 3 integers for (Re, Im)
324
 */
324
 */
325
 
325
 
326
SEXP do_formatinfo(SEXP call, SEXP op, SEXP args, SEXP env)
326
SEXP attribute_hidden do_formatinfo(SEXP call, SEXP op, SEXP args, SEXP env)
327
{
327
{
328
    SEXP x;
328
    SEXP x;
329
    int n, digits, nsmall, no = 1, w, d, e, wi, di, ei;
329
    int n, digits, nsmall, no = 1, w, d, e, wi, di, ei;
330
 
330
 
331
    checkArity(op, args);
331
    checkArity(op, args);