Skip to content

Commit

Permalink
Merge pull request #6 from das-developers/3.0
Browse files Browse the repository at this point in the history
3.0
  • Loading branch information
cpiker authored Feb 29, 2024
2 parents e0e3f4a + 46842f8 commit 90ad201
Show file tree
Hide file tree
Showing 41 changed files with 1,398 additions and 599 deletions.
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ PROJECT_NUMBER =
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = "das2 core C utilities"
PROJECT_BRIEF = "das core C utilities (v3)"

# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand Down Expand Up @@ -914,7 +914,7 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).

IMAGE_PATH =
IMAGE_PATH = notes

# The INPUT_FILTER tag can be used to specify a program that doxygen should
# invoke to filter for each input file. Doxygen will invoke the filter program
Expand Down
28 changes: 21 additions & 7 deletions buildfiles/Linux.mak
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,30 @@ BD=$(BUILD_DIR)
LEX=flex
YACC=bison

DEFINES:=-DWISDOM_FILE=/etc/fftw/wisdom -D_XOPEN_SOURCE=600
WARNINGS:=-Wall -Werror -Wno-format-truncation -Wno-deprecated-declarations
#-Wno-format-security
# -Wno-deprecated needed for OpenSSL, removed when call to ERR_load_BIO_strings is fixed
WARNINGS:=-Wall -Werror -Wno-deprecated-declarations
#-Wno-format-security

# I use string trucation all the time intentianally and make sure it's null
# terminated anyway, so this error doesn't apply

DEFINES:=-DWISDOM_FILE=/etc/fftw/wisdom -D_XOPEN_SOURCE=600 -Wno-format-truncation

DBG_DEFINES=-ggdb
O2_DEFINES=-DNDEBUG -O2 -Wno-unused-result -Wno-stringop-truncation


# Conda build does NOT set the include and lib directories within the
# compiler script itself, it merely exports ENV vars. This is unfortunate
# because it means makefiles must be altered to work with anaconda.

ifeq ($(CONDA_BUILD_STATE),)

CC=gcc
CFLAGS= $(WARNINGS) -fPIC -std=c99 -I. -ggdb $(DEFINES)
#CFLAGS=-Wall -DNDEBUG -O2 -fPIC -std=c99 -Wno-format-security -I. $(DEFINES)
CC=gcc

CFLAGS= $(WARNINGS) $(DBG_DEFINES) $(DEFINES) -fPIC -std=c99 -I.
#CFLAGS=$(WARNINGS) $(O2_DEFINES) $(DEFINES) -fPIC -std=c99 -I.

#-fstack-protector-strong

#CTESTFLAGS=-Wall -fPIC -std=c99 -ggdb -I. $(CFLAGS)
Expand Down Expand Up @@ -168,7 +179,7 @@ $(BD)/das2_psd:$(BD)/das2_psd.o $(BD)/send.o $(BD)/$(TARG).a

cdf:$(BD)/das3_cdf

$(BD)/das3_cdf:$(BD)/das3_cdf.o
$(BD)/das3_cdf:$(BD)/das3_cdf.o $(BD)/$(TARG).a
@echo "An example CDF_INC value would be: /usr/local/include"
@echo "An example CDF_LIB value would be: /usr/local/lib/libcdf.a"
@if [ "$(CDF_INC)" = "" ] ; then echo "CDF_INC not set"; exit 3; fi
Expand Down Expand Up @@ -238,6 +249,9 @@ $(BD)/html:$(BD) $(BD)/$(TARG).a

install_doc:$(INST_DOC)/libdas2

clean_doc:
-rm -r $(BD)/html

