lib/base.js
function forEachStruct(structname, obj, root, callback, noexline) {
    if (noexline == undefined) {
        noexline = false;
    }

    for (var i = 0; i < obj.val.length; ++i) {
        if (noexline && obj.val[i].name.name.indexOf('_') == 0) {
            continue ;
        }

        if (obj.val[i].hasOwnProperty('type2') && obj.val[i].type2 == 'expand') {
            if (!obj.val[i].hasOwnProperty('expand')) {
                forEachStruct(structname, getGlobalObj(obj.val[i].type, root), root, callback);
            }
            else {
                var expandobj = getGlobalObj(obj.val[i].expand, root);
                for (var eoi = 0; eoi < expandobj.val.length; ++eoi) {
                    callback(structname, {
                        name: {name: getEnumMemberRealName(expandobj.val[eoi].name, expandobj.name)},
                        type: obj.val[i].type,
                        comment: expandobj.val[eoi].comment}, root);
                }
            }
        }
        else {
            if (obj.name != structname && obj.val[i].hasOwnProperty('type2') && obj.val[i].type2 == 'primary') {
                callback(structname, {
                    name: obj.val[i].name,
                    val: obj.val[i].val,
                    type: obj.val[i].type,
                    type2: 'unique'
                }, root);
            }
            else {
                callback(structname, obj.val[i], root);
            }
        }
    }
}
function forEachStruct(structname, obj, root, callback, noexline) {
    if (noexline == undefined) {
        noexline = false;
    }

    for (var i = 0; i < obj.val.length; ++i) {
        if (noexline && obj.val[i].name.name.indexOf('_') == 0) {
            continue ;
        }

        if (obj.val[i].hasOwnProperty('type2') && obj.val[i].type2 == 'expand') {
            if (!obj.val[i].hasOwnProperty('expand')) {
                forEachStruct(structname, getGlobalObj(obj.val[i].type, root), root, callback);
            }
            else {
                var expandobj = getGlobalObj(obj.val[i].expand, root);
                for (var eoi = 0; eoi < expandobj.val.length; ++eoi) {
                    callback(structname, {
                        name: {name: getEnumMemberRealName(expandobj.val[eoi].name, expandobj.name)},
                        type: obj.val[i].type,
                        comment: expandobj.val[eoi].comment}, root);
                }
            }
        }
        else {
            if (obj.name != structname && obj.val[i].hasOwnProperty('type2') && obj.val[i].type2 == 'primary') {
                callback(structname, {
                    name: obj.val[i].name,
                    val: obj.val[i].val,
                    type: obj.val[i].type,
                    type2: 'unique'
                }, root);
            }
            else {
                callback(structname, obj.val[i], root);
            }
        }
    }
}
callback(structname, obj, root)