51 #include <sys/types.h>
65 #define STR vstring_str
66 #define END vstring_end
67 #define SWAP(type, a, b) { type temp; temp = a; a = b; b = temp; }
82 for (result = 0; (ch = *(
unsigned char *) str) != 0; str++) {
85 digit_value = ch -
'0';
87 || (result *= 10) >
OFF_T_MAX - digit_value)
89 result += digit_value;
98 static char digs[] =
"0123456789";
107 msg_panic(
"off_cvt_number: negative offset -%s",
114 while (offset != 0) {
126 SWAP(
int, start[i], last[-i]);
139 int main(
int unused_argc,
char **unused_argv)
145 if (
STR(buf)[0] ==
'#' ||
STR(buf)[0] == 0)
#define vstring_fgets_nonl(s, p)
NORETURN msg_panic(const char *fmt,...)
int main(int argc, char **argv)
off_t off_cvt_string(const char *str)
#define VSTRING_TERMINATE(vp)
#define VSTRING_ADDCH(vp, ch)
VSTREAM * vstream_printf(const char *fmt,...)
#define VSTRING_RESET(vp)
void msg_warn(const char *fmt,...)
VSTRING * vstring_alloc(ssize_t len)
int vstream_fflush(VSTREAM *stream)
VSTRING * vstring_free(VSTRING *vp)
VSTRING * off_cvt_number(VSTRING *buf, off_t offset)