$(INST_DOC)/libdas2:$(BD)/html
-mkdir -p $(INST_DOC)
@if [ -e "$(INST_DOC)/libdas2" ]; then rm -r $(INST_DOC)/libdas2; fi
Expand Down
14 changes: 9 additions & 5 deletions das2/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
extern "C" {
#endif

/** @addtogroup datasets
* @{
*/

/** The maximum number of array indices in das2 */
#define DASIDX_MAX 8

Expand Down Expand Up @@ -133,6 +129,9 @@ char* das_idx_prn(int nRank, ptrdiff_t* pIdx, size_t uLen, char* sBuf);
#define RNG_6(i,I,j,J,k,K,l,L,m,M,n,N) 6, (ptrdiff_t[6]){i,j,k,l,m,n}, (ptrdiff_t[6]){I,J,K,L,M,N}
#define RNG_7(i,I,j,J,k,K,l,L,m,M,n,N,o,O) 7, (ptrdiff_t[7]){i,j,k,l,m,n,o}, (ptrdiff_t[7]){I,J,K,L,M,N,O}

/** @addtogroup DM
* @{
*/

/** Calculate a strided array shape from a min/max range.
*
Expand Down Expand Up @@ -197,6 +196,10 @@ typedef struct dyna_buf{

} DynaBuf;

/** @addtogroup DM
* @{
*/

/** Dynamic recursive ragged arrays
*
* This class maps any number of indices, (i,j,k...) to elements stored into a
Expand Down Expand Up @@ -263,7 +266,6 @@ typedef struct dyna_buf{
* printf("\n");
* }
* @endcode
* @ingroup datasets
*/
typedef struct das_array {
char sId[DAS_MAX_ID_BUFSZ]; /* A text identifier of this instance of the array */
Expand Down Expand Up @@ -312,6 +314,8 @@ typedef struct das_array {

} DasAry;

/** @} */


/** Creates a new dynamic array buffer
*
Expand Down
6 changes: 2 additions & 4 deletions das2/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
extern "C" {
#endif

/** @addtogroup utilities
/** @addtogroup IO
* @{
*/

/** Little buffer class to handle accumulating string data.
/** Buffer class to handle accumulating byte streams
*
* DasBuf objects maintain a data buffer with a current write point, a current
* read point and an end read point. As data are written to the buffer the
Expand All @@ -43,8 +43,6 @@ extern "C" {
* memory buffer, or when multiple functions need to read from a buffer without
* memory re-allocations or placing null values to stop parsing.
*
* It is hoped that the use of this class cuts down on alot of data copies and
* sub-string allocations.
*/
typedef struct das_buffer{
char* sBuf;
Expand Down
3 changes: 3 additions & 0 deletions das2/codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,10 @@ static int _var_text_read(
return -1 * das_error(DASERR_ENC, "Expected a text type for the external buffer");
}

#ifndef NDEBUG
das_val_type vtAry = DasAry_valType( pThis->pAry );
#endif

bool bParse = ((pThis->uProc & DASENC_PARSE) != 0);
int nRet;
char cSep = pThis->cSep;
Expand Down
20 changes: 17 additions & 3 deletions das2/codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ extern "C" {
/* Not public, only here because used in a macro */
#define DASENC_VALID 0x0001

/** @addtogroup IO
* @{
*/

/** Reading and writing array data to buffers */
typedef struct das_codec {

Expand Down Expand Up @@ -59,7 +63,11 @@ typedef struct das_codec {

} DasCodec;

/** Has the memory for this encoder been initialized? */

/** Has the memory for this encoder been initialized?
*
* @memberof DasCodec
*/
#define DasCodec_isValid(pCd) (((pCd)->uProc & DASENC_VALID)==(DASENC_VALID))

/** Initialize a serial buffer decoder/encoder
Expand Down Expand Up @@ -106,6 +114,8 @@ typedef struct das_codec {
* Otherwise, no string larger then the last index will be written
* and zeros will be appended to fill out the last index when reading
* data.
*
* @memberof DasCodec
*/
DAS_API DasErrCode DasCodec_init(
DasCodec* pThis, DasAry* pAry, const char* sSemantic, const char* sEncType,
Expand Down Expand Up @@ -143,12 +153,16 @@ DAS_API DasErrCode DasCodec_init(
*
* @returns the number of unread bytes or a negative ERR code if a data conversion
* error occured.
* */
* @memberof DasCodec
*/
DAS_API int DasCodec_decode(
DasCodec* pThis, const ubyte* pBuf, int nBufLen, int nExpect, int* pValsRead
);

/** Release the reference count on the array given to this encoder/decoder */
/** Release the reference count on the array given to this encoder/decoder
*
* @memberof DasCodec
*/
DAS_API void DasCodec_deInit(DasCodec* pThis);

#ifdef __cplusplus
Expand Down
Loading

0 comments on commit 90ad201

Please sign in to comment.