#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <cpuinfo/log.h>
#include <linux/api.h>
#include <x86/linux/api.h>
#define BUFFER_SIZE …
static uint32_t parse_processor_number(const char* processor_start, const char* processor_end) { … }
static void parse_apic_id(
const char* apic_start,
const char* apic_end,
struct cpuinfo_x86_linux_processor processor[restrict static 1]) { … }
struct proc_cpuinfo_parser_state { … };
static bool parse_line(
const char* line_start,
const char* line_end,
struct proc_cpuinfo_parser_state state[restrict static 1],
uint64_t line_number) { … }
bool cpuinfo_x86_linux_parse_proc_cpuinfo(
uint32_t max_processors_count,
struct cpuinfo_x86_linux_processor processors[restrict static max_processors_count]) { … }