Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
argo
excit
Commits
f4f4839e
Commit
f4f4839e
authored
Nov 09, 2018
by
Brice Videau
Browse files
Added introspection capabilities.
parent
11c8aed3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/excit.c
View file @
f4f4839e
#include
<stdlib.h>
#include
<excit.h>
#define CASE(val) case val: return #val; break;
const
char
*
excit_type_name
(
enum
excit_type_e
type
)
{
switch
(
type
)
{
CASE
(
EXCIT_RANGE
)
CASE
(
EXCIT_CONS
)
CASE
(
EXCIT_REPEAT
)
CASE
(
EXCIT_HILBERT2D
)
CASE
(
EXCIT_PRODUCT
)
CASE
(
EXCIT_SLICE
)
CASE
(
EXCIT_USER
)
CASE
(
EXCIT_TYPE_MAX
)
default:
return
NULL
;
}
}
const
char
*
excit_error_name
(
enum
excit_error_e
err
)
{
switch
(
err
)
{
CASE
(
EXCIT_SUCCESS
)
CASE
(
EXCIT_STOPIT
)
CASE
(
EXCIT_ENOMEM
)
CASE
(
EXCIT_EINVAL
)
CASE
(
EXCIT_EDOM
)
CASE
(
EXCIT_ENOTSUP
)
CASE
(
EXCIT_ERROR_MAX
)
default:
return
NULL
;
}
}
#undef CASE
/*--------------------------------------------------------------------*/
struct
slice_it_s
{
...
...
src/excit.h
View file @
f4f4839e
...
...
@@ -12,6 +12,8 @@ enum excit_type_e {
EXCIT_TYPE_MAX
};
const
char
*
excit_type_name
(
enum
excit_type_e
type
);
enum
excit_error_e
{
EXCIT_SUCCESS
,
EXCIT_STOPIT
,
...
...
@@ -22,6 +24,8 @@ enum excit_error_e {
EXCIT_ERROR_MAX
};
const
char
*
excit_error_name
(
enum
excit_error_e
err
);
struct
excit_s
{
const
struct
excit_func_table_s
*
functions
;
ssize_t
dimension
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment