OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
oli_toolbox.h File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
Include dependency graph for oli_toolbox.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tb_string_list
 

Macros

#define NULL   0
 
#define TRUE   1
 
#define FALSE   0
 
#define TB_MAX_BUFFER   32767
 
#define TB_MAXLINE   2048 /* was 256 */
 
#define TB_MAXFNAME   80
 
#define TB_MAXPATH   256
 
#define TB_MAXTIME   40
 
#define TB_MAXNUM   20
 
#define RingThatBell(znumz)   {int ziz; for (ziz=0; ziz < znumz; ++ziz) (void)printf("%c", (char) 7);}
 
#define CloseMe(zfptrz)   {if (zfptrz != NULL) {(void)fclose(zfptrz); zfptrz = NULL;}}
 
#define LemmeGo(zmptrz)   {if (zmptrz != NULL) {free(zmptrz); zmptrz = NULL;}}
 
#define SayGoodbye()   {(void)printf("I'm out of memory and I can't get up!\n"); exit(1);}
 
#define LastChar(zstrz)   (zstrz+strlen(zstrz)-1)
 
#define NewString(zstrz, zsizez)
 
#define CopyString(zstrz, zoldz)
 
#define AppendString(zstrz, znewz)
 
#define StripLeading(zstrz, zstripz)
 
#define StripTrailing(zstrz, zstripz)
 
#define StripUnprintables(zstrz)
 
#define ReplaceChar(zstrz, zoldz, znewz)
 
#define NotOneOfThese(zstrz, zsetz)   (zstrz + strspn(zstrz, zsetz))
 
#define UpperCase(zstrz)
 
#define LowerCase(zstrz)
 
#define DateTime(zascz)
 
#define RemoveStringList(zlistz)
 
#define NewStringList(zstrz, zlistz)
 
#define AddStringToList(zstrz, zlistz)
 
#define AddListToList(zfrom_listz, zto_listz)
 

Typedefs

typedef unsigned short MASK
 

Macro Definition Documentation

◆ AddListToList

#define AddListToList (   zfrom_listz,
  zto_listz 
)
Value:
{ \
TB_STRING_LIST *znz; \
if (zto_listz == NULL) \
zto_listz = zfrom_listz; \
if (zfrom_listz != NULL) \
{ \
for (znz=zto_listz; znz->next != NULL; znz=znz->next) ; \
znz->next = zfrom_listz; \
} \
}

Definition at line 193 of file oli_toolbox.h.

◆ AddStringToList

#define AddStringToList (   zstrz,
  zlistz 
)
Value:
{ \
TB_STRING_LIST *znz, *znnz=NULL; \
if (zlistz == NULL) \
NewStringList(zstrz, zlistz) \
else \
{ \
for (znz=zlistz; znz->next != NULL; znz=znz->next) ; \
NewStringList(zstrz, znnz) \
znz->next = znnz; \
} \
}

Definition at line 180 of file oli_toolbox.h.

◆ AppendString

#define AppendString (   zstrz,
  znewz 
)
Value:
{if (znewz != NULL) \
{ \
if (zstrz == NULL) \
NewString(zstrz, (long)(1+strlen(znewz))) \
else \
zstrz = (char *)realloc(zstrz, 1+strlen(znewz)+strlen(zstrz)); \
if (zstrz == NULL) \
SayGoodbye() \
else \
(void)strcat(zstrz, znewz); \
}}

Definition at line 80 of file oli_toolbox.h.

◆ CloseMe

#define CloseMe (   zfptrz)    {if (zfptrz != NULL) {(void)fclose(zfptrz); zfptrz = NULL;}}

Definition at line 56 of file oli_toolbox.h.

◆ CopyString

#define CopyString (   zstrz,
  zoldz 
)
Value:
{if (zoldz == NULL) \
zstrz = NULL; \
else \
{ \
NewString(zstrz, ((long)(1+strlen(zoldz)))) \
(void)strcpy(zstrz,zoldz); \
}}

Definition at line 71 of file oli_toolbox.h.

◆ DateTime

#define DateTime (   zascz)
Value:
{ \
struct tm *zptrz = {NULL}; \
time_t zltz; \
zltz = time(NULL); \
zptrz = localtime(&zltz); \
zascz = asctime(zptrz); \
zascz[strlen(zascz) -1] = '\0'; \
}

Definition at line 124 of file oli_toolbox.h.

◆ FALSE

#define FALSE   0

Definition at line 36 of file oli_toolbox.h.

◆ LastChar

#define LastChar (   zstrz)    (zstrz+strlen(zstrz)-1)

Definition at line 59 of file oli_toolbox.h.

◆ LemmeGo

#define LemmeGo (   zmptrz)    {if (zmptrz != NULL) {free(zmptrz); zmptrz = NULL;}}

Definition at line 57 of file oli_toolbox.h.

◆ LowerCase

#define LowerCase (   zstrz)
Value:
{char *zcz; \
for (zcz=zstrz; *zcz != '\0'; ++zcz) {*zcz=(char)tolower(*zcz);}}

Definition at line 120 of file oli_toolbox.h.

◆ NewString

#define NewString (   zstrz,
  zsizez 
)
Value:
{if (zsizez <= 1) \
zstrz = (char *)malloc(1); \
else \
zstrz = (char *)malloc(zsizez); \
if (zstrz == NULL) \
SayGoodbye() \
else \
*zstrz = '\0';}

Definition at line 61 of file oli_toolbox.h.

◆ NewStringList

