reSIProcate/stack  9694
Classes | Public Member Functions
resip::ApiCheck Class Reference

#include <ApiCheck.hxx>

List of all members.

Classes

struct  ApiEntry

Public Member Functions

 ApiCheck (ApiEntry *list, int len)

Detailed Description

Definition at line 18 of file ApiCheck.hxx.


Constructor & Destructor Documentation

resip::ApiCheck::ApiCheck ( ApiEntry list,
int  len 
)

Definition at line 11 of file ApiCheck.cxx.

References anonymous_resipApiSizeList, resip::ApiCheck::ApiEntry::culprits, len, resip::ApiCheck::ApiEntry::name, and resip::ApiCheck::ApiEntry::sz.

{
    int bad = 0;

    ApiEntry* p = list;
    ApiEntry* q = ::anonymous_resipApiSizeList;
    int resipListLen = sizeof(::anonymous_resipApiSizeList)/sizeof(*::anonymous_resipApiSizeList);

    if (list == ::anonymous_resipApiSizeList )
    {
        return;
    }

    if (resipListLen != len)
    {
        std::cerr << "reSIProcate Type verification list lengths are different."
                  << std::endl
                  << "\tEither the library and application are radically out of date" 
                  << std::endl
                  << "application length: " << len << std::endl
                  << "reSIProcate length: " << resipListLen << std::endl;
        ++bad;
    }

    std::cerr << std::setfill(' ') 
              << std::setw(34) << "Class" << ' '
              << std::setw(8) << "App" << ' '
              << std::setw(8) << "Lib" << ' '
              << std::setw(8) << "Possible Culprit Flags"
              << std::endl;

    for(int i = 0 ; i < resipListLen && i < len; ++i)
    {
        bool oops = false;
        if (strcmp(p[i].name, q[i].name))
        {
            std::cerr << "!!! Miss match entry for : (app)"
                      << p[i].name << " vs. (resip)" <<  q[i].name
                      << std::endl;
            ++bad;
            continue;
        }

        if (p[i].sz != q[i].sz)
        {
            ++bad;
            oops = true;
        }
        const char w = oops?'!':' ';

        std::cerr << w << w << w << std::setfill(' ')
                  << std::setw(30-strlen(p[i].name)) << "resip::" 
                  << p[i].name << ' '
                  << std::setw(8) << p[i].sz << ' '
                  << std::setw(8) << q[i].sz << ' '
                  << (oops?p[i].culprits:"")
                  << std::endl;


    }

    if (bad)
    {
        std::cerr <<"SERIOUS COMPILATION / CONFIGURATION ERRORS -- ABORTING" << std::endl;
#ifndef UNDER_CE
        abort();
#endif
        exit(bad);
    }
    std::cerr << std::endl;
}

The documentation for this class was generated from the following files: