void print_foxinfo() { StrBuf sb; StrBuf_init(&sb, 32); StrBuf_add(&sb, "foxw ", -1); StrBuf_printf(&sb, "%d.%d.%d", FOX_VERSION_MAJOR, FOX_VERSION_MINOR, FOX_VERSION_REVISION); StrBuf_printf(&sb, ", %dbit", (int)sizeof(void*) * 8); #ifndef NO_DEBUG StrBuf_add(&sb, " (debug-build)", -1); #endif show_error_message(sb.p, sb.size, TRUE); StrBuf_close(&sb); }
static int mapentry_tostr(Value *vret, Value *v, RefNode *node) { Ref *r = Value_ref(*v); StrBuf buf; StrBuf_init(&buf, 0); if (!StrBuf_printf(&buf, "Entry(%v, %v)", r->v[INDEX_ENTRY_KEY], r->v[INDEX_ENTRY_VAL])) { goto ERROR_END; } *vret = cstr_Value(fs->cls_str, buf.p, buf.size); StrBuf_close(&buf); return TRUE; ERROR_END: StrBuf_close(&buf); return FALSE; }