Skip to content

feat: migrate I/O operations to core/ with Result types - #151

Merged
flyingrobots merged 4 commits into
mainfrom
fix/warnings
Jul 8, 2025
Merged

feat: migrate I/O operations to core/ with Result types#151
flyingrobots merged 4 commits into
mainfrom
fix/warnings

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Summary

  • Migrated I/O operations from src/util/io_default.c to core/src/io/io.c
  • Modernized API with Result types for all operations
  • Added comprehensive test suite with 6 test functions

Changes

  • Created new Result-based I/O interface in core/include/gitmind/io/io.h
  • All operations now return Result types for explicit error handling
  • Added test coverage for file, directory, filesystem, and process operations
  • Achieved zero warnings with strict C23 compiler flags
  • Deleted legacy files: io_default.c and io_ops.h

Test Results

All 10 tests pass, zero warnings in clang-tidy.

🤖 Generated with Claude Code

- Create modern I/O interface with Result-based error handling
- All I/O operations now return Result types for explicit error handling
- Comprehensive test coverage for file, directory, filesystem, and process operations
- Zero warnings achieved with strict C23 compiler flags
- Delete legacy io_default.c and io_ops.h from src/
- Fix memory leaks by freeing error objects in tests
- Fix naming conventions (CamelCase for struct constants)
- Add NOLINT for feature test macros
- Remove unused error.h include from io.h
- Add missing includes for types (result.h, sys/types.h)
- Suppress cert-env33-c warning for system() function
- Added gm_error_free() calls for all error cases in test_io.c
- Fixed test_file_operations error handling (line 94)
- Fixed test_dir_operations error handling (line 132)
- Fixed test_fs_operations error handling (line 194)
- Replaced threads.h with pthread.h for macOS compatibility
- Changed thrd_sleep to nanosleep for POSIX compliance
- All tests now pass with zero memory leaks
@flyingrobots
flyingrobots merged commit 852e560 into main Jul 8, 2025
@flyingrobots
flyingrobots deleted the fix/warnings branch July 8, 2025 20:22
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.

1 participant