mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
3530342dcc
Co-authored-by: ckie <25263210+ckiee@users.noreply.github.com> Signed-off-by: h7x4 <h7x4@nani.wtf>
21 lines
565 B
C
21 lines
565 B
C
// Copyright (C) 2005-2023 Mark A Lindner, ckie
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
#include <stdio.h>
|
|
#include <libconfig.h>
|
|
int main(int argc, char **argv)
|
|
{
|
|
config_t cfg;
|
|
config_init(&cfg);
|
|
if (argc != 2)
|
|
{
|
|
fprintf(stderr, "USAGE: validator <path-to-validate>");
|
|
}
|
|
if(! config_read_file(&cfg, argv[1]))
|
|
{
|
|
fprintf(stderr, "[libconfig] %s:%d - %s\n", config_error_file(&cfg),
|
|
config_error_line(&cfg), config_error_text(&cfg));
|
|
config_destroy(&cfg);
|
|
return 1;
|
|
}
|
|
printf("[libconfig] validation ok\n");
|
|
} |