2 Copyright 2004-2005 Chris Tallon
3 Copyright 2004-2005 University Of Bradford
5 This file is part of VOMP.
7 VOMP is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 VOMP is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with VOMP; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 #define MAX_FILENAME_LENGTH 500
34 #define BUFFER_LENGTH 1500
41 int init(char* fileName);
45 char* getValueString(const char* section, const char* key);
46 long getValueLong(const char* section, const char* key, int* failure);
47 long long getValueLongLong(char* section, char* key, int* failure);
48 double getValueDouble(char* section, char* key, int* failure);
50 int setValueString(const char* section, const char* key, const char* newValue);
51 int setValueLong(const char* section, char* key, long newValue);
52 int setValueLongLong(char* section, char* key, long long newValue);
53 int setValueDouble(char* section, char* key, double newValue);
55 int deleteValue(const char* section, char* key); // err.. delete "key".
56 char* getSectionKeyNames(const char* section, int& numberOfReturns, int& length);
59 pthread_mutex_t fileLock;
64 char fileName[MAX_FILENAME_LENGTH];
65 char fileNameTemp[MAX_FILENAME_LENGTH];
68 char buffer[BUFFER_LENGTH];
73 int findSection(const char* section);
74 int findKey(const char* key);
75 void trim(char* sting);
76 FILE* copyToHere(long position);
77 int copyRest(FILE* newFile);