Skip to content

Commit 149ca17

Browse files
committed
New folder structure
Added sections to better organize tasks
1 parent 95d6070 commit 149ca17

34 files changed

+60
-31
lines changed

01-introduction/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Introduction
2+
This section contains tutorials for learning the very basic of C programming.
3+
If you are a noob with no experience in C programming, you are right here ;-)
4+
5+
## Table of Contents

02-data-structures/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Data Structures
2+
This section contains tasks regarding data structures.
3+
4+
## Table of Contents
5+
- [tree](tree)
6+
File renamed without changes.

tree/Makefile 02-data-structures/tree/Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.PHONY: all folder clean run unit_test
22
CC := gcc
3-
CFLAGS := -Wall -Wextra -std=c99 -pedantic -Werror -pipe -fPIC -D_DEFAULT_SOURCE -I../unit_test -O0 -g
3+
CFLAGS := -Wall -Wextra -std=c99 -pedantic -Werror -pipe -fPIC -D_DEFAULT_SOURCE -I../../unit_test -O0 -g
44
LDFLAGS := -g -fPIC
55

66
OBJS += obj/main.o
7-
OBJS += ../unit_test/unit_test.a
7+
OBJS += ../../unit_test/unit_test.a
88
OBJS += obj/create_student.o
99
OBJS += obj/init_tree.o
1010
OBJS += obj/insert_student.o
@@ -24,10 +24,10 @@ clean:
2424
run: tree
2525
./tree
2626

27-
../unit_test/unit_test.a:
28-
make -C ../unit_test
27+
../../unit_test/unit_test.a:
28+
make -C ../../unit_test
2929

30-
obj/main.o: src/main.c src/tree.h ../unit_test/unit_test.h
30+
obj/main.o: src/main.c src/tree.h ../../unit_test/unit_test.h
3131
$(CC) $(CFLAGS) -c -o $@ $<
3232

3333
obj/%.o: src/%.c src/tree.h
File renamed without changes.
File renamed without changes.
File renamed without changes.

03-algorithms/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Algorithms
2+
This section contains material on implementation and optimization of algorithms.
3+
4+
## Table of Contents
5+
- [fib](fib)
File renamed without changes.

fib/Makefile 03-algorithms/fib/Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.PHONY: all folder clean run unit_test
22
CC := gcc
3-
CFLAGS := -Wall -Wextra -std=c99 -pedantic -Werror -pipe -fPIC -D_DEFAULT_SOURCE -I../unit_test -O0 -g
3+
CFLAGS := -Wall -Wextra -std=c99 -pedantic -Werror -pipe -fPIC -D_DEFAULT_SOURCE -I../../unit_test -O0 -g
44
LDFLAGS := -g -fPIC
55

66
OBJS += obj/main.o
7-
OBJS += ../unit_test/unit_test.a
7+
OBJS += ../../unit_test/unit_test.a
88
OBJS += obj/fib_slow.o
99
OBJS += obj/fib_fast.o
1010

@@ -20,10 +20,10 @@ clean:
2020
run: fib
2121
./fib
2222

23-
../unit_test/unit_test.a:
24-
make -C ../unit_test
23+
../../unit_test/unit_test.a:
24+
make -C ../../unit_test
2525

26-
obj/main.o: src/main.c src/fib.h ../unit_test/unit_test.h
26+
obj/main.o: src/main.c src/fib.h ../../unit_test/unit_test.h
2727
$(CC) $(CFLAGS) -c -o $@ $<
2828

2929
obj/%.o: src/%.c src/fib.h
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

04-network/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Network
2+
This section contains material on network programming.
3+
4+
## Table of Contents

05-data-encoding/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Data Encoding
2+
This section contains material on data encoding.
3+
4+
## Table of Contents
5+
- [bitmap](bitmap)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

06-parallel-programming/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Parallel Programming
2+
This section contains material on parallel programming.
3+
4+
## Table of Contents.
5+
- [prime](prime)
File renamed without changes.

prime/Makefile 06-parallel-programming/prime/Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
.PHONY: all folder clean run unit_test
22
CC := gcc
3-
CFLAGS := -Wall -Wextra -std=c99 -pedantic -Werror -pipe -fPIC -D_DEFAULT_SOURCE -I../unit_test -O0 -g
3+
CFLAGS := -Wall -Wextra -std=c99 -pedantic -Werror -pipe -fPIC -D_DEFAULT_SOURCE -I../../unit_test -O0 -g
44
LDFLAGS := -g -fPIC -lm -lpthread
55

66
OBJS += obj/main.o
7-
OBJS += ../unit_test/unit_test.a
7+
OBJS += ../../unit_test/unit_test.a
88
OBJS += obj/prime_singlethreaded.o
99
OBJS += obj/prime_multithreaded.o
1010

@@ -20,10 +20,10 @@ clean:
2020
run: prime
2121
./prime
2222

23-
../unit_test/unit_test.a:
24-
make -C ../unit_test
23+
../../unit_test/unit_test.a:
24+
make -C ../../unit_test
2525

26-
obj/main.o: src/main.c src/prime.h ../unit_test/unit_test.h
26+
obj/main.o: src/main.c src/prime.h ../../unit_test/unit_test.h
2727
$(CC) $(CFLAGS) -c -o $@ $<
2828

2929
obj/%.o: src/%.c src/prime.h
File renamed without changes.
File renamed without changes.
File renamed without changes.

07-debugging/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Introduction
2+
This section contains tutorials on how to use various debugging tools. Even
3+
though this section is the last in our self learning course, it is clearly
4+
one of the most important one.
5+
6+
## Table of Contents

README.md

+8-15
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,11 @@ This repository contains practical C programming tasks covering different aspect
1111
- Some tasks also require [GDB](https://www.gnu.org/software/gdb/), [Valgrind](http://valgrind.org/) and [Wireshark](https://www.wireshark.org/)
1212
- On Linux and BSD this software can often easily obtained using a package manager
1313

14-
## Data Structures
15-
- [tree](tree)
16-
17-
## Algorithms
18-
- [fib](fib)
19-
20-
## Network Programming
21-
22-
## Data Encoding
23-
- [bitmap](bitmap)
24-
25-
## Parallel Programming
26-
- [prime](prime)
27-
28-
## Debugging
14+
## Table of Contents
15+
- [Introduction](01-introduction)
16+
- [Data Structures](02-data-structures)
17+
- [Algorithms](03-algorithms)
18+
- [Network](04-network)
19+
- [Data Encoding](05-data-encoding)
20+
- [Parallel Programming](06-parallel-programming)
21+
- [Debugging](07-debugging)

unit_test/src/test_results.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test_results(void)
99
puts("===============================================================\n");
1010

1111
if (did_no_test_fail()){
12-
puts("All tests passed :-)\n");
12+
printf("All %" PRIu32 " tests passed :-)\n", n_tests);
1313
} else {
1414
printf("%" PRIu32 " out of %" PRIu32 " tests FAILED!\n",
1515
n_fails, n_tests);

0 commit comments

Comments
 (0)