Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
THM-Oberon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Hellwig Geisse
THM-Oberon
Commits
72eede0a
Commit
72eede0a
authored
Apr 08, 2018
by
Hellwig Geisse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reorganize converters
parent
357fa93a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
83 additions
and
120 deletions
+83
-120
tools/Makefile
tools/Makefile
+1
-1
tools/convert/Makefile
tools/convert/Makefile
+0
-23
tools/convert/dos2oberon/Makefile
tools/convert/dos2oberon/Makefile
+0
-17
tools/convert/dos2oberon/dos2oberon.c
tools/convert/dos2oberon/dos2oberon.c
+0
-34
tools/convert/oberon2dos/Makefile
tools/convert/oberon2dos/Makefile
+0
-17
tools/convert/oberon2dos/oberon2dos.c
tools/convert/oberon2dos/oberon2dos.c
+0
-26
tools/oberon2unix/Makefile
tools/oberon2unix/Makefile
+1
-1
tools/oberon2unix/oberon2unix.c
tools/oberon2unix/oberon2unix.c
+40
-0
tools/unix2oberon/Makefile
tools/unix2oberon/Makefile
+1
-1
tools/unix2oberon/unix2oberon.c
tools/unix2oberon/unix2oberon.c
+40
-0
No files found.
tools/Makefile
View file @
72eede0a
...
...
@@ -4,7 +4,7 @@
BUILD
=
../build
DIRS
=
convert mkdisk
DIRS
=
mkdisk oberon2unix unix2oberon
all
:
for
i
in
$(DIRS)
;
do
\
...
...
tools/convert/Makefile
deleted
100644 → 0
View file @
357fa93a
#
# Makefile for text conversion tools
#
BUILD
=
../../build
DIRS
=
dos2oberon oberon2dos unix2oberon oberon2unix
all
:
for
i
in
$(DIRS)
;
do
\
$(MAKE)
-C
$$
i all
;
\
done
install
:
for
i
in
$(DIRS)
;
do
\
$(MAKE)
-C
$$
i
install
;
\
done
clean
:
for
i
in
$(DIRS)
;
do
\
$(MAKE)
-C
$$
i clean
;
\
done
rm
-f
*
~
tools/convert/dos2oberon/Makefile
deleted
100644 → 0
View file @
357fa93a
#
# Makefile for DOS-to-Oberon text converter
#
BUILD
=
../../../build
all
:
dos2oberon
install
:
dos2oberon
mkdir
-p
$(BUILD)
/bin
cp
dos2oberon
$(BUILD)
/bin
dos2oberon
:
dos2oberon.c
gcc
-g
-Wall
-o
dos2oberon dos2oberon.c
clean
:
rm
-f
*
~ dos2oberon
tools/convert/dos2oberon/dos2oberon.c
deleted
100644 → 0
View file @
357fa93a
/*
* dos2oberon.c -- convert DOS line endings to Oberon line endings
*/
#include <stdio.h>
int
main
(
int
argc
,
char
*
argv
[])
{
int
c1
,
c2
;
c1
=
fgetc
(
stdin
);
if
(
c1
==
EOF
)
{
return
0
;
}
while
(
1
)
{
c2
=
fgetc
(
stdin
);
if
(
c2
==
EOF
)
{
fputc
(
c1
,
stdout
);
return
0
;
}
if
(
c1
==
'\r'
&&
c2
==
'\n'
)
{
fputc
(
c1
,
stdout
);
c1
=
fgetc
(
stdin
);
if
(
c1
==
EOF
)
{
return
0
;
}
}
else
{
fputc
(
c1
,
stdout
);
c1
=
c2
;
}
}
return
0
;
}
tools/convert/oberon2dos/Makefile
deleted
100644 → 0
View file @
357fa93a
#
# Makefile for Oberon-to-DOS text converter
#
BUILD
=
../../../build
all
:
oberon2dos
install
:
oberon2dos
mkdir
-p
$(BUILD)
/bin
cp
oberon2dos
$(BUILD)
/bin
oberon2dos
:
oberon2dos.c
gcc
-g
-Wall
-o
oberon2dos oberon2dos.c
clean
:
rm
-f
*
~ oberon2dos
tools/convert/oberon2dos/oberon2dos.c
deleted
100644 → 0
View file @
357fa93a
/*
* oberon2dos.c -- convert Oberon line endings to DOS line endings
*/
#include <stdio.h>
int
main
(
int
argc
,
char
*
argv
[])
{
int
c
;
while
(
1
)
{
c
=
fgetc
(
stdin
);
if
(
c
==
EOF
)
{
return
0
;
}
if
(
c
==
'\r'
)
{
fputc
(
c
,
stdout
);
c
=
'\n'
;
fputc
(
c
,
stdout
);
}
else
{
fputc
(
c
,
stdout
);
}
}
return
0
;
}
tools/
convert/
oberon2unix/Makefile
→
tools/oberon2unix/Makefile
View file @
72eede0a
...
...
@@ -2,7 +2,7 @@
# Makefile for Oberon-to-UNIX text converter
#
BUILD
=
../../
../
build
BUILD
=
../../build
all
:
oberon2unix
...
...
tools/
convert/
oberon2unix/oberon2unix.c
→
tools/oberon2unix/oberon2unix.c
View file @
72eede0a
...
...
@@ -7,17 +7,34 @@
int
main
(
int
argc
,
char
*
argv
[])
{
FILE
*
in
,
*
out
;
int
c
;
if
(
argc
!=
3
)
{
printf
(
"usage: %s <input file> <output file>
\n
"
,
argv
[
0
]);
return
1
;
}
in
=
fopen
(
argv
[
1
],
"r"
);
if
(
in
==
NULL
)
{
printf
(
"error: cannot open input file '%s'
\n
"
,
argv
[
1
]);
return
1
;
}
out
=
fopen
(
argv
[
2
],
"w"
);
if
(
out
==
NULL
)
{
printf
(
"error: cannot open output file '%s'
\n
"
,
argv
[
2
]);
return
1
;
}
while
(
1
)
{
c
=
fgetc
(
std
in
);
c
=
fgetc
(
in
);
if
(
c
==
EOF
)
{
return
0
;
break
;
}
if
(
c
==
'\r'
)
{
c
=
'\n'
;
}
fputc
(
c
,
std
out
);
fputc
(
c
,
out
);
}
fclose
(
in
);
fclose
(
out
);
return
0
;
}
tools/
convert/
unix2oberon/Makefile
→
tools/unix2oberon/Makefile
View file @
72eede0a
...
...
@@ -2,7 +2,7 @@
# Makefile for UNIX-to-Oberon text converter
#
BUILD
=
../../
../
build
BUILD
=
../../build
all
:
unix2oberon
...
...
tools/
convert/
unix2oberon/unix2oberon.c
→
tools/unix2oberon/unix2oberon.c
View file @
72eede0a
...
...
@@ -7,17 +7,34 @@
int
main
(
int
argc
,
char
*
argv
[])
{
FILE
*
in
,
*
out
;
int
c
;
if
(
argc
!=
3
)
{
printf
(
"usage: %s <input file> <output file>
\n
"
,
argv
[
0
]);
return
1
;
}
in
=
fopen
(
argv
[
1
],
"r"
);
if
(
in
==
NULL
)
{
printf
(
"error: cannot open input file '%s'
\n
"
,
argv
[
1
]);
return
1
;
}
out
=
fopen
(
argv
[
2
],
"w"
);
if
(
out
==
NULL
)
{
printf
(
"error: cannot open output file '%s'
\n
"
,
argv
[
2
]);
return
1
;
}
while
(
1
)
{
c
=
fgetc
(
std
in
);
c
=
fgetc
(
in
);
if
(
c
==
EOF
)
{
return
0
;
break
;
}
if
(
c
==
'\n'
)
{
c
=
'\r'
;
}
fputc
(
c
,
std
out
);
fputc
(
c
,
out
);
}
fclose
(
in
);
fclose
(
out
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment