-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Pablo R. edited this page Oct 6, 2025
·
3 revisions
A small, efficient C library providing missing utilities for safe and comfortable string manipulation and time helpers. Designed to be lightweight, portable, and easy to integrate into C projects.
# Clone and build
git clone https://github.com/murapadev/strap.git
cd strap
make
# Install (optional)
sudo make install
#include <stdio.h>
#include "strap.h"
int main(void) {
// Safe line reading
char *line = afgets(stdin);
if (line) {
char *trimmed = strtrim(line);
printf("Trimmed: '%s'\n", trimmed);
free(line);
free(trimmed);
}
// String joining
const char *parts[] = {"Hello", "world", "from", "STRAP"};
char *joined = strjoin(parts, 4, " ");
printf("%s\n", joined);
free(joined);
return 0;
}
- Quick Start Guide - Get up and running in minutes
- API Reference - Detailed function documentation
- Examples - Code examples and use cases
- Cookbook - Practical recipes for logs, CSV wrangling, and templating
- Contributing - How to contribute to STRAP
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
- Extended locale-aware string helpers
- Optional arena allocator for transient strings
- Timezone-aware time utilities
- Unified error reporting system
- Additional performance optimizations
- SIMD-accelerated hot paths for
strtrim
/strjoin
- Streaming-friendly buffering for
afgets
and file utilities (strap_line_buffer_read
)
- SIMD-accelerated hot paths for
- Extended string manipulation utilities
- High-level split helpers with delimiter limits and predicates (
strsplit_limit
,strsplit_predicate
) - Case-insensitive comparison helpers (
strap_strcasecmp
,strcaseeq
)
- High-level split helpers with delimiter limits and predicates (
- Cross-platform improvements
- Official Windows/MSVC build scripts and CI coverage
- Locale/timezone shims for BSD and musl targets
- Enhanced documentation
- Cookbook-style guides that solve real-world text processing tasks
- API reference refresh with usage notes and complexity details
MIT Licensed - see LICENSE for details.
STRAP - Making C string and time operations safer and more convenient.