Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
482c49e8
Commit
482c49e8
authored
6 years ago
by
Loic Hausammann
Browse files
Options
Downloads
Patches
Plain Diff
Start removing python dependency
parent
397f2c7b
No related branches found
No related tags found
1 merge request
!685
Logger loader
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
logger/Makefile.am
+5
-1
5 additions, 1 deletion
logger/Makefile.am
logger/header.c
+1
-1
1 addition, 1 deletion
logger/header.c
logger/header.h
+0
-1
0 additions, 1 deletion
logger/header.h
logger/logger_tools.h
+27
-4
27 additions, 4 deletions
logger/logger_tools.h
with
33 additions
and
7 deletions
logger/Makefile.am
+
5
−
1
View file @
482c49e8
...
...
@@ -43,7 +43,11 @@ include_HEADERS = header.h io.h particle.h timeline.h logger_tools.h
# Common source files
AM_SOURCES
=
header.c io.c logger_loader.c particle.c
\
timeline.c logger_tools.c
timeline.c
if
HAVEPYTHON
AM_SOURCES
+=
logger_loader.c
endif
# Include files for distribution, not installation.
nobase_noinst_HEADERS
=
...
...
This diff is collapsed.
Click to expand it.
logger/header.c
+
1
−
1
View file @
482c49e8
...
...
@@ -3,7 +3,7 @@
#include
"io.h"
#include
"logger_tools.h"
#include
<
Python
.h>
#include
<
string
.h>
#include
<stdio.h>
#include
<stdlib.h>
...
...
This diff is collapsed.
Click to expand it.
logger/header.h
+
0
−
1
View file @
482c49e8
...
...
@@ -3,7 +3,6 @@
#include
"logger_tools.h"
#include
<Python.h>
#include
<stdio.h>
#include
<stdlib.h>
...
...
This diff is collapsed.
Click to expand it.
logger/logger_tools.h
+
27
−
4
View file @
482c49e8
#ifndef __TOOLS_H__
#define __TOOLS_H__
#ifndef __
LOGGER_
TOOLS_H__
#define __
LOGGER_
TOOLS_H__
#
define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#
include
"../config.h"
#ifdef HAVE_PYTHON
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include
<Python.h>
#endif
#include
<errno.h>
#include
<stdio.h>
#include
<stdlib.h>
...
...
@@ -11,6 +16,7 @@
struct
header
;
#ifdef HAVE_PYTHON
/* Set the error message for python and return the error code
* WARNING for python, you need to return NULL and not the error code
*/
...
...
@@ -30,6 +36,23 @@ struct header;
PyErr_SetString(PyExc_RuntimeError, error_msg); \
})
#else
#define error(err, s, ...) \
({ \
error_no_return(err, s, ##__VA_ARGS__); \
exit(1); \
})
#define error_no_return(err, s, ...) \
({ \
char error_msg[STRING_SIZE]; \
sprintf(error_msg, "%s:%s():%i: " s ": %s\n", __FILE__, __FUNCTION__, \
__LINE__, ##__VA_ARGS__, strerror(err)); \
})
#endif
#define message(s, ...) \
({ \
printf("%s:%s():%i: " s "\n", __FILE__, __FUNCTION__, __LINE__, \
...
...
@@ -100,4 +123,4 @@ int tools_reverse_offset(const struct header *h, void *map, size_t *offset);
*/
int
tools_check_offset
(
const
struct
header
*
h
,
void
*
map
,
size_t
*
offset
);
#endif //__TOOLS_H__
#endif //__
LOGGER_
TOOLS_H__
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment