libicuid  1.4.1
Functions
icuid.c File Reference
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <icuid/icuid.h>
#include <internal/stdcompat.h>
#include "features.h"
#include "intel.h"
#include "amd.h"

Functions

int cpuid_get_raw_data (cpuid_raw_data_t *raw)
 Obtains the raw CPUID info from the CPU. More...
 
int cpuid_serialize_raw_data (cpuid_raw_data_t *raw, const char *file)
 Writes the raw CPUID info to a file or stdout. More...
 
int cpuid_deserialize_raw_data (cpuid_raw_data_t *raw, const char *file)
 Reads the raw CPUID info to a file or stdin. More...
 
int icuid_identify (cpuid_raw_data_t *raw, cpuid_data_t *data)
 Identifies the CPU. More...
 

Function Documentation

int cpuid_deserialize_raw_data ( cpuid_raw_data_t raw,
const char *  file 
)

Reads the raw CPUID info to a file or stdin.

Parameters
raw[in] - a pointer to a cpuid_raw_data_t structure
file[in] - the path to the file, where the serialized raw data should be read from. If empty, stdin will be used instead.
Note
This is primarily intended for debugging use. e.g. if someone has an error with the returned data they can send the raw data to us for us to fix. Backwards compatibility is not guaranteed nor is forwards compatibility.
Returns
ICUID_OK if successful, and some other error code otherwise. The error message can be obtained by calling icuid_errorstr.
int cpuid_get_raw_data ( cpuid_raw_data_t raw)

Obtains the raw CPUID info from the CPU.

Parameters
raw[in] - a pointer to a cpuid_raw_data_t structure
Returns
ICUID_OK if successful, and some other error code otherwise. The error message can be obtained by calling icuid_errorstr.
int cpuid_serialize_raw_data ( cpuid_raw_data_t raw,
const char *  file 
)

Writes the raw CPUID info to a file or stdout.

Parameters
raw[in] - a pointer to a cpuid_raw_data_t structure
file[in] - the path to the file, where the serialized raw data should be written. If empty, stdout will be used instead.
Note
This is primarily intended for debugging use. e.g. if someone has an error with the returned data they can send the raw data to us for us to fix. Backwards compatibility is not guaranteed nor is forwards compatibility.
Returns
ICUID_OK if successful, and some other error code otherwise. The error message can be obtained by calling icuid_errorstr.
int icuid_identify ( cpuid_raw_data_t raw,
cpuid_data_t data 
)

Identifies the CPU.

Parameters
raw[in] - a pointer to the raw CPUID data, which is obtained by cpuid_get_raw_data or by passing NULL, in which case the function calls cpuid_get_raw_data itself.
data[out] - the decoded CPU information
Note
This function will not fail even if some info is not collected due to error or unsupported info.
Returns
ICUID_OK if successful, and some other error code otherwise. The error message can be obtained by calling icuid_errorstr.