Skip to content

About

I created this config parser project to practice reading files, string manipulation, and memory management in C. It helped me learn how to parse simple key-value data (like KEY=VALUE) from a text file and store it dynamically using a custom linked list structure.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C Config Parser

A command-line utility written in C that parses simple key-value configuration files.

Features

  • Parses configuration settings line by line.
  • Stores key-value pairs dynamically using a custom linked list.
  • Safely manages memory by allocating and freeing strings and nodes.
  • Utilizes a modern C build setup with CMake and Ninja.

The Dummy Test File

Included in this project is a file named file.config. This is strictly a dummy test file provided so you can quickly see how the parser works out of the box. It contains some sample key-value pairs. You can safely modify it or point the program to your own custom configuration files instead.

Building and Running

You can build and run this project either by using the provided command runner (just) or by running the CMake commands manually.

Option 1: With just (Recommended)

If you have just installed, building and running the project is streamlined.

Build the project:

just build

Run the project:

just run file.config

Clean up build artifacts:

just clean

Option 2: Without just (Manual CMake)

Build the project:

cmake -B build -G Ninja -S .
cmake --build build

Run the project:

./build/parser file.config

About

I created this config parser project to practice reading files, string manipulation, and memory management in C. It helped me learn how to parse simple key-value data (like KEY=VALUE) from a text file and store it dynamically using a custom linked list structure.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages