コード例 #1
0
logical IniFile :: Refresh ( )
{
  logical                 term = NO;
  Initialize();
  LocateSection(section_name);
  return(term);
}
コード例 #2
0
ファイル: getinit.c プロジェクト: michaeco/D-SEM
long GetInitLong(const char *Section, const char *Key, long Default,
		 LISTPTR Input)
{
  LISTPTR SectionHead = NULL;
  char Buffer[BUFSIZE + 1];
  char *EndPtr = NULL;
  long Entry;

  if ((SectionHead = LocateSection(Section, Input)) == NULL) return Default;
  if (!LocateKey(Key, Buffer, SectionHead))return Default;
  Entry = strtol(Buffer, &EndPtr, 0);
  if (EndPtr == Buffer) return Default;
  return Entry;
}
コード例 #3
0
     IniFile :: IniFile (IniFile &inifile )
                     : max_len(),
  ini_string(NULL),
  section(NULL),
  variable_string(255)
{


  strcpy(file_name,inifile.get_file_name());
  Initialize();
  
  LocateSection(inifile.get_section_name());


}
コード例 #4
0
ファイル: getinit.c プロジェクト: michaeco/D-SEM
unsigned long GetInitString(const char *Section, const char *Key,
			    const char *Default, char *ReturnBuffer,
			    unsigned long BufferSize, LISTPTR Input)
{
	LISTPTR SectionHead = NULL;
	if ((SectionHead = LocateSection(Section, Input)) == NULL) {
		strncpy(ReturnBuffer, Default, BufferSize);
		return (unsigned long) strlen(ReturnBuffer);
	}
 //Returnbuffer contains variable value
	if (!LocateKey(Key, ReturnBuffer, SectionHead)) {
		strncpy(ReturnBuffer, Default, BufferSize);
		return (unsigned long) strlen(ReturnBuffer);
	}
	return (unsigned long) strlen(ReturnBuffer);
}
コード例 #5
0
ファイル: getinit.c プロジェクト: michaeco/D-SEM
double GetInitDouble(const char *Section, const char *Key, double Default,
		     LISTPTR Input)
{
  LISTPTR SectionHead = NULL;
  char Buffer[BUFSIZE + 1];
  char *EndPtr = NULL;
  double Entry;

  if ((SectionHead = LocateSection(Section, Input)) == NULL) {
    return Default;
  }

  if (!LocateKey(Key, Buffer, SectionHead)) {
    return Default;
  }

  Entry = strtod(Buffer, &EndPtr);
  if (EndPtr == Buffer) {
    return Default;
  }

  return (Entry);
}