/**********************************************
 * cpuinfo.c - Case Metrics Interface
 *  Copyright 2007 John Sully.
 *
 *  This file is part of Case Metrics.
 *
 *  Case Metrics is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as 
 *  published by the Free Software Foundation.
 *
 *  Case Metrics is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Case Metrics.  If not, see <http://www.gnu.org/licenses/>.
 *
 **********************************************/


#include "cpuinfo.h"
#include <stdlib.h>

#ifdef __X86__
#include "x86/cpuinfo.h"
#define __IA_ARCH__
#elif __X64__
#include "x86/cpuinfo.h"
#define __IA_ARCH__
#endif

XCHAR *cpuInfoStz()
{
    XCHAR *pstz = NULL;
#ifdef __IA_ARCH__
    BYTE *pb;
    int size;

    size = cpuinfoGetStruct(&pb);
    if(size)
        pstz = cpuInfoToStz(pb);

    free(pb);
#else //__IA_ARCH__
#error "Invalid arch"
#endif
    return pstz;
}
