#include "ruby.h"
#include <ctype.h>
#include <math.h>
Go to the source code of this file.
Defines | |
| #define | BIT_DIGITS(N) (((N)*146)/485 + 1) |
| #define | FNONE 0 |
| #define | FSHARP 1 |
| #define | FMINUS 2 |
| #define | FPLUS 4 |
| #define | FZERO 8 |
| #define | FSPACE 16 |
| #define | FWIDTH 32 |
| #define | FPREC 64 |
| #define | CHECK(l) |
| #define | PUSH(s, l) |
| #define | GETARG() |
| #define | GETPOSARG(n) |
| #define | GETNTHARG(nth) ((nth >= argc) ? (rb_raise(rb_eArgError, "too few arguments"), 0) : argv[nth]) |
| #define | GETASTER(val) |
Functions | |
| void | fmt_setup (char *, int, int, int, int) |
| char * | remove_sign_bits (char *str, int base) |
| char | sign_bits (int base, const char *p) |
| VALUE | rb_f_sprintf (int argc, VALUE *argv) |
|
|
Definition at line 19 of file sprintf.c. Referenced by rb_f_sprintf(). |
|
|
Value: do {\ while (blen + (l) >= bsiz) {\ bsiz*=2;\ }\ rb_str_resize(result, bsiz);\ buf = RSTRING(result)->ptr;\ } while (0) |
|
|
Definition at line 78 of file sprintf.c. Referenced by fmt_setup(), and rb_f_sprintf(). |
|
|
Definition at line 76 of file sprintf.c. Referenced by rb_f_sprintf(). |
|
|
Definition at line 79 of file sprintf.c. Referenced by fmt_setup(), and rb_f_sprintf(). |
|
|
Definition at line 83 of file sprintf.c. Referenced by fmt_setup(), and rb_f_sprintf(). |
|
|
Definition at line 77 of file sprintf.c. Referenced by fmt_setup(), and rb_f_sprintf(). |
|
|
Definition at line 81 of file sprintf.c. Referenced by fmt_setup(), and rb_f_sprintf(). |
|
|
Definition at line 82 of file sprintf.c. Referenced by fmt_setup(), and rb_f_sprintf(). |
|
|
Definition at line 80 of file sprintf.c. Referenced by fmt_setup(), and rb_f_sprintf(). |
|
|
Value: (nextvalue != Qundef ? nextvalue : \ posarg < 0 ? \ (rb_raise(rb_eArgError, "unnumbered(%d) mixed with numbered", nextarg), 0) : \ (posarg = nextarg++, GETNTHARG(posarg))) Definition at line 99 of file sprintf.c. Referenced by rb_f_sprintf(). |
|
|
Value: do { \ t = p++; \ n = 0; \ for (; p < end && ISDIGIT(*p); p++) { \ int next_n = 10 * n + (*p - '0'); \ if (next_n / 10 != n) {\ rb_raise(rb_eArgError, #val " too big"); \ } \ n = next_n; \ } \ if (p >= end) { \ rb_raise(rb_eArgError, "malformed format string - %%*[0-9]"); \ } \ if (*p == '$') { \ tmp = GETPOSARG(n); \ } \ else { \ tmp = GETARG(); \ p = t; \ } \ val = NUM2INT(tmp); \ } while (0) Definition at line 112 of file sprintf.c. Referenced by rb_f_sprintf(). |
|
|
Definition at line 109 of file sprintf.c. Referenced by rb_f_sprintf(). |
|
|
Value: (posarg > 0 ? \
(rb_raise(rb_eArgError, "numbered(%d) after unnumbered(%d)", n, posarg), 0) : \
((n < 1) ? (rb_raise(rb_eArgError, "invalid index - %d$", n), 0) : \
(posarg = -1, GETNTHARG(n))))
Definition at line 104 of file sprintf.c. Referenced by rb_f_sprintf(). |
|
|
Value: do { \ CHECK(l);\ memcpy(&buf[blen], s, l);\ blen += (l);\ } while (0) Definition at line 93 of file sprintf.c. Referenced by rb_f_sprintf(), and ruby_qsort(). |
|
||||||||||||||||||||||||
|
Definition at line 797 of file sprintf.c. References FMINUS, FPLUS, FPREC, FSHARP, FSPACE, FWIDTH, and FZERO. Referenced by rb_f_sprintf(). |
|
||||||||||||
|
Definition at line 24 of file sprintf.c. Referenced by rb_f_sprintf(). |
|
||||||||||||
|
Definition at line 57 of file sprintf.c. Referenced by rb_f_sprintf(). |
1.3.5