OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
parse_file_name.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdint.h>
Include dependency graph for parse_file_name.c:

Go to the source code of this file.

Macros

#define isdigit(c)   (c >= '0' && c <= '9')
 
#define isalpha(c)   ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
 
#define isspace(c)   (c == ' ' || c == '\t' || c == '\n')
 

Functions

int zs_strparts (char str[], char delim[], int maxparts, char *strvec[])
 
int zs_strip (char str[])
 
char * zs_substr (char *longstr, char *smlstr)
 
void parse_file_name (const char *inpath, char *outpath)
 
int zs_strparts (str, delim, int maxparts, strvec)
 
int zs_strip (str)
 

Macro Definition Documentation

◆ isalpha

#define isalpha (   c)    ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))

Definition at line 8 of file parse_file_name.c.

◆ isdigit

#define isdigit (   c)    (c >= '0' && c <= '9')

Definition at line 7 of file parse_file_name.c.

◆ isspace

#define isspace (   c)    (c == ' ' || c == '\t' || c == '\n')

Definition at line 9 of file parse_file_name.c.

Function Documentation

◆ parse_file_name()

void parse_file_name ( const char *  inpath,
char *  outpath 
)

This function parses a path name. It removes extra /'s, translates any environment variables, translates ~users, and also handles "." and ".."

Parameters
inpathfile name to be translated
outpathpointer to enough space for the translated file path

Definition at line 23 of file parse_file_name.c.

◆ zs_strip() [1/2]

int zs_strip ( char  str[])

◆ zs_strip() [2/2]

int zs_strip ( str  )

Definition at line 154 of file parse_file_name.c.

◆ zs_strparts() [1/2]

int zs_strparts ( char  str[],
char  delim[],
int  maxparts,
char *  strvec[] 
)

◆ zs_strparts() [2/2]

int zs_strparts ( str  ,
delim  ,
int  maxparts,
strvec   
)

Definition at line 116 of file parse_file_name.c.

◆ zs_substr()

char * zs_substr ( char *  longstr,
char *  smlstr 
)

Definition at line 179 of file parse_file_name.c.