diff --git a/Makefile b/Makefile index 5f8a680..e3c686d 100644 --- a/Makefile +++ b/Makefile @@ -26,9 +26,9 @@ TESTS = $(TEST_DIR)/feature_test.rc \ $(TEST_DIR)/string_test.rc \ $(TEST_DIR)/string_manip_test.rc -EXAMPLES = $(EXAMPLE_DIR)/test.rc \ - $(EXAMPLE_DIR)/demo.rc \ - $(EXAMPLE_DIR)/a.rc +EXAMPLES = $(EXAMPLE_DIR)/http_simple.rc \ + $(EXAMPLE_DIR)/http_persistent.rc \ + $(EXAMPLE_DIR)/http_multi.rc .PHONY: all clean test run-tests run-examples help dirs @@ -81,14 +81,14 @@ run-string-test: $(TARGET) run-string-manip: $(TARGET) $(TARGET) $(TEST_DIR)/string_manip_test.rc -run-example-test: $(TARGET) - $(TARGET) $(EXAMPLE_DIR)/test.rc +run-http-simple: $(TARGET) + $(TARGET) $(EXAMPLE_DIR)/http_simple.rc -run-example-demo: $(TARGET) - $(TARGET) $(EXAMPLE_DIR)/demo.rc +run-http-persistent: $(TARGET) + $(TARGET) $(EXAMPLE_DIR)/http_persistent.rc -run-example-a: $(TARGET) - $(TARGET) $(EXAMPLE_DIR)/a.rc +run-http-multi: $(TARGET) + $(TARGET) $(EXAMPLE_DIR)/http_multi.rc help: @echo "RC - Retoor's C Interpreter" @@ -106,9 +106,9 @@ help: @echo " make run-string-manip - Run string_manip_test.rc (string manipulation & slicing)" @echo "" @echo "Examples:" - @echo " make run-example-test - Run test.rc (HTTP server)" - @echo " make run-example-demo - Run demo.rc (HTTP server with counter)" - @echo " make run-example-a - Run a.rc (HTTP server, 100 connections)" + @echo " make run-http-simple - Run http_simple.rc (single connection HTTP server)" + @echo " make run-http-persistent - Run http_persistent.rc (persistent HTTP server)" + @echo " make run-http-multi - Run http_multi.rc (HTTP server, 100 connections)" @echo "" @echo "Directory Structure:" @echo " src/ - Source code files" diff --git a/README.md b/README.md index 3d6d1d7..4edfdfc 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ Or use make targets: ```bash make test # Run all tests make run-feature-test # Run specific test -make run-example-test # Run HTTP server example +make run-http-simple # Run simple HTTP server example ``` ## Example Programs @@ -115,8 +115,16 @@ int main() { } ``` -### HTTP Server -See `examples/test.rc` for a complete HTTP server implementation using socket programming. +### HTTP Server Examples + +**Simple HTTP Server** (`examples/http_simple.rc`) +Single-connection HTTP server that accepts one request and exits. + +**Persistent HTTP Server** (`examples/http_persistent.rc`) +HTTP server with request counter that continuously accepts connections. + +**Multi-Connection HTTP Server** (`examples/http_multi.rc`) +HTTP server that handles up to 100 consecutive connections. ## Project Structure diff --git a/examples/a.rc b/examples/http_multi.rc similarity index 100% rename from examples/a.rc rename to examples/http_multi.rc diff --git a/examples/demo.rc b/examples/http_persistent.rc similarity index 100% rename from examples/demo.rc rename to examples/http_persistent.rc diff --git a/examples/test.rc b/examples/http_simple.rc similarity index 100% rename from examples/test.rc rename to examples/http_simple.rc