-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
209 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# base settings | ||
BasedOnStyle: LLVM | ||
IndentWidth: 4 | ||
ColumnLimit: 120 | ||
# details | ||
# AlignArrayOfStructures: Left # Disable for now, crashes current clang-format. | ||
AlignEscapedNewlines: Left | ||
AllowAllConstructorInitializersOnNextLine: true | ||
AllowShortBlocksOnASingleLine: Never | ||
AlwaysBreakAfterReturnType: None | ||
#BinPackArguments: false | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
BeforeElse: true | ||
BeforeCatch: true | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
MaxEmptyLinesToKeep: 2 | ||
# clang 14+: | ||
#PackConstructorInitializers: NextLine | ||
PointerAlignment: Left | ||
UseTab: Never | ||
#IncludeIsMainRegex: "$" | ||
IncludeCategories: | ||
- Regex: '^"config.h"' | ||
Priority: 1 | ||
- Regex: '^"compat.h"' | ||
Priority: 2 | ||
- Regex: '^<' | ||
Priority: 3 | ||
- Regex: '.*' | ||
Priority: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
- Add test for `read-only`. | ||
- Include documentation in binary distribution. | ||
- Allow running on multiple tests. | ||
- Allow quotes in `description`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ set(TEST_PROGRAMS | |
cat | ||
getenv | ||
file | ||
uppercase | ||
) | ||
|
||
foreach(PROGRAM ${TEST_PROGRAMS}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
program nihtest-true | ||
arguments | ||
return 0 | ||
file test.uc test.lc <inline> | ||
LOWERCASE TEXT | ||
end-of-inline-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
program nihtest | ||
arguments test.test | ||
return 0 | ||
file test.test copier.input | ||
file nihtest.conf nihtest-conf | ||
file test.lc <inline> | ||
lowercase text | ||
end-of-inline-data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
uppercase.c -- | ||
Copyright (C) Dieter Baron | ||
The authors can be contacted at <assembler@tpau.group> | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions | ||
are met: | ||
1. Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
2. The names of the authors may not be used to endorse or promote | ||
products derived from this software without specific prior | ||
written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS | ||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY | ||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE | ||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER | ||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN | ||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
|
||
#include <ctype.h> | ||
#include <errno.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
|
||
int main(int argc, char *argv[]) { | ||
if (argc != 3) { | ||
fprintf(stderr, "usage: %s: input output\n", argv[0]); | ||
} | ||
|
||
FILE *in = fopen(argv[1], "r"); | ||
if (in == NULL) { | ||
fprintf(stderr, "%s: can't open '%s': %s\n", argv[0], argv[1], strerror(errno)); | ||
exit(1); | ||
} | ||
|
||
FILE *out = fopen(argv[2], "w"); | ||
if (out == NULL) { | ||
fprintf(stderr, "%s: can't create '%s': %s\n", argv[0], argv[2], strerror(errno)); | ||
exit(1); | ||
} | ||
|
||
unsigned char buf[512]; | ||
size_t n; | ||
|
||
while (((n=fread(buf, 1, sizeof(buf), in))) > 0) { | ||
for (size_t i=0; i < n; i++) { | ||
if (islower(buf[i])) { | ||
buf[i] = toupper(buf[i]); | ||
} | ||
} | ||
if (fwrite(buf, 1, n, out) != n) { | ||
fprintf(stderr, "%s: can't write to '%s': %s\n", argv[0], argv[2], strerror(errno)); | ||
exit(1); | ||
} | ||
} | ||
|
||
if (ferror(in)) { | ||
fprintf(stderr, "%s: can't read from '%s': %s\n", argv[0], argv[1], strerror(errno)); | ||
exit(1); | ||
} | ||
fclose(in); | ||
|
||
if (fclose(out) != 0) { | ||
fprintf(stderr, "%s: can't write to '%s': %s\n", argv[0], argv[2], strerror(errno)); | ||
exit(1); | ||
} | ||
|
||
exit(0); | ||
} |