fix: Rename C SDK files to un.c/un.h to match naming convention
- Renamed src/unsandbox.c -> src/un.c - Renamed src/unsandbox.h -> src/un.h - Updated all references in Makefile, README.md, IMPLEMENTATION.md - Matches un.py, un.js, un.go, etc. naming pattern
This commit is contained in:
parent
798336a16d
commit
00dfc1bebc
7 changed files with 42 additions and 33 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Overview
|
||||
|
||||
Complete, production-ready C SDK for unsandbox.com API with full support for code execution, async jobs, language detection, and credential management.
|
||||
Complete, production-ready C SDK for un.com API with full support for code execution, async jobs, language detection, and credential management.
|
||||
|
||||
## Files Created/Modified
|
||||
|
||||
|
|
@ -15,7 +15,7 @@ Complete, production-ready C SDK for unsandbox.com API with full support for cod
|
|||
- Proper extern "C" guards for C++ compatibility
|
||||
- Memory-safe with dedicated free functions
|
||||
|
||||
#### `/clients/c/src/unsandbox.c` (823 lines)
|
||||
#### `/clients/c/src/un.c` (823 lines)
|
||||
- Full implementation with production-quality error handling
|
||||
- Core execution functions (sync, async, wait, get, cancel, list)
|
||||
- Language detection with 48 file extensions
|
||||
|
|
@ -170,7 +170,7 @@ $ cd clients/c && make clean && make test
|
|||
[✓] Test binary ready
|
||||
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
LIBRARY MODE: Testing unsandbox.c functions
|
||||
LIBRARY MODE: Testing un.c functions
|
||||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
|
||||
Testing SHA-256...
|
||||
|
|
@ -316,7 +316,7 @@ make test
|
|||
make clean
|
||||
|
||||
# Manual compilation
|
||||
gcc -O2 -Wall -Wextra -o myapp myapp.c src/unsandbox.c -Isrc -lcurl -lssl -lcrypto
|
||||
gcc -O2 -Wall -Wextra -o myapp myapp.c src/un.c -Isrc -lcurl -lssl -lcrypto
|
||||
```
|
||||
|
||||
## Performance Characteristics
|
||||
|
|
@ -348,7 +348,7 @@ All 22 tests passing with 0 failures.
|
|||
|
||||
## Code Statistics
|
||||
|
||||
- **src/unsandbox.c**: 823 lines (implementation)
|
||||
- **src/un.c**: 823 lines (implementation)
|
||||
- **src/unsandbox.h**: 311 lines (header)
|
||||
- **examples/hello_world.c**: 121 lines
|
||||
- **examples/fibonacci.c**: 217 lines
|
||||
|
|
@ -398,7 +398,7 @@ Use freely for any purpose without restriction.
|
|||
|
||||
## References
|
||||
|
||||
- API Base: https://api.unsandbox.com
|
||||
- API Base: https://api.un.com
|
||||
- Python SDK: `../python/sync/src/un.py`
|
||||
- Go SDK: `../go/sync/src/un.go`
|
||||
- Ruby SDK: `../ruby/sync/src/un.rb`
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
# Paths
|
||||
ROOT_DIR := $(shell cd ../.. && pwd)
|
||||
SRC_DIR := src
|
||||
SRC := $(SRC_DIR)/unsandbox.c
|
||||
HEADER := $(SRC_DIR)/unsandbox.h
|
||||
SRC := $(SRC_DIR)/un.c
|
||||
HEADER := $(SRC_DIR)/un.h
|
||||
BIN := un
|
||||
TEST_DIR := tests
|
||||
EXAMPLES_DIR := examples
|
||||
|
|
@ -60,8 +60,8 @@ build: lib examples
|
|||
|
||||
lib: $(SRC) $(HEADER)
|
||||
@echo "$(GREEN)✓$(NC) Library files ready:"
|
||||
@echo " - $(SRC_DIR)/unsandbox.c (implementation)"
|
||||
@echo " - $(SRC_DIR)/unsandbox.h (header)"
|
||||
@echo " - $(SRC_DIR)/un.c (implementation)"
|
||||
@echo " - $(SRC_DIR)/un.h (header)"
|
||||
|
||||
examples: $(EXAMPLES_DIR)/hello_world $(EXAMPLES_DIR)/fibonacci
|
||||
@echo "$(GREEN)✓$(NC) Examples built"
|
||||
|
|
@ -89,7 +89,7 @@ deps:
|
|||
test: build $(TEST_DIR)/test_library
|
||||
@echo ""
|
||||
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
@echo "LIBRARY MODE: Testing unsandbox.c functions"
|
||||
@echo "LIBRARY MODE: Testing un.c functions"
|
||||
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
@echo ""
|
||||
@./$(TEST_DIR)/test_library
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# unsandbox.com C SDK
|
||||
# un.com C SDK
|
||||
|
||||
A complete, production-ready C SDK for the unsandbox.com code execution API.
|
||||
A complete, production-ready C SDK for the un.com code execution API.
|
||||
|
||||
## Features
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ sudo apt install build-essential libcurl4-openssl-dev libssl-dev
|
|||
cd clients/c
|
||||
make
|
||||
|
||||
# Just build the library (src/unsandbox.c and src/unsandbox.h)
|
||||
# Just build the library (src/un.c and src/unsandbox.h)
|
||||
make lib
|
||||
|
||||
# Build examples (hello_world, fibonacci)
|
||||
|
|
@ -76,7 +76,7 @@ int main(void) {
|
|||
Compile:
|
||||
|
||||
```bash
|
||||
gcc -o myapp myapp.c src/unsandbox.c -Isrc -lcurl -lssl -lcrypto
|
||||
gcc -o myapp myapp.c src/un.c -Isrc -lcurl -lssl -lcrypto
|
||||
```
|
||||
|
||||
### Examples
|
||||
|
|
@ -106,7 +106,7 @@ Run the example:
|
|||
|
||||
```bash
|
||||
cd examples
|
||||
gcc -o hello_world hello_world.c ../src/unsandbox.c -I../src -lcurl -lssl -lcrypto
|
||||
gcc -o hello_world hello_world.c ../src/un.c -I../src -lcurl -lssl -lcrypto
|
||||
./hello_world
|
||||
```
|
||||
|
||||
|
|
@ -466,7 +466,7 @@ export UNSANDBOX_SECRET_KEY="your-secret"
|
|||
|
||||
Check your credentials are valid:
|
||||
```bash
|
||||
curl -H "Authorization: Bearer $UNSANDBOX_PUBLIC_KEY" https://api.unsandbox.com/health
|
||||
curl -H "Authorization: Bearer $UNSANDBOX_PUBLIC_KEY" https://api.un.com/health
|
||||
```
|
||||
|
||||
### Compilation errors
|
||||
|
|
@ -478,7 +478,7 @@ sudo apt install libcurl4-openssl-dev libssl-dev
|
|||
|
||||
Check include paths:
|
||||
```bash
|
||||
gcc -I/usr/include -c src/unsandbox.c
|
||||
gcc -I/usr/include -c src/un.c
|
||||
```
|
||||
|
||||
## License
|
||||
|
|
@ -496,7 +496,7 @@ Compile examples:
|
|||
```bash
|
||||
cd examples
|
||||
make -C .. examples # Or:
|
||||
gcc -o hello_world hello_world.c ../src/unsandbox.c -I../src -lcurl -lssl -lcrypto
|
||||
gcc -o hello_world hello_world.c ../src/un.c -I../src -lcurl -lssl -lcrypto
|
||||
./hello_world
|
||||
```
|
||||
|
||||
|
|
@ -504,4 +504,4 @@ gcc -o hello_world hello_world.c ../src/unsandbox.c -I../src -lcurl -lssl -lcryp
|
|||
|
||||
- Python SDK: `../python/sync/src/un.py`
|
||||
- Go SDK: `../go/sync/src/un.go`
|
||||
- API Documentation: `https://api.unsandbox.com/`
|
||||
- API Documentation: `https://api.un.com/`
|
||||
|
|
|
|||
|
|
@ -563,4 +563,4 @@ apt install libcurl4-openssl-dev libwebsockets-dev libssl-dev
|
|||
- See `../Makefile` for compilation and testing infrastructure
|
||||
- See `../tests/test_library.c` for unit test patterns
|
||||
- See `../../un.c` for full library implementation
|
||||
- Visit https://unsandbox.com for API documentation
|
||||
- Visit https://un.com for API documentation
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
* unsandbox.com C SDK Implementation
|
||||
*/
|
||||
|
||||
#include "unsandbox.h"
|
||||
#include "un.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
* unsandbox.com C SDK (Synchronous)
|
||||
*
|
||||
* Library Usage:
|
||||
* #include "unsandbox.h"
|
||||
* #include "un.h"
|
||||
*
|
||||
* // Execute code synchronously
|
||||
* unsandbox_result_t *result = unsandbox_execute("python", "print(42)", NULL, NULL);
|
||||
Loading…
Add table
Add a link
Reference in a new issue