fxkit 0.1.3

Useful utilities for writting Rust CLI tools
Documentation
#ifndef FXKIT_H
#define FXKIT_H

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

#if defined(FXKIT_FS)
/**
 * # Safety
 * Make sure file and text aren't null.
 */
 bool fxkit_file_contains(const char *file, const char *text);
#endif

#if defined(FXKIT_UNIX)
/**
 * Checks if the user is root, if yes then returns true otherwise false
 * # Safety
 * This function is completely safe
 */
 bool fxkit_is_root(void);
#endif

#if (defined(FXKIT_UNIX) && defined(FXKIT_BEDROCK))
/**
 * Returns true if running on a Bedrock system, otherwise false
 * # Safety
 * This function is completely safe
 */
 bool fxkit_check_bedrock(void);
#endif

#if (defined(FXKIT_UNIX) && defined(FXKIT_BEDROCK))
/**
 * Returns the amount of installed strata's on a Bedrock system
 * # Safety
 * This function is completely safe
 */
 int fxkit_list_strata(void);
#endif

#if (defined(FXKIT_UNIX) && defined(FXKIT_BEDROCK))
/**
 * Checks if the process is running ``strat`` if yes it the function returns true, else false
 * # Safety
 * This function is completely safe
 */
 bool fxkit_running_in_strat(void);
#endif

#if (defined(FXKIT_UNIX) && defined(FXKIT_BEDROCK))
/**
 * Detects the ``pmm`` interface and returns it
 * # Safety
 * If the function fails to detect the interface, it returns null
 */
 const char *fxkit_pmm_detect_interface(void);
#endif

#if (defined(FXKIT_UNIX) && defined(FXKIT_BEDROCK))
/**
 * Detects the ``init`` stratum and returns the name of it
 * # Safety
 * If the function fails to detect the stratum, it returns null
 */
 const char *fxkit_detect_init_stratum(void);
#endif

#if defined(FXKIT_UNIX)
/**
 * Detects if running on NixOS, if yes then true otherwise false
 * # Safety
 * This function is completely safe
 */
 bool fxkit_running_on_nixos(void);
#endif

#if defined(FXKIT_UNIX)
/**
 * Looks for the ``os-release`` file and returns it
 * # Safety
 * If the function fails to find the ``os-release`` file, it returns null
 */
 const char *fxkit_find_os_release(void);
#endif

#if defined(FXKIT_UNIX)
/**
 * Checks the os version from the ``os-release`` file, and returns it
 * # Safety
 * If the function fails to get the os version, it returns null
 */
 const char *fxkit_get_os_version(void);
#endif

#if defined(FXKIT_UNIX)
/**
 * Checks the os id from the ``os-release`` file, and returns it
 * # Safety
 * If the function fails to get the os id, it returns null
 */
 const char *fxkit_get_os(void);
#endif

#if (defined(FXKIT_TOOLS) && defined(FXKIT_TOOLS))
/**
 * Checks if a command exists
 * # Safety
 * Make sure cmd isn't null.
 */
 bool fxkit_cmd_exists(const char *cmd);
#endif

#if (defined(FXKIT_TOOLS) && defined(FXKIT_TOOLS))
/**
 * Returns true if the process is running, else false
 * It takes the name of the process as an argument
 * # Safety
 * cmd shouldn't be null.
 */
 bool fxkit_is_process_running(const char *cmd);
#endif

#endif  /* FXKIT_H */