char lineBuffer[0x400];
char lineBuffer[4096];
int nm2tsv(Options* inOptions)/***  Read all input.**  Output tab seperated value data.****  We expect our data to be in a particular format.**  nm --format=bsd --size-sort --print-file-name --demangle*/{    int retval = 0;    char lineBuffer[0x400];    char* module = NULL;    char* size = NULL;    char* type = NULL;    char* symbol = NULL;    /*    **  Read in the nm file.    */    while(0 == retval && NULL != fgets(lineBuffer, sizeof(lineBuffer), inOptions->mInput))    {        trimWhite(lineBuffer);        /*        ** Find the various peices of information we'll be looking for.        */        size = strchr(lineBuffer, ':');        if(NULL != size)        {            *size = '\0';            size++;            module = strrchr(lineBuffer, '/');            if(NULL == module)            {                module = lineBuffer;            }            else            {                *module = '\0';                module++;            }            type = scanWhite(size);            *type = '\0';            type++;            symbol = type + 1;            *symbol = '\0';            symbol++;            /*            **  Skip certain types.            */            switch(*type)            {                case '-':                    continue;                    break;                default:                    break;            }            /*            **  Simply output the data with a little more interpretation.            **  First is size.            */            fprintf(inOptions->mOutput, "%s\t", size);            /*            **  Type, CODE or DATA            */            switch(toupper(*type))            {                case 'T': /* text (code) */                case 'W': /* weak symbol ??? */                    fprintf(inOptions->mOutput, "CODE\t");                    break;                default:                    fprintf(inOptions->mOutput, "DATA\t");                    break;            }            /*            **  Scope, PUBLIC, STATIC, or UNDEF            */            if(islower(*type))            {                fprintf(inOptions->mOutput, "STATIC\t");            }            else            {                switch(*type)                {                    case '?':                        fprintf(inOptions->mOutput, "UNDEF\t");                        break;                    default:                        fprintf(inOptions->mOutput, "PUBLIC\t");                        break;                }            }            /*            **  Module name, segment.            */            fprintf(inOptions->mOutput, "%s\t", module);            fprintf(inOptions->mOutput, "%c\t", toupper(*type));            /*            **  Origin            */            fprintf(inOptions->mOutput, "UNDEF:%s:%c\t", module, toupper(*type));            /*            **  Symbol is last.            */            fprintf(inOptions->mOutput, "%s\n", symbol);        }        else        {            retval = __LINE__;            ERROR_REPORT(retval, lineBuffer, "Malformed input line.");        }    }    if(0 == retval && 0 != ferror(inOptions->mInput))    {        retval = __LINE__;        ERROR_REPORT(retval, inOptions->mInputName, "Unable to read file.");    }    return retval;}