Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsINIParser.cpp File Reference
#include "nsINIParser.h"
#include "nsError.h"
#include "nsILocalFile.h"
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Classes

class  AutoFILE

Defines

#define BINARY_MODE

Functions

static char * mstrspnp (const char *delims, char *str)
 Scan "str" for the first character that is not in "delims".
static char * mstrtok (const char *delims, char **str)

Variables

static const char kNL [] = "\r\n"
static const char kEquals [] = "="
static const char kWhitespace [] = " \t"
static const char kRBracket [] = "]"

Define Documentation

Definition at line 51 of file nsINIParser.cpp.


Function Documentation

static char* mstrspnp ( const char *  delims,
char *  str 
) [static]

Scan "str" for the first character that is not in "delims".

Definition at line 101 of file nsINIParser.cpp.

{
  const char *d;
  do {
    for (d = delims; *d != '\0'; ++d) {
      if (*str == *d) {
        ++str;
        break;
      }
    }
  } while (*d);

  return str;
}

Here is the caller graph for this function:

static char* mstrtok ( const char *  delims,
char **  str 
) [static]

Definition at line 117 of file nsINIParser.cpp.

{
  if (!*str)
    return NULL;

  char *ret = mstrspnp(delims, *str);

  if (!*ret) {
    *str = ret;
    return NULL;
  }

  char *i = ret;
  do {
    for (const char *d = delims; *d != '\0'; ++d) {
      if (*i == *d) {
        *i = '\0';
        *str = ++i;
        return ret;
      }
    }
    ++i;
  } while (*i);

  *str = NULL;
  return ret;
}

Here is the call graph for this function:


Variable Documentation

const char kEquals[] = "=" [static]

Definition at line 146 of file nsINIParser.cpp.

const char kNL[] = "\r\n" [static]

Definition at line 145 of file nsINIParser.cpp.

const char kRBracket[] = "]" [static]

Definition at line 148 of file nsINIParser.cpp.

const char kWhitespace[] = " \t" [static]

Definition at line 147 of file nsINIParser.cpp.