Functions

gs_storage_sqlite_util.c File Reference

#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include "sqlite3.h"
Include dependency graph for gs_storage_sqlite_util.c:

Go to the source code of this file.

Functions

static int isNumber (const char *z, int *realnum)
int sqliteIsNumber (const char *c)

Function Documentation

static int isNumber ( const char *  z,
int *  realnum 
) [static]

Determines if a string is a number of not.

Definition at line 24 of file gs_storage_sqlite_util.c.

{
  if( *z=='-' || *z=='+' ) z++;
  if( !isdigit(*z) ){
    return 0;
  }
  z++;
  if( realnum ) *realnum = 0;
  while( isdigit(*z) ){ z++; }
  if( *z=='.' ){
    z++;
    if( !isdigit(*z) ) return 0;
    while( isdigit(*z) ){ z++; }
    if( realnum ) *realnum = 1;
  }
  if( *z=='e' || *z=='E' ){
    z++;
    if( *z=='+' || *z=='-' ) z++;
    if( !isdigit(*z) ) return 0;
    while( isdigit(*z) ){ z++; }
    if( realnum ) *realnum = 1;
  }
  return *z==0;
}

Here is the caller graph for this function:

int sqliteIsNumber ( const char *  c  ) 

Definition at line 50 of file gs_storage_sqlite_util.c.

{
  return isNumber(c,0);
}

Here is the call graph for this function: