Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 85 additions & 17 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,17 +1,85 @@
*.c linguist-language=C
*.cmake linguist-vendored
*.cmd linguist-detectable=false
*.cpp linguist-language=C++
*.cxx linguist-language=C++
*.dsp linguist-detectable=false
*.dsw linguist-detectable=false
*.h linguist-language=C
*.hpp linguist-language=C++
*.html linguist-detectable=false
*.hxx linguist-language=C++
*.sh linguist-detectable=false
*.sln linguist-detectable=false
*.vcxproj linguist-detectable=false
*.vimrc linguist-detectable=false
CMakeLists.txt linguist-vendored
makefile linguist-detectable=false
# .gitattributes — C (GitHub-hosted)
#
# Sources: GitHub Docs (line endings), git-scm gitattributes (diff=cpp),
# gitattributes/gitattributes C++.gitattributes + Common.gitattributes,
# github-linguist overrides.

# Default: detect text, normalize to LF in the repository
* text=auto

# --- Source ---
*.c text diff=cpp
*.h text diff=cpp
*.inc text
*.inl text

# --- Build / config ---
*.am text
*.cmake text
*.m4 text
*.mak text
*.mk text
*akefile text
CMakeLists.txt text
configure text eol=lf
configure.ac text

# --- Scripts ---
*.bash text eol=lf
*.bat text eol=crlf
*.cmd text eol=crlf
*.ps1 text eol=crlf
*.sh text eol=lf
*.zsh text eol=lf

# --- Docs / meta ---
*.adoc text
*.markdown text diff=markdown
*.md text diff=markdown
*.txt text
AUTHORS text
CHANGELOG text
CHANGES text
CONTRIBUTING text
COPYING text
LICENSE text
NEWS text
README text
TODO text
.gitattributes text
.gitignore text

# --- Serialisation ---
*.json text
*.toml text
*.xml text
*.yaml text
*.yml text

# --- Compiled / binary artefacts ---
*.a binary
*.dll binary
*.dylib binary
*.exe binary
*.gch binary
*.lib binary
*.o binary
*.obj binary
*.out binary
*.pch binary
*.so binary

# --- Archives / images (common) ---
*.gif binary
*.gz binary
*.ico binary
*.jpeg binary
*.jpg binary
*.png binary
*.tar binary
*.zip binary

# --- GitHub Linguist ---
# Object / build trees if committed (prefer .gitignore; mark if present)
**/build/** linguist-generated
**/cmake-build-*/** linguist-generated
1 change: 1 addition & 0 deletions .github/workflows/ci-cell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,3 +266,4 @@ jobs:
else
test -x "$PREFIX/bin/${PROJECT}"
fi
test -f "$PREFIX/share/man/man1/${PROJECT}.1" || test -f "$PREFIX/man/man1/${PROJECT}.1"
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ on:
push:
branches:
- master
- dev
- boilerplate
- idiomatic
- rc1
- rc2
- rc3
pull_request:

concurrency:
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/_internal/

/bin/
/doc/
/include/
/lib/
/node_modules/
Expand Down
16 changes: 15 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"editor.tabSize": 4,
},
"[c]": {
"editor.defaultFormatter": "ms-vscode.cpptools",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.rulers": [ 60, 64, 68, 72, 76 ],
"editor.tabSize": 4,
Expand All @@ -14,6 +16,8 @@
"editor.tabSize": 4,
},
"[cpp]": {
"editor.defaultFormatter": "ms-vscode.cpptools",
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.rulers": [ 60, 64, 68, 72, 76 ],
"editor.tabSize": 4,
Expand Down Expand Up @@ -49,7 +53,17 @@
"editor.insertSpaces": true,
"editor.tabSize": 2,
},
"C_Cpp.autocompleteAddParentheses": true,
"C_Cpp.clang_format_fallbackStyle": "none",
"C_Cpp.clang_format_style": "file",
"C_Cpp.default.cStandard": "c17",
"C_Cpp.default.cppStandard": "c++17",
"C_Cpp.enhancedColorization": "enabled",
"C_Cpp.errorSquiggles": "enabled",
"C_Cpp.formatting": "clangFormat",
"C_Cpp.intelliSenseEngine": "default",
"cmake.configureOnOpen": false,
"debug.allowBreakpointsEverywhere": true,
"editor.detectIndentation": false,
"editor.insertSpaces": false,
"editor.renderWhitespace": "all",
Expand Down Expand Up @@ -128,6 +142,7 @@
"numeric": "cpp",
"optional": "cpp",
"ostream": "cpp",
"print": "cpp",
"queue": "cpp",
"random": "cpp",
"ranges": "cpp",
Expand Down Expand Up @@ -180,4 +195,3 @@
"files.trimTrailingWhitespace": true,
"git.mergeEditor": false,
}

20 changes: 15 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,16 @@ set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT

# adhere strictly to C and C++ standards plus extensions. These are actually
# useless since we do not compile anything; they merely state our intention.
set(CMAKE_C_STANDARD 11)
if(NOT CMAKE_C_STANDARD)

set(CMAKE_C_STANDARD 17)
endif()
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON) # GNU extensions and POSIX standard
set(CMAKE_CXX_STANDARD 17)
if(NOT CMAKE_CXX_STANDARD)

set(CMAKE_CXX_STANDARD 17)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS ON)

Expand Down Expand Up @@ -186,7 +192,7 @@ elseif(DEFINED ENV{STLSOFT})
set(STLSOFT_INCLUDE_DIR $ENV{STLSOFT}/include)
else()

set(STLSoft_REQUIRED_VERSION_ 1.11)
set(STLSoft_REQUIRED_VERSION_ 1.11.1)

find_package(STLSoft ${STLSoft_REQUIRED_VERSION_} REQUIRED)

Expand Down Expand Up @@ -255,6 +261,11 @@ install(TARGETS ${PROJECT_NAME_LOWER}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

install(FILES
doc/${PROJECT_NAME_LOWER}.1
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
)


# ################################################
# examples
Expand Down Expand Up @@ -304,8 +315,7 @@ endif(BUILD_TESTING)
# ##########################################################
# completion

message(NOTICE "Generating CMake build scripts for ${PROJECT_NAME} ${PROJECT_VERSION}, for C${CMAKE_C_STANDARD} C++${CMAKE_CXX_STANDARD}")
message(NOTICE "Generating CMake build scripts for ${PROJECT_NAME} ${PROJECT_VERSION}, for C${CMAKE_C_STANDARD} C++${CMAKE_CXX_STANDARD}, with build type ${CMAKE_BUILD_TYPE}")


# ############################## end of file ############################# #

51 changes: 51 additions & 0 deletions Doxyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Doxyfile for chomp (C API)

PROJECT_NAME = "chomp"
PROJECT_BRIEF = "Strips trailing new lines from input"
PROJECT_NUMBER = 0.1.1

OUTPUT_DIRECTORY = _build/doxygen
CREATE_SUBDIRS = NO

INPUT = chomp.h \
chomp.c \
entry.c \
doc
FILE_PATTERNS = *.h \
*.c \
*.md
RECURSIVE = NO
EXCLUDE =

USE_MDFILE_AS_MAINPAGE = doc/mainpage.md

EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO

GENERATE_HTML = YES
GENERATE_LATEX = NO
HTML_OUTPUT = html

GENERATE_TREEVIEW = YES
DISABLE_INDEX = NO
SEARCHENGINE = YES
SOURCE_BROWSER = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES

MARKDOWN_SUPPORT = YES
JAVADOC_AUTOBRIEF = YES
QUIET = YES

WARN_IF_UNDOCUMENTED = YES
WARN_NO_PARAMDOC = YES
WARN_IF_DOC_ERROR = YES

MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
PREDEFINED =

# ########################### end of file ########################### #
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,17 @@ For unit-testing, **chomp** depends additionally on:

### Related projects

Other (similar) project include:

* [**lstrip**](https://github.com/sistools/lstrip)
* [**rstrip**](https://github.com/sistools/rstrip)
Other **sistools** projects include:

* [**errni**](https://github.com/sistools/errni) (errno on all platforms, and also GetLastError codes on Windows);
* [**lnunique**](https://github.com/sistools/lnunique);
* [**lslocales**](https://github.com/sistools/lslocales);
* [**lstrip**](https://github.com/sistools/lstrip);
* [**mksock**](https://github.com/sistools/mksock) (Unix-only);
* [**ReadDebugString**](https://github.com/sistools/ReadDebugString) (Windows-only);
* [**realpath**](https://github.com/sistools/realpath) (Windows-only);
* [**rstrip**](https://github.com/sistools/rstrip);
* [**WriteDebugString**](https://github.com/sistools/WriteDebugString) (Windows-only);


### License
Expand Down
5 changes: 2 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# chomp - TODO list


## chomp 0.8.x TODOs:
## chomp 0.1.x TODOs:

* \<none>
* Set GitHub repository topics: `c`, `cli`, `command-line`, `cmake`, `stlsoft`, `text-processing`, `filter`, `string-manipulation`, `bsd-3-clause`, `sistools`;


<!-- ########################### end of file ########################### -->

Loading
Loading