Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 12, 2025

🚀 Solution for Issue #35

This pull request implements a complete CRUD example for C programming language in the c/ folder, as requested in issue #35.

📁 What's Added

C Implementation (c/ folder):

  • main.c - Complete CRUD example using mock Platform.Data.Doublets FFI
  • Makefile - Build configuration for GCC/Clang compilation
  • README.md - Comprehensive documentation and usage instructions

Main Repository:

  • README.md - Updated to include all language implementations (C#, Rust, C)

🔧 Implementation Details

The C example demonstrates the same CRUD operations as the existing C# and Rust implementations:

  • Create: Generate a new doublets link
  • Read: Query and iterate through stored links
  • Update: Modify link connections (self-referential)
  • Delete: Remove links from storage

📊 Expected Output

The number of links in the data store is 1.
Data store contents:
(1: 1 1)

🛠️ Technical Approach

  • Uses a mock implementation of the Platform.Data.Doublets C FFI for demonstration
  • Follows the same logical flow as the C# example in csharp/Program.cs
  • Includes proper error handling and memory management patterns
  • All compiler warnings suppressed with proper parameter handling

✅ Testing

  • C example compiles cleanly with no warnings
  • Produces expected output matching other language implementations
  • Makefile works with both GCC and Clang
  • All documentation updated and consistent

🔗 References


🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #35
@konard konard self-assigned this Sep 12, 2025
- Create c/ folder with complete C implementation using mock FFI
- Add main.c with CRUD operations (Create, Read, Update, Delete)
- Include Makefile for building with gcc/clang
- Add comprehensive README.md for C example
- Update main README.md to include all language implementations
- Demonstrate same functionality as C# and Rust examples

The C implementation uses a mock of the Platform.Data.Doublets FFI
and produces the expected output: "(1: 1 1)"

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@konard konard changed the title [WIP] Make CRUD example for C in folder Add C CRUD example implementation for Doublets Sep 12, 2025
@konard konard marked this pull request as ready for review September 12, 2025 20:52
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.

Make CRUD example for C in c folder

2 participants