libdas2
das2 core C utilities
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Macros | Functions
array.h File Reference

A dynamic buffer with multi-dimensional array style access. More...

Detailed Description

A dynamic buffer with multi-dimensional array style access.

#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <das2/value.h>
#include <das2/units.h>

Go to the source code of this file.

Data Structures

struct  DasAry
 Dynamic recursive ragged arrays. More...
 

Macros

#define D2ARY_AS_SUBSEQ   0x00000001
 This array's elements aren't intended to be addressed to the last index, instead each run of the last index should be used as if it were a complete an individual entity. More...
 
#define D2ARY_FILL_TERM   0x00000003
 A stronger condition that D2ARY_AS_SUBSEQ. More...
 
#define D2ARY_AS_STRING   0x00000007
 A still stronger condition than D2ARY_FILL_TERM. More...
 
#define DasAry_getIntsIn(T,...)   (const int32_t*) DasAry_getIn(T, vtInt, __VA_ARGS__)
 A wrapper around Array_getIn that casts the output and preforms type checking. More...
 

Functions

char * das_shape_prnRng (ptrdiff_t *pShape, int iFirstInternal, int nShapeLen, char *sBuf, int nBufLen)
 Print shape information using symbols i,j,k etc for index positions. More...
 
const void * DasAry_getFill (const DasAry *pThis)
 Return the fill value for this array. More...
 

Macro Definition Documentation

#define D2ARY_AS_SUBSEQ   0x00000001

This array's elements aren't intended to be addressed to the last index, instead each run of the last index should be used as if it were a complete an individual entity.

#define D2ARY_FILL_TERM   0x00000003

A stronger condition that D2ARY_AS_SUBSEQ.

Not only should the last index be ignored when using this array, in addition for each run of the fastest moving index a FILL value is always inserted as the last element.

#define D2ARY_AS_STRING   0x00000007

A still stronger condition than D2ARY_FILL_TERM.

This flag indicates not only that the last index shouldn't be addressed and that each fast-index run is FILL terminated, the fill value is 0. This flag is useful for UTF-8 string data.

#define DasAry_getIntsIn (   T,
  ... 
)    (const int32_t*) DasAry_getIn(T, vtInt, __VA_ARGS__)

A wrapper around Array_getIn that casts the output and preforms type checking.

Function Documentation

char* das_shape_prnRng ( ptrdiff_t *  pShape,
int  iFirstInternal,
int  nShapeLen,
char *  sBuf,
int  nBufLen 
)

Print shape information using symbols i,j,k etc for index positions.

Parameters
pShapepointer to an array containing shape information
iFirstInternalthe index of the first internal index. The index notation changes at this point to use I,J,K instead of i,j,k and the index count reverts back to 0.
nShapeLenAn index 1 past the last unsed index in the shape array.
sBufa buffer to recieve the shape info
nBufLenthe length of the buffer. The function will not print past this value - 1 to insure null terminiation.
Returns
The a pointer to the position in the buffer sBuf after all text was written.
const void* DasAry_getFill ( const DasAry pThis)

Return the fill value for this array.

The caller is responsible for casting to the proper type