@mytechtoday/augment-extensions 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/augment-extensions/coding-standards/c/CHANGELOG.md +55 -0
- package/augment-extensions/coding-standards/c/LICENSE +22 -0
- package/augment-extensions/coding-standards/c/README.md +167 -0
- package/augment-extensions/coding-standards/c/config/defaults.json +26 -0
- package/augment-extensions/coding-standards/c/config/examples/embedded.yaml +25 -0
- package/augment-extensions/coding-standards/c/config/examples/systems.json +31 -0
- package/augment-extensions/coding-standards/c/config/schema.json +244 -0
- package/augment-extensions/coding-standards/c/docs/API.md +613 -0
- package/augment-extensions/coding-standards/c/docs/CONFIGURATION.md +259 -0
- package/augment-extensions/coding-standards/c/docs/USER_GUIDE.md +567 -0
- package/augment-extensions/coding-standards/c/examples/drivers/Makefile +33 -0
- package/augment-extensions/coding-standards/c/examples/drivers/README.md +192 -0
- package/augment-extensions/coding-standards/c/examples/drivers/dma-example.c +224 -0
- package/augment-extensions/coding-standards/c/examples/drivers/example.dts +64 -0
- package/augment-extensions/coding-standards/c/examples/drivers/platform-driver.c +174 -0
- package/augment-extensions/coding-standards/c/examples/embedded/README.md +167 -0
- package/augment-extensions/coding-standards/c/examples/embedded/gpio-control.c +172 -0
- package/augment-extensions/coding-standards/c/examples/embedded/timer-isr.c +198 -0
- package/augment-extensions/coding-standards/c/examples/embedded/uart-communication.c +212 -0
- package/augment-extensions/coding-standards/c/examples/kernel/Makefile +82 -0
- package/augment-extensions/coding-standards/c/examples/kernel/README.md +168 -0
- package/augment-extensions/coding-standards/c/examples/kernel/char-device.c +198 -0
- package/augment-extensions/coding-standards/c/examples/kernel/proc-file.c +131 -0
- package/augment-extensions/coding-standards/c/examples/kernel/simple-module.c +111 -0
- package/augment-extensions/coding-standards/c/examples/legacy/Makefile +62 -0
- package/augment-extensions/coding-standards/c/examples/legacy/README.md +255 -0
- package/augment-extensions/coding-standards/c/examples/legacy/c89-to-c11-migration.c +268 -0
- package/augment-extensions/coding-standards/c/examples/legacy/compatibility-layer.c +239 -0
- package/augment-extensions/coding-standards/c/examples/networking/Makefile +35 -0
- package/augment-extensions/coding-standards/c/examples/networking/README.md +207 -0
- package/augment-extensions/coding-standards/c/examples/networking/protocol-parser.c +270 -0
- package/augment-extensions/coding-standards/c/examples/networking/tcp-server.c +197 -0
- package/augment-extensions/coding-standards/c/examples/networking/udp-multicast.c +220 -0
- package/augment-extensions/coding-standards/c/examples/realtime/Makefile +53 -0
- package/augment-extensions/coding-standards/c/examples/realtime/README.md +199 -0
- package/augment-extensions/coding-standards/c/examples/realtime/deadline-monitoring.c +260 -0
- package/augment-extensions/coding-standards/c/examples/realtime/priority-scheduling.c +258 -0
- package/augment-extensions/coding-standards/c/examples/systems/Makefile +34 -0
- package/augment-extensions/coding-standards/c/examples/systems/README.md +123 -0
- package/augment-extensions/coding-standards/c/examples/systems/ipc-pipes.c +181 -0
- package/augment-extensions/coding-standards/c/examples/systems/process-management.c +153 -0
- package/augment-extensions/coding-standards/c/examples/systems/signal-handling.c +162 -0
- package/augment-extensions/coding-standards/c/module.json +149 -0
- package/augment-extensions/coding-standards/c/rules/categories/drivers.md +635 -0
- package/augment-extensions/coding-standards/c/rules/categories/embedded.md +510 -0
- package/augment-extensions/coding-standards/c/rules/categories/kernel.md +653 -0
- package/augment-extensions/coding-standards/c/rules/categories/legacy.md +526 -0
- package/augment-extensions/coding-standards/c/rules/categories/networking.md +735 -0
- package/augment-extensions/coding-standards/c/rules/categories/realtime.md +631 -0
- package/augment-extensions/coding-standards/c/rules/categories/systems.md +586 -0
- package/augment-extensions/coding-standards/c/rules/universal/const-correctness.md +275 -0
- package/augment-extensions/coding-standards/c/rules/universal/documentation.md +251 -0
- package/augment-extensions/coding-standards/c/rules/universal/error-handling.md +250 -0
- package/augment-extensions/coding-standards/c/rules/universal/header-guards.md +254 -0
- package/augment-extensions/coding-standards/c/rules/universal/memory-safety.md +233 -0
- package/augment-extensions/coding-standards/c/rules/universal/naming.md +146 -0
- package/augment-extensions/coding-standards/c/src/conflict-detector.ts +461 -0
- package/augment-extensions/coding-standards/c/src/prompt-generator.ts +307 -0
- package/augment-extensions/coding-standards/c/src/rule-evaluator.ts +307 -0
- package/augment-extensions/coding-standards/c/src/rule-override.ts +427 -0
- package/augment-extensions/coding-standards/c/src/template-engine.ts +217 -0
- package/augment-extensions/coding-standards/c/templates/prompts/drivers.txt +191 -0
- package/augment-extensions/coding-standards/c/templates/prompts/embedded.txt +164 -0
- package/augment-extensions/coding-standards/c/templates/prompts/kernel.txt +175 -0
- package/augment-extensions/coding-standards/c/templates/prompts/legacy.txt +280 -0
- package/augment-extensions/coding-standards/c/templates/prompts/networking.txt +259 -0
- package/augment-extensions/coding-standards/c/templates/prompts/realtime.txt +219 -0
- package/augment-extensions/coding-standards/c/templates/prompts/systems.txt +147 -0
- package/augment-extensions/coding-standards/c/tests/integration/category-specific.test.ts +356 -0
- package/augment-extensions/coding-standards/c/tests/integration/end-to-end-workflow.test.ts +377 -0
- package/augment-extensions/coding-standards/c/tests/performance/benchmarks.test.ts +407 -0
- package/augment-extensions/coding-standards/c/tests/unit/config-manager.test.ts +345 -0
- package/augment-extensions/coding-standards/c/tests/unit/conflict-detector.test.ts +294 -0
- package/augment-extensions/coding-standards/c/tests/unit/prompt-generator.test.ts +174 -0
- package/augment-extensions/coding-standards/c/tests/unit/registry.test.ts +313 -0
- package/augment-extensions/coding-standards/c/tests/unit/rule-evaluator.test.ts +318 -0
- package/augment-extensions/coding-standards/c/tests/unit/rule-override.test.ts +326 -0
- package/augment-extensions/coding-standards/c/tests/unit/template-engine.test.ts +314 -0
- package/augment-extensions/coding-standards/go/CHARACTER-COUNT-REPORT.md +135 -0
- package/augment-extensions/coding-standards/go/PHASE1-COMPLETION.md +146 -0
- package/augment-extensions/coding-standards/go/PHASE4-COMPLETION.md +184 -0
- package/augment-extensions/coding-standards/go/README.md +200 -0
- package/augment-extensions/coding-standards/go/VALIDATION-CHECKLIST.md +154 -0
- package/augment-extensions/coding-standards/go/config/examples/example-cli.json +15 -0
- package/augment-extensions/coding-standards/go/config/examples/example-microservices.json +21 -0
- package/augment-extensions/coding-standards/go/config/examples/example-multi-category.yaml +24 -0
- package/augment-extensions/coding-standards/go/config/examples/example-web.json +15 -0
- package/augment-extensions/coding-standards/go/config/schema.json +110 -0
- package/augment-extensions/coding-standards/go/docs/CATEGORIES.md +221 -0
- package/augment-extensions/coding-standards/go/docs/CONFIGURATION.md +198 -0
- package/augment-extensions/coding-standards/go/docs/TROUBLESHOOTING.md +285 -0
- package/augment-extensions/coding-standards/go/examples/cli/cobra-app.go +287 -0
- package/augment-extensions/coding-standards/go/examples/cloud-native-app.go +217 -0
- package/augment-extensions/coding-standards/go/examples/devops-tool.go +250 -0
- package/augment-extensions/coding-standards/go/examples/distributed-system.go +247 -0
- package/augment-extensions/coding-standards/go/examples/microservices/grpc-service.go +253 -0
- package/augment-extensions/coding-standards/go/examples/rest-api.go +270 -0
- package/augment-extensions/coding-standards/go/examples/web/http-server.go +224 -0
- package/augment-extensions/coding-standards/go/module.json +139 -0
- package/augment-extensions/coding-standards/go/rules/categories/api-development/api-versioning.md +149 -0
- package/augment-extensions/coding-standards/go/rules/categories/api-development/rate-limiting.md +209 -0
- package/augment-extensions/coding-standards/go/rules/categories/api-development/rest-api-design.md +183 -0
- package/augment-extensions/coding-standards/go/rules/categories/cloud-native/cloud-config.md +193 -0
- package/augment-extensions/coding-standards/go/rules/categories/cloud-native/health-checks.md +231 -0
- package/augment-extensions/coding-standards/go/rules/categories/cloud-native/kubernetes.md +180 -0
- package/augment-extensions/coding-standards/go/rules/categories/devops-tooling/automation.md +179 -0
- package/augment-extensions/coding-standards/go/rules/categories/devops-tooling/ci-cd-integration.md +147 -0
- package/augment-extensions/coding-standards/go/rules/categories/devops-tooling/infrastructure-as-code.md +231 -0
- package/augment-extensions/coding-standards/go/rules/categories/distributed-systems/caching.md +150 -0
- package/augment-extensions/coding-standards/go/rules/categories/distributed-systems/consensus.md +187 -0
- package/augment-extensions/coding-standards/go/rules/categories/distributed-systems/event-sourcing.md +246 -0
- package/augment-extensions/coding-standards/go/rules/cli/command-parsing.md +264 -0
- package/augment-extensions/coding-standards/go/rules/cli/configuration.md +268 -0
- package/augment-extensions/coding-standards/go/rules/cli/cross-platform.md +324 -0
- package/augment-extensions/coding-standards/go/rules/microservices/distributed-tracing.md +253 -0
- package/augment-extensions/coding-standards/go/rules/microservices/grpc.md +257 -0
- package/augment-extensions/coding-standards/go/rules/microservices/metrics.md +278 -0
- package/augment-extensions/coding-standards/go/rules/microservices/service-discovery.md +249 -0
- package/augment-extensions/coding-standards/go/rules/universal/code-organization.md +221 -0
- package/augment-extensions/coding-standards/go/rules/universal/documentation.md +269 -0
- package/augment-extensions/coding-standards/go/rules/universal/performance.md +323 -0
- package/augment-extensions/coding-standards/go/rules/universal/testing.md +162 -0
- package/augment-extensions/coding-standards/go/rules/web/graceful-shutdown.md +249 -0
- package/augment-extensions/coding-standards/go/rules/web/http-handlers.md +164 -0
- package/augment-extensions/coding-standards/go/rules/web/middleware.md +234 -0
- package/augment-extensions/coding-standards/go/rules/web/routing.md +251 -0
- package/augment-extensions/coding-standards/go/templates/prompts/api.md +160 -0
- package/augment-extensions/coding-standards/go/templates/prompts/cli.md +225 -0
- package/augment-extensions/coding-standards/go/templates/prompts/cloud-native.md +121 -0
- package/augment-extensions/coding-standards/go/templates/prompts/devops.md +146 -0
- package/augment-extensions/coding-standards/go/templates/prompts/distributed.md +133 -0
- package/augment-extensions/coding-standards/go/templates/prompts/microservices.md +225 -0
- package/augment-extensions/coding-standards/go/templates/prompts/web.md +181 -0
- package/augment-extensions/coding-standards/go/tests/integration/module-integration.test.ts +164 -0
- package/augment-extensions/coding-standards/go/tests/unit/category-selection.test.ts +147 -0
- package/augment-extensions/coding-standards/go/tests/unit/module-structure.test.ts +154 -0
- package/augment-extensions/coding-standards/go/tests/validate-character-count.ps1 +13 -0
- package/augment-extensions/coding-standards/go/tests/validate-examples.ps1 +148 -0
- package/augment-extensions/coding-standards/go/tests/validate-examples.sh +135 -0
- package/cli/dist/analysis/ast-parser.d.ts +47 -0
- package/cli/dist/analysis/ast-parser.d.ts.map +1 -0
- package/cli/dist/analysis/ast-parser.js +161 -0
- package/cli/dist/analysis/ast-parser.js.map +1 -0
- package/cli/dist/analysis/complexity-analyzer.d.ts +27 -0
- package/cli/dist/analysis/complexity-analyzer.d.ts.map +1 -0
- package/cli/dist/analysis/complexity-analyzer.js +189 -0
- package/cli/dist/analysis/complexity-analyzer.js.map +1 -0
- package/cli/dist/analysis/dependency-analyzer.d.ts +23 -0
- package/cli/dist/analysis/dependency-analyzer.d.ts.map +1 -0
- package/cli/dist/analysis/dependency-analyzer.js +237 -0
- package/cli/dist/analysis/dependency-analyzer.js.map +1 -0
- package/cli/dist/analysis/index.d.ts +9 -0
- package/cli/dist/analysis/index.d.ts.map +1 -0
- package/cli/dist/analysis/index.js +25 -0
- package/cli/dist/analysis/index.js.map +1 -0
- package/cli/dist/analysis/security-scanner.d.ts +11 -0
- package/cli/dist/analysis/security-scanner.d.ts.map +1 -0
- package/cli/dist/analysis/security-scanner.js +294 -0
- package/cli/dist/analysis/security-scanner.js.map +1 -0
- package/cli/dist/analysis/types.d.ts +151 -0
- package/cli/dist/analysis/types.d.ts.map +1 -0
- package/cli/dist/analysis/types.js +6 -0
- package/cli/dist/analysis/types.js.map +1 -0
- package/cli/dist/cli.js +24 -0
- package/cli/dist/cli.js.map +1 -1
- package/cli/dist/commands/code-analysis.d.ts +11 -0
- package/cli/dist/commands/code-analysis.d.ts.map +1 -0
- package/cli/dist/commands/code-analysis.js +412 -0
- package/cli/dist/commands/code-analysis.js.map +1 -0
- package/modules.md +99 -3
- package/package.json +14 -2
- package/cli/dist/commands/agent.d.ts +0 -37
- package/cli/dist/commands/agent.d.ts.map +0 -1
- package/cli/dist/commands/agent.js +0 -222
- package/cli/dist/commands/agent.js.map +0 -1
- package/cli/dist/commands/beads.d.ts +0 -64
- package/cli/dist/commands/beads.d.ts.map +0 -1
- package/cli/dist/commands/beads.js +0 -377
- package/cli/dist/commands/beads.js.map +0 -1
- package/cli/dist/commands/change.d.ts +0 -54
- package/cli/dist/commands/change.d.ts.map +0 -1
- package/cli/dist/commands/change.js +0 -243
- package/cli/dist/commands/change.js.map +0 -1
- package/cli/dist/commands/clean.d.ts +0 -15
- package/cli/dist/commands/clean.d.ts.map +0 -1
- package/cli/dist/commands/clean.js +0 -63
- package/cli/dist/commands/clean.js.map +0 -1
- package/cli/dist/commands/clone.d.ts +0 -15
- package/cli/dist/commands/clone.d.ts.map +0 -1
- package/cli/dist/commands/clone.js +0 -49
- package/cli/dist/commands/clone.js.map +0 -1
- package/cli/dist/commands/config.d.ts +0 -33
- package/cli/dist/commands/config.d.ts.map +0 -1
- package/cli/dist/commands/config.js +0 -166
- package/cli/dist/commands/config.js.map +0 -1
- package/cli/dist/commands/context.d.ts +0 -38
- package/cli/dist/commands/context.d.ts.map +0 -1
- package/cli/dist/commands/context.js +0 -205
- package/cli/dist/commands/context.js.map +0 -1
- package/cli/dist/commands/create.d.ts +0 -18
- package/cli/dist/commands/create.d.ts.map +0 -1
- package/cli/dist/commands/create.js +0 -178
- package/cli/dist/commands/create.js.map +0 -1
- package/cli/dist/commands/diff.d.ts +0 -19
- package/cli/dist/commands/diff.d.ts.map +0 -1
- package/cli/dist/commands/diff.js +0 -104
- package/cli/dist/commands/diff.js.map +0 -1
- package/cli/dist/commands/doctor.d.ts +0 -14
- package/cli/dist/commands/doctor.d.ts.map +0 -1
- package/cli/dist/commands/doctor.js +0 -62
- package/cli/dist/commands/doctor.js.map +0 -1
- package/cli/dist/commands/export.d.ts +0 -28
- package/cli/dist/commands/export.d.ts.map +0 -1
- package/cli/dist/commands/export.js +0 -135
- package/cli/dist/commands/export.js.map +0 -1
- package/cli/dist/commands/import.d.ts +0 -23
- package/cli/dist/commands/import.d.ts.map +0 -1
- package/cli/dist/commands/import.js +0 -118
- package/cli/dist/commands/import.js.map +0 -1
- package/cli/dist/commands/prompt.d.ts +0 -45
- package/cli/dist/commands/prompt.d.ts.map +0 -1
- package/cli/dist/commands/prompt.js +0 -223
- package/cli/dist/commands/prompt.js.map +0 -1
- package/cli/dist/commands/spec.d.ts +0 -57
- package/cli/dist/commands/spec.d.ts.map +0 -1
- package/cli/dist/commands/spec.js +0 -279
- package/cli/dist/commands/spec.js.map +0 -1
- package/cli/dist/commands/stats.d.ts +0 -18
- package/cli/dist/commands/stats.d.ts.map +0 -1
- package/cli/dist/commands/stats.js +0 -85
- package/cli/dist/commands/stats.js.map +0 -1
- package/cli/dist/commands/task.d.ts +0 -65
- package/cli/dist/commands/task.d.ts.map +0 -1
- package/cli/dist/commands/task.js +0 -282
- package/cli/dist/commands/task.js.map +0 -1
- package/cli/dist/commands/template.d.ts +0 -17
- package/cli/dist/commands/template.d.ts.map +0 -1
- package/cli/dist/commands/template.js +0 -55
- package/cli/dist/commands/template.js.map +0 -1
- package/cli/dist/utils/agent-config.d.ts +0 -129
- package/cli/dist/utils/agent-config.d.ts.map +0 -1
- package/cli/dist/utils/agent-config.js +0 -297
- package/cli/dist/utils/agent-config.js.map +0 -1
- package/cli/dist/utils/beads-graph.d.ts +0 -17
- package/cli/dist/utils/beads-graph.d.ts.map +0 -1
- package/cli/dist/utils/beads-graph.js +0 -150
- package/cli/dist/utils/beads-graph.js.map +0 -1
- package/cli/dist/utils/beads-integration.d.ts +0 -112
- package/cli/dist/utils/beads-integration.d.ts.map +0 -1
- package/cli/dist/utils/beads-integration.js +0 -312
- package/cli/dist/utils/beads-integration.js.map +0 -1
- package/cli/dist/utils/beads-reporter.d.ts +0 -17
- package/cli/dist/utils/beads-reporter.d.ts.map +0 -1
- package/cli/dist/utils/beads-reporter.js +0 -160
- package/cli/dist/utils/beads-reporter.js.map +0 -1
- package/cli/dist/utils/cache-manager.d.ts +0 -55
- package/cli/dist/utils/cache-manager.d.ts.map +0 -1
- package/cli/dist/utils/cache-manager.js +0 -150
- package/cli/dist/utils/cache-manager.js.map +0 -1
- package/cli/dist/utils/change-manager.d.ts +0 -70
- package/cli/dist/utils/change-manager.d.ts.map +0 -1
- package/cli/dist/utils/change-manager.js +0 -412
- package/cli/dist/utils/change-manager.js.map +0 -1
- package/cli/dist/utils/config-manager-enhanced.d.ts +0 -66
- package/cli/dist/utils/config-manager-enhanced.d.ts.map +0 -1
- package/cli/dist/utils/config-manager-enhanced.js +0 -77
- package/cli/dist/utils/config-manager-enhanced.js.map +0 -1
- package/cli/dist/utils/context-manager.d.ts +0 -96
- package/cli/dist/utils/context-manager.d.ts.map +0 -1
- package/cli/dist/utils/context-manager.js +0 -258
- package/cli/dist/utils/context-manager.js.map +0 -1
- package/cli/dist/utils/diff-engine.d.ts +0 -78
- package/cli/dist/utils/diff-engine.d.ts.map +0 -1
- package/cli/dist/utils/diff-engine.js +0 -233
- package/cli/dist/utils/diff-engine.js.map +0 -1
- package/cli/dist/utils/export-system.d.ts +0 -101
- package/cli/dist/utils/export-system.d.ts.map +0 -1
- package/cli/dist/utils/export-system.js +0 -289
- package/cli/dist/utils/export-system.js.map +0 -1
- package/cli/dist/utils/health-checker.d.ts +0 -66
- package/cli/dist/utils/health-checker.d.ts.map +0 -1
- package/cli/dist/utils/health-checker.js +0 -285
- package/cli/dist/utils/health-checker.js.map +0 -1
- package/cli/dist/utils/import-system.d.ts +0 -74
- package/cli/dist/utils/import-system.d.ts.map +0 -1
- package/cli/dist/utils/import-system.js +0 -317
- package/cli/dist/utils/import-system.js.map +0 -1
- package/cli/dist/utils/module-cloner.d.ts +0 -40
- package/cli/dist/utils/module-cloner.d.ts.map +0 -1
- package/cli/dist/utils/module-cloner.js +0 -136
- package/cli/dist/utils/module-cloner.js.map +0 -1
- package/cli/dist/utils/prompt-manager.d.ts +0 -90
- package/cli/dist/utils/prompt-manager.d.ts.map +0 -1
- package/cli/dist/utils/prompt-manager.js +0 -302
- package/cli/dist/utils/prompt-manager.js.map +0 -1
- package/cli/dist/utils/spec-manager.d.ts +0 -65
- package/cli/dist/utils/spec-manager.d.ts.map +0 -1
- package/cli/dist/utils/spec-manager.js +0 -329
- package/cli/dist/utils/spec-manager.js.map +0 -1
- package/cli/dist/utils/stats-collector.d.ts +0 -74
- package/cli/dist/utils/stats-collector.d.ts.map +0 -1
- package/cli/dist/utils/stats-collector.js +0 -164
- package/cli/dist/utils/stats-collector.js.map +0 -1
- package/cli/dist/utils/template-engine.d.ts +0 -47
- package/cli/dist/utils/template-engine.d.ts.map +0 -1
- package/cli/dist/utils/template-engine.js +0 -204
- package/cli/dist/utils/template-engine.js.map +0 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file ipc-pipes.c
|
|
3
|
+
* @brief Example demonstrating inter-process communication using pipes
|
|
4
|
+
*
|
|
5
|
+
* This example shows:
|
|
6
|
+
* - Creating pipes for IPC
|
|
7
|
+
* - Bidirectional communication between parent and child
|
|
8
|
+
* - Proper file descriptor management
|
|
9
|
+
* - Error handling for pipe operations
|
|
10
|
+
* - Resource cleanup
|
|
11
|
+
*
|
|
12
|
+
* Compile: gcc -Wall -Wextra -std=c11 -o ipc-pipes ipc-pipes.c
|
|
13
|
+
* Run: ./ipc-pipes
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#include <unistd.h>
|
|
17
|
+
#include <stdio.h>
|
|
18
|
+
#include <stdlib.h>
|
|
19
|
+
#include <string.h>
|
|
20
|
+
#include <sys/types.h>
|
|
21
|
+
#include <sys/wait.h>
|
|
22
|
+
#include <errno.h>
|
|
23
|
+
|
|
24
|
+
#define BUFFER_SIZE 256
|
|
25
|
+
#define MESSAGE_COUNT 5
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @brief Simple pipe communication example
|
|
29
|
+
* @return 0 on success, -1 on error
|
|
30
|
+
*/
|
|
31
|
+
int simple_pipe_example(void) {
|
|
32
|
+
int pipefd[2];
|
|
33
|
+
pid_t pid;
|
|
34
|
+
char buffer[BUFFER_SIZE];
|
|
35
|
+
|
|
36
|
+
// Create pipe
|
|
37
|
+
if (pipe(pipefd) < 0) {
|
|
38
|
+
perror("pipe");
|
|
39
|
+
return -1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
pid = fork();
|
|
43
|
+
if (pid < 0) {
|
|
44
|
+
perror("fork");
|
|
45
|
+
close(pipefd[0]);
|
|
46
|
+
close(pipefd[1]);
|
|
47
|
+
return -1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (pid == 0) {
|
|
51
|
+
// Child process: write to pipe
|
|
52
|
+
close(pipefd[0]); // Close read end
|
|
53
|
+
|
|
54
|
+
const char *message = "Hello from child process!";
|
|
55
|
+
ssize_t written = write(pipefd[1], message, strlen(message) + 1);
|
|
56
|
+
if (written < 0) {
|
|
57
|
+
perror("write");
|
|
58
|
+
close(pipefd[1]);
|
|
59
|
+
exit(EXIT_FAILURE);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
close(pipefd[1]);
|
|
63
|
+
exit(EXIT_SUCCESS);
|
|
64
|
+
} else {
|
|
65
|
+
// Parent process: read from pipe
|
|
66
|
+
close(pipefd[1]); // Close write end
|
|
67
|
+
|
|
68
|
+
ssize_t bytes_read = read(pipefd[0], buffer, sizeof(buffer) - 1);
|
|
69
|
+
if (bytes_read < 0) {
|
|
70
|
+
perror("read");
|
|
71
|
+
close(pipefd[0]);
|
|
72
|
+
return -1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
buffer[bytes_read] = '\0';
|
|
76
|
+
printf("Parent received: %s\n", buffer);
|
|
77
|
+
|
|
78
|
+
close(pipefd[0]);
|
|
79
|
+
wait(NULL); // Wait for child to finish
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @brief Bidirectional pipe communication example
|
|
87
|
+
* @return 0 on success, -1 on error
|
|
88
|
+
*/
|
|
89
|
+
int bidirectional_pipe_example(void) {
|
|
90
|
+
int parent_to_child[2]; // Parent writes, child reads
|
|
91
|
+
int child_to_parent[2]; // Child writes, parent reads
|
|
92
|
+
pid_t pid;
|
|
93
|
+
char buffer[BUFFER_SIZE];
|
|
94
|
+
|
|
95
|
+
// Create both pipes
|
|
96
|
+
if (pipe(parent_to_child) < 0) {
|
|
97
|
+
perror("pipe (parent_to_child)");
|
|
98
|
+
return -1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (pipe(child_to_parent) < 0) {
|
|
102
|
+
perror("pipe (child_to_parent)");
|
|
103
|
+
close(parent_to_child[0]);
|
|
104
|
+
close(parent_to_child[1]);
|
|
105
|
+
return -1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
pid = fork();
|
|
109
|
+
if (pid < 0) {
|
|
110
|
+
perror("fork");
|
|
111
|
+
close(parent_to_child[0]);
|
|
112
|
+
close(parent_to_child[1]);
|
|
113
|
+
close(child_to_parent[0]);
|
|
114
|
+
close(child_to_parent[1]);
|
|
115
|
+
return -1;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (pid == 0) {
|
|
119
|
+
// Child process
|
|
120
|
+
close(parent_to_child[1]); // Close write end of parent->child
|
|
121
|
+
close(child_to_parent[0]); // Close read end of child->parent
|
|
122
|
+
|
|
123
|
+
// Read from parent
|
|
124
|
+
ssize_t bytes_read = read(parent_to_child[0], buffer, sizeof(buffer) - 1);
|
|
125
|
+
if (bytes_read > 0) {
|
|
126
|
+
buffer[bytes_read] = '\0';
|
|
127
|
+
printf("Child received: %s\n", buffer);
|
|
128
|
+
|
|
129
|
+
// Send response to parent
|
|
130
|
+
const char *response = "ACK from child";
|
|
131
|
+
write(child_to_parent[1], response, strlen(response) + 1);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
close(parent_to_child[0]);
|
|
135
|
+
close(child_to_parent[1]);
|
|
136
|
+
exit(EXIT_SUCCESS);
|
|
137
|
+
} else {
|
|
138
|
+
// Parent process
|
|
139
|
+
close(parent_to_child[0]); // Close read end of parent->child
|
|
140
|
+
close(child_to_parent[1]); // Close write end of child->parent
|
|
141
|
+
|
|
142
|
+
// Send message to child
|
|
143
|
+
const char *message = "Hello from parent";
|
|
144
|
+
write(parent_to_child[1], message, strlen(message) + 1);
|
|
145
|
+
close(parent_to_child[1]);
|
|
146
|
+
|
|
147
|
+
// Read response from child
|
|
148
|
+
ssize_t bytes_read = read(child_to_parent[0], buffer, sizeof(buffer) - 1);
|
|
149
|
+
if (bytes_read > 0) {
|
|
150
|
+
buffer[bytes_read] = '\0';
|
|
151
|
+
printf("Parent received: %s\n", buffer);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
close(child_to_parent[0]);
|
|
155
|
+
wait(NULL);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
int main(void) {
|
|
162
|
+
printf("=== IPC Pipes Example ===\n\n");
|
|
163
|
+
|
|
164
|
+
printf("Example 1: Simple one-way pipe\n");
|
|
165
|
+
if (simple_pipe_example() < 0) {
|
|
166
|
+
fprintf(stderr, "Simple pipe example failed\n");
|
|
167
|
+
return EXIT_FAILURE;
|
|
168
|
+
}
|
|
169
|
+
printf("\n");
|
|
170
|
+
|
|
171
|
+
printf("Example 2: Bidirectional pipe communication\n");
|
|
172
|
+
if (bidirectional_pipe_example() < 0) {
|
|
173
|
+
fprintf(stderr, "Bidirectional pipe example failed\n");
|
|
174
|
+
return EXIT_FAILURE;
|
|
175
|
+
}
|
|
176
|
+
printf("\n");
|
|
177
|
+
|
|
178
|
+
printf("All IPC examples completed successfully\n");
|
|
179
|
+
return EXIT_SUCCESS;
|
|
180
|
+
}
|
|
181
|
+
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file process-management.c
|
|
3
|
+
* @brief Example demonstrating POSIX process management with fork/exec/wait
|
|
4
|
+
*
|
|
5
|
+
* This example shows:
|
|
6
|
+
* - Proper fork() usage with error checking
|
|
7
|
+
* - Process creation and management
|
|
8
|
+
* - Parent-child process coordination
|
|
9
|
+
* - Exit status handling
|
|
10
|
+
* - Resource cleanup
|
|
11
|
+
*
|
|
12
|
+
* Compile: gcc -Wall -Wextra -std=c11 -o process-management process-management.c
|
|
13
|
+
* Run: ./process-management
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#include <sys/types.h>
|
|
17
|
+
#include <sys/wait.h>
|
|
18
|
+
#include <unistd.h>
|
|
19
|
+
#include <stdio.h>
|
|
20
|
+
#include <stdlib.h>
|
|
21
|
+
#include <string.h>
|
|
22
|
+
#include <errno.h>
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @brief Spawn a child process to execute a command
|
|
26
|
+
* @param command Command to execute
|
|
27
|
+
* @param args Arguments for the command (NULL-terminated)
|
|
28
|
+
* @return 0 on success, -1 on error
|
|
29
|
+
*/
|
|
30
|
+
int spawn_process(const char *command, char *const args[]) {
|
|
31
|
+
if (command == NULL || args == NULL) {
|
|
32
|
+
fprintf(stderr, "Error: NULL command or args\n");
|
|
33
|
+
return -1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
pid_t pid = fork();
|
|
37
|
+
|
|
38
|
+
if (pid < 0) {
|
|
39
|
+
// Fork failed
|
|
40
|
+
perror("fork");
|
|
41
|
+
return -1;
|
|
42
|
+
} else if (pid == 0) {
|
|
43
|
+
// Child process
|
|
44
|
+
execvp(command, args);
|
|
45
|
+
// If execvp returns, it failed
|
|
46
|
+
perror("execvp");
|
|
47
|
+
exit(EXIT_FAILURE);
|
|
48
|
+
} else {
|
|
49
|
+
// Parent process
|
|
50
|
+
int status;
|
|
51
|
+
pid_t result = waitpid(pid, &status, 0);
|
|
52
|
+
|
|
53
|
+
if (result < 0) {
|
|
54
|
+
perror("waitpid");
|
|
55
|
+
return -1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (WIFEXITED(status)) {
|
|
59
|
+
int exit_code = WEXITSTATUS(status);
|
|
60
|
+
printf("Child process %d exited with status %d\n", pid, exit_code);
|
|
61
|
+
return exit_code == 0 ? 0 : -1;
|
|
62
|
+
} else if (WIFSIGNALED(status)) {
|
|
63
|
+
int signal = WTERMSIG(status);
|
|
64
|
+
fprintf(stderr, "Child process %d terminated by signal %d\n", pid, signal);
|
|
65
|
+
return -1;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @brief Create multiple child processes and wait for all
|
|
74
|
+
* @param count Number of child processes to create
|
|
75
|
+
* @return 0 on success, -1 on error
|
|
76
|
+
*/
|
|
77
|
+
int spawn_multiple_processes(int count) {
|
|
78
|
+
if (count <= 0 || count > 100) {
|
|
79
|
+
fprintf(stderr, "Error: Invalid process count %d\n", count);
|
|
80
|
+
return -1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
pid_t *children = malloc(count * sizeof(pid_t));
|
|
84
|
+
if (children == NULL) {
|
|
85
|
+
perror("malloc");
|
|
86
|
+
return -1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Create child processes
|
|
90
|
+
for (int i = 0; i < count; i++) {
|
|
91
|
+
pid_t pid = fork();
|
|
92
|
+
|
|
93
|
+
if (pid < 0) {
|
|
94
|
+
perror("fork");
|
|
95
|
+
// Clean up already created processes
|
|
96
|
+
for (int j = 0; j < i; j++) {
|
|
97
|
+
kill(children[j], SIGTERM);
|
|
98
|
+
}
|
|
99
|
+
free(children);
|
|
100
|
+
return -1;
|
|
101
|
+
} else if (pid == 0) {
|
|
102
|
+
// Child process
|
|
103
|
+
printf("Child %d (PID %d) running\n", i, getpid());
|
|
104
|
+
sleep(1); // Simulate work
|
|
105
|
+
exit(EXIT_SUCCESS);
|
|
106
|
+
} else {
|
|
107
|
+
// Parent process
|
|
108
|
+
children[i] = pid;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Wait for all children
|
|
113
|
+
int failed = 0;
|
|
114
|
+
for (int i = 0; i < count; i++) {
|
|
115
|
+
int status;
|
|
116
|
+
pid_t result = waitpid(children[i], &status, 0);
|
|
117
|
+
|
|
118
|
+
if (result < 0) {
|
|
119
|
+
perror("waitpid");
|
|
120
|
+
failed++;
|
|
121
|
+
} else if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
|
|
122
|
+
fprintf(stderr, "Child %d failed\n", children[i]);
|
|
123
|
+
failed++;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
free(children);
|
|
128
|
+
return failed == 0 ? 0 : -1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
int main(void) {
|
|
132
|
+
printf("=== Process Management Example ===\n\n");
|
|
133
|
+
|
|
134
|
+
// Example 1: Simple process execution
|
|
135
|
+
printf("Example 1: Execute 'ls -l' command\n");
|
|
136
|
+
char *args[] = {"ls", "-l", NULL};
|
|
137
|
+
if (spawn_process("ls", args) < 0) {
|
|
138
|
+
fprintf(stderr, "Failed to execute ls command\n");
|
|
139
|
+
}
|
|
140
|
+
printf("\n");
|
|
141
|
+
|
|
142
|
+
// Example 2: Multiple child processes
|
|
143
|
+
printf("Example 2: Create 3 child processes\n");
|
|
144
|
+
if (spawn_multiple_processes(3) < 0) {
|
|
145
|
+
fprintf(stderr, "Failed to create multiple processes\n");
|
|
146
|
+
return EXIT_FAILURE;
|
|
147
|
+
}
|
|
148
|
+
printf("\n");
|
|
149
|
+
|
|
150
|
+
printf("All examples completed successfully\n");
|
|
151
|
+
return EXIT_SUCCESS;
|
|
152
|
+
}
|
|
153
|
+
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file signal-handling.c
|
|
3
|
+
* @brief Example demonstrating POSIX signal handling
|
|
4
|
+
*
|
|
5
|
+
* This example shows:
|
|
6
|
+
* - Registering signal handlers with sigaction()
|
|
7
|
+
* - Handling common signals (SIGINT, SIGTERM, SIGUSR1)
|
|
8
|
+
* - Async-signal-safe operations
|
|
9
|
+
* - Graceful shutdown
|
|
10
|
+
* - Signal masking
|
|
11
|
+
*
|
|
12
|
+
* Compile: gcc -Wall -Wextra -std=c11 -o signal-handling signal-handling.c
|
|
13
|
+
* Run: ./signal-handling (Press Ctrl+C to test SIGINT)
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#include <signal.h>
|
|
17
|
+
#include <stdio.h>
|
|
18
|
+
#include <stdlib.h>
|
|
19
|
+
#include <string.h>
|
|
20
|
+
#include <unistd.h>
|
|
21
|
+
#include <errno.h>
|
|
22
|
+
|
|
23
|
+
// Global flag for graceful shutdown (volatile sig_atomic_t is async-signal-safe)
|
|
24
|
+
static volatile sig_atomic_t shutdown_requested = 0;
|
|
25
|
+
static volatile sig_atomic_t usr1_count = 0;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @brief Signal handler for SIGINT and SIGTERM
|
|
29
|
+
* @param signum Signal number
|
|
30
|
+
*/
|
|
31
|
+
void shutdown_handler(int signum) {
|
|
32
|
+
// Only async-signal-safe operations allowed here
|
|
33
|
+
shutdown_requested = 1;
|
|
34
|
+
|
|
35
|
+
// write() is async-signal-safe, printf() is not
|
|
36
|
+
const char *msg = (signum == SIGINT) ?
|
|
37
|
+
"Received SIGINT, shutting down...\n" :
|
|
38
|
+
"Received SIGTERM, shutting down...\n";
|
|
39
|
+
write(STDOUT_FILENO, msg, strlen(msg));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @brief Signal handler for SIGUSR1
|
|
44
|
+
* @param signum Signal number
|
|
45
|
+
*/
|
|
46
|
+
void usr1_handler(int signum) {
|
|
47
|
+
(void)signum; // Unused parameter
|
|
48
|
+
usr1_count++;
|
|
49
|
+
|
|
50
|
+
const char *msg = "Received SIGUSR1\n";
|
|
51
|
+
write(STDOUT_FILENO, msg, strlen(msg));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @brief Install signal handlers using sigaction()
|
|
56
|
+
* @return 0 on success, -1 on error
|
|
57
|
+
*/
|
|
58
|
+
int install_signal_handlers(void) {
|
|
59
|
+
struct sigaction sa_shutdown;
|
|
60
|
+
struct sigaction sa_usr1;
|
|
61
|
+
|
|
62
|
+
// Setup shutdown handler (SIGINT, SIGTERM)
|
|
63
|
+
memset(&sa_shutdown, 0, sizeof(sa_shutdown));
|
|
64
|
+
sa_shutdown.sa_handler = shutdown_handler;
|
|
65
|
+
sigemptyset(&sa_shutdown.sa_mask);
|
|
66
|
+
sa_shutdown.sa_flags = SA_RESTART; // Restart interrupted system calls
|
|
67
|
+
|
|
68
|
+
if (sigaction(SIGINT, &sa_shutdown, NULL) < 0) {
|
|
69
|
+
perror("sigaction(SIGINT)");
|
|
70
|
+
return -1;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (sigaction(SIGTERM, &sa_shutdown, NULL) < 0) {
|
|
74
|
+
perror("sigaction(SIGTERM)");
|
|
75
|
+
return -1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Setup SIGUSR1 handler
|
|
79
|
+
memset(&sa_usr1, 0, sizeof(sa_usr1));
|
|
80
|
+
sa_usr1.sa_handler = usr1_handler;
|
|
81
|
+
sigemptyset(&sa_usr1.sa_mask);
|
|
82
|
+
sa_usr1.sa_flags = SA_RESTART;
|
|
83
|
+
|
|
84
|
+
if (sigaction(SIGUSR1, &sa_usr1, NULL) < 0) {
|
|
85
|
+
perror("sigaction(SIGUSR1)");
|
|
86
|
+
return -1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @brief Example of signal masking
|
|
94
|
+
* @return 0 on success, -1 on error
|
|
95
|
+
*/
|
|
96
|
+
int signal_masking_example(void) {
|
|
97
|
+
sigset_t mask, oldmask;
|
|
98
|
+
|
|
99
|
+
printf("Blocking SIGUSR1 for 3 seconds...\n");
|
|
100
|
+
|
|
101
|
+
// Block SIGUSR1
|
|
102
|
+
sigemptyset(&mask);
|
|
103
|
+
sigaddset(&mask, SIGUSR1);
|
|
104
|
+
|
|
105
|
+
if (sigprocmask(SIG_BLOCK, &mask, &oldmask) < 0) {
|
|
106
|
+
perror("sigprocmask(SIG_BLOCK)");
|
|
107
|
+
return -1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
printf("SIGUSR1 is now blocked. Send signal with: kill -USR1 %d\n", getpid());
|
|
111
|
+
sleep(3);
|
|
112
|
+
|
|
113
|
+
// Unblock SIGUSR1
|
|
114
|
+
printf("Unblocking SIGUSR1...\n");
|
|
115
|
+
if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0) {
|
|
116
|
+
perror("sigprocmask(SIG_SETMASK)");
|
|
117
|
+
return -1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
printf("SIGUSR1 is now unblocked\n");
|
|
121
|
+
return 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @brief Main application loop
|
|
126
|
+
*/
|
|
127
|
+
void run_application(void) {
|
|
128
|
+
printf("Application running (PID: %d)\n", getpid());
|
|
129
|
+
printf("Press Ctrl+C to trigger SIGINT\n");
|
|
130
|
+
printf("Send SIGUSR1 with: kill -USR1 %d\n", getpid());
|
|
131
|
+
printf("Send SIGTERM with: kill -TERM %d\n\n", getpid());
|
|
132
|
+
|
|
133
|
+
// Demonstrate signal masking
|
|
134
|
+
signal_masking_example();
|
|
135
|
+
|
|
136
|
+
// Main loop
|
|
137
|
+
int iteration = 0;
|
|
138
|
+
while (!shutdown_requested) {
|
|
139
|
+
printf("Working... (iteration %d, SIGUSR1 count: %d)\n",
|
|
140
|
+
iteration++, (int)usr1_count);
|
|
141
|
+
sleep(2);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
printf("\nShutdown complete. Total SIGUSR1 signals: %d\n", (int)usr1_count);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
int main(void) {
|
|
148
|
+
printf("=== Signal Handling Example ===\n\n");
|
|
149
|
+
|
|
150
|
+
// Install signal handlers
|
|
151
|
+
if (install_signal_handlers() < 0) {
|
|
152
|
+
fprintf(stderr, "Failed to install signal handlers\n");
|
|
153
|
+
return EXIT_FAILURE;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Run application
|
|
157
|
+
run_application();
|
|
158
|
+
|
|
159
|
+
printf("Application terminated gracefully\n");
|
|
160
|
+
return EXIT_SUCCESS;
|
|
161
|
+
}
|
|
162
|
+
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "c-standards",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"displayName": "C Coding Standards",
|
|
5
|
+
"description": "Comprehensive C programming language coding standards for systems programming, embedded systems, kernel development, device drivers, real-time systems, networking, and legacy code maintenance",
|
|
6
|
+
"type": "coding-standards",
|
|
7
|
+
"language": "c",
|
|
8
|
+
"author": "Augment Extensions",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": "https://github.com/mytech-today-now/augment-extensions",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"c",
|
|
13
|
+
"coding-standards",
|
|
14
|
+
"systems-programming",
|
|
15
|
+
"embedded",
|
|
16
|
+
"kernel",
|
|
17
|
+
"drivers",
|
|
18
|
+
"real-time",
|
|
19
|
+
"networking",
|
|
20
|
+
"legacy"
|
|
21
|
+
],
|
|
22
|
+
"tags": [
|
|
23
|
+
"c",
|
|
24
|
+
"systems",
|
|
25
|
+
"embedded",
|
|
26
|
+
"kernel",
|
|
27
|
+
"drivers",
|
|
28
|
+
"realtime",
|
|
29
|
+
"networking",
|
|
30
|
+
"legacy"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {},
|
|
33
|
+
"optionalDependencies": {
|
|
34
|
+
"clang-tidy": ">=14.0.0",
|
|
35
|
+
"cppcheck": ">=2.0.0",
|
|
36
|
+
"valgrind": ">=3.18.0"
|
|
37
|
+
},
|
|
38
|
+
"augment": {
|
|
39
|
+
"minVersion": "1.0.0",
|
|
40
|
+
"characterCount": 0,
|
|
41
|
+
"priority": "high",
|
|
42
|
+
"category": "coding-standards",
|
|
43
|
+
"autoLoad": false,
|
|
44
|
+
"appliesTo": {
|
|
45
|
+
"filePatterns": [
|
|
46
|
+
"**/*.c",
|
|
47
|
+
"**/*.h"
|
|
48
|
+
],
|
|
49
|
+
"projectTypes": [
|
|
50
|
+
"systems",
|
|
51
|
+
"embedded",
|
|
52
|
+
"kernel",
|
|
53
|
+
"drivers",
|
|
54
|
+
"realtime",
|
|
55
|
+
"networking",
|
|
56
|
+
"legacy"
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"categories": {
|
|
61
|
+
"systems": {
|
|
62
|
+
"description": "Systems programming (POSIX, IPC, processes, signals)",
|
|
63
|
+
"rules": ["categories/systems.md"],
|
|
64
|
+
"examples": ["examples/systems/"]
|
|
65
|
+
},
|
|
66
|
+
"embedded": {
|
|
67
|
+
"description": "Embedded systems (microcontrollers, ISRs, hardware registers)",
|
|
68
|
+
"rules": ["categories/embedded.md"],
|
|
69
|
+
"examples": ["examples/embedded/"]
|
|
70
|
+
},
|
|
71
|
+
"kernel": {
|
|
72
|
+
"description": "Linux kernel development (modules, drivers, subsystems)",
|
|
73
|
+
"rules": ["categories/kernel.md"],
|
|
74
|
+
"examples": ["examples/kernel/"]
|
|
75
|
+
},
|
|
76
|
+
"drivers": {
|
|
77
|
+
"description": "Device drivers (character, block, network devices)",
|
|
78
|
+
"rules": ["categories/drivers.md"],
|
|
79
|
+
"examples": ["examples/drivers/"]
|
|
80
|
+
},
|
|
81
|
+
"realtime": {
|
|
82
|
+
"description": "Real-time systems (RTOS, scheduling, determinism)",
|
|
83
|
+
"rules": ["categories/realtime.md"],
|
|
84
|
+
"examples": ["examples/realtime/"]
|
|
85
|
+
},
|
|
86
|
+
"networking": {
|
|
87
|
+
"description": "Network programming (sockets, protocols, packet processing)",
|
|
88
|
+
"rules": ["categories/networking.md"],
|
|
89
|
+
"examples": ["examples/networking/"]
|
|
90
|
+
},
|
|
91
|
+
"legacy": {
|
|
92
|
+
"description": "Legacy code maintenance and modernization",
|
|
93
|
+
"rules": ["categories/legacy.md"],
|
|
94
|
+
"examples": ["examples/legacy/"]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"universalRules": [
|
|
98
|
+
"universal/naming.md",
|
|
99
|
+
"universal/memory-safety.md",
|
|
100
|
+
"universal/error-handling.md",
|
|
101
|
+
"universal/documentation.md",
|
|
102
|
+
"universal/header-guards.md",
|
|
103
|
+
"universal/const-correctness.md"
|
|
104
|
+
],
|
|
105
|
+
"features": {
|
|
106
|
+
"configuration": true,
|
|
107
|
+
"ruleRegistry": true,
|
|
108
|
+
"promptGeneration": true,
|
|
109
|
+
"staticAnalysis": true,
|
|
110
|
+
"customRules": true,
|
|
111
|
+
"hotReload": true
|
|
112
|
+
},
|
|
113
|
+
"installation": {
|
|
114
|
+
"required": false,
|
|
115
|
+
"steps": [
|
|
116
|
+
"Link module using: augx link coding-standards/c",
|
|
117
|
+
"Or manually copy contents to project's .augment/ folder",
|
|
118
|
+
"Configure categories in .augment/c-standards.json"
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
"configuration": {
|
|
122
|
+
"schema": "config/schema.json",
|
|
123
|
+
"defaults": "config/defaults.json",
|
|
124
|
+
"examples": [
|
|
125
|
+
"config/examples/systems.json",
|
|
126
|
+
"config/examples/embedded.yaml"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"contents": [
|
|
130
|
+
"module.json",
|
|
131
|
+
"README.md",
|
|
132
|
+
"CHANGELOG.md",
|
|
133
|
+
"LICENSE",
|
|
134
|
+
".gitignore",
|
|
135
|
+
"src/",
|
|
136
|
+
"rules/",
|
|
137
|
+
"examples/",
|
|
138
|
+
"templates/",
|
|
139
|
+
"config/",
|
|
140
|
+
"tests/",
|
|
141
|
+
"docs/"
|
|
142
|
+
],
|
|
143
|
+
"links": {
|
|
144
|
+
"homepage": "https://github.com/mytech-today-now/augment-extensions",
|
|
145
|
+
"documentation": "https://github.com/mytech-today-now/augment-extensions/tree/main/augment-extensions/coding-standards/c",
|
|
146
|
+
"issues": "https://github.com/mytech-today-now/augment-extensions/issues"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|