Skip to content

Chunduri-Aditya/In-Memory-Event-Stream-Engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‘ In-Memory Event Stream Engine

A C project that implements an event stream using singly linked lists.
Perfect for learning dynamic memory, pointer manipulation, and modular C design.


πŸš€ Features

  • Add events dynamically with id, source, and payload
  • Print full stream contents
  • Search for events by ID
  • Delete specific events by ID
  • Reverse the stream order
  • Fully interactive CLI with memory safety

πŸ“¦ File Structure

β”œβ”€β”€ event.h          # Structure and function declarations
β”œβ”€β”€ event.c          # Core logic: add, delete, search, reverse
β”œβ”€β”€ event_stream.c   # Main program with menu UI
β”œβ”€β”€ Makefile         # Easy build

πŸ§ͺ Sample Run

--- Event Stream Menu ---
1. Add Event
2. Print Stream
3. Search Event by ID
4. Delete Event by ID
5. Reverse Stream
6. Exit
Enter your choice: 2

Event Stream:
Event ID: 6, Source: sensor-3, Payload: Temperature: 25Β°C
Event ID: 5, Source: light-2, Payload: Light turned on
Event ID: 3, Source: sensor-2, Payload: Humidity: 46%
Event ID: 2, Source: camera-1, Payload: Motion detected

πŸ›  Build and Run

πŸ”§ Requirements

  • GCC compiler (e.g., gcc or clang)
  • Make utility (recommended)

πŸ”¨ Build

To build using the provided Makefile:

make

Or compile manually without Makefile:

gcc -o event_stream event.c event_stream.c

▢️ Run the Program

./event_stream

You'll see an interactive CLI menu:

--- Event Stream Menu ---
1. Add Event
2. Print Stream
3. Search Event by ID
4. Delete Event by ID
5. Reverse Stream
6. Exit
Enter your choice: _

🧼 Clean the Build

To remove the compiled executable:

make clean

Or manually:

rm event_stream

πŸ“š Skills Demonstrated

  • βœ… C Structures and Linked Lists
  • βœ… Modular Programming with Header Files
  • βœ… Dynamic Memory Allocation (malloc, free)
  • βœ… CLI Interaction & Input Handling
  • βœ… Pointer Manipulation and Traversal
  • βœ… Clean Code Organization using Makefile

πŸ“Œ Author

Aditya Chunduri


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages