Commit 7301aed0 authored by Robert Izzard's avatar Robert Izzard
Browse files

V1.28

clean up cdict_macros to use a table of X macros to
generate many of the other code macros, short functions
to replace some of these.

Also fixed some missing (unsigned) long long int functionality.

updated TODO list and meson build version/date.
parent c5a4d70e
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
###########################################################
# meson build file for libcdict
#
# (c) Robert Izzard 24/04/2020
# (c) Robert Izzard 18/07/2022
#
# You may well require: bash, gawk, cp, grep, wc, tr, head
#                       and perl. These are standard tools on
#                       etc. These are standard tools on
#                       most systems.
#
# You certainly require a C compiler (e.g. gcc or clang),
@@ -22,8 +22,9 @@ project(
        'cpp_std=gnu++17',
        'libdir=lib',
    ],
    version : '1.0',
    version : '1.28',
)

############################################################
# basic system requirements
#
@@ -93,7 +94,6 @@ if compiler.get_id() == 'gcc'
    endforeach
endif


############################################################
# get home directory
#
@@ -337,8 +337,6 @@ libdirs_quoted = '_slash_'.join(libdirs_quoted.split('/')) # deslash
libs_quoted = '-DLIBS=' + ''.join(['"', ' '.join(libs),'"'])
libs_quoted = '_slash_'.join(libs_quoted.split('/'))



# hence a quoted version of the cflags
quoted_cflags_list = [
    cflags_quoted,
@@ -350,7 +348,6 @@ quoted_cflags_list = [
    libs_quoted,
]


############################################################
# compiler warning flags
############################################################
@@ -382,7 +379,6 @@ if compiler.get_id() != 'clang'
    endforeach
endif


############################################################
# add Meson project name and version
cflags += [
@@ -390,7 +386,6 @@ cflags += [
  '-DMESON_PROJECT_VERSION=' + meson.project_version(),
]


############################################################
#
# make shared library
+1 −1
Original line number Diff line number Diff line
brackets in cdict_macros for ENTRY and LOCATION
 No newline at end of file
* FORTRAN API
 No newline at end of file
+3 −2
Original line number Diff line number Diff line
@@ -10,13 +10,14 @@
 */

#include <float.h>
#include "cdict_types.h"
#include "cdict_macros.h"
#include "uthash_libcdict.h"
#include "cdict_types.h"

#include "cdict_prototypes.h"
#include "cdict_API.h"

#define CDICT_VERSION "1.27"
#define CDICT_VERSION "1.28"

/*
 * Global variables - very bad, I know, but these
+3 −0
Original line number Diff line number Diff line
@@ -58,4 +58,7 @@
#undef __CDict_Pure_function
#define __CDict_Pure_function

#undef __CDict_inline_function
#define __CDict_inline_function inline

#endif // CDICT_CODE_OPTIONS_H

src/cdict_descriptor.c

0 → 100644
+29 −0
Original line number Diff line number Diff line
#include "cdict.h"

/*
 * Return a descriptor string describing
 * libcdict data type n
 */
#undef X
#define X(TYPE,                                                         \
          CTYPE,                                                        \
          DESCRIPTOR,                                                   \
          FORMAT,                                                       \
          DEREF_FORMAT,                                                 \
          DEREF_CTYPE,                                                  \
          GROUP,                                                        \
          ARRAY_TO_SCALAR_MAPPER,                                       \
          SCALAR_TO_ARRAY_MAPPER,                                       \
          NUMERIC)                                                      \
    DESCRIPTOR,

char * __CDict_descriptor(const CDict_data_type n)
{
    static const char * const __descriptors[] = {
        __CDICT_DATA_TYPES__
    };

    return n < CDICT_DATA_NUMBER_OF_TYPES ? (char *) __descriptors[n] :
        "data type not recognised";
}
#undef X
Loading