diff --git a/cmTagFile.c b/cmTagFile.c index fe5e898..035433b 100644 --- a/cmTagFile.c +++ b/cmTagFile.c @@ -33,12 +33,15 @@ const cmChar_t* _cmTfFlagsToLabel( unsigned flags ) { switch(flags) { - case kFuncTfFl: return "p"; - case kEnumTfFl: return "e"; - case kMacroTfFl: return "m"; - case kTypedefTfFl: return "t"; - case kFieldTfFl: return "f"; - case kExternTfFl: return "x"; + case kFuncProtoTfFl: return "p"; + case kFuncDefnTfFl: return "d"; + case kEnumTfFl: return "e"; + case kMacroTfFl: return "m"; + case kTypedefTfFl: return "t"; + case kFieldTfFl: return "f"; + case kExternTfFl: return "x"; + case kStructTagTfFl:return "s"; + case kUnionTagTfFl: return "u"; default: { assert(0); } } @@ -125,7 +128,11 @@ cmTfRC_t _cmTfParseLine( cmTf_t* p, const cmChar_t* fn, unsigned line, cmChar_t* break; case 'p': // function prototype - r.flags |= kFuncTfFl; + r.flags |= kFuncProtoTfFl; + break; + + case 'f': // function defn + r.flags |= kFuncDefnTfFl; break; case 't': // typedef @@ -140,6 +147,14 @@ cmTfRC_t _cmTfParseLine( cmTf_t* p, const cmChar_t* fn, unsigned line, cmChar_t* r.flags |= kExternTfFl; break; + case 's': // struct tag + r.flags |= kStructTagTfFl; + break; + + case 'u': // union tag + r.flags |= kUnionTagTfFl; + break; + default: // unrecognized type return rc; } diff --git a/cmTagFile.h b/cmTagFile.h index 2966ac0..d3e28a3 100644 --- a/cmTagFile.h +++ b/cmTagFile.h @@ -9,7 +9,9 @@ extern "C" { // // ctags --c-kinds=+p --fields=+n file.h // - // --c-kinds=+p turns on function prototype reporting. + // --c-kinds=+px + // p - turns on function prototype reporting. + // x - turns on external and forward decl // --field=+n turns on line number reporting enum { @@ -27,12 +29,15 @@ extern "C" { enum { - kFuncTfFl = 0x01, - kEnumTfFl = 0x02, - kMacroTfFl = 0x04, - kTypedefTfFl = 0x08, - kFieldTfFl = 0x10, - kExternTfFl = 0x20 // extern var's and forward declarations + kFuncProtoTfFl = 0x001, + kFuncDefnTfFl = 0x002, + kEnumTfFl = 0x004, + kMacroTfFl = 0x008, + kTypedefTfFl = 0x010, + kFieldTfFl = 0x020, + kExternTfFl = 0x040, // extern var's and forward declarations + kStructTagTfFl = 0x080, + kUnionTagTfFl = 0x100 // be sure to add new flags to _cmTfFlagsToLabel() };