Skip to content
Snippets Groups Projects
Commit 46ffc905 authored by raphael.bach's avatar raphael.bach
Browse files

Add file_io.h and file_io.c

parent 64714155
Branches
Tags
No related merge requests found
Pipeline #
/*!
@file
@date 18.01.2019
@author Raphael Bach
@copyright
The MIT License (MIT)
Copyright (c) 2019 Raphael Bach
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@brief
@details
*/
/*==============================================================================
GUARD
==============================================================================*/
#ifndef FILE_IO_H_20190118185317
#define FILE_IO_H_20190118185317
/*==============================================================================
GUARD
==============================================================================*/
#endif // FILE_IO_H_20190118185317
...@@ -200,11 +200,13 @@ LFLAGS += -o ./$@.out ...@@ -200,11 +200,13 @@ LFLAGS += -o ./$@.out
SPARSE2IMG_DEP := \ SPARSE2IMG_DEP := \
sparse2img.o \ sparse2img.o \
sparse.o \ sparse.o \
file_io.o \
log.o log.o
IMG2SPARSE_DEP := \ IMG2SPARSE_DEP := \
img2sparse.o \ img2sparse.o \
sparse.o \ sparse.o \
file_io.o \
log.o log.o
SPARSE2IMG_OBJ_LIST_PATH := $(addprefix $(OBJECT_PATH)/, $(SPARSE2IMG_DEP)) SPARSE2IMG_OBJ_LIST_PATH := $(addprefix $(OBJECT_PATH)/, $(SPARSE2IMG_DEP))
...@@ -216,6 +218,10 @@ I2S_DEP := \ ...@@ -216,6 +218,10 @@ I2S_DEP := \
$(SOURCE_FOLDER)/img2sparse.c $(SOURCE_FOLDER)/img2sparse.c
SPARSE_DEP := \ SPARSE_DEP := \
$(SOURCE_FOLDER)/sparse.c \ $(SOURCE_FOLDER)/sparse.c \
$(HEADER_FOLDER)/file_io.h \
$(HEADER_FOLDER)/log.h
FILE_IO_DEP := \
$(SOURCE_FOLDER)/file_io.c \
$(HEADER_FOLDER)/log.h $(HEADER_FOLDER)/log.h
LOG_DEP := \ LOG_DEP := \
$(SOURCE_FOLDER)/log.c $(SOURCE_FOLDER)/log.c
...@@ -234,6 +240,8 @@ img2sparse.o: $(I2S_DEP) ...@@ -234,6 +240,8 @@ img2sparse.o: $(I2S_DEP)
$(CFLAGS) $(CFLAGS)
sparse.o: $(SPARSE_DEP) sparse.o: $(SPARSE_DEP)
$(CFLAGS) $(CFLAGS)
file_io.o: $(FILE_IO_DEP)
$(CFLAGS)
log.o: $(LOG_DEP) log.o: $(LOG_DEP)
$(CFLAGS) $(CFLAGS)
...@@ -245,7 +253,7 @@ tests: ...@@ -245,7 +253,7 @@ tests:
$(SCANBUILD) $(SCANBUILD)
$(CPPCHECK) $(CPPCHECK)
$(VALGRIND) ./sparse2img.out x x 2> $(ANALYZE_PATH)/valgrind $(VALGRIND) ./sparse2img.out x x 2> $(ANALYZE_PATH)/valgrind
$(VALGRIND) ./img2sparse.out test.simg x 2>> $(ANALYZE_PATH)/valgrind #$(VALGRIND) ./img2sparse.out test.simg x 2>> $(ANALYZE_PATH)/valgrind
%.info: %.o %.info: %.o
$(LCOV) $(LCOV)
......
/*!
@file
@date 18.01.2019
@author Raphael Bach
@copyright
The MIT License (MIT)
Copyright (c) 2019 Raphael Bach
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@brief
@details
*/
/*==============================================================================
INCLUDE
==============================================================================*/
// Own header
#include "file_io.h"
// Internal
#include "log.h"
/*==============================================================================
STATIC
==============================================================================*/
static struct Logger s_logger = {
.level_flag = LOG_LEVEL_ALL,
.output = LOG_OUTPUT_STDERR
};
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment