/
ygl
/
test_statdata
Обзор
Документация
Войти
/
ygl
/
test_statdata
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/stat.h
40 строк
881 B
user
togit
04 ноя 2025, 15:46
04 ноя 2025, 15:46
53c0af3
Код
Авторство
О чём код?
#ifndef stat_h #define stat_h #include <stdlib.h> #include <stdio.h> typedef struct StatData { long id; int count; float cost; unsigned int primary:1; unsigned int mode:3; } StatData; typedef struct StatDataList { StatData* data; long len; } StatDataList; int StoreDump(const char* filename, const StatData* data, size_t count); int LoadDump(const char* fn, StatData** sdl, long* sdn); /* если бы id был точно !=0, можно класть сразу StatData после calloc */ typedef struct { int used; StatData sd; } HashSlot; void ht_insert(const StatData* s, HashSlot* table, size_t mask); int JoinDump( const StatData* a, long an, const StatData* b, long bn, StatData** r, long* rn); void SortDump(StatData *data, size_t count); void StatDataPrint(const StatData *sd, size_t n); #endif