48 lines
1.4 KiB
C
48 lines
1.4 KiB
C
#ifndef _FETCH_H
|
|
#define _FETCH_H
|
|
|
|
#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
|
|
|
|
#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"
|
|
};
|
|
#endif
|
|
|
|
|
|
#if defined(_FETCH_C) || defined(_MAIN_C)
|
|
int GetOs(char *os_name, size_t len);
|
|
void GetArt(FETCH *fetch, int flag);
|
|
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
|
|
|
|
#endif
|