/* * main.c * Copyright (C) 2021 light * * Distributed under terms of the MIT license. */ #include #include"./include/test.h" #include #include struct memGlobal { unsigned int All; float Useage; unsigned int Free; } memG; struct cpuGlobal { float Useage; } cpuG; struct Proc_Info pList[MaxCache]; int main() { unsigned int *ids; ids = getProcess(); int i, index; pList[3].pid = 2; for(i=0;i<128;i++) { index = foundProcess(pList, *ids); if (index == -1) { index = assertProcess(pList, *ids); } updateProcInfo(&pList[index]); // printf("/proc/%d %d \n", *ids, index); ids ++; if (*ids == 0) { break; } } updateMem(&memG.All, &memG.Free, &memG.Useage); printf("mem: all %u free: %u usage: %f\n", memG.All, memG.Free, memG.Useage); return 0; }