文件
ParlzPackageManger/src/ini.h
T
JGZYES 114ef62dd9 ParlzPackageManger (PMM): cross-platform package manager + mirror
- C11, static MinGW build, single exe (pmm/pdm)
- apt-style multi-mirror install with sha256/sha1 verify
- .pdm package format (pdm pack/install/remove), deb-like
- github/gitlab/gitea/forgejo release install with --git/--github etc.
- python/pip-style version selection (==,>=,<=,>,< , comma)
- auto platform selection (windows/linux variants)
- Windows Installed Apps registration + PATH auto-add
- download progress bar (tqdm-style, ASCII-safe)
- mirror/ : zero-dep Node.js registry server (variants, multi-version)
- Licensed under GNU GPL v3
2026-08-30 18:11:21 +08:00

29 行
776 B
C

/* ini.h - tiny INI / .conf parser for PMM.
* Format:
* [section]
* key = value (# or ; comment)
* Also accepts key = value lines without a section (section = "").
*/
#ifndef PMM_INI_H
#define PMM_INI_H
typedef struct IniEntry {
char *section;
char *key;
char *value;
struct IniEntry *next;
} IniEntry;
typedef struct {
IniEntry *head;
} Ini;
Ini *ini_load(const char *path);
void ini_free(Ini *ini);
/* Lookup value; section may be NULL or "" for top-level. Returns NULL if absent. */
const char *ini_get(const Ini *ini, const char *section, const char *key);
/* First key in given section whose value matches; returns key name or NULL. */
const char *ini_find_key_by_value(const Ini *ini, const char *section, const char *value);
#endif