libexplain  1.4.D001
Data Structures | Typedefs | Functions | Variables
libexplain/fstrcmp.c File Reference
#include <libexplain/ac/assert.h>
#include <libexplain/ac/ctype.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/string.h>
#include <libexplain/fstrcmp.h>

Go to the source code of this file.

Data Structures

struct  snake_t
struct  file
struct  fc_t

Typedefs

typedef struct snake_t snake_t
typedef struct file file
typedef struct fc_t fc_t

Functions

static long midsnake (int depth, long A, long N, long B, long M, long *ulx, long *uly, long *lrx, long *lry)
static void findsnake (int depth, long A, long N, long B, long M)
double explain_fstrcmp (const char *s1, const char *s2)
static void downcase (char *out, const char *in)
double explain_fstrcasecmp (const char *s1, const char *s2)

Variables

static long tablesize
static long tablesize_max
static long * V1
static long * V1_table
static long * V2
static long * V2_table
static snake_tnextsnake
static snake_tsnake_table
static fc_t fc

Typedef Documentation

typedef struct fc_t fc_t

Definition at line 72 of file fstrcmp.c.

typedef struct file file

Definition at line 65 of file fstrcmp.c.

typedef struct snake_t snake_t

Definition at line 47 of file fstrcmp.c.


Function Documentation

static void downcase ( char *  out,
const char *  in 
) [static]

Definition at line 407 of file fstrcmp.c.

double explain_fstrcasecmp ( const char *  s1,
const char *  s2 
)

The explain_fstrcasecmp function may be used to compare two strings. The comparison is case insensitive. The order of the strings has no effect on the result.

Parameters:
s1The first string to be compared.
s2The second string to be compared.
Returns:
Rather than a simple yes/no result, the similarity of the strings is returned. A return of 0.0 means the strings are completely differemt, and a return value of 1.0 means they are identical. However, values can be returned between these two values, indicating the degree of similarity.
Note:
This function uses dynamic memory. May return -1 if malloc fails.

Definition at line 424 of file fstrcmp.c.

double explain_fstrcmp ( const char *  s1,
const char *  s2 
)

The explain_fstrcmp function may be used to compare two strings. The order of the strings has no effect on the result.

Parameters:
s1The first string to be compared.
s2The second string to be compared.
Returns:
Rather than a simple yes/no result, the similarity of the strings is returned. A return of 0.0 means the strings are completely differemt, and a return value of 1.0 means they are identical. However, values can be returned between these two values, indicating the degree of similarity.
Note:
This function uses dynamic memory. May return -1 if malloc fails. This function is not thread-safe.

Definition at line 289 of file fstrcmp.c.

static void findsnake ( int  depth,
long  A,
long  N,
long  B,
long  M 
) [static]

Definition at line 233 of file fstrcmp.c.

static long midsnake ( int  depth,
long  A,
long  N,
long  B,
long  M,
long *  ulx,
long *  uly,
long *  lrx,
long *  lry 
) [static]

Definition at line 95 of file fstrcmp.c.


Variable Documentation

fc_t fc [static]

Definition at line 84 of file fstrcmp.c.

snake_t* nextsnake [static]

Definition at line 62 of file fstrcmp.c.

snake_t* snake_table [static]

Definition at line 63 of file fstrcmp.c.

long tablesize [static]

Definition at line 56 of file fstrcmp.c.

long tablesize_max [static]

Definition at line 57 of file fstrcmp.c.

long* V1 [static]

Definition at line 58 of file fstrcmp.c.

long* V1_table [static]

Definition at line 59 of file fstrcmp.c.

long* V2 [static]

Definition at line 60 of file fstrcmp.c.

long* V2_table [static]

Definition at line 61 of file fstrcmp.c.