kfetch/include/fetch.h

48 lines
1.4 KiB
C
Raw Normal View History

2024-01-03 12:09:07 +00:00
#ifndef _FETCH_H
#define _FETCH_H
2023-11-02 14:51:10 +00:00
2024-06-07 11:41:51 +00:00
#include "structs.h"
#ifdef _FETCH_C
#include <time.h>
#if defined(CLOCK_BOOTTIME)
#define CLOCK CLOCK_BOOTTIME
#elif defined(CLOCK_UPTIME)
#define CLOCK CLOCK_UPTIME
#elif defined(__APPLE__)
#define CLOCK CLOCK_MONOTONIC
#endif
2023-11-02 14:51:10 +00:00
2024-06-07 11:41:51 +00:00
#define MODEL_BUFF_SIZE 512
static const char *MODELS[] = {
"/sys/devices/virtual/dmi/id/product_name",
"/sys/devices/virtual/dmi/id/product_version",
"/sys/firmware/devicetree/base/model"
};
2023-11-02 14:51:10 +00:00
#endif
2023-12-28 13:21:23 +00:00
2024-06-07 11:41:51 +00:00
#if defined(_FETCH_C) || defined(_MAIN_C)
2023-11-02 14:51:10 +00:00
int GetOs(char *os_name, size_t len);
2024-01-03 10:18:43 +00:00
void GetArt(FETCH *fetch, int flag);
2024-06-07 11:41:51 +00:00
FETCH Init(void);
#endif
#if defined(_CONFIG_C) || defined(_MAIN_C)
int GetKernel(const struct par par, const FETCH fetch);
int PrintOs(const struct par par, const FETCH fetch);
int Blank(const struct par par, const FETCH fetch);
int GetUser(const struct par par, const FETCH fetch);
int GetUptime(const struct par par, const FETCH fetch);
int GetArch(const struct par par, const FETCH fetch);
int GetShell(const struct par par, const FETCH fetch);
int GetPkg(const struct par par, const FETCH fetch);
int GetMem(const struct par par, const FETCH fetch);
int GetModel(const struct par par, const FETCH fetch);
int GetHostname(const struct par par, const FETCH fetch);
int GetAVG(const struct par par, const FETCH fetch);
int Execute(const struct par par, const FETCH fetch);
int eBlank(const struct par par, const FETCH fetch);
#endif
2023-11-02 14:51:10 +00:00
#endif