Utah Raster Toolkit  9999-git
URT Development version (post-3.1b)
Functions
rle_getcom.c File Reference
#include <stdio.h>
#include "rle.h"
Include dependency graph for rle_getcom.c:

Go to the source code of this file.

Functions

static char * match (char *n, char *v)
 
char * rle_getcom (char *name, rle_hdr *the_hdr) const
 

Function Documentation

static char* match ( char *  n,
char *  v 
)
static

Definition at line 50 of file rle_getcom.c.

53 {
54  for ( ; *n != '\0' && *n != '=' && *n == *v; n++, v++ )
55  ;
56  if (*n == '\0' || *n == '=') {
57  if ( *v == '\0' )
58  return v;
59  else if ( *v == '=' )
60  return ++v;
61  }
62 
63  return NULL;
64 }
char* rle_getcom ( char *  name,
rle_hdr the_hdr 
) const

Definition at line 81 of file rle_getcom.c.

Referenced by display_rle(), find_most_used(), and load_x_map().

84 {
85  CONST_DECL char ** cp;
86  char * v;
87 
88  if ( the_hdr->comments == NULL )
89  return NULL;
90 
91  for ( cp = the_hdr->comments; *cp; cp++ )
92  if ( (v = match( name, *cp )) != NULL )
93  return v;
94 
95  return NULL;
96 }
const char ** comments
Definition: rle.h:113
#define CONST_DECL
Definition: rle_config.h:42
static char * match(char *n, char *v)
Definition: rle_getcom.c:50

Here is the caller graph for this function: