return 1;
}
-int Config::deleteValue(char* section, char* key)
+int Config::deleteValue(const char* section, char* key)
{
if (!initted) return 0;
if (!openFile()) return 0;
return copyRest(newFile);
}
-int Config::setValueLong(char* section, char* key, long newValue)
+int Config::setValueLong(const char* section, char* key, long newValue)
{
char longBuffer[50];
sprintf(longBuffer, "%li", newValue);
return setValueString(section, key, doubleBuffer);
}
-int Config::setValueString(char* section, char* key, char* newValue)
+int Config::setValueString(const char* section, const char* key, const char* newValue)
{
if (!initted) return 0;
if (!openFile()) return 0;
}
}
-char* Config::getSectionKeyNames(char* section, int& numberOfReturns, int& allKeysSize)
+char* Config::getSectionKeyNames(const char* section, int& numberOfReturns, int& allKeysSize)
{
numberOfReturns = 0;
allKeysSize = 0;
// END HERE
-int Config::findSection(char* section)
+int Config::findSection(const char* section)
{
if (!initted || !file) return 0;
if (strlen(section) > (BUFFER_LENGTH-2))
return 0;
}
-int Config::findKey(char* key)
+int Config::findKey(const char* key)
{
if (!initted || !file) return 0;
return 0;
}
-char* Config::getValueString(char* section, char* key)
+char* Config::getValueString(const char* section, const char* key)
{
if (!initted) return NULL;
if (!openFile()) return NULL;
return returnString;
}
-long Config::getValueLong(char* section, char* key, int* failure)
+long Config::getValueLong(const char* section, const char* key, int* failure)
{
*failure = 1;
if (!initted) return 0;
int shutdown();
int status();
- char* getValueString(char* section, char* key);
- long getValueLong(char* section, char* key, int* failure);
+ char* getValueString(const char* section, const char* key);
+ long getValueLong(const char* section, const char* key, int* failure);
long long getValueLongLong(char* section, char* key, int* failure);
double getValueDouble(char* section, char* key, int* failure);
- int setValueString(char* section, char* key, char* newValue);
- int setValueLong(char* section, char* key, long newValue);
+ int setValueString(const char* section, const char* key, const char* newValue);
+ int setValueLong(const char* section, char* key, long newValue);
int setValueLongLong(char* section, char* key, long long newValue);
int setValueDouble(char* section, char* key, double newValue);
- int deleteValue(char* section, char* key); // err.. delete "key".
- char* getSectionKeyNames(char* section, int& numberOfReturns, int& length);
+ int deleteValue(const char* section, char* key); // err.. delete "key".
+ char* getSectionKeyNames(const char* section, int& numberOfReturns, int& length);
private:
pthread_mutex_t fileLock;
int openFile();
void closeFile();
int readLine();
- int findSection(char* section);
- int findKey(char* key);
+ int findSection(const char* section);
+ int findKey(const char* key);
void trim(char* sting);
FILE* copyToHere(long position);
int copyRest(FILE* newFile);
*/
}
-void DatagramSocket::send(char *ipa, USHORT port, char *message, int length)
+void DatagramSocket::send(const char *ipa, USHORT port, char *message, int length)
{
int sentLength = 0;
bool init(USHORT); // port
void shutdown();
unsigned char waitforMessage(unsigned char); // int =0-block =1-new wait =2-continue wait
- void send(char *, USHORT, char *, int); // send wants: IP Address ddn style, port,
+ void send(const char *, USHORT, char *, int); // send wants: IP Address ddn style, port,
// data, length of data
char* getData(void) { return buf; } // returns a pointer to the data
return 1;
}
-int Log::log(char *fromModule, int level, char* message, ...)
+int Log::log(const char *fromModule, int level, const char* message, ...)
{
if (!initted) return 0;
int init(int defaultLevel, char* fileName);
int shutdown();
- int log(char *fromModule, int level, char *message, ...);
+ int log(const char *fromModule, int level, const char *message, ...);
void upLogLevel();
void downLogLevel();
ULONG sendBufferLength = 100000;
ULONG sendBufferUsed = sizeof(ULONG); // leave a hole for the entire packet length
- char* empty = "";
+ const char* empty = "";
// assign all the event info to temp vars then we know exactly what size they are
ULONG thisEventID;
MVPReceiver::MVPReceiver(cChannel* channel, cDevice* device)
#if VDRVERSNUM < 10300
: cReceiver(channel->Ca(), 0, 7, channel->Vpid(), channel->Ppid(), channel->Apid1(), channel->Apid2(), channel->Dpid1(), channel->Dpid2(), channel->Tpid())
-#else
+#elif VDRVERSNUM < 10500
: cReceiver(channel->Ca(), 0, channel->Vpid(), channel->Apids(), channel->Dpids(), channel->Spids())
+#else
+: cReceiver(channel->GetChannelID(), 0, channel->Vpid(), channel->Apids(), channel->Dpids(), channel->Spids())
#endif
{
logger = Log::getInstance();