Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 23, 2025

Initialize repository as a doubly-linked list library following the choco-technologies DMOD ecosystem pattern (dmheap, dmlog, dmvfs, dmenv). Uses dmod as the sole dependency for memory allocation (Dmod_MallocEx/Dmod_Free) and logging (DMOD_LOG_*).

Implementation

  • Core: Doubly-linked list with O(1) push/pop at both ends
  • API: 17 functions covering create/destroy, push/pop/insert/remove, find, foreach, get/size
  • Memory: Module-aware allocation via DMOD enables automatic cleanup on module unload
  • Storage: Generic void* data pointers

Build System

  • CMake with FetchContent for DMOD dependency
  • Auto-generated Makefile via create_library_makefile()
  • Test suite with DMOD stub symbols for standalone execution
  • CI/CD workflow with build-and-test and coverage jobs

Example Usage

dmlist_context_t* list = dmlist_create("my_module");
dmlist_push_back(list, &my_data);
void* data = dmlist_pop_front(list);
dmlist_destroy(list);

Directory structure:

include/dmlist.h          # Public API
src/dmlist.c              # Implementation
tests/test_simple.c       # Basic test suite
tests/dmod_stubs.c        # Linker symbol stubs for tests
CMakeLists.txt            # Build configuration
README.md                 # Documentation
.github/workflows/ci.yml  # CI/CD configuration
Original prompt

This section details on the original issue you should resolve

<issue_title>Zainicjować repozytorium jako bibliotekę</issue_title>
<issue_description>Początkowo myślałem o tym, żeby zrobić to repo jako moduł, ale dotarło do mnie, że będę go też potrzebował do implementacji takich rzeczy jak RTOS, które to będą biblioteką, więc zainicjujmy to repozytorium jako bibliotekę listy linkowanej, w tym samym stylu jak te:

https://github.com/choco-technologies/dmheap
https://github.com/choco-technologies/dmvfs
https://github.com/choco-technologies/dmlog
https://github.com/choco-technologies/dmenv

Do tego repozytorium jedyną zależnością będzie prawdopodobnie repozytorium dmod - nic więcej nie powinniśmy potrzebować do listy linkowanej. Alokację i logi weźmiemy z niej - Dmod_Malloc oraz DMOD_LOG_* nam całkowicie powinno wystarczyć. </issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 23, 2025 15:05
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title [WIP] Initialize repository as a linked list library Initialize dmlist as DMOD linked list library Nov 23, 2025
Copilot AI requested a review from JohnAmadis November 23, 2025 15:09
Copy link
Contributor

@JohnAmadis JohnAmadis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot popraw

include/dmlist.h Outdated
*
* @return Pointer to the list context, or NULL if initialization fails.
*/
DMOD_BUILTIN_API( dmlist, 1.0, dmlist_context_t*, _init, ( const char* module_name ) );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tutaj lepiej by było to nazwać _create

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Renamed to _create in commit 974c737.

# ======================================================================
# DMOD List
# ======================================================================
project(dmlist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brakuje CI

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added CI workflow with build-and-test and coverage jobs in commit 974c737.

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 23, 2025

@copilot popraw

Fixed both issues in commit 974c737:

  • Renamed _init to _create
  • Added CI configuration at .github/workflows/ci.yml

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
@JohnAmadis JohnAmadis marked this pull request as ready for review November 23, 2025 16:02
@JohnAmadis JohnAmadis merged commit 7c2ec83 into master Nov 23, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Zainicjować repozytorium jako bibliotekę

2 participants