sprint_realloc_description(u_char ** buf, size_t * buf_len,
                     size_t * out_len, int allow_realloc,
                     oid * objid, size_t objidlen, int width)
{
    struct tree    *tp = get_tree(objid, objidlen, tree_head);
    struct tree    *subtree = tree_head;
    int             pos, len;
    char            tmpbuf[128];
    const char     *cp;

    if (NULL == tp)
        return 0;

    if (tp->type <= TYPE_SIMPLE_LAST)
        cp = " OBJECT-TYPE";
    else
        switch (tp->type) {
        case TYPE_TRAPTYPE:
            cp = " TRAP-TYPE";
            break;
        case TYPE_NOTIFTYPE:
            cp = " NOTIFICATION-TYPE";
            break;
        case TYPE_OBJGROUP:
            cp = " OBJECT-GROUP";
            break;
        case TYPE_AGENTCAP:
            cp = " AGENT-CAPABILITIES";
            break;
        case TYPE_MODID:
            cp = " MODULE-IDENTITY";
            break;
        case TYPE_OBJIDENTITY:
            cp = " OBJECT-IDENTITY";
            break;
        case TYPE_MODCOMP:
            cp = " MODULE-COMPLIANCE";
            break;
        default:
            sprintf(tmpbuf, " type_%d", tp->type);
            cp = tmpbuf;
        }

    if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tp->label) ||
        !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, cp) ||
        !snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n")) {
        return 0;
    }
    if (!print_tree_node(buf, buf_len, out_len, allow_realloc, tp, width))
        return 0;
    if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "::= {"))
        return 0;
    pos = 5;
    while (objidlen > 1) {
        for (; subtree; subtree = subtree->next_peer) {
            if (*objid == subtree->subid) {
                while (subtree->next_peer && subtree->next_peer->subid == *objid)
                    subtree = subtree->next_peer;
                if (strncmp(subtree->label, ANON, ANON_LEN)) {
                    snprintf(tmpbuf, sizeof(tmpbuf), " %s(%lu)", subtree->label, subtree->subid);
                    tmpbuf[ sizeof(tmpbuf)-1 ] = 0;
                } else
                    sprintf(tmpbuf, " %lu", subtree->subid);
                len = strlen(tmpbuf);
                if (pos + len + 2 > width) {
                    if (!snmp_cstrcat(buf, buf_len, out_len,
                                     allow_realloc, "\n     "))
                        return 0;
                    pos = 5;
                }
                if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tmpbuf))
                    return 0;
                pos += len;
                objid++;
                objidlen--;
                break;
            }
        }
        if (subtree)
            subtree = subtree->child_list;
        else
            break;
    }
    while (objidlen > 1) {
        sprintf(tmpbuf, " %" NETSNMP_PRIo "u", *objid);
        len = strlen(tmpbuf);
        if (pos + len + 2 > width) {
            if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n     "))
                return 0;
            pos = 5;
        }
        if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tmpbuf))
            return 0;
        pos += len;
        objid++;
        objidlen--;
    }
    sprintf(tmpbuf, " %" NETSNMP_PRIo "u }", *objid);
    len = strlen(tmpbuf);
    if (pos + len + 2 > width) {
        if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, "\n     "))
            return 0;
        pos = 5;
    }
    if (!snmp_cstrcat(buf, buf_len, out_len, allow_realloc, tmpbuf))
        return 0;
    return 1;
}