#define NewStringList (   zstrz,
  zlistz 
)
Value:
{ \
if (zlistz != NULL) RemoveStringList(zlistz) \
zlistz = (TB_STRING_LIST *) malloc(sizeof(TB_STRING_LIST)); \
zlistz->next = NULL; \
if (zlistz == NULL) SayGoodbye() \
if (zstrz == NULL) \
NewString(zlistz->text, 1) \
CopyString(zlistz->text, zstrz) \
}

Definition at line 168 of file oli_toolbox.h.

◆ NotOneOfThese

#define NotOneOfThese (   zstrz,
  zsetz 
)    (zstrz + strspn(zstrz, zsetz))

Definition at line 114 of file oli_toolbox.h.

◆ NULL

#define NULL   0

Definition at line 30 of file oli_toolbox.h.

◆ RemoveStringList

#define RemoveStringList (   zlistz)
Value:
{ \
TB_STRING_LIST *znz, *znnz=NULL; \
for (znz=zlistz; znz != NULL; znz=znnz) \
{ \
znnz = znz->next; \
LemmeGo(znz->text) \
LemmeGo(znz) \
} \
}

Definition at line 157 of file oli_toolbox.h.

◆ ReplaceChar

#define ReplaceChar (   zstrz,
  zoldz,
  znewz 
)
Value:
{char *zcz; \
for (zcz=zstrz; *zcz != '\0'; ++zcz) \
{if (*zcz == zoldz) *zcz = znewz;}}

Definition at line 109 of file oli_toolbox.h.

◆ RingThatBell

#define RingThatBell (   znumz)    {int ziz; for (ziz=0; ziz < znumz; ++ziz) (void)printf("%c", (char) 7);}

Definition at line 55 of file oli_toolbox.h.

◆ SayGoodbye

#define SayGoodbye ( )    {(void)printf("I'm out of memory and I can't get up!\n"); exit(1);}

Definition at line 58 of file oli_toolbox.h.

◆ StripLeading

#define StripLeading (   zstrz,
  zstripz 
)
Value:
{char *zcz; int len;\
for (zcz=zstrz; ((*zcz != '\0') && (*zcz == zstripz)); ++zcz) ; \
len = strlen(zcz) + 1; \
(void)memmove(zstrz, zcz, len);}

Definition at line 93 of file oli_toolbox.h.

◆ StripTrailing

#define StripTrailing (   zstrz,
  zstripz 
)
Value:
{char *zcz; \
for (zcz=LastChar(zstrz); ((zcz >= zstrz) && (*zcz == zstripz)); --zcz) \
*zcz = '\0';}

Definition at line 99 of file oli_toolbox.h.

◆ StripUnprintables

#define StripUnprintables (   zstrz)
Value:
{char *zcz; \
for (zcz=LastChar(zstrz); ((zcz >= zstrz) && ((*zcz < ' ') || (*zcz > '~'))); --zcz) \
*zcz = '\0';}

Definition at line 104 of file oli_toolbox.h.

◆ TB_MAX_BUFFER

#define TB_MAX_BUFFER   32767

Definition at line 39 of file oli_toolbox.h.

◆ TB_MAXFNAME

#define TB_MAXFNAME   80

Definition at line 41 of file oli_toolbox.h.

◆ TB_MAXLINE

#define TB_MAXLINE   2048 /* was 256 */

Definition at line 40 of file oli_toolbox.h.

◆ TB_MAXNUM

#define TB_MAXNUM   20

Definition at line 44 of file oli_toolbox.h.

◆ TB_MAXPATH

#define TB_MAXPATH   256

Definition at line 42 of file oli_toolbox.h.

◆ TB_MAXTIME

#define TB_MAXTIME   40

Definition at line 43 of file oli_toolbox.h.

◆ TRUE

#define TRUE   1

Definition at line 33 of file oli_toolbox.h.

◆ UpperCase

#define UpperCase (   zstrz)
Value:
{char *zcz; \
for (zcz=zstrz; *zcz != '\0'; ++zcz) {*zcz=(char)toupper(*zcz);}}

Definition at line 116 of file oli_toolbox.h.

Typedef Documentation

◆ MASK

typedef unsigned short MASK

Definition at line 148 of file oli_toolbox.h.

#define LastChar(zstrz)
Definition: oli_toolbox.h:59
float tm[MODELMAX]
#define CopyString(zstrz, zoldz)
Definition: oli_toolbox.h:71
character(len=1000) if
Definition: names.f90:13
#define RemoveStringList(zlistz)
Definition: oli_toolbox.h:157
this program makes no use of any feature of the SDP Toolkit that could generate such a then geolocation is calculated at that and then aggregated up to Resolved feature request Bug by adding three new int8 SDSs for each high resolution offsets between the high resolution geolocation and a bi linear interpolation extrapolation of the positions This can be used to reconstruct the high resolution geolocation Resolved Bug by delaying cumulation of gflags until after validation of derived products Resolved Bug by setting Latitude and Longitude to the correct fill resolving to support Near Real Time because they may be unnecessary if use of entrained ephemeris and attitude data is turned resolving bug report Corrected to filter out Aqua attitude records with missing status helping resolve bug MOD_PR03 will still correctly write scan and pixel data that does not depend upon the start time
Definition: HISTORY.txt:248
#define NULL
Definition: oli_toolbox.h:30
#define SayGoodbye()
Definition: oli_toolbox.h:58
How many dimensions is the output array Default is Not sure if anything above will work correctly strcpy(l2prod->title, "no title yet")