diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.argustv/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.argustv/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.argustv/addon/addon.xml.in 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.argustv/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,12 +1,12 @@ - + bSupportsEPG = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsTimers = true; pCapabilities->bSupportsTV = true; pCapabilities->bSupportsRadio = g_bRadioEnabled; @@ -392,7 +393,7 @@ return g_client->GetBackendTime(localTime, gmtOffset); } -PVR_ERROR DialogChannelScan() +PVR_ERROR OpenDialogChannelScan() { return PVR_ERROR_NOT_IMPLEMENTED; } @@ -439,13 +440,13 @@ return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &channelinfo) +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &channelinfo) { NOTUSED(channelinfo); return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &channelinfo) +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &channelinfo) { NOTUSED(channelinfo); return PVR_ERROR_NOT_IMPLEMENTED; @@ -474,12 +475,12 @@ /*******************************************/ /** PVR Recording Functions **/ -int GetRecordingsAmount(void) +int GetRecordingsAmount(bool deleted) { return g_client->GetNumRecordings(); } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { return g_client->GetRecordings(handle); } @@ -660,4 +661,6 @@ time_t GetPlayingTime() { return 0; } time_t GetBufferTimeStart() { return 0; } time_t GetBufferTimeEnd() { return 0; } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; } } //end extern "C" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.demo/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.demo/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.demo/addon/addon.xml.in 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.demo/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,17 +1,17 @@ - + 7500 + + + Demo Recording entry 11 + + /Directory1/SubDirectory1/ + Demo TV Channel 1 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7200 + + + Demo Recording entry 12 + + /Directory1/SubDirectory1/ + Demo TV Channel 2 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7500 + + + Demo Recording entry 13 + + /Directory1/SubDirectory1/ + Demo TV Channel 3 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7500 + + + Demo Recording entry 14 + + /Directory1/SubDirectory2/ + Demo TV Channel 4 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7500 + + + Demo Recording entry 15 + + /Directory1/SubDirectory2/ + Demo TV Channel 5 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7500 + + + Demo Recording entry 16 + + /Directory2/SubDirectory1/ + Demo TV Channel 6 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7500 + + + Demo Recording entry 17 + + /Directory2/SubDirectory1/ + Demo TV Channel 7 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7500 + + + Demo Recording entry 18 + + /Directory2/SubDirectory2/ + Demo TV Channel 8 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7500 + + + Demo Recording entry 19 + + /Directory2/SubDirectory2/ + Demo TV Channel 9 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7500 + + + Demo Recording entry 20 + + /Directory2/ + Demo TV Channel 20 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam cursus consectetur ipsum, eu tincidunt dui aliquam ac. Sed scelerisque, augue eu lacinia ultrices, libero ante ullamcorper augue, vel malesuada justo risus ac nulla. Quisque ac libero libero. Sed tincidunt, orci eu condimentum laoreet, felis odio mattis est, et lacinia metus enim in leo. Fusce faucibus tristique risus in varius. Etiam sagittis venenatis ligula nec rutrum. Etiam gravida dictum hendrerit. Sed sodales felis in sapien rutrum non malesuada nisi lobortis. Mauris iaculis ante odio. Nunc gravida erat convallis purus dignissim et ultricies orci dapibus. Aliquam erat volutpat. Vestibulum mi felis, malesuada ac tincidunt sit amet, pulvinar nec dolor. Pellentesque vehicula est vulputate mi adipiscing euismod. Donec ac mauris nulla. Nullam suscipit felis eu quam sodales ac bibendum nisi interdum. Curabitur non lectus a ante venenatis semper eget id justo. Ut facilisis, ligula pretium dictum congue, lacus dolor commodo nibh, sit amet sodales sed. + 10 + 0 + + 7500 + + Demo Timer entry #1 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.demo/src/client.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.demo/src/client.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.demo/src/client.cpp 2015-01-19 19:21:06.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.demo/src/client.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -165,6 +165,7 @@ pCapabilities->bSupportsRadio = true; pCapabilities->bSupportsChannelGroups = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = true; pCapabilities->bSupportsTimers = true; return PVR_ERROR_NO_ERROR; @@ -294,18 +295,18 @@ return PVR_ERROR_NO_ERROR; } -int GetRecordingsAmount(void) +int GetRecordingsAmount(bool deleted) { if (m_data) - return m_data->GetRecordingsAmount(); + return m_data->GetRecordingsAmount(deleted); return -1; } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { if (m_data) - return m_data->GetRecordings(handle); + return m_data->GetRecordings(handle, deleted); return PVR_ERROR_NOT_IMPLEMENTED; } @@ -327,13 +328,13 @@ } /** UNUSED API FUNCTIONS */ -PVR_ERROR DialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR CallMenuHook(const PVR_MENUHOOK &menuhook, const PVR_MENUHOOK_DATA &item) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR DeleteChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR RenameChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR MoveChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } bool OpenRecordedStream(const PVR_RECORDING &recording) { return false; } void CloseRecordedStream(void) {} int ReadRecordedStream(unsigned char *pBuffer, unsigned int iBufferSize) { return 0; } @@ -367,4 +368,6 @@ time_t GetPlayingTime() { return 0; } time_t GetBufferTimeStart() { return 0; } time_t GetBufferTimeEnd() { return 0; } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; } } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.demo/src/PVRDemoData.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.demo/src/PVRDemoData.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.demo/src/PVRDemoData.cpp 2014-09-12 07:43:45.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.demo/src/PVRDemoData.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -283,6 +283,77 @@ } } + /* load deleted recordings */ + pElement = pRootElement->FirstChildElement("recordingsdeleted"); + if (pElement) + { + TiXmlNode *pRecordingNode = NULL; + while ((pRecordingNode = pElement->IterateChildren(pRecordingNode)) != NULL) + { + CStdString strTmp; + PVRDemoRecording recording; + + /* recording title */ + if (!XMLUtils::GetString(pRecordingNode, "title", strTmp)) + continue; + recording.strTitle = strTmp; + + /* recording url */ + if (!XMLUtils::GetString(pRecordingNode, "url", strTmp)) + recording.strStreamURL = m_strDefaultMovie; + else + recording.strStreamURL = strTmp; + + /* recording path */ + if (XMLUtils::GetString(pRecordingNode, "directory", strTmp)) + recording.strDirectory = strTmp; + + iUniqueGroupId++; + strTmp.Format("%d", iUniqueGroupId); + recording.strRecordingId = strTmp; + + /* channel name */ + if (XMLUtils::GetString(pRecordingNode, "channelname", strTmp)) + recording.strChannelName = strTmp; + + /* plot */ + if (XMLUtils::GetString(pRecordingNode, "plot", strTmp)) + recording.strPlot = strTmp; + + /* plot outline */ + if (XMLUtils::GetString(pRecordingNode, "plotoutline", strTmp)) + recording.strPlotOutline = strTmp; + + /* genre type */ + XMLUtils::GetInt(pRecordingNode, "genretype", recording.iGenreType); + + /* genre subtype */ + XMLUtils::GetInt(pRecordingNode, "genresubtype", recording.iGenreSubType); + + /* duration */ + XMLUtils::GetInt(pRecordingNode, "duration", recording.iDuration); + + /* recording time */ + if (XMLUtils::GetString(pRecordingNode, "time", strTmp)) + { + time_t timeNow = time(NULL); + struct tm* now = localtime(&timeNow); + + CStdString::size_type delim = strTmp.Find(':'); + if (delim != CStdString::npos) + { + now->tm_hour = (int)strtol(strTmp.Left(delim), NULL, 0); + now->tm_min = (int)strtol(strTmp.Mid(delim + 1), NULL, 0); + now->tm_mday--; // yesterday + + recording.recordingTime = mktime(now); + } + } + + m_recordingsDeleted.push_back(recording); + } + } + /* load timers */ pElement = pRootElement->FirstChildElement("timers"); if (pElement) @@ -506,14 +577,16 @@ return PVR_ERROR_NO_ERROR; } -int PVRDemoData::GetRecordingsAmount(void) +int PVRDemoData::GetRecordingsAmount(bool bDeleted) { - return m_recordings.size(); + return bDeleted ? m_recordingsDeleted.size() : m_recordings.size(); } -PVR_ERROR PVRDemoData::GetRecordings(ADDON_HANDLE handle) +PVR_ERROR PVRDemoData::GetRecordings(ADDON_HANDLE handle, bool bDeleted) { - for (std::vector::iterator it = m_recordings.begin() ; it != m_recordings.end() ; it++) + std::vector *recordings = bDeleted ? &m_recordingsDeleted : &m_recordings; + + for (std::vector::iterator it = recordings->begin() ; it != recordings->end() ; it++) { PVRDemoRecording &recording = *it; @@ -523,6 +596,7 @@ xbmcRecording.iGenreType = recording.iGenreType; xbmcRecording.iGenreSubType = recording.iGenreSubType; xbmcRecording.recordingTime = recording.recordingTime; + xbmcRecording.bIsDeleted = bDeleted; strncpy(xbmcRecording.strChannelName, recording.strChannelName.c_str(), sizeof(xbmcRecording.strChannelName) - 1); strncpy(xbmcRecording.strPlotOutline, recording.strPlotOutline.c_str(), sizeof(xbmcRecording.strPlotOutline) - 1); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.demo/src/PVRDemoData.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.demo/src/PVRDemoData.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.demo/src/PVRDemoData.h 2014-09-12 07:43:45.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.demo/src/PVRDemoData.h 2015-02-20 11:24:58.000000000 +0000 @@ -109,8 +109,8 @@ virtual PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd); - virtual int GetRecordingsAmount(void); - virtual PVR_ERROR GetRecordings(ADDON_HANDLE handle); + virtual int GetRecordingsAmount(bool bDeleted); + virtual PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool bDeleted); virtual int GetTimersAmount(void); virtual PVR_ERROR GetTimers(ADDON_HANDLE handle); @@ -122,6 +122,7 @@ std::vector m_groups; std::vector m_channels; std::vector m_recordings; + std::vector m_recordingsDeleted; std::vector m_timers; time_t m_iEpgStart; CStdString m_strDefaultIcon; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvblink/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvblink/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvblink/addon/addon.xml.in 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvblink/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,12 +1,12 @@ - + bSupportsEPG = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsTimers = true; pCapabilities->bSupportsTV = true; pCapabilities->bSupportsRadio = true; @@ -646,7 +647,7 @@ } -int GetRecordingsAmount(void) +int GetRecordingsAmount(bool deleted) { if (dvblinkclient) return dvblinkclient->GetRecordingsAmount(); @@ -654,7 +655,7 @@ return -1; } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { if (dvblinkclient) return dvblinkclient->GetRecordings(handle); @@ -769,7 +770,7 @@ } -PVR_ERROR DialogChannelScan(void) +PVR_ERROR OpenDialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } @@ -794,12 +795,12 @@ return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &channel) +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &channel) +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } @@ -848,6 +849,16 @@ return -1; } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) +{ + return PVR_ERROR_NOT_IMPLEMENTED; +} + +PVR_ERROR DeleteAllRecordingsFromTrash() +{ + return PVR_ERROR_NOT_IMPLEMENTED; +} + void DemuxAbort(void) { } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/addon/addon.xml.in 2015-01-19 19:21:06.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,12 +1,12 @@ - + + - + + - - + diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/Makefile.am 2014-11-26 11:56:30.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/Makefile.am 2015-02-20 11:24:58.000000000 +0000 @@ -16,6 +16,7 @@ libdvbviewer_addon_la_SOURCES = src/client.cpp \ src/DvbData.cpp \ - src/TimeshiftBuffer.cpp + src/TimeshiftBuffer.cpp \ + src/RecordingReader.cpp libdvbviewer_addon_la_LDFLAGS = @TARGET_LDFLAGS@ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/project/VS2010Express/pvr.dvbviewer.vcxproj kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/project/VS2010Express/pvr.dvbviewer.vcxproj --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/project/VS2010Express/pvr.dvbviewer.vcxproj 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/project/VS2010Express/pvr.dvbviewer.vcxproj 2015-02-20 11:24:58.000000000 +0000 @@ -96,11 +96,13 @@ + + @@ -119,4 +121,4 @@ - \ No newline at end of file + diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/project/VS2010Express/pvr.dvbviewer.vcxproj.filters kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/project/VS2010Express/pvr.dvbviewer.vcxproj.filters --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/project/VS2010Express/pvr.dvbviewer.vcxproj.filters 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/project/VS2010Express/pvr.dvbviewer.vcxproj.filters 2015-02-20 11:24:58.000000000 +0000 @@ -24,6 +24,9 @@ Source Files + + Source Files + @@ -35,6 +38,9 @@ Header Files + + Header Files + diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/client.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/client.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/client.cpp 2015-01-19 19:21:06.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/client.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -22,14 +22,14 @@ #include "client.h" #include "DvbData.h" +#include "TimeshiftBuffer.h" +#include "RecordingReader.h" #include "xbmc_pvr_dll.h" #include "platform/util/util.h" #include using namespace ADDON; -ADDON_STATUS m_curStatus = ADDON_STATUS_UNKNOWN; - /* User adjustable settings are saved here. * Default values are defined inside client.h * and exported to the other source files. @@ -41,15 +41,19 @@ bool g_useFavourites = false; bool g_useFavouritesFile = false; CStdString g_favouritesFile = ""; -int g_groupRecordings = DvbRecording::GroupDisabled; +int g_groupRecordings = DvbRecording::GROUPING_DISABLED; bool g_useTimeshift = false; CStdString g_timeshiftBufferPath = DEFAULT_TSBUFFERPATH; bool g_useRTSP = false; +int g_prependOutline = PrependOutline::IN_EPG; bool g_lowPerformance = false; +ADDON_STATUS m_curStatus = ADDON_STATUS_UNKNOWN; CHelper_libXBMC_addon *XBMC = NULL; CHelper_libXBMC_pvr *PVR = NULL; Dvb *DvbData = NULL; +TimeshiftBuffer *tsBuffer = NULL; +RecordingReader *recReader = NULL; extern "C" { @@ -79,7 +83,7 @@ g_favouritesFile = buffer; if (!XBMC->GetSetting("grouprecordings", &g_groupRecordings)) - g_groupRecordings = DvbRecording::GroupDisabled; + g_groupRecordings = DvbRecording::GROUPING_DISABLED; if (!XBMC->GetSetting("usetimeshift", &g_useTimeshift)) g_useTimeshift = false; @@ -90,6 +94,9 @@ if (!XBMC->GetSetting("usertsp", &g_useRTSP) || g_useTimeshift) g_useRTSP = false; + if (!XBMC->GetSetting("prependoutline", &g_prependOutline)) + g_prependOutline = PrependOutline::IN_EPG; + if (!XBMC->GetSetting("lowperformance", &g_lowPerformance)) g_lowPerformance = false; @@ -105,12 +112,14 @@ XBMC->Log(LOG_DEBUG, "Use favourites: %s", (g_useFavourites) ? "yes" : "no"); if (g_useFavouritesFile) XBMC->Log(LOG_DEBUG, "Favourites file: %s", g_favouritesFile.c_str()); - if (g_groupRecordings != DvbRecording::GroupDisabled) + if (g_groupRecordings != DvbRecording::GROUPING_DISABLED) XBMC->Log(LOG_DEBUG, "Group recordings: %d", g_groupRecordings); XBMC->Log(LOG_DEBUG, "Timeshift: %s", (g_useTimeshift) ? "enabled" : "disabled"); if (g_useTimeshift) XBMC->Log(LOG_DEBUG, "Timeshift buffer path: %s", g_timeshiftBufferPath.c_str()); XBMC->Log(LOG_DEBUG, "Use RTSP: %s", (g_useRTSP) ? "yes" : "no"); + if (g_prependOutline != PrependOutline::NEVER) + XBMC->Log(LOG_DEBUG, "Prepend outline: %d", g_prependOutline); XBMC->Log(LOG_DEBUG, "Low performance mode: %s", (g_lowPerformance) ? "yes" : "no"); } @@ -134,7 +143,7 @@ return ADDON_STATUS_PERMANENT_FAILURE; } - XBMC->Log(LOG_DEBUG, "%s Creating DVBViewer PVR-Client", __FUNCTION__); + XBMC->Log(LOG_DEBUG, "%s: Creating DVBViewer PVR-Client", __FUNCTION__); m_curStatus = ADDON_STATUS_UNKNOWN; ADDON_ReadSettings(); @@ -232,7 +241,7 @@ } else if (sname == "grouprecordings") { - if (g_groupRecordings != *(const DvbRecording::Group *)settingValue) + if (g_groupRecordings != *(const DvbRecording::Grouping *)settingValue) return ADDON_STATUS_NEED_RESTART; } else if (sname == "timeshiftpath") @@ -240,8 +249,9 @@ CStdString newValue = (const char *)settingValue; if (g_timeshiftBufferPath != newValue) { - XBMC->Log(LOG_DEBUG, "%s Changed Setting '%s' from '%s' to '%s'", __FUNCTION__, - settingName, g_timeshiftBufferPath.c_str(), newValue.c_str()); + XBMC->Log(LOG_DEBUG, "%s: Changed setting '%s' from '%s' to '%s'", + __FUNCTION__, settingName, g_timeshiftBufferPath.c_str(), + newValue.c_str()); g_timeshiftBufferPath = newValue; } } @@ -250,6 +260,17 @@ if (g_useRTSP != *(bool *)settingValue) return ADDON_STATUS_NEED_RESTART; } + else if (sname == "prependoutline") + { + PrependOutline::options newValue = *(const PrependOutline::options *)settingValue; + if (g_prependOutline != newValue) + { + g_prependOutline = newValue; + // EPG view seems cached, so TriggerEpgUpdate isn't reliable + // also if PVR is currently disabled we don't get notified at all + XBMC->QueueNotification(QUEUE_WARNING, XBMC->GetLocalizedString(30507)); + } + } else if (sname == "lowperformance") { if (g_lowPerformance != *(bool *)settingValue) @@ -266,9 +287,11 @@ { } -void ADDON_Announce(const char *_UNUSED(flag), const char *_UNUSED(sender), - const char *_UNUSED(message), const void *_UNUSED(data)) +void ADDON_Announce(const char *_UNUSED(flag), const char *sender, + const char *message, const void *_UNUSED(data)) { + if (recReader != NULL && strcmp(sender, "xbmc") == 0) + recReader->Announce(message); } /*********************************************************** @@ -305,6 +328,7 @@ pCapabilities->bSupportsTV = true; pCapabilities->bSupportsRadio = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsTimers = true; pCapabilities->bSupportsChannelGroups = true; pCapabilities->bSupportsChannelScan = false; @@ -344,20 +368,37 @@ return g_hostname.c_str(); } -PVR_ERROR GetDriveSpace(long long *iTotal, long long *iUsed) +PVR_ERROR SignalStatus(PVR_SIGNAL_STATUS &signalStatus) { - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; + // the RS api doesn't provide information about signal quality (yet) + strncpy(signalStatus.strAdapterName, "DVBViewer Recording Service", + sizeof(signalStatus.strAdapterName)); + strncpy(signalStatus.strAdapterStatus, "OK", + sizeof(signalStatus.strAdapterStatus)); + return PVR_ERROR_NO_ERROR; +} - return DvbData->GetDriveSpace(iTotal, iUsed); +PVR_ERROR GetDriveSpace(long long *total, long long *used) +{ + return (DvbData && DvbData->IsConnected() + && DvbData->GetDriveSpace(total, used)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; } -PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, time_t iStart, time_t iEnd) +/* channel functions */ +PVR_ERROR GetChannels(ADDON_HANDLE handle, bool radio) { - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; + return (DvbData && DvbData->IsConnected() + && DvbData->GetChannels(handle, radio)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; +} - return DvbData->GetEPGForChannel(handle, channel, iStart, iEnd); +PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL &channel, + time_t start, time_t end) +{ + return (DvbData && DvbData->IsConnected() + && DvbData->GetEPGForChannel(handle, channel, start, end)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; } int GetChannelsAmount(void) @@ -368,43 +409,46 @@ return DvbData->GetChannelsAmount(); } -PVR_ERROR GetChannels(ADDON_HANDLE handle, bool bRadio) +int GetCurrentClientChannel(void) { if (!DvbData || !DvbData->IsConnected()) return PVR_ERROR_SERVER_ERROR; - return DvbData->GetChannels(handle, bRadio); + return DvbData->GetCurrentClientChannel(); } -int GetRecordingsAmount(void) +bool SwitchChannel(const PVR_CHANNEL &channel) { if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; + return false; - return DvbData->GetRecordingsAmount(); + return DvbData->SwitchChannel(channel); } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +/* channel group functions */ +int GetChannelGroupsAmount(void) { if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; + return 0; - return DvbData->GetRecordings(handle); + return DvbData->GetChannelGroupsAmount(); } -PVR_ERROR DeleteRecording(const PVR_RECORDING &recording) +PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool radio) { - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; - - return DvbData->DeleteRecording(recording); + return (DvbData && DvbData->IsConnected() + && DvbData->GetChannelGroups(handle, radio)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; } -PVR_ERROR RenameRecording(const PVR_RECORDING &_UNUSED(recording)) +PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group) { - return PVR_ERROR_NOT_IMPLEMENTED; + return (DvbData && DvbData->IsConnected() + && DvbData->GetChannelGroupMembers(handle, group)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; } +/* timer functions */ int GetTimersAmount(void) { if (!DvbData || !DvbData->IsConnected()) @@ -415,87 +459,55 @@ PVR_ERROR GetTimers(ADDON_HANDLE handle) { - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; - - return DvbData->GetTimers(handle); + return (DvbData && DvbData->IsConnected() && DvbData->GetTimers(handle)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; } PVR_ERROR AddTimer(const PVR_TIMER &timer) { - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; - - return DvbData->AddTimer(timer); -} - -PVR_ERROR DeleteTimer(const PVR_TIMER &timer, bool _UNUSED(bForceDelete)) -{ - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; - - return DvbData->DeleteTimer(timer); + return (DvbData && DvbData->IsConnected() && DvbData->AddTimer(timer)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; } PVR_ERROR UpdateTimer(const PVR_TIMER &timer) { - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; - - return DvbData->UpdateTimer(timer); + return (DvbData && DvbData->IsConnected() && DvbData->AddTimer(timer, true)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; } -int GetCurrentClientChannel(void) +PVR_ERROR DeleteTimer(const PVR_TIMER &timer, bool _UNUSED(bForceDelete)) { - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; - - return DvbData->GetCurrentClientChannel(); + return (DvbData && DvbData->IsConnected() && DvbData->DeleteTimer(timer)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; } -bool SwitchChannel(const PVR_CHANNEL &channel) +/* live stream functions */ +bool OpenLiveStream(const PVR_CHANNEL &channel) { if (!DvbData || !DvbData->IsConnected()) return false; - return DvbData->SwitchChannel(channel); -} - -int GetChannelGroupsAmount(void) -{ - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; + if (channel.iUniqueId == DvbData->GetCurrentClientChannel()) + return true; - return DvbData->GetChannelGroupsAmount(); -} - -PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio) -{ - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; - - return DvbData->GetChannelGroups(handle, bRadio); -} - -PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group) -{ - if (!DvbData || !DvbData->IsConnected()) - return PVR_ERROR_SERVER_ERROR; + if (!DvbData->OpenLiveStream(channel)) + return false; + if (!g_useTimeshift) + return true; - return DvbData->GetChannelGroupMembers(handle, group); + CStdString streamURL = DvbData->GetLiveStreamURL(channel); + XBMC->Log(LOG_INFO, "Timeshift starts; url=%s", streamURL.c_str()); + if (tsBuffer) + SAFE_DELETE(tsBuffer); + tsBuffer = new TimeshiftBuffer(streamURL, g_timeshiftBufferPath); + return tsBuffer->IsValid(); } void CloseLiveStream(void) { DvbData->CloseLiveStream(); -} - -bool OpenLiveStream(const PVR_CHANNEL &channel) -{ - if (!DvbData || !DvbData->IsConnected()) - return false; - - return DvbData->OpenLiveStream(channel); + if (tsBuffer) + SAFE_DELETE(tsBuffer); } const char *GetLiveStreamURL(const PVR_CHANNEL &channel) @@ -523,52 +535,52 @@ return g_useTimeshift; } -int ReadLiveStream(unsigned char *pBuffer, unsigned int iBufferSize) +int ReadLiveStream(unsigned char *buffer, unsigned int size) { - if (!DvbData || !DvbData->IsConnected() || !DvbData->GetTimeshiftBuffer()) + if (!tsBuffer) return 0; - return DvbData->GetTimeshiftBuffer()->ReadData(pBuffer, iBufferSize); + return tsBuffer->ReadData(buffer, size); } -long long SeekLiveStream(long long iPosition, int iWhence /* = SEEK_SET */) +long long SeekLiveStream(long long position, int whence) { - if (!DvbData || !DvbData->IsConnected() || !DvbData->GetTimeshiftBuffer()) + if (!tsBuffer) return -1; - return DvbData->GetTimeshiftBuffer()->Seek(iPosition, iWhence); + return tsBuffer->Seek(position, whence); } long long PositionLiveStream(void) { - if (!DvbData || !DvbData->IsConnected() || !DvbData->GetTimeshiftBuffer()) + if (!tsBuffer) return -1; - return DvbData->GetTimeshiftBuffer()->Position(); + return tsBuffer->Position(); } long long LengthLiveStream(void) { - if (!DvbData || !DvbData->IsConnected() || !DvbData->GetTimeshiftBuffer()) - return 0; + if (!tsBuffer) + return -1; - return DvbData->GetTimeshiftBuffer()->Length(); + return tsBuffer->Length(); } time_t GetBufferTimeStart() { - if (!DvbData || !DvbData->IsConnected() || !DvbData->GetTimeshiftBuffer()) + if (!tsBuffer) return 0; - return DvbData->GetTimeshiftBuffer()->TimeStart(); + return tsBuffer->TimeStart(); } time_t GetBufferTimeEnd() { - if (!DvbData || !DvbData->IsConnected() || !DvbData->GetTimeshiftBuffer()) + if (!tsBuffer) return 0; - return DvbData->GetTimeshiftBuffer()->TimeEnd(); + return tsBuffer->TimeEnd(); } time_t GetPlayingTime() @@ -577,39 +589,95 @@ return GetBufferTimeEnd(); } -PVR_ERROR SignalStatus(PVR_SIGNAL_STATUS &signalStatus) +/* recording stream functions */ +int GetRecordingsAmount(bool _UNUSED(deleted)) { - // the RS api doesn't provide information about signal quality (yet) - strncpy(signalStatus.strAdapterName, "DVBViewer Recording Service", - sizeof(signalStatus.strAdapterName)); - strncpy(signalStatus.strAdapterStatus, "OK", - sizeof(signalStatus.strAdapterStatus)); - return PVR_ERROR_NO_ERROR; + if (!DvbData || !DvbData->IsConnected()) + return PVR_ERROR_SERVER_ERROR; + + return DvbData->GetRecordingsAmount(); +} + +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool _UNUSED(deleted)) +{ + return (DvbData && DvbData->IsConnected() + && DvbData->GetRecordings(handle)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; +} + +PVR_ERROR DeleteRecording(const PVR_RECORDING &recording) +{ + return (DvbData && DvbData->IsConnected() + && DvbData->DeleteRecording(recording)) + ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR; +} + +bool OpenRecordedStream(const PVR_RECORDING &recording) +{ + if (recReader) + SAFE_DELETE(recReader); + recReader = DvbData->OpenRecordedStream(recording); + return recReader->IsValid(); +} + +void CloseRecordedStream(void) +{ + if (recReader) + SAFE_DELETE(recReader); +} + +int ReadRecordedStream(unsigned char *buffer, unsigned int size) +{ + if (!recReader) + return 0; + + return recReader->ReadData(buffer, size); +} + +long long SeekRecordedStream(long long position, int whence) +{ + if (!recReader) + return 0; + + return recReader->Seek(position, whence); +} + +long long PositionRecordedStream(void) +{ + if (!recReader) + return -1; + + return recReader->Position(); +} + +long long LengthRecordedStream(void) +{ + if (!recReader) + return -1; + + return recReader->Length(); } /** UNUSED API FUNCTIONS */ -PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* _UNUSED(pProperties)) { return PVR_ERROR_NOT_IMPLEMENTED; } -void DemuxAbort(void) { return; } -DemuxPacket* DemuxRead(void) { return NULL; } -PVR_ERROR DialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES *_UNUSED(pProperties)) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR CallMenuHook(const PVR_MENUHOOK &_UNUSED(menuhook), const PVR_MENUHOOK_DATA &_UNUSED(item)) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR DeleteChannel(const PVR_CHANNEL &_UNUSED(channel)) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR RenameChannel(const PVR_CHANNEL &_UNUSED(channel)) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR MoveChannel(const PVR_CHANNEL &_UNUSED(channel)) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &_UNUSED(channel)) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &_UNUSED(channel)) { return PVR_ERROR_NOT_IMPLEMENTED; } -bool OpenRecordedStream(const PVR_RECORDING &_UNUSED(recording)) { return false; } -void CloseRecordedStream(void) {} -int ReadRecordedStream(unsigned char *_UNUSED(pBuffer), unsigned int _UNUSED(iBufferSize)) { return 0; } -long long SeekRecordedStream(long long _UNUSED(iPosition), int _UNUSED(iWhence) /* = SEEK_SET */) { return 0; } +PVR_ERROR OpenDialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &_UNUSED(channel)) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &_UNUSED(channel)) { return PVR_ERROR_NOT_IMPLEMENTED; } +DemuxPacket *DemuxRead(void) { return NULL; } +void DemuxAbort(void) {} void DemuxReset(void) {} void DemuxFlush(void) {} -long long PositionRecordedStream(void) { return -1; } -long long LengthRecordedStream(void) { return -1; } PVR_ERROR SetRecordingPlayCount(const PVR_RECORDING &_UNUSED(recording), int _UNUSED(count)) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR SetRecordingLastPlayedPosition(const PVR_RECORDING &_UNUSED(recording), int _UNUSED(lastplayedposition)) { return PVR_ERROR_NOT_IMPLEMENTED; } int GetRecordingLastPlayedPosition(const PVR_RECORDING &_UNUSED(recording)) { return -1; } +PVR_ERROR RenameRecording(const PVR_RECORDING &_UNUSED(recording)) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR GetRecordingEdl(const PVR_RECORDING&, PVR_EDL_ENTRY[], int*) { return PVR_ERROR_NOT_IMPLEMENTED; }; +PVR_ERROR UndeleteRecording(const PVR_RECORDING& _UNUSED(recording)) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; } unsigned int GetChannelSwitchDelay(void) { return 0; } void PauseStream(bool _UNUSED(bPaused)) {} bool SeekTime(int, bool, double*) { return false; } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/client.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/client.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/client.h 2014-09-12 07:43:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/client.h 2015-02-20 11:24:58.000000000 +0000 @@ -74,9 +74,21 @@ extern bool g_useTimeshift; extern CStdString g_timeshiftBufferPath; extern bool g_useRTSP; +extern int g_prependOutline; extern bool g_lowPerformance; extern ADDON::CHelper_libXBMC_addon *XBMC; extern CHelper_libXBMC_pvr *PVR; +//TODO: convert to enum class as soon as c++11 is available +class PrependOutline +{ +public: + enum options { NEVER = 0, IN_EPG, IN_RECORDINGS, ALWAYS }; + static bool test(options flag) + { + return (g_prependOutline == flag || g_prependOutline == ALWAYS); + } +}; + #endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/DvbData.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/DvbData.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/DvbData.cpp 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/DvbData.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -12,34 +12,9 @@ using namespace ADDON; using namespace PLATFORM; -template -void tokenize(const CStdString& str, ContainerT& tokens, - const CStdString& delimiters = " ", const bool trimEmpty = false) -{ - CStdString::size_type pos, lastPos = 0; - while (true) - { - pos = str.find_first_of(delimiters, lastPos); - if (pos == CStdString::npos) - { - pos = str.length(); - - if (pos != lastPos || !trimEmpty) - tokens.push_back(typename ContainerT::value_type(str.data() + lastPos, pos - lastPos)); - break; - } - else - { - if (pos != lastPos || !trimEmpty) - tokens.push_back(typename ContainerT::value_type(str.data() + lastPos, pos - lastPos)); - } - lastPos = pos + 1; - } -}; - - Dvb::Dvb() - : m_connected(false), m_backendVersion(0) + : m_connected(false), m_backendVersion(0), m_currentChannel(0), + m_nextTimerId(0) { // simply add user@pass in front of the URL if username/password is set CStdString auth(""); @@ -47,19 +22,13 @@ auth.Format("%s:%s@", g_username.c_str(), g_password.c_str()); m_url.Format("http://%s%s:%u/", auth.c_str(), g_hostname.c_str(), g_webPort); - m_currentChannel = 0; - m_newTimerIndex = 1; - m_updateTimers = false; m_updateEPG = false; - m_tsBuffer = NULL; } Dvb::~Dvb() { StopThread(); - if (m_tsBuffer) - SAFE_DELETE(m_tsBuffer); for (DvbChannels_t::iterator channel = m_channels.begin(); channel != m_channels.end(); ++channel) @@ -70,8 +39,7 @@ { CLockObject lock(m_mutex); - m_connected = CheckBackendVersion(); - if (!m_connected) + if (!(m_connected = CheckBackendVersion())) return false; if (!UpdateBackendStatus(true)) @@ -112,18 +80,18 @@ return version; } -PVR_ERROR Dvb::GetDriveSpace(long long *total, long long *used) +bool Dvb::GetDriveSpace(long long *total, long long *used) { if (!UpdateBackendStatus()) - return PVR_ERROR_SERVER_ERROR; + return false; *total = m_diskspace.total; *used = m_diskspace.used; - return PVR_ERROR_NO_ERROR; + return true; } -bool Dvb::SwitchChannel(const PVR_CHANNEL& channel) +bool Dvb::SwitchChannel(const PVR_CHANNEL& channelinfo) { - m_currentChannel = channel.iUniqueId; + m_currentChannel = channelinfo.iUniqueId; m_updateEPG = true; return true; } @@ -133,7 +101,7 @@ return m_currentChannel; } -PVR_ERROR Dvb::GetChannels(ADDON_HANDLE handle, bool bRadio) +bool Dvb::GetChannels(ADDON_HANDLE handle, bool radio) { for (DvbChannels_t::iterator it = m_channels.begin(); it != m_channels.end(); ++it) @@ -141,7 +109,7 @@ DvbChannel *channel = *it; if (channel->hidden) continue; - if (channel->radio != bRadio) + if (channel->radio != radio) continue; PVR_CHANNEL xbmcChannel; @@ -169,19 +137,16 @@ PVR->TransferChannelEntry(handle, &xbmcChannel); } - - return PVR_ERROR_NO_ERROR; + return true; } -//TODO: rewrite -//TODO: missing epg v2 - there's no documention -PVR_ERROR Dvb::GetEPGForChannel(ADDON_HANDLE handle, - const PVR_CHANNEL& channel, time_t iStart, time_t iEnd) +bool Dvb::GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL& channelinfo, + time_t start, time_t end) { - DvbChannel *myChannel = m_channels[channel.iUniqueId - 1]; + DvbChannel *channel = m_channels[channelinfo.iUniqueId - 1]; CStdString url = BuildURL("api/epg.html?lvl=2&channel=%" PRIu64 "&start=%f&end=%f", - myChannel->epgId, iStart/86400.0 + DELPHI_DATE, iEnd/86400.0 + DELPHI_DATE); + channel->epgId, start/86400.0 + DELPHI_DATE, end/86400.0 + DELPHI_DATE); CStdString req = GetHttpXML(url); TiXmlDocument doc; @@ -190,66 +155,74 @@ { XBMC->Log(LOG_ERROR, "Unable to parse EPG. Error: %s", doc.ErrorDesc()); - return PVR_ERROR_SERVER_ERROR; + return false; } - unsigned iNumEPG = 0; + unsigned int numEPG = 0; for (TiXmlElement *xEntry = doc.RootElement()->FirstChildElement("programme"); xEntry; xEntry = xEntry->NextSiblingElement("programme")) { DvbEPGEntry entry; - entry.iChannelUid = channel.iUniqueId; - entry.startTime = ParseDateTime(xEntry->Attribute("start")); - entry.endTime = ParseDateTime(xEntry->Attribute("stop")); + entry.channel = channel; + entry.start = ParseDateTime(xEntry->Attribute("start")); + entry.end = ParseDateTime(xEntry->Attribute("stop")); - if (iEnd > 1 && iEnd < entry.endTime) + if (end > 1 && end < entry.end) continue; - if (!XMLUtils::GetInt(xEntry, "eventid", entry.iEventId)) + if (!XMLUtils::GetUInt(xEntry, "eventid", entry.id)) continue; // since RS 1.26.0 the correct language is already merged into the elements TiXmlNode *xTitles = xEntry->FirstChild("titles"); - if (!xTitles || !XMLUtils::GetString(xTitles, "title", entry.strTitle)) + if (!xTitles || !XMLUtils::GetString(xTitles, "title", entry.title)) continue; TiXmlNode *xDescriptions = xEntry->FirstChild("descriptions"); if (xDescriptions) - XMLUtils::GetString(xDescriptions, "description", entry.strPlot); + XMLUtils::GetString(xDescriptions, "description", entry.plot); TiXmlNode *xEvents = xEntry->FirstChild("events"); if (xEvents) { - XMLUtils::GetString(xEvents, "event", entry.strPlotOutline); - if (!entry.strPlotOutline.empty() && entry.strPlot.empty()) - entry.strPlot = entry.strPlotOutline; + XMLUtils::GetString(xEvents, "event", entry.plotOutline); + if (entry.plot.empty()) + { + entry.plot = entry.plotOutline; + entry.plotOutline.clear(); + } + else if (PrependOutline::test(PrependOutline::IN_EPG)) + { + entry.plot.insert(0, entry.plotOutline + "\n"); + entry.plotOutline.clear(); + } } XMLUtils::GetUInt(xEntry, "content", entry.genre); EPG_TAG broadcast; memset(&broadcast, 0, sizeof(EPG_TAG)); - broadcast.iUniqueBroadcastId = entry.iEventId; - broadcast.strTitle = entry.strTitle.c_str(); - broadcast.iChannelNumber = channel.iChannelNumber; - broadcast.startTime = entry.startTime; - broadcast.endTime = entry.endTime; - broadcast.strPlotOutline = entry.strPlotOutline.c_str(); - broadcast.strPlot = entry.strPlot.c_str(); + broadcast.iUniqueBroadcastId = entry.id; + broadcast.strTitle = entry.title.c_str(); + broadcast.iChannelNumber = channelinfo.iChannelNumber; + broadcast.startTime = entry.start; + broadcast.endTime = entry.end; + broadcast.strPlotOutline = entry.plotOutline.c_str(); + broadcast.strPlot = entry.plot.c_str(); broadcast.iGenreType = entry.genre & 0xF0; broadcast.iGenreSubType = entry.genre & 0x0F; PVR->TransferEpgEntry(handle, &broadcast); - ++iNumEPG; + ++numEPG; - XBMC->Log(LOG_DEBUG, "%s loaded EPG entry '%u:%s': start=%u, end=%u", - __FUNCTION__, broadcast.iUniqueBroadcastId, broadcast.strTitle, - entry.startTime, entry.endTime); + XBMC->Log(LOG_DEBUG, "%s: Loaded EPG entry '%u:%s': start=%u, end=%u", + __FUNCTION__, entry.id, entry.title.c_str(), + entry.start, entry.end); } XBMC->Log(LOG_INFO, "Loaded %u EPG entries for channel '%s'", - iNumEPG, channel.strChannelName); - return PVR_ERROR_NO_ERROR; + numEPG, channel->name.c_str()); + return true; } unsigned int Dvb::GetChannelsAmount() @@ -258,14 +231,14 @@ } -PVR_ERROR Dvb::GetChannelGroups(ADDON_HANDLE handle, bool bRadio) +bool Dvb::GetChannelGroups(ADDON_HANDLE handle, bool radio) { for (DvbGroups_t::iterator group = m_groups.begin(); group != m_groups.end(); ++group) { if (group->hidden) continue; - if (group->radio != bRadio) + if (group->radio != radio) continue; PVR_CHANNEL_GROUP tag; @@ -275,11 +248,11 @@ PVR->TransferChannelGroup(handle, &tag); } - - return PVR_ERROR_NO_ERROR; + return true; } -PVR_ERROR Dvb::GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP& pvrGroup) +bool Dvb::GetChannelGroupMembers(ADDON_HANDLE handle, + const PVR_CHANNEL_GROUP& pvrGroup) { unsigned int channelNumberInGroup = 1; @@ -302,12 +275,12 @@ PVR->TransferChannelGroupMember(handle, &tag); - XBMC->Log(LOG_DEBUG, "%s add channel '%s' (%u) to group '%s'", + XBMC->Log(LOG_DEBUG, "%s: Add channel '%s' (%u) to group '%s'", __FUNCTION__, channel->name.c_str(), channel->backendNr, group->name.c_str()); } } - return PVR_ERROR_NO_ERROR; + return true; } unsigned int Dvb::GetChannelGroupsAmount() @@ -316,52 +289,87 @@ } -PVR_ERROR Dvb::GetTimers(ADDON_HANDLE handle) +bool Dvb::GetTimers(ADDON_HANDLE handle) { for (DvbTimers_t::iterator timer = m_timers.begin(); timer != m_timers.end(); ++timer) { PVR_TIMER tag; memset(&tag, 0, sizeof(PVR_TIMER)); - PVR_STRCPY(tag.strTitle, timer->strTitle.c_str()); - PVR_STRCPY(tag.strSummary, timer->strPlot.c_str()); - tag.iClientChannelUid = timer->iChannelUid; - tag.startTime = timer->startTime; - tag.endTime = timer->endTime; + PVR_STRCPY(tag.strTitle, timer->title.c_str()); + tag.iClientIndex = timer->id; + tag.iClientChannelUid = timer->channel->id; + tag.startTime = timer->start; + tag.endTime = timer->end; tag.state = timer->state; - tag.iPriority = timer->iPriority; - tag.bIsRepeating = timer->bRepeating; - tag.firstDay = timer->iFirstDay; - tag.iWeekdays = timer->iWeekdays; - tag.iEpgUid = timer->iEpgId; - tag.iClientIndex = timer->iClientIndex; + tag.iPriority = timer->priority; + tag.bIsRepeating = (timer->weekdays != 0); + tag.firstDay = (timer->weekdays != 0) ? timer->start : 0; + tag.iWeekdays = timer->weekdays; PVR->TransferTimerEntry(handle, &tag); } - return PVR_ERROR_NO_ERROR; + return true; } -PVR_ERROR Dvb::AddTimer(const PVR_TIMER& timer) +bool Dvb::AddTimer(const PVR_TIMER& timer, bool update) { - GenerateTimer(timer); - return PVR_ERROR_NO_ERROR; -} + XBMC->Log(LOG_DEBUG, "%s: channel=%u, title='%s'", + __FUNCTION__, timer.iClientChannelUid, timer.strTitle); -PVR_ERROR Dvb::UpdateTimer(const PVR_TIMER& timer) -{ - GenerateTimer(timer, false); - return PVR_ERROR_NO_ERROR; + time_t startTime = timer.startTime - timer.iMarginStart * 60; + time_t endTime = timer.endTime + timer.iMarginEnd * 60; + if (!timer.startTime) + startTime = time(NULL); + + unsigned int date = ((startTime + m_timezone) / DAY_SECS) + DELPHI_DATE; + struct tm *timeinfo; + timeinfo = localtime(&startTime); + unsigned int start = timeinfo->tm_hour * 60 + timeinfo->tm_min; + timeinfo = localtime(&endTime); + unsigned int stop = timeinfo->tm_hour * 60 + timeinfo->tm_min; + + char repeat[8] = "-------"; + for (int i = 0; i < 7; ++i) + { + if (timer.iWeekdays & (1 << i)) + repeat[i] = 'T'; + } + + uint64_t channelId = m_channels[timer.iClientChannelUid - 1]->backendIds.front(); + CStdString url; + if (!update) + url = BuildURL("api/timeradd.html?ch=%" PRIu64 "&dor=%u&enable=1&start=%u&stop=%u&prio=%d&days=%s&title=%s&encoding=255", + channelId, date, start, stop, timer.iPriority, repeat, URLEncodeInline(timer.strTitle).c_str()); + else + { + DvbTimer *t = GetTimer(timer); + if (!t) + return false; + + short enabled = (timer.state == PVR_TIMER_STATE_CANCELLED) ? 0 : 1; + url = BuildURL("api/timeredit.html?id=%d&ch=%" PRIu64 "&dor=%u&enable=%d&start=%u&stop=%u&prio=%d&days=%s&title=%s&encoding=255", + t->backendId, channelId, date, enabled, start, stop, timer.iPriority, repeat, URLEncodeInline(timer.strTitle).c_str()); + } + + GetHttpXML(url); + //TODO: instead of syncing all timers, we could only sync the new/modified + m_updateTimers = true; + return true; } -PVR_ERROR Dvb::DeleteTimer(const PVR_TIMER& timer) +bool Dvb::DeleteTimer(const PVR_TIMER& timer) { - GetHttpXML(BuildURL("api/timerdelete.html?id=%d", GetTimerId(timer))); + DvbTimer *t = GetTimer(timer); + if (!t) + return false; + GetHttpXML(BuildURL("api/timerdelete.html?id=%u", t->backendId)); if (timer.state == PVR_TIMER_STATE_RECORDING) PVR->TriggerRecordingUpdate(); m_updateTimers = true; - return PVR_ERROR_NO_ERROR; + return true; } unsigned int Dvb::GetTimersAmount() @@ -370,7 +378,7 @@ } -PVR_ERROR Dvb::GetRecordings(ADDON_HANDLE handle) +bool Dvb::GetRecordings(ADDON_HANDLE handle) { CStdString url = BuildURL("api/recordings.html?images=1"); CStdString req = GetHttpXML(url); @@ -382,12 +390,13 @@ { XBMC->Log(LOG_ERROR, "Unable to parse recordings. Error: %s", doc.ErrorDesc()); - return PVR_ERROR_SERVER_ERROR; + return false; } - CStdString streamURL, imageURL; + CStdString imageURL; TiXmlElement *root = doc.RootElement(); - XMLUtils::GetString(root, "serverURL", streamURL); + // refresh in case this has changed + XMLUtils::GetString(root, "serverURL", m_recordingURL); XMLUtils::GetString(root, "imageURL", imageURL); // there's no need to merge new recordings in older ones as XBMC does this @@ -411,42 +420,44 @@ XMLUtils::GetString(xRecording, "info", recording.plotOutline); XMLUtils::GetString(xRecording, "desc", recording.plot); if (recording.plot.empty()) + { recording.plot = recording.plotOutline; - - recording.streamURL = BuildExtURL(streamURL, "%s.ts", recording.id.c_str()); + recording.plotOutline.clear(); + } + else if (PrependOutline::test(PrependOutline::IN_RECORDINGS)) + { + recording.plot.insert(0, recording.plotOutline + "\n"); + recording.plotOutline.clear(); + } CStdString thumbnail; if (!g_lowPerformance && XMLUtils::GetString(xRecording, "image", thumbnail)) recording.thumbnailPath = BuildExtURL(imageURL, "%s", thumbnail.c_str()); CStdString startTime = xRecording->Attribute("start"); - recording.startTime = ParseDateTime(startTime); + recording.start = ParseDateTime(startTime); int hours, mins, secs; sscanf(xRecording->Attribute("duration"), "%02d%02d%02d", &hours, &mins, &secs); recording.duration = hours*60*60 + mins*60 + secs; - // generate a more unique id - recording.id += "_" + startTime; - - PVR_RECORDING tag; - memset(&tag, 0, sizeof(PVR_RECORDING)); - PVR_STRCPY(tag.strRecordingId, recording.id.c_str()); - PVR_STRCPY(tag.strTitle, recording.title.c_str()); - PVR_STRCPY(tag.strStreamURL, recording.streamURL.c_str()); - PVR_STRCPY(tag.strPlotOutline, recording.plotOutline.c_str()); - PVR_STRCPY(tag.strPlot, recording.plot.c_str()); - PVR_STRCPY(tag.strChannelName, recording.channelName.c_str()); - PVR_STRCPY(tag.strThumbnailPath, recording.thumbnailPath.c_str()); - tag.recordingTime = recording.startTime; - tag.iDuration = recording.duration; - tag.iGenreType = recording.genre & 0xF0; - tag.iGenreSubType = recording.genre & 0x0F; + PVR_RECORDING recinfo; + memset(&recinfo, 0, sizeof(PVR_RECORDING)); + PVR_STRCPY(recinfo.strRecordingId, recording.id.c_str()); + PVR_STRCPY(recinfo.strTitle, recording.title.c_str()); + PVR_STRCPY(recinfo.strPlotOutline, recording.plotOutline.c_str()); + PVR_STRCPY(recinfo.strPlot, recording.plot.c_str()); + PVR_STRCPY(recinfo.strChannelName, recording.channelName.c_str()); + PVR_STRCPY(recinfo.strThumbnailPath, recording.thumbnailPath.c_str()); + recinfo.recordingTime = recording.start; + recinfo.iDuration = recording.duration; + recinfo.iGenreType = recording.genre & 0xF0; + recinfo.iGenreSubType = recording.genre & 0x0F; CStdString tmp; switch(g_groupRecordings) { - case DvbRecording::GroupByDirectory: + case DvbRecording::GROUP_BY_DIRECTORY: XMLUtils::GetString(xRecording, "file", tmp); tmp.ToLower(); for (std::vector::reverse_iterator recf = m_recfolders.rbegin(); @@ -456,56 +467,50 @@ continue; tmp = tmp.substr(recf->length(), tmp.ReverseFind('\\') - recf->length()); tmp.Replace('\\', '/'); - PVR_STRCPY(tag.strDirectory, tmp.c_str() + 1); + PVR_STRCPY(recinfo.strDirectory, tmp.c_str() + 1); break; } break; - case DvbRecording::GroupByDate: + case DvbRecording::GROUP_BY_DATE: tmp.Format("%s/%s", startTime.substr(0, 4), startTime.substr(4, 2)); - PVR_STRCPY(tag.strDirectory, tmp.c_str()); + PVR_STRCPY(recinfo.strDirectory, tmp.c_str()); break; - case DvbRecording::GroupByFirstLetter: - tag.strDirectory[0] = recording.title[0]; - tag.strDirectory[1] = '\0'; + case DvbRecording::GROUP_BY_FIRST_LETTER: + recinfo.strDirectory[0] = recording.title[0]; + recinfo.strDirectory[1] = '\0'; break; - case DvbRecording::GroupByTVChannel: - PVR_STRCPY(tag.strDirectory, recording.channelName.c_str()); + case DvbRecording::GROUP_BY_TV_CHANNEL: + PVR_STRCPY(recinfo.strDirectory, recording.channelName.c_str()); break; - case DvbRecording::GroupBySeries: + case DvbRecording::GROUP_BY_SERIES: tmp = "Unknown"; XMLUtils::GetString(xRecording, "series", tmp); - PVR_STRCPY(tag.strDirectory, tmp.c_str()); + PVR_STRCPY(recinfo.strDirectory, tmp.c_str()); break; default: break; } - PVR->TransferRecordingEntry(handle, &tag); + PVR->TransferRecordingEntry(handle, &recinfo); ++m_recordingAmount; - XBMC->Log(LOG_DEBUG, "%s loaded Recording entry '%s': start=%u, length=%u", - __FUNCTION__, recording.title.c_str(), recording.startTime, + XBMC->Log(LOG_DEBUG, "%s: Loaded recording entry '%s': start=%u, length=%u", + __FUNCTION__, recording.title.c_str(), recording.start, recording.duration); } - XBMC->Log(LOG_INFO, "Loaded %u Recording Entries", m_recordingAmount); - - return PVR_ERROR_NO_ERROR; + XBMC->Log(LOG_INFO, "Loaded %u recording entries", m_recordingAmount); + return true; } -PVR_ERROR Dvb::DeleteRecording(const PVR_RECORDING& recinfo) +bool Dvb::DeleteRecording(const PVR_RECORDING& recinfo) { - CStdString recid = recinfo.strRecordingId; - CStdString::size_type pos = recid.find('_'); - if (pos != CStdString::npos) - recid.erase(pos); - // RS api doesn't return a result - GetHttpXML(BuildURL("api/recdelete.html?recid=%s&delfile=1", recid.c_str())); + GetHttpXML(BuildURL("api/recdelete.html?recid=%s&delfile=1", + recinfo.strRecordingId)); PVR->TriggerRecordingUpdate(); - - return PVR_ERROR_NO_ERROR; + return true; } unsigned int Dvb::GetRecordingsAmount() @@ -513,37 +518,41 @@ return m_recordingAmount; } +RecordingReader *Dvb::OpenRecordedStream(const PVR_RECORDING &recinfo) +{ + time_t now = time(NULL), end = 0; + CStdString channelName = recinfo.strChannelName; + for (DvbTimers_t::iterator timer = m_timers.begin(); + timer != m_timers.end(); ++timer) + { + if (timer->start <= now && now <= timer->end + && timer->state != PVR_TIMER_STATE_CANCELLED + && timer->channel->name.compare(0, channelName.length(), channelName) == 0) + { + end = timer->end; + break; + } + } + + return new RecordingReader(BuildExtURL(m_recordingURL, "%s.ts", + recinfo.strRecordingId), end); +} + bool Dvb::OpenLiveStream(const PVR_CHANNEL& channelinfo) { - XBMC->Log(LOG_DEBUG, "%s channel=%u", __FUNCTION__, channelinfo.iUniqueId); + XBMC->Log(LOG_DEBUG, "%s: channel=%u", __FUNCTION__, channelinfo.iUniqueId); if (channelinfo.iUniqueId == m_currentChannel) return true; SwitchChannel(channelinfo); - if (!g_useTimeshift) - return true; - - if (m_tsBuffer) - SAFE_DELETE(m_tsBuffer); - - CStdString streamURL = GetLiveStreamURL(channelinfo); - XBMC->Log(LOG_INFO, "Timeshift starts; url=%s", streamURL.c_str()); - m_tsBuffer = new TimeshiftBuffer(streamURL, g_timeshiftBufferPath); - return m_tsBuffer->IsValid(); + return true; } void Dvb::CloseLiveStream(void) { m_currentChannel = 0; - if (m_tsBuffer) - SAFE_DELETE(m_tsBuffer); -} - -TimeshiftBuffer *Dvb::GetTimeshiftBuffer() -{ - return m_tsBuffer; } CStdString& Dvb::GetLiveStreamURL(const PVR_CHANNEL& channelinfo) @@ -555,7 +564,7 @@ void *Dvb::Process() { int updateTimer = 0; - XBMC->Log(LOG_DEBUG, "%s starting", __FUNCTION__); + XBMC->Log(LOG_DEBUG, "%s: Running...", __FUNCTION__); while (!IsStopped()) { @@ -589,7 +598,6 @@ CLockObject lock(m_mutex); m_started.Broadcast(); - return NULL; } @@ -856,7 +864,6 @@ return true; } -//TODO: rewrite DvbTimers_t Dvb::LoadTimers() { DvbTimers_t timers; @@ -881,71 +888,59 @@ { DvbTimer timer; - CStdString strTmp; - if (XMLUtils::GetString(xTimer, "Descr", strTmp)) - XBMC->Log(LOG_DEBUG, "%s Processing timer '%s'", __FUNCTION__, strTmp.c_str()); - - timer.strTitle = strTmp; - timer.iChannelUid = GetChannelUid(xTimer->FirstChildElement("Channel")->Attribute("ID")); - if (timer.iChannelUid == 0) + if (!XMLUtils::GetString(xTimer, "GUID", timer.guid)) continue; - timer.state = PVR_TIMER_STATE_SCHEDULED; - - CStdString DateTime = xTimer->Attribute("Date"); - DateTime.append(xTimer->Attribute("Start")); - timer.startTime = ParseDateTime(DateTime, false); - timer.endTime = timer.startTime + atoi(xTimer->Attribute("Dur")) * 60; - - CStdString Weekdays = xTimer->Attribute("Days"); - timer.iWeekdays = 0; - for (unsigned int j = 0; j < Weekdays.length(); ++j) - { - if (Weekdays.data()[j] != '-') - timer.iWeekdays += (1 << j); - } - - if (timer.iWeekdays != 0) - { - timer.iFirstDay = timer.startTime; - timer.bRepeating = true; - } - else - timer.bRepeating = false; + XMLUtils::GetUInt(xTimer, "ID", timer.backendId); + XMLUtils::GetString(xTimer, "Descr", timer.title); - timer.iPriority = atoi(xTimer->Attribute("Priority")); + uint64_t backendId = 0; + std::istringstream ss(xTimer->FirstChildElement("Channel")->Attribute("ID")); + ss >> backendId; + if (!backendId) + continue; - if (xTimer->Attribute("EPGEventID")) - timer.iEpgId = atoi(xTimer->Attribute("EPGEventID")); + timer.channel = GetChannelByBackendId(backendId); + if (!timer.channel) + continue; + CStdString startDate = xTimer->Attribute("Date"); + startDate += xTimer->Attribute("Start"); + timer.start = ParseDateTime(startDate, false); + timer.end = timer.start + atoi(xTimer->Attribute("Dur")) * 60; + + CStdString weekdays = xTimer->Attribute("Days"); + timer.weekdays = 0; + for (unsigned int j = 0; j < weekdays.length(); ++j) + { + if (weekdays.data()[j] != '-') + timer.weekdays += (1 << j); + } + + timer.priority = atoi(xTimer->Attribute("Priority")); + timer.updateState = DvbTimer::STATE_NEW; + timer.state = PVR_TIMER_STATE_SCHEDULED; if (xTimer->Attribute("Enabled")[0] == '0') timer.state = PVR_TIMER_STATE_CANCELLED; - int iTmp; - if (XMLUtils::GetInt(xTimer, "Recording", iTmp)) - { - if (iTmp == -1) - timer.state = PVR_TIMER_STATE_RECORDING; - } - - if (XMLUtils::GetInt(xTimer, "ID", iTmp)) - timer.iTimerId = iTmp; + int tmp; + XMLUtils::GetInt(xTimer, "Recording", tmp); + if (tmp == -1) + timer.state = PVR_TIMER_STATE_RECORDING; timers.push_back(timer); - - XBMC->Log(LOG_DEBUG, "%s loaded Timer entry '%s': start=%u, end=%u", - __FUNCTION__, timer.strTitle.c_str(), timer.startTime, timer.endTime); + XBMC->Log(LOG_DEBUG, "%s: Loaded timer entry '%s': start=%u, end=%u", + __FUNCTION__, timer.title.c_str(), timer.start, timer.end); } - XBMC->Log(LOG_INFO, "Loaded %u Timer entries", timers.size()); + XBMC->Log(LOG_INFO, "Loaded %u timer entries", timers.size()); return timers; } -//TODO: rewrite void Dvb::TimerUpdates() { for (DvbTimers_t::iterator timer = m_timers.begin(); timer != m_timers.end(); ++timer) - timer->iUpdateState = DVB_UPDATE_STATE_NONE; + timer->updateState = DvbTimer::STATE_NONE; DvbTimers_t newtimers = LoadTimers(); unsigned int updated = 0, unchanged = 0; @@ -955,30 +950,18 @@ for (DvbTimers_t::iterator timer = m_timers.begin(); timer != m_timers.end(); ++timer) { - if (!timer->like(*newtimer)) + if (timer->guid != newtimer->guid) continue; - if (*timer == *newtimer) + if (timer->updateFrom(*newtimer)) { - timer->iUpdateState = newtimer->iUpdateState = DVB_UPDATE_STATE_FOUND; - ++unchanged; + timer->updateState = newtimer->updateState = DvbTimer::STATE_UPDATED; + ++updated; } else { - timer->iUpdateState = newtimer->iUpdateState = DVB_UPDATE_STATE_UPDATED; - timer->strTitle = newtimer->strTitle; - timer->strPlot = newtimer->strPlot; - timer->iChannelUid = newtimer->iChannelUid; - timer->startTime = newtimer->startTime; - timer->endTime = newtimer->endTime; - timer->bRepeating = newtimer->bRepeating; - timer->iWeekdays = newtimer->iWeekdays; - timer->iEpgId = newtimer->iEpgId; - timer->iTimerId = newtimer->iTimerId; - timer->iPriority = newtimer->iPriority; - timer->iFirstDay = newtimer->iFirstDay; - timer->state = newtimer->state; - ++updated; + timer->updateState = newtimer->updateState = DvbTimer::STATE_FOUND; + ++unchanged; } } } @@ -986,10 +969,10 @@ unsigned int removed = 0; for (DvbTimers_t::iterator it = m_timers.begin(); it != m_timers.end();) { - if (it->iUpdateState == DVB_UPDATE_STATE_NONE) + if (it->updateState == DvbTimer::STATE_NONE) { - XBMC->Log(LOG_DEBUG, "%s Removed timer: '%s', ClientIndex: %u", - __FUNCTION__, it->strTitle.c_str(), it->iClientIndex); + XBMC->Log(LOG_DEBUG, "%s: Removed timer '%s': id=%u", __FUNCTION__, + it->title.c_str(), it->id); it = m_timers.erase(it); ++removed; } @@ -1000,18 +983,18 @@ unsigned int added = 0; for (DvbTimers_t::iterator it = newtimers.begin(); it != newtimers.end(); ++it) { - if (it->iUpdateState == DVB_UPDATE_STATE_NEW) + if (it->updateState == DvbTimer::STATE_NEW) { - it->iClientIndex = m_newTimerIndex; - XBMC->Log(LOG_DEBUG, "%s New timer: '%s', ClientIndex: %u", - __FUNCTION__, it->strTitle.c_str(), m_newTimerIndex); + it->id = m_nextTimerId; + XBMC->Log(LOG_DEBUG, "%s: New timer '%s': id=%u", __FUNCTION__, + it->title.c_str(), it->id); m_timers.push_back(*it); - ++m_newTimerIndex; + ++m_nextTimerId; ++added; } } - XBMC->Log(LOG_DEBUG, "%s Timers update: removed=%u, untouched=%u, updated=%u, added=%u", + XBMC->Log(LOG_DEBUG, "%s: Timers update: removed=%u, unchanged=%u, updated=%u, added=%u", __FUNCTION__, removed, unchanged, updated, added); if (removed || updated || added) @@ -1021,60 +1004,14 @@ } } -void Dvb::GenerateTimer(const PVR_TIMER& timer, bool newTimer) -{ - // http://en.dvbviewer.tv/wiki/Recording_Service_Web_API#Add_a_timer - - XBMC->Log(LOG_DEBUG, "%s iChannelUid=%u title='%s' epgid=%d", - __FUNCTION__, timer.iClientChannelUid, timer.strTitle, timer.iEpgUid); - - time_t startTime = timer.startTime, endTime = timer.endTime; - if (!startTime) - startTime = time(NULL); - else - { - startTime -= timer.iMarginStart * 60; - endTime += timer.iMarginEnd * 60; - } - - unsigned int date = ((startTime + m_timezone) / DAY_SECS) + DELPHI_DATE; - struct tm *timeinfo; - timeinfo = localtime(&startTime); - unsigned int start = timeinfo->tm_hour * 60 + timeinfo->tm_min; - timeinfo = localtime(&endTime); - unsigned int stop = timeinfo->tm_hour * 60 + timeinfo->tm_min; - - char repeat[8] = "-------"; - for (int i = 0; i < 7; ++i) - { - if (timer.iWeekdays & (1 << i)) - repeat[i] = 'T'; - } - - uint64_t iChannelId = m_channels[timer.iClientChannelUid - 1]->backendIds.front(); - CStdString url; - if (newTimer) - url = BuildURL("api/timeradd.html?ch=%" PRIu64 "&dor=%u&enable=1&start=%u&stop=%u&prio=%d&days=%s&title=%s&encoding=255", - iChannelId, date, start, stop, timer.iPriority, repeat, URLEncodeInline(timer.strTitle).c_str()); - else - { - short enabled = (timer.state == PVR_TIMER_STATE_CANCELLED) ? 0 : 1; - url = BuildURL("api/timeredit.html?id=%d&ch=%" PRIu64 "&dor=%u&enable=%d&start=%u&stop=%u&prio=%d&days=%s&title=%s&encoding=255", - GetTimerId(timer), iChannelId, date, enabled, start, stop, timer.iPriority, repeat, URLEncodeInline(timer.strTitle).c_str()); - } - - GetHttpXML(url); - m_updateTimers = true; -} - -int Dvb::GetTimerId(const PVR_TIMER& timer) +DvbTimer *Dvb::GetTimer(const PVR_TIMER& timer) { for (DvbTimers_t::iterator it = m_timers.begin(); it != m_timers.end(); ++it) { - if (it->iClientIndex == timer.iClientIndex) - return it->iTimerId; + if (it->id == timer.iClientIndex) + return &*it; } - return 0; + return NULL; } @@ -1095,8 +1032,6 @@ { XBMC->Log(LOG_ERROR, "Unable to connect to the backend service. Error: %s", doc.ErrorDesc()); - XBMC->QueueNotification(QUEUE_ERROR, XBMC->GetLocalizedString(30500)); - Sleep(10000); return false; } @@ -1171,11 +1106,11 @@ m_diskspace.used += (size - free) / 1024; } - if (updateSettings && g_groupRecordings != DvbRecording::GroupDisabled) + if (updateSettings && g_groupRecordings != DvbRecording::GROUPING_DISABLED) m_recfolders.push_back(CStdString(xFolder->GetText()).ToLower()); } - if (updateSettings && g_groupRecordings != DvbRecording::GroupDisabled) + if (updateSettings && g_groupRecordings != DvbRecording::GROUPING_DISABLED) std::sort(m_recfolders.begin(), m_recfolders.end(), StringGreaterThan); return true; @@ -1201,55 +1136,20 @@ return mktime(&timeinfo); } -uint64_t Dvb::ParseChannelString(const CStdString& str, CStdString& channelName) -{ - std::vector tokenlist; - tokenize >(str, tokenlist, "|"); - if (tokenlist.size() < 1) - { - XBMC->Log(LOG_ERROR, "Unable to parse channel string: %s", str.c_str()); - return 0; - } - - uint64_t channelId = 0; - std::istringstream ss(tokenlist[0]); - ss >> channelId; - if (ss.fail()) - { - XBMC->Log(LOG_ERROR, "Unable to parse channel id: %s", - tokenlist[0].c_str()); - return 0; - } - - channelName.clear(); - if (tokenlist.size() >= 2) - channelName = ConvertToUtf8(tokenlist[1]); - return channelId; -} - -unsigned int Dvb::GetChannelUid(const CStdString& str) -{ - CStdString channelName; - uint64_t channelId = ParseChannelString(str, channelName); - if (channelId == 0) - return 0; - return GetChannelUid(channelId); -} - -unsigned int Dvb::GetChannelUid(const uint64_t channelId) +DvbChannel *Dvb::GetChannelByBackendId(const uint64_t backendId) { for (DvbChannels_t::iterator it = m_channels.begin(); it != m_channels.end(); ++it) { DvbChannel *channel = *it; - for (std::list::iterator backendId = channel->backendIds.begin(); - backendId != channel->backendIds.end(); backendId++) + for (std::list::iterator it2 = channel->backendIds.begin(); + it2 != channel->backendIds.end(); it2++) { - if (channelId == *backendId) - return channel->id; + if (backendId == *it2) + return channel; } } - return 0; + return NULL; } CStdString Dvb::BuildURL(const char* path, ...) diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/DvbData.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/DvbData.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/DvbData.h 2014-06-10 08:39:15.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/DvbData.h 2015-02-20 11:24:58.000000000 +0000 @@ -4,7 +4,7 @@ #define PVR_DVBVIEWER_DVBDATA_H #include "client.h" -#include "TimeshiftBuffer.h" +#include "RecordingReader.h" #include "platform/util/StdString.h" #include "platform/threads/threads.h" #include @@ -31,14 +31,6 @@ /* forward declaration */ class DvbGroup; -typedef enum DVB_UPDATE_STATE -{ - DVB_UPDATE_STATE_NONE, - DVB_UPDATE_STATE_FOUND, - DVB_UPDATE_STATE_UPDATED, - DVB_UPDATE_STATE_NEW -} DVB_UPDATE_STATE; - class DvbChannel { public: @@ -47,7 +39,10 @@ {} public: - /*!< @brief unique id passed to xbmc database. see FIXME for more details */ + /*!< @brief unique id passed to xbmc database. + * starts at 1 and increases by each channel regardless of hidden state. + * see FIXME for more details + */ unsigned int id; /*!< @brief backend number for generating the stream url */ unsigned int backendNr; @@ -81,74 +76,83 @@ {} public: - int iEventId; - CStdString strTitle; - unsigned int iChannelUid; - time_t startTime; - time_t endTime; + unsigned int id; + DvbChannel *channel; + CStdString title; + time_t start; + time_t end; unsigned int genre; - CStdString strPlotOutline; - CStdString strPlot; + CStdString plotOutline; + CStdString plot; }; class DvbTimer { public: - DvbTimer() + enum State { - iUpdateState = DVB_UPDATE_STATE_NEW; - } + STATE_NONE, + STATE_NEW, + STATE_FOUND, + STATE_UPDATED + }; - bool like(const DvbTimer& right) const - { - bool bChanged = true; - bChanged = bChanged && (startTime == right.startTime); - bChanged = bChanged && (endTime == right.endTime); - bChanged = bChanged && (iChannelUid == right.iChannelUid); - bChanged = bChanged && (bRepeating == right.bRepeating); - bChanged = bChanged && (iWeekdays == right.iWeekdays); - bChanged = bChanged && (iEpgId == right.iEpgId); - return bChanged; - } + DvbTimer() + : updateState(STATE_NEW) + {} + +#define TIMER_UPDATE_MEMBER(member) \ + if (member != source.member) \ + { \ + member = source.member; \ + updated = true; \ + } - bool operator==(const DvbTimer& right) const + bool updateFrom(const DvbTimer &source) { - bool bChanged = true; - bChanged = bChanged && like(right); - bChanged = bChanged && (state == right.state); - bChanged = bChanged && (strTitle == right.strTitle); - bChanged = bChanged && (strPlot == right.strPlot); - return bChanged; + bool updated = false; + TIMER_UPDATE_MEMBER(channel); + TIMER_UPDATE_MEMBER(title); + TIMER_UPDATE_MEMBER(start); + TIMER_UPDATE_MEMBER(end); + TIMER_UPDATE_MEMBER(priority); + TIMER_UPDATE_MEMBER(weekdays); + TIMER_UPDATE_MEMBER(state); + return updated; } public: - CStdString strTitle; - CStdString strPlot; - unsigned int iChannelUid; - time_t startTime; - time_t endTime; - bool bRepeating; - int iWeekdays; - int iEpgId; - int iTimerId; - int iPriority; - int iFirstDay; + /*!< @brief unique id passed to xbmc database + * starts at 1 and increases by each new timer. never decreases. + */ + unsigned int id; + /*!< @brief unique guid provided by backend. unique every time */ + CStdString guid; + /*!< @brief timer id on backend. unique at a time */ + unsigned int backendId; + + DvbChannel *channel; + CStdString title; + uint64_t channelId; + time_t start; + time_t end; + int priority; + unsigned int weekdays; PVR_TIMER_STATE state; - DVB_UPDATE_STATE iUpdateState; - unsigned int iClientIndex; + State updateState; }; class DvbRecording { public: - enum Group + enum Grouping { - GroupDisabled = 0, - GroupByDirectory, - GroupByDate, - GroupByFirstLetter, - GroupByTVChannel, - GroupBySeries, + GROUPING_DISABLED = 0, + GROUP_BY_DIRECTORY, + GROUP_BY_DATE, + GROUP_BY_FIRST_LETTER, + GROUP_BY_TV_CHANNEL, + GROUP_BY_SERIES }; public: @@ -158,11 +162,10 @@ public: CStdString id; - time_t startTime; + time_t start; int duration; unsigned int genre; CStdString title; - CStdString streamURL; CStdString plot; CStdString plotOutline; CStdString channelName; @@ -185,31 +188,32 @@ CStdString GetBackendName(); CStdString GetBackendVersion(); - PVR_ERROR GetDriveSpace(long long *total, long long *used); + bool GetDriveSpace(long long *total, long long *used); - bool SwitchChannel(const PVR_CHANNEL& channel); + bool SwitchChannel(const PVR_CHANNEL& channelinfo); unsigned int GetCurrentClientChannel(void); - PVR_ERROR GetChannels(ADDON_HANDLE handle, bool bRadio); - PVR_ERROR GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL& channel, time_t iStart, time_t iEnd); + bool GetChannels(ADDON_HANDLE handle, bool radio); + bool GetEPGForChannel(ADDON_HANDLE handle, const PVR_CHANNEL& channelinfo, + time_t start, time_t end); unsigned int GetChannelsAmount(void); - PVR_ERROR GetChannelGroups(ADDON_HANDLE handle, bool bRadio); - PVR_ERROR GetChannelGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP& group); + bool GetChannelGroups(ADDON_HANDLE handle, bool radio); + bool GetChannelGroupMembers(ADDON_HANDLE handle, + const PVR_CHANNEL_GROUP& group); unsigned int GetChannelGroupsAmount(void); - PVR_ERROR GetTimers(ADDON_HANDLE handle); - PVR_ERROR AddTimer(const PVR_TIMER& timer); - PVR_ERROR UpdateTimer(const PVR_TIMER& timer); - PVR_ERROR DeleteTimer(const PVR_TIMER& timer); + bool GetTimers(ADDON_HANDLE handle); + bool AddTimer(const PVR_TIMER& timer, bool update = false); + bool DeleteTimer(const PVR_TIMER& timer); unsigned int GetTimersAmount(void); - PVR_ERROR GetRecordings(ADDON_HANDLE handle); - PVR_ERROR DeleteRecording(const PVR_RECORDING& recinfo); + bool GetRecordings(ADDON_HANDLE handle); + bool DeleteRecording(const PVR_RECORDING& recinfo); unsigned int GetRecordingsAmount(); + RecordingReader *OpenRecordedStream(const PVR_RECORDING &recinfo); bool OpenLiveStream(const PVR_CHANNEL& channelinfo); void CloseLiveStream(); - TimeshiftBuffer *GetTimeshiftBuffer(); CStdString& GetLiveStreamURL(const PVR_CHANNEL& channelinfo); protected: @@ -222,17 +226,14 @@ bool LoadChannels(); DvbTimers_t LoadTimers(); void TimerUpdates(); - void GenerateTimer(const PVR_TIMER& timer, bool newtimer = true); - int GetTimerId(const PVR_TIMER& timer); + DvbTimer *GetTimer(const PVR_TIMER& timer); // helper functions void RemoveNullChars(CStdString& str); bool CheckBackendVersion(); bool UpdateBackendStatus(bool updateSettings = false); time_t ParseDateTime(const CStdString& strDate, bool iso8601 = true); - uint64_t ParseChannelString(const CStdString& str, CStdString& channelName); - unsigned int GetChannelUid(const CStdString& str); - unsigned int GetChannelUid(const uint64_t channelId); + DvbChannel *GetChannelByBackendId(const uint64_t backendId); CStdString BuildURL(const char* path, ...); CStdString BuildExtURL(const CStdString& baseURL, const char* path, ...); CStdString ConvertToUtf8(const CStdString& src); @@ -241,29 +242,30 @@ private: bool m_connected; unsigned int m_backendVersion; + CStdString m_url; + CStdString m_recordingURL; long m_timezone; struct { long long total, used; } m_diskspace; std::vector m_recfolders; - CStdString m_url; - unsigned int m_currentChannel; - - /* channels + active (not hidden) channels */ + /* channels */ DvbChannels_t m_channels; + /* active (not hidden) channels */ unsigned int m_channelAmount; + unsigned int m_currentChannel; - /* channel groups + active (not hidden) groups */ + /* channel groups */ DvbGroups_t m_groups; + /* active (not hidden) groups */ unsigned int m_groupAmount; bool m_updateTimers; bool m_updateEPG; unsigned int m_recordingAmount; - TimeshiftBuffer *m_tsBuffer; DvbTimers_t m_timers; - unsigned int m_newTimerIndex; + unsigned int m_nextTimerId; PLATFORM::CMutex m_mutex; PLATFORM::CCondition m_started; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/RecordingReader.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/RecordingReader.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/RecordingReader.cpp 1970-01-01 00:00:00.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/RecordingReader.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -0,0 +1,100 @@ +#include "RecordingReader.h" +#include "client.h" +#include "platform/util/util.h" +#include "platform/threads/mutex.h" + +#define REOPEN_INTERVAL 30 +#define REOPEN_INTERVAL_FAST 10 + +using namespace ADDON; + +RecordingReader::RecordingReader(CStdString streamURL, time_t end) + : m_streamURL(streamURL), m_end(end), m_fastReopen(false), m_playback(false) +{ + m_readHandle = XBMC->OpenFile(m_streamURL, 0); + m_len = XBMC->GetFileLength(m_readHandle); + m_pos = 0; + m_nextReopen = time(NULL) + REOPEN_INTERVAL; + XBMC->Log(LOG_DEBUG, "RecordingReader: Started; url=%s, end=%u", + m_streamURL.c_str(), m_end); +} + +RecordingReader::~RecordingReader(void) +{ + if (m_readHandle) + XBMC->CloseFile(m_readHandle); + XBMC->Log(LOG_DEBUG, "RecordingReader: Stopped"); +} + +bool RecordingReader::IsValid() +{ + return (m_readHandle != NULL); +} + +int RecordingReader::ReadData(unsigned char *buffer, unsigned int size) +{ + /* check for playback of ongoing recording */ + if (m_playback && m_end) + { + time_t now = time(NULL); + if (now > m_nextReopen) + { +FORCE_REOPEN: + /* reopen stream */ + XBMC->Log(LOG_DEBUG, "RecordingReader: Reopening stream..."); + XBMC->CloseFile(m_readHandle); + m_readHandle = XBMC->OpenFile(m_streamURL, 0); + m_len = XBMC->GetFileLength(m_readHandle); + XBMC->SeekFile(m_readHandle, m_pos, SEEK_SET); + + m_nextReopen = now + ((m_fastReopen) ? REOPEN_INTERVAL_FAST : REOPEN_INTERVAL); + + /* recording has finished */ + if (now > m_end) + m_end = 0; + } + else if (m_pos == m_len) + { + /* in case we reached the end we need to wait a little */ + int sleep = REOPEN_INTERVAL_FAST + 5; + if (!m_fastReopen) + sleep = std::min(sleep, static_cast(m_nextReopen - now + 1)); + XBMC->Log(LOG_DEBUG, "RecordingReader: End reached. Sleeping %d secs", + sleep); + PLATFORM::CEvent::Sleep(sleep * 1000); + now += sleep; + m_fastReopen = true; + goto FORCE_REOPEN; + } + } + + unsigned int read = XBMC->ReadFile(m_readHandle, buffer, size); + m_pos += read; + return read; +} + +long long RecordingReader::Seek(long long position, int whence) +{ + int64_t ret = XBMC->SeekFile(m_readHandle, position, whence); + // for unknown reason seek sometimes doesn't return the correct position + // so let's sync with the underlaying implementation + m_pos = XBMC->GetFilePosition(m_readHandle); + m_len = XBMC->GetFileLength(m_readHandle); + return ret; +} + +long long RecordingReader::Position() +{ + return m_pos; +} + +long long RecordingReader::Length() +{ + return m_len; +} + +void RecordingReader::Announce(const char *message) +{ + if (strcmp(message, "OnPlay") == 0) + m_playback = true; +} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/RecordingReader.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/RecordingReader.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/RecordingReader.h 1970-01-01 00:00:00.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/RecordingReader.h 2015-02-20 11:24:58.000000000 +0000 @@ -0,0 +1,38 @@ +#pragma once + +#ifndef PVR_DVBVIEWER_RECORDINGREADER_H +#define PVR_DVBVIEWER_RECORDINGREADER_H + +#include "platform/util/StdString.h" + +class RecordingReader +{ +public: + RecordingReader(CStdString streamURL, time_t end); + ~RecordingReader(void); + int ReadData(unsigned char *buffer, unsigned int size); + bool IsValid(); + long long Seek(long long position, int whence); + long long Position(); + long long Length(); + void Announce(const char *message); + +private: + CStdString m_streamURL; + void *m_readHandle; + + /*!< @brief end time of the recording in case this an ongoing recording */ + time_t m_end; + time_t m_nextReopen; + bool m_fastReopen; + + /*!< @brief indicates if ffmpeg playback has started + * In case we reach the end we need to sleep until the next reopen. However + * during start/seek/jump/resume ffmpeg seeks and reads till the end. + */ + bool m_playback; + uint64_t m_pos; + uint64_t m_len; +}; + +#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/TimeshiftBuffer.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/TimeshiftBuffer.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/TimeshiftBuffer.cpp 2014-06-10 08:39:15.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/TimeshiftBuffer.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -2,12 +2,16 @@ #include "client.h" #include "platform/util/util.h" +#define STREAM_READ_BUFFER_SIZE 32768 +#define BUFFER_READ_TIMEOUT 10000 +#define BUFFER_READ_WAITTIME 50 + using namespace ADDON; -TimeshiftBuffer::TimeshiftBuffer(CStdString streampath, CStdString bufferpath) - : m_bufferPath(bufferpath) +TimeshiftBuffer::TimeshiftBuffer(CStdString streamURL, CStdString bufferPath) + : m_bufferPath(bufferPath) { - m_streamHandle = XBMC->OpenFile(streampath, READ_NO_CACHE); + m_streamHandle = XBMC->OpenFile(streamURL, READ_NO_CACHE); m_bufferPath += "/tsbuffer.ts"; m_filebufferWriteHandle = XBMC->OpenFileForWrite(m_bufferPath, true); #ifndef TARGET_POSIX @@ -35,7 +39,9 @@ bool TimeshiftBuffer::IsValid() { - return (m_streamHandle != NULL); + return (m_streamHandle != NULL + && m_filebufferWriteHandle != NULL + && m_filebufferReadHandle != NULL); } void TimeshiftBuffer::Stop() @@ -45,7 +51,7 @@ void *TimeshiftBuffer::Process() { - XBMC->Log(LOG_DEBUG, "Timeshift: thread started"); + XBMC->Log(LOG_DEBUG, "Timeshift: Thread started"); byte buffer[STREAM_READ_BUFFER_SIZE]; while (m_start) @@ -59,29 +65,22 @@ m_mutex.Unlock(); #endif } - XBMC->Log(LOG_DEBUG, "Timeshift: thread stopped"); + XBMC->Log(LOG_DEBUG, "Timeshift: Thread stopped"); return NULL; } long long TimeshiftBuffer::Seek(long long position, int whence) { - if (m_filebufferReadHandle) - return XBMC->SeekFile(m_filebufferReadHandle, position, whence); - return -1; + return XBMC->SeekFile(m_filebufferReadHandle, position, whence); } long long TimeshiftBuffer::Position() { - if (m_filebufferReadHandle) - return XBMC->GetFilePosition(m_filebufferReadHandle); - return -1; + return XBMC->GetFilePosition(m_filebufferReadHandle); } long long TimeshiftBuffer::Length() { - if (!m_filebufferReadHandle || !m_filebufferWriteHandle) - return 0; - // We can't use GetFileLength here as it's value will be cached // by XBMC until we read or seek above it. // see xbm/xbmc/filesystem/HDFile.cpp CHDFile::GetLength() @@ -102,11 +101,8 @@ int TimeshiftBuffer::ReadData(unsigned char *buffer, unsigned int size) { - if (!m_filebufferReadHandle || !m_filebufferWriteHandle) - return 0; - /* make sure we never read above the current write position */ - int64_t readPos = XBMC->GetFilePosition(m_filebufferReadHandle); + int64_t readPos = XBMC->GetFilePosition(m_filebufferReadHandle); unsigned int timeWaited = 0; while (readPos + size > Length()) { diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/TimeshiftBuffer.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/TimeshiftBuffer.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.dvbviewer/src/TimeshiftBuffer.h 2014-06-10 08:39:15.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.dvbviewer/src/TimeshiftBuffer.h 2015-02-20 11:24:58.000000000 +0000 @@ -6,18 +6,14 @@ #include "platform/util/StdString.h" #include "platform/threads/threads.h" -#define STREAM_READ_BUFFER_SIZE 32768 -#define BUFFER_READ_TIMEOUT 10000 -#define BUFFER_READ_WAITTIME 50 - class TimeshiftBuffer : public PLATFORM::CThread { public: - TimeshiftBuffer(CStdString streamPath, CStdString bufferPath); + TimeshiftBuffer(CStdString streamURL, CStdString bufferPath); ~TimeshiftBuffer(void); - int ReadData(unsigned char *buffer, unsigned int size); bool IsValid(); + int ReadData(unsigned char *buffer, unsigned int size); long long Seek(long long position, int whence); long long Position(); long long Length(); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.filmon/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.filmon/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.filmon/addon/addon.xml.in 2015-01-19 19:21:06.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.filmon/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,12 +1,12 @@ - + Filmon előtér-kiszolgáló. Támogatja az Élő TV-t, felvételeket, EPG-t. Filmon regisztráció szükséges. Engedélyezése előtt: (a) a Filmon-ban állítsa be kedvencként a csatornát hogy megjelenjen a Kodi-ban (b) írja be a felhasználónevet és a jelszót a kiegészítő beállításainál. Megjegyzés: a felvételek befejezése után előfordulhat hogy csak egy idő mulva jelennek meg a felvételi listában. Front end Filmon. Mendukung siaran TV, rekaman, EPG. Memerlukan langganan Filmon. Sebelum mengaktifkan: (a) dalam menetapkan saluran Filmon sebagai favorit untuk melihat mereka di Kodi (b) masukkan nama penggunan dan sandi pada pengaturan addon ini. Catatan : rekaman bisa memerlukan beberapa menit untuk muncul setelah timer selesai Filmon framendi. Styður beina útsendingu, upptökur, rafræna dagskrárupplýsingar. Þarfnast Filmon áskriftar. Áður en þú gerir virkt: (a) í Filmon settu rásir sem uppáhalds til að sjá þær í Kodi. (b) settu inn notandanafn þitt og lykilorð í uppsetningu viðbótarinnar. Taktu eftir: það getur tekið nokkrar mínútur þangað til upptaka verður sýnileg eftir að upptöku líkur. + Frontend Filmon. Supporta TV in diretta, registrazioni, EPG. Richiede l'abbonamento a Filmon. Prima di abilitare: (a) in Filmon, imposta i canali come preferiti per visualizzarli in Kodi (b) inserisci i tuoi username e password nelle impostazioni dell'addon. Nota: le registrazioni potrebbero apparire dopo alcuni minuti dallo scadere del timer. Filmon 프론트엔드. 라이브 TV, 녹화, EPG 지원. Filmon 계정정보 필요. 활성화하기 전에: (a) Kodi에서 보려면 Filmon에서 채널을 즐겨찾기에 등록하세요. (b) 애드온 설정에 사용자명과 비밀번호를 입력하세요. 노트: 녹화물은 타이머가 만료된 후 몇 분 뒤에 나타날 수 있습니다. Filmon naudotojo sąsaja. Palaiko TV transliaciją, laidų įrašymą, EPG. Reikalinga Filmon paskyra. Prieš įjungiant: (a) Filmon puslapyje nustatykite kanalus, kuriuos norite matyti Kodi, kaip mėgstamiausius (b) įveskite savo vartotojo vardą ir slaptažodį šio priedo nustatymuose. Pastaba: įrašymo atsiradimui gali prireikti keleto minučių po laikmačio sukūrimo. Интерфејс за Filmon. Поддржува ТВ во живо, снимки, EPG. Бара Filmon претплата. Пред да го вклучите: (а) во Filmon поставете канали како омилени за да можете да ги видите во Kodi (б) внесете го вашето име и лозинка во подесувањата за овој аддон. Белешка: на снимките може да им требаат неколку минути за да се појават откако тајмерот ќе заврши. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.filmon/addon/changelog.txt kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.filmon/addon/changelog.txt --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.filmon/addon/changelog.txt 2015-01-19 19:21:06.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.filmon/addon/changelog.txt 2015-02-20 11:24:58.000000000 +0000 @@ -1,3 +1,9 @@ +0.5.1 +Updated to API v1.9.4 + +0.4.8 +Updated Language files from Transifex + 0.4.7 Updated Language files from Transifex diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.filmon/src/client.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.filmon/src/client.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.filmon/src/client.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.filmon/src/client.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -192,6 +192,7 @@ pCapabilities->bSupportsTV = true; pCapabilities->bSupportsEPG = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsTimers = true; pCapabilities->bSupportsChannelGroups = true; pCapabilities->bSupportsRadio = false; @@ -294,14 +295,14 @@ return PVR_ERROR_NO_ERROR; } -int GetRecordingsAmount(void) { +int GetRecordingsAmount(bool deleted) { if (m_data) return m_data->GetRecordingsAmount(); return -1; } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) { +PVR_ERROR GetRecordings(ADDON_HANDLE, bool deleted) { if (m_data) return m_data->GetRecordings(handle); @@ -352,7 +353,7 @@ } /** UNUSED API FUNCTIONS */ -PVR_ERROR DialogChannelScan(void) { +PVR_ERROR OpenDialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR CallMenuHook(const PVR_MENUHOOK &menuhook, @@ -374,10 +375,10 @@ int GetCurrentClientChannel(void) { return 0; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &channel) { +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &channel) { +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } bool OpenRecordedStream(const PVR_RECORDING &recording) { @@ -476,4 +477,12 @@ time_t GetBufferTimeEnd() { return 0; } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) +{ + return PVR_ERROR_NOT_IMPLEMENTED; +} +PVR_ERROR DeleteAllRecordingsFromTrash() +{ + return PVR_ERROR_NOT_IMPLEMENTED; +} } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/addon.xml.in 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,14 +1,14 @@ - - - + + + =2 && n<=4) ? 1 : 2;\n" +msgctxt "#30000" +msgid "Connection Settings" +msgstr "Nastavení připojení" + msgctxt "#30001" msgid "Tvheadend hostname or IP address" msgstr "Název počítače, nebo adresa IP Tvheadend" @@ -36,10 +40,26 @@ msgid "Password" msgstr "Heslo" +msgctxt "#30006" +msgid "Connection timeout in seconds" +msgstr "Limit pro ukončení spojení v sekundách" + msgctxt "#30007" msgid "Response timeout in seconds" msgstr "Časový limit odpovědi v sekundách" +msgctxt "#30100" +msgid "Data Transfer" +msgstr "Přenos dat" + +msgctxt "#30101" +msgid "Asynchronous EPG transfer" +msgstr "Asynchronní přenos EPG" + msgctxt "#30200" msgid "Debugging" msgstr "Ladění" + +msgctxt "#30201" +msgid "Trace (detailed)" +msgstr "Trace (detailní)" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/French/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/French/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/French/strings.po 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/French/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -16,6 +16,10 @@ "Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" +msgctxt "#30000" +msgid "Connection Settings" +msgstr "Paramètres de connexion" + msgctxt "#30001" msgid "Tvheadend hostname or IP address" msgstr "Nom d'hôte ou adresse IP de Tvheadend" @@ -36,10 +40,26 @@ msgid "Password" msgstr "Mot de passe" +msgctxt "#30006" +msgid "Connection timeout in seconds" +msgstr "Timeout de connexion en secondes" + msgctxt "#30007" msgid "Response timeout in seconds" msgstr "Temporisation de réponse en secondes" +msgctxt "#30100" +msgid "Data Transfer" +msgstr "Transfert de données" + +msgctxt "#30101" +msgid "Asynchronous EPG transfer" +msgstr "Transfert EPG asynchronisé" + msgctxt "#30200" msgid "Debugging" msgstr "Débogage" + +msgctxt "#30201" +msgid "Trace (detailed)" +msgstr "Trace (détaillé)" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Galician/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Galician/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Galician/strings.po 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Galician/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -16,6 +16,10 @@ "Language: gl\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +msgctxt "#30000" +msgid "Connection Settings" +msgstr "Configuración da Conexión" + msgctxt "#30001" msgid "Tvheadend hostname or IP address" msgstr "Nome do host ou enderezo IP" @@ -36,10 +40,22 @@ msgid "Password" msgstr "Contrasinal" +msgctxt "#30006" +msgid "Connection timeout in seconds" +msgstr "Tempo de espera da conexión en segundos" + msgctxt "#30007" msgid "Response timeout in seconds" msgstr "Tempo de espera da resposta en segundos" +msgctxt "#30100" +msgid "Data Transfer" +msgstr "Transferencia de datos" + +msgctxt "#30101" +msgid "Asynchronous EPG transfer" +msgstr "Transferencia asíncrona da Guía" + msgctxt "#30200" msgid "Debugging" msgstr "Depuración" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Hungarian/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Hungarian/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Hungarian/strings.po 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Hungarian/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -16,6 +16,10 @@ "Language: hu\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +msgctxt "#30000" +msgid "Connection Settings" +msgstr "Kapcsolódási beállítások" + msgctxt "#30001" msgid "Tvheadend hostname or IP address" msgstr "TVHeadend kiszolgálónév vagy IP cím" @@ -36,10 +40,26 @@ msgid "Password" msgstr "Jelszó" +msgctxt "#30006" +msgid "Connection timeout in seconds" +msgstr "Kapcsolódási időtullépés másodpercben" + msgctxt "#30007" msgid "Response timeout in seconds" msgstr "Válasz időkorlát másodpercben" +msgctxt "#30100" +msgid "Data Transfer" +msgstr "Adatátvitel" + +msgctxt "#30101" +msgid "Asynchronous EPG transfer" +msgstr "Asszinkron EPG átvitel" + msgctxt "#30200" msgid "Debugging" msgstr "Hibakeresés" + +msgctxt "#30201" +msgid "Trace (detailed)" +msgstr "Nyomonkövetés (részletes)" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Italian/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Italian/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Italian/strings.po 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Italian/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -16,6 +16,10 @@ "Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +msgctxt "#30000" +msgid "Connection Settings" +msgstr "Impostazioni di connessione" + msgctxt "#30001" msgid "Tvheadend hostname or IP address" msgstr "Tvheadend hostname o indirizzo IP" @@ -36,10 +40,26 @@ msgid "Password" msgstr "Password" +msgctxt "#30006" +msgid "Connection timeout in seconds" +msgstr "Timeout di connessione in secondi" + msgctxt "#30007" msgid "Response timeout in seconds" msgstr "Timeout della risposta in secondi" +msgctxt "#30100" +msgid "Data Transfer" +msgstr "Trasferimento dati" + +msgctxt "#30101" +msgid "Asynchronous EPG transfer" +msgstr "Trasferimento EPG asincrono" + msgctxt "#30200" msgid "Debugging" msgstr "Debugging" + +msgctxt "#30201" +msgid "Trace (detailed)" +msgstr "Traccia (dettagliata)" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Polish/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Polish/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Polish/strings.po 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Polish/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -58,7 +58,7 @@ msgctxt "#30200" msgid "Debugging" -msgstr "Diagnozowanie błędów" +msgstr "Diagnostyka" msgctxt "#30201" msgid "Trace (detailed)" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Portuguese/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Portuguese/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/addon/resources/language/Portuguese/strings.po 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/addon/resources/language/Portuguese/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -16,6 +16,10 @@ "Language: pt\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" +msgctxt "#30000" +msgid "Connection Settings" +msgstr "Configurações de conexão" + msgctxt "#30001" msgid "Tvheadend hostname or IP address" msgstr "Nome do servidor Tvheadend ou endereço IP" @@ -36,10 +40,26 @@ msgid "Password" msgstr "Palavra-passe" +msgctxt "#30006" +msgid "Connection timeout in seconds" +msgstr "Tempo limite de conexão em segundos" + msgctxt "#30007" msgid "Response timeout in seconds" msgstr "Tempo limite para resposta em segundos" +msgctxt "#30100" +msgid "Data Transfer" +msgstr "Transferência de dados" + +msgctxt "#30101" +msgid "Asynchronous EPG transfer" +msgstr "EPG transferência assíncrona" + msgctxt "#30200" msgid "Debugging" msgstr "Depuração" + +msgctxt "#30201" +msgid "Trace (detailed)" +msgstr "Localizar (detalhada)" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/src/client.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/src/client.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/src/client.cpp 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/src/client.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -89,7 +89,7 @@ UPDATE_STR(g_strUsername, "user", buffer, ""); UPDATE_STR(g_strPassword, "pass", buffer, ""); UPDATE_INT(g_iPortHTSP, "htsp_port", DEFAULT_HTSP_PORT); - UPDATE_INT(g_iPortHTTP, "http_port", DEFAULT_HTSP_PORT); + UPDATE_INT(g_iPortHTTP, "http_port", DEFAULT_HTTP_PORT); UPDATE_INT(g_iConnectTimeout, "connect_timeout", DEFAULT_CONNECT_TIMEOUT); UPDATE_INT(g_iResponseTimeout, "response_timeout", DEFAULT_RESPONSE_TIMEOUT); @@ -310,6 +310,7 @@ pCapabilities->bSupportsTV = true; pCapabilities->bSupportsRadio = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsTimers = true; pCapabilities->bSupportsChannelGroups = true; pCapabilities->bHandlesInputStream = true; @@ -476,12 +477,12 @@ * Recording Management * *************************************************************************/ -int GetRecordingsAmount(void) +int GetRecordingsAmount(bool deleted) { return tvh->GetRecordingCount(); } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { return tvh->GetRecordings(handle); } @@ -502,6 +503,16 @@ return tvh->RenameRecording(rec); } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) +{ + return PVR_ERROR_NOT_IMPLEMENTED; +} + +PVR_ERROR DeleteAllRecordingsFromTrash() +{ + return PVR_ERROR_NOT_IMPLEMENTED; +} + int GetTimersAmount(void) { return tvh->GetTimerCount(); @@ -584,7 +595,7 @@ } /* Channel Management */ -PVR_ERROR DialogChannelScan(void) +PVR_ERROR OpenDialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } @@ -600,11 +611,11 @@ { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &_unused(channel)) +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &_unused(channel)) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &_unused(channel)) +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &_unused(channel)) { return PVR_ERROR_NOT_IMPLEMENTED; } @@ -626,7 +637,7 @@ } time_t GetBufferTimeEnd() { - return 0; } + return 0; } /* Live stream (VFS interface - not relevant) */ @@ -652,3 +663,5 @@ { return ""; } + +} /* extern "C" */ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/src/Tvheadend.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/src/Tvheadend.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.hts/src/Tvheadend.cpp 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.hts/src/Tvheadend.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -312,7 +312,7 @@ PVR_ERROR CTvheadend::GetRecordings ( ADDON_HANDLE handle ) { if (!m_asyncState.WaitForState(ASYNC_EPG)) - return PVR_ERROR_NO_ERROR; + return PVR_ERROR_FAILED; std::vector recs; { @@ -799,6 +799,9 @@ htsmsg_t *msg; STags::iterator tit; SChannels::iterator cit; + SRecordings::iterator rit; + SSchedules::iterator sit; + SEvents::iterator eit; /* Rebuild state */ m_dmx.Connected(); @@ -809,6 +812,15 @@ cit->second.del = true; for (tit = m_tags.begin(); tit != m_tags.end(); ++tit) tit->second.del = true; + for (rit = m_recordings.begin(); rit != m_recordings.end(); ++rit) + rit->second.del = true; + for (sit = m_schedules.begin(); sit != m_schedules.end(); ++sit) + { + sit->second.del = true; + + for (eit = sit->second.events.begin(); eit != sit->second.events.end(); ++eit) + eit->second.del = true; + } /* Request Async data */ m_asyncState.SetState(ASYNC_NONE); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.iptvsimple/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.iptvsimple/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.iptvsimple/addon/addon.xml.in 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.iptvsimple/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,12 +1,12 @@ - + - - + + bSupportsEPG = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsTimers = true; pCapabilities->bSupportsTV = true; pCapabilities->bSupportsRadio = g_bRadioEnabled; @@ -550,7 +551,7 @@ return g_client->GetBackendTime(localTime, gmtOffset); } -PVR_ERROR DialogChannelScan() +PVR_ERROR OpenDialogChannelScan() { return PVR_ERROR_NOT_IMPLEMENTED; } @@ -602,12 +603,12 @@ return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL& UNUSED(channelinfo)) +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL& UNUSED(channelinfo)) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL& UNUSED(channelinfo)) +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL& UNUSED(channelinfo)) { return PVR_ERROR_NOT_IMPLEMENTED; } @@ -644,7 +645,7 @@ /*******************************************/ /** PVR Recording Functions **/ -int GetRecordingsAmount(void) +int GetRecordingsAmount(bool deleted) { if (!g_client) return 0; @@ -652,7 +653,7 @@ return g_client->GetNumRecordings(); } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { if (!g_client) return PVR_ERROR_SERVER_ERROR; @@ -910,4 +911,6 @@ time_t GetPlayingTime() { return 0; } time_t GetBufferTimeStart() { return 0; } time_t GetBufferTimeEnd() { return 0; } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; } } //end extern "C" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/addon/addon.xml.in 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,14 +1,14 @@ - - - + + + {086b2f32-c84b-481c-bb7e-accb4b2a0671} - - {e95631f0-9035-4be4-b8e1-e2c6b0e3f0c3} - {fe4573f6-a794-4ad3-b37f-49e51f1140e6} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/addon.map kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/addon.map --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/addon.map 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/addon.map 2015-02-20 11:24:58.000000000 +0000 @@ -17,15 +17,13 @@ CloseLiveStream; CloseRecordedStream; DeleteChannel; + DeleteAllRecordingsFromTrash; DeleteRecording; DeleteTimer; DemuxAbort; DemuxFlush; DemuxRead; DemuxReset; - DialogAddChannel; - DialogChannelScan; - DialogChannelSettings; GetAddonCapabilities; GetBackendHostname; GetBackendName; @@ -58,6 +56,9 @@ LengthLiveStream; LengthRecordedStream; MoveChannel; + OpenDialogChannelAdd; + OpenDialogChannelScan; + OpenDialogChannelSettings; OpenLiveStream; OpenRecordedStream; PauseStream; @@ -75,6 +76,7 @@ SetSpeed; SignalStatus; SwitchChannel; + UndeleteRecording; UpdateTimer; local: diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/avinfo.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/avinfo.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/avinfo.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/avinfo.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -52,7 +52,7 @@ break; } if (XBMC && doLog) - XBMC->Log(loglevel, LOGTAG"%s", msg); + XBMC->Log(loglevel, LOGTAG "%s", msg); } } @@ -88,7 +88,7 @@ } else { - XBMC->Log(LOG_ERROR, LOGTAG"alloc AV buffer failed"); + XBMC->Log(LOG_ERROR, LOGTAG "alloc AV buffer failed"); } } @@ -101,7 +101,7 @@ if (m_av_buf) { if (g_bExtraDebug) - XBMC->Log(LOG_DEBUG, LOGTAG"free AV buffer: allocated size was %zu", m_av_buf_size); + XBMC->Log(LOG_DEBUG, LOGTAG "free AV buffer: allocated size was %zu", m_av_buf_size); free(m_av_buf); m_av_buf = NULL; } @@ -165,7 +165,7 @@ { if (!m_AVContext) { - XBMC->Log(LOG_ERROR, LOGTAG"%s: no AVContext", __FUNCTION__); + XBMC->Log(LOG_ERROR, LOGTAG "%s: no AVContext", __FUNCTION__); return; } @@ -207,7 +207,7 @@ } if (ret < 0) - XBMC->Log(LOG_NOTICE, LOGTAG"%s: error %d", __FUNCTION__, ret); + XBMC->Log(LOG_NOTICE, LOGTAG "%s: error %d", __FUNCTION__, ret); if (ret == AVCONTEXT_TS_ERROR) m_AVContext->Shift(); @@ -217,7 +217,7 @@ m_AVStatus = ret; m_file->Seek(0, Myth::WHENCE_SET); - XBMC->Log(LOG_DEBUG, LOGTAG"%s: terminated with status %d", __FUNCTION__, ret); + XBMC->Log(LOG_DEBUG, LOGTAG "%s: terminated with status %d", __FUNCTION__, ret); } bool AVInfo::GetMainStream(STREAM_AVINFO *info) const @@ -305,7 +305,7 @@ m_nosetup.insert((*it)->pid); if (g_bExtraDebug) - XBMC->Log(LOG_DEBUG, LOGTAG"%s: register PES %.4x %s", __FUNCTION__, (*it)->pid, codec_name); + XBMC->Log(LOG_DEBUG, LOGTAG "%s: register PES %.4x %s", __FUNCTION__, (*it)->pid, codec_name); } } // Renew main stream @@ -319,7 +319,7 @@ return false; if (g_bExtraDebug) - XBMC->Log(LOG_DEBUG, LOGTAG"%s: update info PES %.4x %s", __FUNCTION__, es->pid, es->GetStreamCodecName()); + XBMC->Log(LOG_DEBUG, LOGTAG "%s: update info PES %.4x %s", __FUNCTION__, es->pid, es->GetStreamCodecName()); if (es->has_stream_info) { @@ -329,7 +329,7 @@ { m_nosetup.erase(it); if (m_nosetup.empty()) - XBMC->Log(LOG_DEBUG, LOGTAG"%s: setup is completed", __FUNCTION__); + XBMC->Log(LOG_DEBUG, LOGTAG "%s: setup is completed", __FUNCTION__); } } return true; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/client.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/client.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/client.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/client.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -378,6 +378,13 @@ menuhookEpgRec5.iHookId = MENUHOOK_EPG_REC_NEW_EPISODES; menuhookEpgRec5.iLocalizedStringId = 30435; PVR->AddMenuHook(&menuhookEpgRec5); + + PVR_MENUHOOK menuhookSettingRCI; + menuhookSettingRCI.category = PVR_MENUHOOK_SETTING; + menuhookSettingRCI.iHookId = MENUHOOK_REFRESH_CHANNEL_ICONS; + menuhookSettingRCI.iLocalizedStringId = 30422; + PVR->AddMenuHook(&menuhookSettingRCI); + XBMC->Log(LOG_DEBUG, "Creating menu hooks...done"); XBMC->Log(LOG_DEBUG, "Addon created successfully"); @@ -682,6 +689,7 @@ pCapabilities->bHandlesDemuxing = g_bDemuxing; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsRecordingPlayCount = true; pCapabilities->bSupportsLastPlayedPosition = false; pCapabilities->bSupportsRecordingEdl = true; @@ -721,7 +729,7 @@ return g_client->GetDriveSpace(iTotal, iUsed); } -PVR_ERROR DialogChannelScan() +PVR_ERROR OpenDialogChannelScan() { return PVR_ERROR_FAILED; } @@ -789,13 +797,13 @@ return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &channel) +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &channel) { (void)channel; return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &channel) +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &channel) { (void)channel; return PVR_ERROR_NOT_IMPLEMENTED; @@ -829,19 +837,19 @@ * PVR Recording Functions */ -int GetRecordingsAmount(void) +int GetRecordingsAmount(bool deleted) { if (g_client == NULL) return 0; - + (void)deleted; return g_client->GetRecordingsAmount(); } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { if (g_client == NULL) return PVR_ERROR_SERVER_ERROR; - + (void)deleted; return g_client->GetRecordings(handle); } @@ -1159,5 +1167,7 @@ void DemuxReset() {} const char * GetLiveStreamURL(const PVR_CHANNEL &) { return ""; } void SetSpeed(int) {}; +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) { (void)recording; return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; } } //end extern "C" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/client.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/client.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/client.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/client.h 2015-02-20 11:24:58.000000000 +0000 @@ -56,6 +56,7 @@ #define MENUHOOK_EPG_REC_CHAN_DAILY 6 #define MENUHOOK_EPG_REC_ONE_SHOWING 7 #define MENUHOOK_EPG_REC_NEW_EPISODES 8 +#define MENUHOOK_REFRESH_CHANNEL_ICONS 9 #define DEFAULT_HANDLE_DEMUXING false #define DEFAULT_TUNE_DELAY 5 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/demux.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/demux.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/demux.cpp 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/demux.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -57,7 +57,7 @@ break; } if (XBMC && doLog) - XBMC->Log(loglevel, LOGTAG"%s", msg); + XBMC->Log(loglevel, LOGTAG "%s", msg); } } @@ -98,7 +98,7 @@ } else { - XBMC->Log(LOG_ERROR, LOGTAG"alloc AV buffer failed"); + XBMC->Log(LOG_ERROR, LOGTAG "alloc AV buffer failed"); } } @@ -113,7 +113,7 @@ if (m_av_buf) { if (g_bExtraDebug) - XBMC->Log(LOG_DEBUG, LOGTAG"free AV buffer: allocated size was %zu", m_av_buf_size); + XBMC->Log(LOG_DEBUG, LOGTAG "free AV buffer: allocated size was %zu", m_av_buf_size); free(m_av_buf); m_av_buf = NULL; } @@ -177,7 +177,7 @@ { if (!m_AVContext) { - XBMC->Log(LOG_ERROR, LOGTAG"%s: no AVContext", __FUNCTION__); + XBMC->Log(LOG_ERROR, LOGTAG "%s: no AVContext", __FUNCTION__); return NULL; } @@ -221,7 +221,7 @@ } if (ret < 0) - XBMC->Log(LOG_NOTICE, LOGTAG"%s: error %d", __FUNCTION__, ret); + XBMC->Log(LOG_NOTICE, LOGTAG "%s: error %d", __FUNCTION__, ret); if (ret == AVCONTEXT_TS_ERROR) m_AVContext->Shift(); @@ -229,14 +229,14 @@ m_AVContext->GoNext(); } - XBMC->Log(LOG_DEBUG, LOGTAG"%s: stopped with status %d", __FUNCTION__, ret); + XBMC->Log(LOG_DEBUG, LOGTAG "%s: stopped with status %d", __FUNCTION__, ret); return NULL; } bool Demux::GetStreamProperties(PVR_STREAM_PROPERTIES* props) { if (!m_nosetup.empty()) - XBMC->Log(LOG_NOTICE, LOGTAG"%s: incomplete setup", __FUNCTION__); + XBMC->Log(LOG_NOTICE, LOGTAG "%s: incomplete setup", __FUNCTION__); CLockObject lock(m_mutex); m_isChangePlaced = false; @@ -287,7 +287,7 @@ int64_t desired = m_curTime + offset; if (g_bExtraDebug) - XBMC->Log(LOG_DEBUG, LOGTAG"%s: bw:%d tm:%d tm_pts:%" PRId64 " c_pts:%" PRIu64 " offset:%+6.3f c_tm:%+6.3f n_tm:%+6.3f", __FUNCTION__, + XBMC->Log(LOG_DEBUG, LOGTAG "%s: bw:%d tm:%d tm_pts:%" PRId64 " c_pts:%" PRIu64 " offset:%+6.3f c_tm:%+6.3f n_tm:%+6.3f", __FUNCTION__, backwards, time, pts, m_PTS, (double)offset / PTS_TIME_BASE, (double)m_curTime / PTS_TIME_BASE, (double)desired / PTS_TIME_BASE); CLockObject lock(m_mutex); @@ -301,7 +301,7 @@ int64_t new_time = it->first; uint64_t new_pos = it->second.av_pos; uint64_t new_pts = it->second.av_pts; - XBMC->Log(LOG_DEBUG, LOGTAG"seek to %" PRId64 " pts=%" PRIu64, new_time, new_pts); + XBMC->Log(LOG_DEBUG, LOGTAG "seek to %" PRId64 " pts=%" PRIu64, new_time, new_pts); Flush(); m_AVContext->GoPosition(new_pos); @@ -456,7 +456,7 @@ m_nosetup.insert((*it)->pid); if (g_bExtraDebug) - XBMC->Log(LOG_DEBUG, LOGTAG"%s: register PES %.4x %s", __FUNCTION__, (*it)->pid, codec_name); + XBMC->Log(LOG_DEBUG, LOGTAG "%s: register PES %.4x %s", __FUNCTION__, (*it)->pid, codec_name); } } m_streams.UpdateStreams(new_streams); @@ -473,7 +473,7 @@ const char* codec_name = es->GetStreamCodecName(); xbmc_codec_t codec = CODEC->GetCodecByName(codec_name); if (g_bExtraDebug) - XBMC->Log(LOG_DEBUG, LOGTAG"%s: update info PES %.4x %s", __FUNCTION__, es->pid, codec_name); + XBMC->Log(LOG_DEBUG, LOGTAG "%s: update info PES %.4x %s", __FUNCTION__, es->pid, codec_name); CLockObject Lock(m_mutex); @@ -503,7 +503,7 @@ { m_nosetup.erase(it); if (m_nosetup.empty()) - XBMC->Log(LOG_DEBUG, LOGTAG"%s: setup is completed", __FUNCTION__); + XBMC->Log(LOG_DEBUG, LOGTAG "%s: setup is completed", __FUNCTION__); } } return true; @@ -526,7 +526,7 @@ else { m_isChangePlaced = true; - XBMC->Log(LOG_DEBUG, LOGTAG"%s: done", __FUNCTION__); + XBMC->Log(LOG_DEBUG, LOGTAG "%s: done", __FUNCTION__); } } } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/fileOps.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/fileOps.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/fileOps.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/fileOps.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -189,6 +189,41 @@ } } +void FileOps::CleanChannelIcons() +{ + // Currently XBMC's addon lib doesn't provide a way to list files in a directory. + // Therefore we currently can't clean only leftover files. + + XBMC->Log(LOG_DEBUG, "%s: Cleaning channel icons %s", __FUNCTION__, m_localBasePath.c_str()); + + CLockObject lock(m_lock); + + // Remove cache sub directories + std::vector::const_iterator it; + std::vector fileTypes = GetFileTypes(); + std::vector directories; + for (it = fileTypes.begin(); it != fileTypes.end(); ++it) + { + if (*it == FileTypeChannelIcon) + { + std::string directory(GetTypeNameByFileType(*it)); + if (!directory.empty()) + directories.push_back(m_localBasePath + directory); + } + } + std::vector::const_iterator it2; + for (it2 = directories.begin(); it2 != directories.end(); ++it2) + { + if (XBMC->DirectoryExists(it2->c_str()) && !XBMC->RemoveDirectory(it2->c_str())) + { + XBMC->Log(LOG_ERROR, "%s: Failed to remove cache sub directory %s", __FUNCTION__, it2->c_str()); + } + } + + // Clear the cached local filenames so that new cache jobs get generated + m_icons.clear(); +} + void *FileOps::Process() { XBMC->Log(LOG_DEBUG, "%s: FileOps Thread Started", __FUNCTION__); @@ -462,7 +497,6 @@ } // Clear the cached local filenames so that new cache jobs get generated - m_icons.clear(); m_preview.clear(); m_artworks.clear(); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/fileOps.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/fileOps.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/fileOps.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/fileOps.h 2015-02-20 11:24:58.000000000 +0000 @@ -105,6 +105,8 @@ void Suspend(); void Resume(); + void CleanChannelIcons(); + protected: void *Process(); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/pvrclient-mythtv.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/pvrclient-mythtv.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.mythtv/src/pvrclient-mythtv.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.mythtv/src/pvrclient-mythtv.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -359,6 +359,26 @@ else XBMC->Log(LOG_ERROR, "%s: Add recording failed for %u %ld", __FUNCTION__, (unsigned)chanid, (long)startts); } + else if (cs == 3 && msg.subject[1] == "ADD") + { + uint32_t recordedid = Myth::StringToId(msg.subject[2]); + MythProgramInfo prog(m_control->GetRecorded(recordedid)); + if (!prog.IsNull()) + { + CLockObject lock(m_recordingsLock); + ProgramInfoMap::iterator it = m_recordings.find(prog.UID()); + if (it == m_recordings.end()) + { + if (g_bExtraDebug) + XBMC->Log(LOG_DEBUG, "%s: Add recording: %s", __FUNCTION__, prog.UID().c_str()); + // Add recording + m_recordings.insert(std::pair(prog.UID().c_str(), prog)); + ++m_recordingChangePinCount; + } + } + else + XBMC->Log(LOG_ERROR, "%s: Add recording failed for %u", __FUNCTION__, (unsigned)recordedid); + } else if (cs == 2 && msg.subject[1] == "UPDATE" && msg.program) { CLockObject lock(m_recordingsLock); @@ -400,6 +420,26 @@ } } } + else if (cs == 3 && msg.subject[1] == "DELETE") + { + // MythTV send two DELETE events. First requests deletion, second confirms deletion. + // On first we delete recording. On second program will not be found. + uint32_t recordedid = Myth::StringToId(msg.subject[2]); + MythProgramInfo prog(m_control->GetRecorded(recordedid)); + if (!prog.IsNull()) + { + CLockObject lock(m_recordingsLock); + ProgramInfoMap::iterator it = m_recordings.find(prog.UID()); + if (it != m_recordings.end()) + { + if (g_bExtraDebug) + XBMC->Log(LOG_DEBUG, "%s: Delete recording: %s", __FUNCTION__, prog.UID().c_str()); + // Remove recording + m_recordings.erase(it); + ++m_recordingChangePinCount; + } + } + } } void PVRClientMythTV::RunHouseKeeping() @@ -1308,7 +1348,7 @@ PVR->TransferTimerEntry(handle, &tag); // Add it to memorandom: cf UpdateTimer() MYTH_SHARED_PTR pTag = MYTH_SHARED_PTR(new PVR_TIMER(tag)); - m_PVRtimerMemorandum.insert(std::make_pair(tag.iClientIndex, pTag)); + m_PVRtimerMemorandum.insert(std::make_pair((unsigned int&)tag.iClientIndex, pTag)); } if (g_bExtraDebug) @@ -1854,40 +1894,76 @@ // Suspend fileOps to avoid connection hang m_fileOps->Suspend(); - if (!m_recordingStream) + if (m_recordingStream) { - if (prog.HostName() == m_control->GetServerHostName()) - // Request the stream from our master using the opened event handler. - m_recordingStream = new Myth::RecordingPlayback(*m_eventHandler); - else + if (!m_recordingStream->IsOpen()) + XBMC->QueueNotification(QUEUE_ERROR, XBMC->GetLocalizedString(30302)); // MythTV backend unavailable + else if (m_recordingStream->TransferIsOpen()) + { + if (g_bExtraDebug) + XBMC->Log(LOG_DEBUG, "%s: Done", __FUNCTION__); + return true; + } + } + else if (prog.HostName() == m_control->GetServerHostName()) + { + // Request the stream from our master using the opened event handler. + m_recordingStream = new Myth::RecordingPlayback(*m_eventHandler); + if (!m_recordingStream->IsOpen()) + XBMC->QueueNotification(QUEUE_ERROR, XBMC->GetLocalizedString(30302)); // MythTV backend unavailable + else if (m_recordingStream->OpenTransfer(prog.GetPtr())) { - // Query backend server IP - std::string backend_addr(m_control->GetBackendServerIP6(prog.HostName())); - if (backend_addr.empty()) - backend_addr = m_control->GetBackendServerIP(prog.HostName()); - if (backend_addr.empty()) - backend_addr = prog.HostName(); - // Query backend server port - unsigned backend_port(m_control->GetBackendServerPort(prog.HostName())); - if (!backend_port) - backend_port = (unsigned)g_iProtoPort; - // Request the stream from slave host. A dedicated event handler will be opened. - XBMC->Log(LOG_INFO, "%s: Connect to remote backend %s:%u", __FUNCTION__, backend_addr.c_str(), backend_port); - m_recordingStream = new Myth::RecordingPlayback(backend_addr, backend_port); + if (g_bExtraDebug) + XBMC->Log(LOG_DEBUG, "%s: Done", __FUNCTION__); + // Fill AV info for later use + FillRecordingAVInfo(prog, m_recordingStream); + return true; } } else - m_recordingStream->Open(); - - if (!m_recordingStream->IsOpen()) - XBMC->QueueNotification(QUEUE_ERROR, XBMC->GetLocalizedString(30302)); // MythTV backend unavailable - else if (m_recordingStream->OpenTransfer(prog.GetPtr())) { - if (g_bExtraDebug) - XBMC->Log(LOG_DEBUG, "%s: Done", __FUNCTION__); - // Fill AV info for later use - FillRecordingAVInfo(prog, m_recordingStream); - return true; + // MasterBackendOverride setting will guide us to choose best method + // If checked we will try to connect master failover slave + Myth::SettingPtr mbo = m_control->GetSetting("MasterBackendOverride", false); + if (mbo && mbo->value == "1") + { + XBMC->Log(LOG_INFO, "%s: Option 'MasterBackendOverride' is enabled", __FUNCTION__); + m_recordingStream = new Myth::RecordingPlayback(*m_eventHandler); + if (m_recordingStream->IsOpen() && m_recordingStream->OpenTransfer(prog.GetPtr())) + { + if (g_bExtraDebug) + XBMC->Log(LOG_DEBUG, "%s: Done", __FUNCTION__); + // Fill AV info for later use + FillRecordingAVInfo(prog, m_recordingStream); + return true; + } + SAFE_DELETE(m_recordingStream); + XBMC->Log(LOG_NOTICE, "%s: Failed to open recorded stream from master backend", __FUNCTION__); + XBMC->Log(LOG_NOTICE, "%s: You should uncheck option 'MasterBackendOverride' from MythTV setup", __FUNCTION__); + } + // Query backend server IP + std::string backend_addr(m_control->GetBackendServerIP6(prog.HostName())); + if (backend_addr.empty()) + backend_addr = m_control->GetBackendServerIP(prog.HostName()); + if (backend_addr.empty()) + backend_addr = prog.HostName(); + // Query backend server port + unsigned backend_port(m_control->GetBackendServerPort(prog.HostName())); + if (!backend_port) + backend_port = (unsigned)g_iProtoPort; + // Request the stream from slave host. A dedicated event handler will be opened. + XBMC->Log(LOG_INFO, "%s: Connect to remote backend %s:%u", __FUNCTION__, backend_addr.c_str(), backend_port); + m_recordingStream = new Myth::RecordingPlayback(backend_addr, backend_port); + if (!m_recordingStream->IsOpen()) + XBMC->QueueNotification(QUEUE_ERROR, XBMC->GetLocalizedString(30302)); // MythTV backend unavailable + else if (m_recordingStream->OpenTransfer(prog.GetPtr())) + { + if (g_bExtraDebug) + XBMC->Log(LOG_DEBUG, "%s: Done", __FUNCTION__); + // Fill AV info for later use + FillRecordingAVInfo(prog, m_recordingStream); + return true; + } } SAFE_DELETE(m_recordingStream); @@ -2018,6 +2094,13 @@ XBMC->QueueNotification(QUEUE_INFO, info.c_str()); return PVR_ERROR_NO_ERROR; } + else if (menuhook.iHookId == MENUHOOK_REFRESH_CHANNEL_ICONS && m_fileOps) + { + CLockObject lock(m_channelsLock); + m_fileOps->CleanChannelIcons(); + PVR->TriggerChannelUpdate(); + return PVR_ERROR_NO_ERROR; + } } if (menuhook.category == PVR_MENUHOOK_EPG && item.cat == PVR_MENUHOOK_EPG) diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.nextpvr/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.nextpvr/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.nextpvr/addon/addon.xml.in 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.nextpvr/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,13 +1,13 @@ - - + + bSupportsTimeshift = true; //removed from Frodo API pCapabilities->bSupportsEPG = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsTimers = true; pCapabilities->bSupportsTV = true; pCapabilities->bSupportsRadio = true; @@ -381,7 +382,7 @@ return g_client->GetBackendTime(localTime, gmtOffset); } -PVR_ERROR DialogChannelScan() +PVR_ERROR OpenDialogChannelScan() { return PVR_ERROR_NOT_IMPLEMENTED; } @@ -433,12 +434,12 @@ return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &channelinfo) +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &channelinfo) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &channelinfo) +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &channelinfo) { return PVR_ERROR_NOT_IMPLEMENTED; } @@ -475,7 +476,7 @@ /*******************************************/ /** PVR Recording Functions **/ -int GetRecordingsAmount(void) +int GetRecordingsAmount(bool deleted) { if (!g_client) return 0; @@ -483,7 +484,7 @@ return g_client->GetNumRecordings(); } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { if (!g_client) return PVR_ERROR_SERVER_ERROR; @@ -737,4 +738,6 @@ time_t GetPlayingTime() { return 0; } time_t GetBufferTimeStart() { return 0; } time_t GetBufferTimeEnd() { return 0; } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; } } //end extern "C" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.njoy/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.njoy/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.njoy/addon/addon.xml.in 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.njoy/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,12 +1,12 @@ - + - - - + + + Odjemalec PVR za povezavo VDR in Kodija preko vmesnika VNSI Klient PVR për lidhjen e VDR dhe Kodi mbi ndërfaqjen VNSI PVR-klient för att ansluta VDR till Kodi över VNSI-gränsnittet + Kayıt Sunucusu VDR'ye Kodi'yle VNSI Arayüzü Üzerinden Bağlanır Клієнт PVR для зв’язку VDR з Kodi через інтерфейс VNSI Trình PVR để kết nối VDR với Kodi qua giao tiếp VNSI 让 Kodi 通过 VNSI 界面与 VDR 连接的 PVR 客户端 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/French (Canada)/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/French (Canada)/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/French (Canada)/strings.po 2014-11-24 13:23:33.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/French (Canada)/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -166,7 +166,7 @@ msgctxt "#30037" msgid "No device available - exiting" -msgstr "Aucun dispositif disponible - Sortie" +msgstr "Aucun dispositif disponible - fermeture" msgctxt "#30038" msgid "No DVB-S2 device available - trying fallback to DVB-S" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/Korean/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/Korean/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/Korean/strings.po 2014-11-24 13:23:33.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/Korean/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -178,7 +178,7 @@ msgctxt "#30040" msgid "Stopped" -msgstr "정지" +msgstr "중지" msgctxt "#30041" msgid "Finished" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/Persian (Iran)/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/Persian (Iran)/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/Persian (Iran)/strings.po 2014-11-24 13:23:33.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/Persian (Iran)/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -16,6 +16,14 @@ "Language: fa_IR\n" "Plural-Forms: nplurals=1; plural=0;\n" +msgctxt "#30012" +msgid "TV channels" +msgstr "کانال های تلویزیونی" + +msgctxt "#30013" +msgid "Radio channels" +msgstr "کانال های رادیویی" + msgctxt "#30017" msgid "Country" msgstr "کشور" @@ -27,3 +35,7 @@ msgctxt "#30101" msgid "Setup" msgstr "پیکربندی" + +msgctxt "#30108" +msgid "Channels" +msgstr "کانال ها" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/Serbian/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/Serbian/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/Serbian/strings.po 2014-11-24 13:23:33.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/Serbian/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -20,6 +20,14 @@ msgid "Connect timeout (s)" msgstr "Истек времена за повезивање (с)" +msgctxt "#30012" +msgid "TV channels" +msgstr "TV kanali" + +msgctxt "#30013" +msgid "Radio channels" +msgstr "Radio kanali" + msgctxt "#30017" msgid "Country" msgstr "Država" @@ -35,3 +43,7 @@ msgctxt "#30101" msgid "Setup" msgstr "Konfiguracija" + +msgctxt "#30108" +msgid "Channels" +msgstr "Kanali" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/Turkish/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/Turkish/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/addon/resources/language/Turkish/strings.po 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/addon/resources/language/Turkish/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -92,6 +92,18 @@ msgid "Cable Inversion" msgstr "Kabloluya çevir" +msgctxt "#30019" +msgid "Cable Symbolrate" +msgstr "Kablo Sembol Oranı" + +msgctxt "#30020" +msgid "Cable modulation" +msgstr "Kablo Modülasyonu" + +msgctxt "#30021" +msgid "Terr Inversion" +msgstr "Terr Ters Dönüştürmesi" + msgctxt "#30022" msgid "Satellite" msgstr "Uydu" @@ -104,6 +116,10 @@ msgid "Back" msgstr "Geri" +msgctxt "#30025" +msgid "Channel search - running... %i %%" +msgstr "Kanal Araması - İlerliyor... %i %%" + msgctxt "#30026" msgid "Type:" msgstr "Tür:" @@ -136,6 +152,10 @@ msgid "Analog Radio" msgstr "Analog Radyo" +msgctxt "#30034" +msgid "Transponder:" +msgstr "Verici" + msgctxt "#30035" msgid "New channels" msgstr "Yeni kanallar" @@ -144,6 +164,14 @@ msgid "Channel search - Finished" msgstr "Kanal araması - Tamamlandı" +msgctxt "#30037" +msgid "No device available - exiting" +msgstr "Aygıt bulunamadı - çıkılıyor" + +msgctxt "#30038" +msgid "No DVB-S2 device available - trying fallback to DVB-S" +msgstr "DVB-S2 aygıtı bulunamadı - DVB-S'e geri dönmeyi deniyor" + msgctxt "#30039" msgid "Running" msgstr "Çalışıyor" @@ -168,14 +196,82 @@ msgid "Lost connection to VDR Server" msgstr "VDR Sunucusun bağlantısı kaybedildi" +msgctxt "#30045" +msgid "Connection to VDR Server restored" +msgstr "VDR Sunucusu Bağlantısı Kaydedildi" + +msgctxt "#30046" +msgid "Create channel groups automatically on the server" +msgstr "Kanal Gruplarını Bu Sunucuda Kendiliğinden Kaydet" + +msgctxt "#30047" +msgid "Request Timeshift" +msgstr "İstenilen zaman kaydırması" + +msgctxt "#30048" +msgid "Path to channel icons" +msgstr "Kanal simgeleri kaynağı" + +msgctxt "#30049" +msgid "VDR Server MAC for Wake-on-LAN" +msgstr "Ağ Üzerinden Uyandırma (Wake-on-Lan) için VDR Sunucusu Mac Adresi" + +msgctxt "#30100" +msgid "VDR OSD" +msgstr "VDR Göstergesi" + msgctxt "#30101" msgid "Setup" msgstr "Yapılandırma" +msgctxt "#30102" +msgid "Controlling OSD - press info to exit" +msgstr "Gösterge Kontrol Ediliyor - Çıkmak için \"info\" tuşuna basın" + +msgctxt "#30103" +msgid "Select to control OSD" +msgstr "Kontrol İçin Göstergeyi Seçin" + +msgctxt "#30104" +msgid "Timeshift Mode" +msgstr "Zaman Kaydırması Modu" + +msgctxt "#30105" +msgid "Timeshift Buffer (RAM) x100 MB" +msgstr "Zaman Kaydırma Önbelleği (RAM) x100 MB" + +msgctxt "#30106" +msgid "Timeshift Buffer (File) x1 GB" +msgstr "Zaman Kaydırma Önbelleği (DOSYA) x1 GB" + +msgctxt "#30107" +msgid "VDR Admin" +msgstr "VDR Yöneticisi" + msgctxt "#30108" msgid "Channels" msgstr "Kanallar" +msgctxt "#30109" +msgid "Provider whitelist" +msgstr "Sağlayıcı Beyaz Listesi" + +msgctxt "#30110" +msgid "Channel blacklist" +msgstr "Kanal Kara Listesi" + +msgctxt "#30111" +msgid "Channel filters" +msgstr "Kanal Filtreleri" + msgctxt "#30112" msgid "Radio Channels" msgstr "Radyo Kanalları" + +msgctxt "#30113" +msgid "Save filters" +msgstr "Filtreyi Kaydet" + +msgctxt "#30114" +msgid "Provider Unknown" +msgstr "Bilinmeyen Sağlayıcı" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/client.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/client.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/client.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/client.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -405,6 +405,8 @@ pCapabilities->bHandlesDemuxing = true; if (VNSIData && VNSIData->SupportChannelScan()) pCapabilities->bSupportsChannelScan = true; + if (VNSIData && VNSIData->SupportRecordingsUndelete()) + pCapabilities->bSupportsRecordingsUndelete = true; return PVR_ERROR_NO_ERROR; } @@ -454,7 +456,7 @@ return (VNSIData->GetDriveSpace(iTotal, iUsed) ? PVR_ERROR_NO_ERROR : PVR_ERROR_SERVER_ERROR); } -PVR_ERROR DialogChannelScan(void) +PVR_ERROR OpenDialogChannelScan(void) { cVNSIChannelScan scanner; scanner.Open(g_szHostname, g_iPort); @@ -571,20 +573,26 @@ /*******************************************/ /** PVR Recording Functions **/ -int GetRecordingsAmount(void) +int GetRecordingsAmount(bool deleted) { if (!VNSIData) return 0; - return VNSIData->GetRecordingsCount(); + if (!deleted) + return VNSIData->GetRecordingsCount(); + else + return VNSIData->GetDeletedRecordingsCount(); } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { if (!VNSIData) return PVR_ERROR_SERVER_ERROR; - return VNSIData->GetRecordingsList(handle); + if (!deleted) + return VNSIData->GetRecordingsList(handle); + else + return VNSIData->GetDeletedRecordingsList(handle); } PVR_ERROR RenameRecording(const PVR_RECORDING &recording) @@ -603,6 +611,22 @@ return VNSIData->DeleteRecording(recording); } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) +{ + if (!VNSIData) + return PVR_ERROR_SERVER_ERROR; + + return VNSIData->UndeleteRecording(recording); +} + +PVR_ERROR DeleteAllRecordingsFromTrash() +{ + if (!VNSIData) + return PVR_ERROR_SERVER_ERROR; + + return VNSIData->DeleteAllRecordingsFromTrash(); +} + /*******************************************/ /** PVR Live Stream Functions **/ @@ -803,8 +827,8 @@ PVR_ERROR DeleteChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR RenameChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR MoveChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } void DemuxReset(void) {} void DemuxFlush(void) {} int ReadLiveStream(unsigned char *pBuffer, unsigned int iBufferSize) { return 0; } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/VNSIAdmin.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/VNSIAdmin.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/VNSIAdmin.cpp 2014-09-12 07:43:39.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/VNSIAdmin.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -1356,6 +1356,7 @@ m_osdRender->DisposeTexture(wnd); m_bIsOsdDirty = true; m_osdMutex.Unlock(); + m_window->SetFocusId(CONTROL_MENU); } else if (resp->getOpCodeID() == VNSI_OSD_MOVEWINDOW) { diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/vnsicommand.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/vnsicommand.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/vnsicommand.h 2014-09-12 07:43:39.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/vnsicommand.h 2015-02-20 11:24:58.000000000 +0000 @@ -24,7 +24,10 @@ #define VNSI_COMMAND_H /** Current VNSI Protocol Version number */ -#define VNSI_PROTOCOLVERSION 6 +#define VNSI_PROTOCOLVERSION 8 + +/** Start of RDS support protocol Version */ +#define VNSI_RDS_PROTOCOLVERSION 8 /** Minimum VNSI Protocol Version number */ #define VNSI_MIN_PROTOCOLVERSION 5 @@ -44,6 +47,9 @@ #define CONFNAME_TIMESHIFT "Timeshift" #define CONFNAME_TIMESHIFTBUFFERSIZE "TimeshiftBufferSize" #define CONFNAME_TIMESHIFTBUFFERFILESIZE "TimeshiftBufferFileSize" +#define CONFNAME_TIMESHIFTBUFFERDIR "TimeshiftBufferDir" +#define CONFNAME_PLAYRECORDING "PlayRecording" +#define CONFNAME_AVOIDEPGSCAN "AvoidEPGScan" /* OPCODE 1 - 19: VNSI network functions for general purpose */ #define VNSI_LOGIN 1 @@ -110,6 +116,14 @@ #define VNSI_OSD_DISCONNECT 161 #define VNSI_OSD_HITKEY 162 +/* OPCODE 180 - 189: VNSI network functions for deleted recording access */ +#define VNSI_RECORDINGS_DELETED_ACCESS_SUPPORTED 180 +#define VNSI_RECORDINGS_DELETED_GETCOUNT 181 +#define VNSI_RECORDINGS_DELETED_GETLIST 182 +#define VNSI_RECORDINGS_DELETED_DELETE 183 +#define VNSI_RECORDINGS_DELETED_UNDELETE 184 +#define VNSI_RECORDINGS_DELETED_DELETE_ALL 185 + /** Stream packet types (server -> client) */ #define VNSI_STREAM_CHANGE 1 #define VNSI_STREAM_STATUS 2 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/VNSIData.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/VNSIData.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/VNSIData.cpp 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/VNSIData.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -169,6 +169,33 @@ return ret == VNSI_RET_OK ? true : false; } +bool cVNSIData::SupportRecordingsUndelete() +{ + if (GetProtocol() > 7) + { + cRequestPacket vrp; + if (!vrp.init(VNSI_RECORDINGS_DELETED_ACCESS_SUPPORTED)) + { + XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__); + return false; + } + + cResponsePacket* vresp = ReadResult(&vrp); + if (!vresp) + { + XBMC->Log(LOG_INFO, "%s - Can't get response packed", __FUNCTION__); + return false; + } + + uint32_t ret = vresp->extract_U32(); + delete vresp; + return ret == VNSI_RET_OK ? true : false; + } + + XBMC->Log(LOG_INFO, "%s - Undelete not supported on backend (min. Ver. 1.3.0; Protocol 7)", __FUNCTION__); + return false; +} + bool cVNSIData::EnableStatusInterface(bool onOff) { cRequestPacket vrp; @@ -556,19 +583,17 @@ delete vresp; return PVR_ERROR_UNKNOWN; } - uint32_t returnCode = vresp->extract_U32(); delete vresp; if (returnCode == VNSI_RET_DATALOCKED) return PVR_ERROR_FAILED; - if (returnCode == VNSI_RET_RECRUNNING) + else if (returnCode == VNSI_RET_RECRUNNING) return PVR_ERROR_RECORDING_RUNNING; else if (returnCode == VNSI_RET_DATAINVALID) return PVR_ERROR_INVALID_PARAMETERS; else if (returnCode == VNSI_RET_ERROR) return PVR_ERROR_SERVER_ERROR; - return PVR_ERROR_NO_ERROR; } @@ -669,6 +694,7 @@ tag.iDuration = vresp->extract_U32(); tag.iPriority = vresp->extract_U32(); tag.iLifetime = vresp->extract_U32(); + tag.bIsDeleted = false; char *strChannelName = vresp->extract_String(); strncpy(tag.strChannelName, strChannelName, sizeof(tag.strChannelName) - 1); @@ -739,7 +765,7 @@ PVR_ERROR cVNSIData::DeleteRecording(const PVR_RECORDING& recinfo) { cRequestPacket vrp; - if (!vrp.init(VNSI_RECORDINGS_DELETE)) + if (!vrp.init(recinfo.bIsDeleted ? VNSI_RECORDINGS_DELETED_DELETE : VNSI_RECORDINGS_DELETE)) { XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__); return PVR_ERROR_UNKNOWN; @@ -808,6 +834,164 @@ return PVR_ERROR_NO_ERROR; } + +int cVNSIData::GetDeletedRecordingsCount() +{ + cRequestPacket vrp; + if (!vrp.init(VNSI_RECORDINGS_DELETED_GETCOUNT)) + { + XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__); + return -1; + } + + cResponsePacket* vresp = ReadResult(&vrp); + if (!vresp) + { + XBMC->Log(LOG_ERROR, "%s - Can't get response packed", __FUNCTION__); + return -1; + } + + uint32_t count = vresp->extract_U32(); + + delete vresp; + return count; +} + +PVR_ERROR cVNSIData::GetDeletedRecordingsList(ADDON_HANDLE handle) +{ + cRequestPacket vrp; + if (!vrp.init(VNSI_RECORDINGS_DELETED_GETLIST)) + { + XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__); + return PVR_ERROR_UNKNOWN; + } + + cResponsePacket* vresp = ReadResult(&vrp); + if (!vresp) + { + XBMC->Log(LOG_ERROR, "%s - Can't get response packed", __FUNCTION__); + return PVR_ERROR_UNKNOWN; + } + + CStdString strRecordingId; + while (!vresp->end()) + { + PVR_RECORDING tag; + memset(&tag, 0, sizeof(tag)); + tag.recordingTime = vresp->extract_U32(); + tag.iDuration = vresp->extract_U32(); + tag.iPriority = vresp->extract_U32(); + tag.iLifetime = vresp->extract_U32(); + tag.bIsDeleted = true; + + char *strChannelName = vresp->extract_String(); + strncpy(tag.strChannelName, strChannelName, sizeof(tag.strChannelName) - 1); + + char *strTitle = vresp->extract_String(); + strncpy(tag.strTitle, strTitle, sizeof(tag.strTitle) - 1); + + char *strPlotOutline = vresp->extract_String(); + strncpy(tag.strPlotOutline, strPlotOutline, sizeof(tag.strPlotOutline) - 1); + + char *strPlot = vresp->extract_String(); + strncpy(tag.strPlot, strPlot, sizeof(tag.strPlot) - 1); + + char *strDirectory = vresp->extract_String(); + strncpy(tag.strDirectory, strDirectory, sizeof(tag.strDirectory) - 1); + + strRecordingId.Format("%i", vresp->extract_U32()); + strncpy(tag.strRecordingId, strRecordingId.c_str(), sizeof(tag.strRecordingId) - 1); + + PVR->TransferRecordingEntry(handle, &tag); + + delete[] strChannelName; + delete[] strTitle; + delete[] strPlotOutline; + delete[] strPlot; + delete[] strDirectory; + } + + delete vresp; + + return PVR_ERROR_NO_ERROR; +} + +PVR_ERROR cVNSIData::UndeleteRecording(const PVR_RECORDING& recinfo) +{ + cRequestPacket vrp; + if (!vrp.init(VNSI_RECORDINGS_DELETED_UNDELETE)) + { + XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__); + return PVR_ERROR_UNKNOWN; + } + + if (!vrp.add_U32(atoi(recinfo.strRecordingId))) + return PVR_ERROR_UNKNOWN; + + cResponsePacket* vresp = ReadResult(&vrp); + if (vresp == NULL || vresp->noResponse()) + { + delete vresp; + return PVR_ERROR_UNKNOWN; + } + + uint32_t returnCode = vresp->extract_U32(); + delete vresp; + + switch(returnCode) + { + case VNSI_RET_DATALOCKED: + return PVR_ERROR_FAILED; + + case VNSI_RET_RECRUNNING: + return PVR_ERROR_RECORDING_RUNNING; + + case VNSI_RET_DATAINVALID: + return PVR_ERROR_INVALID_PARAMETERS; + + case VNSI_RET_ERROR: + return PVR_ERROR_SERVER_ERROR; + } + + return PVR_ERROR_NO_ERROR; +} + +PVR_ERROR cVNSIData::DeleteAllRecordingsFromTrash() +{ + cRequestPacket vrp; + if (!vrp.init(VNSI_RECORDINGS_DELETED_DELETE_ALL)) + { + XBMC->Log(LOG_ERROR, "%s - Can't init cRequestPacket", __FUNCTION__); + return PVR_ERROR_UNKNOWN; + } + + cResponsePacket* vresp = ReadResult(&vrp); + if (vresp == NULL || vresp->noResponse()) + { + delete vresp; + return PVR_ERROR_UNKNOWN; + } + + uint32_t returnCode = vresp->extract_U32(); + delete vresp; + + switch(returnCode) + { + case VNSI_RET_DATALOCKED: + return PVR_ERROR_FAILED; + + case VNSI_RET_RECRUNNING: + return PVR_ERROR_RECORDING_RUNNING; + + case VNSI_RET_DATAINVALID: + return PVR_ERROR_INVALID_PARAMETERS; + + case VNSI_RET_ERROR: + return PVR_ERROR_SERVER_ERROR; + } + + return PVR_ERROR_NO_ERROR; +} bool cVNSIData::OnResponsePacket(cResponsePacket* pkt) { diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/VNSIData.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/VNSIData.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/VNSIData.h 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/VNSIData.h 2015-02-20 11:24:58.000000000 +0000 @@ -41,6 +41,7 @@ bool Login(); bool SupportChannelScan(); + bool SupportRecordingsUndelete(); bool EnableStatusInterface(bool onOff); bool GetDriveSpace(long long *total, long long *used); @@ -65,6 +66,11 @@ PVR_ERROR RenameRecording(const PVR_RECORDING& recinfo, const char* newname); PVR_ERROR DeleteRecording(const PVR_RECORDING& recinfo); PVR_ERROR GetRecordingEdl(const PVR_RECORDING& recinfo, PVR_EDL_ENTRY edl[], int *size); + int GetDeletedRecordingsCount(); + PVR_ERROR GetDeletedRecordingsList(ADDON_HANDLE handle); + PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording); + PVR_ERROR DeleteAllRecordingsFromTrash(); + PVR_ERROR UndeleteAllRecordingsFromTrash(); cResponsePacket* ReadResult(cRequestPacket* vrp); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/VNSIDemux.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/VNSIDemux.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vdr.vnsi/src/VNSIDemux.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vdr.vnsi/src/VNSIDemux.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -257,8 +257,9 @@ time_t cVNSIDemux::GetPlayingTime() { - time_t ret; - ret = m_ReferenceTime + (m_CurrentDTS - m_ReferenceDTS) / DVD_TIME_BASE; + time_t ret = 0; + if (m_ReferenceTime) + ret = m_ReferenceTime + (m_CurrentDTS - m_ReferenceDTS) / DVD_TIME_BASE; return ret; } @@ -341,6 +342,20 @@ newStreams.push_back(newStream); + delete[] language; + } + else if (codecId.Codec().codec_type == XBMC_CODEC_TYPE_RDS) + { + const char *language = resp->extract_String(); + uint32_t rel_channel_pid = resp->extract_U32(); + newStream.strLanguage[0] = language[0]; + newStream.strLanguage[1] = language[1]; + newStream.strLanguage[2] = language[2]; + newStream.strLanguage[3] = 0; + newStream.iIdentifier = -1; + + newStreams.push_back(newStream); + delete[] language; } else diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vuplus/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vuplus/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.vuplus/addon/addon.xml.in 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.vuplus/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,12 +1,12 @@ - + bSupportsTV = true; pCapabilities->bSupportsRadio = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsRecordingFolders = true; pCapabilities->bSupportsTimers = true; pCapabilities->bSupportsChannelGroups = true; @@ -404,7 +405,7 @@ return VuData->GetChannels(handle, bRadio); } -int GetRecordingsAmount(void) +int GetRecordingsAmount(bool deleted) { if (!VuData || !VuData->IsConnected()) return PVR_ERROR_SERVER_ERROR; @@ -412,7 +413,7 @@ return VuData->GetRecordingsAmount(); } -PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { if (!VuData || !VuData->IsConnected()) return PVR_ERROR_SERVER_ERROR; @@ -554,13 +555,13 @@ PVR_ERROR GetStreamProperties(PVR_STREAM_PROPERTIES* pProperties) { return PVR_ERROR_NOT_IMPLEMENTED; } void DemuxAbort(void) { return; } DemuxPacket* DemuxRead(void) { return NULL; } -PVR_ERROR DialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR CallMenuHook(const PVR_MENUHOOK &menuhook, const PVR_MENUHOOK_DATA &item) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR DeleteChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR RenameChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR MoveChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } -PVR_ERROR DialogAddChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } bool OpenRecordedStream(const PVR_RECORDING &recording) { return false; } void CloseRecordedStream(void) {} int ReadRecordedStream(unsigned char *pBuffer, unsigned int iBufferSize) { return 0; } @@ -584,4 +585,6 @@ time_t GetPlayingTime() { return 0; } time_t GetBufferTimeStart() { return 0; } time_t GetBufferTimeEnd() { return 0; } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; } } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/addon.xml.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/addon.xml.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/addon.xml.in 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/addon.xml.in 2015-02-20 11:24:58.000000000 +0000 @@ -1,13 +1,13 @@  - - + + PVR WMC Kliens Klien PVR WMC PVR WMC Biðlari + Client PVR WMC PVR WMC 클라이언트 PVR WMC klientas PVR WMC клиент @@ -68,6 +69,7 @@ @OS@ @ARCHITECTURE@ Kiadás. Egy PVR kliens a Windows Media Center felvételeihez és EPG szolgáltatáshoz. Köszönet: JeffreyF, Tomba73, Hoopsdavis. Különleges köszönet: DBurckh. Edisi @OS@ @ARCHITECTURE@. Sebuah klien PVR untuk berhubungan dengan Perekaman Windows Media Center dan layanan EPG. Terimakasih untuk Tomba73 dan Hoopsdavis. Terimakasih khusus untuk DBurckh. @OS@ @ARCHITECTURE@ Útgáfa. PVR Biðlari til að tala við Windows Media Center's Upptöku og rafræna dagskrárþjónustur. Þakkir fá Tomba73 og Hoopsdavis. Sérstakar þakkir fær DBurckh. + Edizione @OS@ @ARCHITECTURE@. Un client PVR per interfacciarsi con i servizi di registrazione ed EPG di Windows Media Center. Grazie a Tomba73 e Hoopsdavis. Un ringraziamento speciale a DBurckh. @OS@ @ARCHITECTURE@ Edition. Windows Media Center의 녹화 및 EPG 서비스와 연결되는 PVR 클라이언트입니다. Tomba73 과 Hoopsdavis 에게 감사드립니다. DBurckh 에게 특별한 감사의 말을 남깁니다. @OS@ @ARCHITECTURE@ leidimas. PVR kliento sąsaja su Windows Media Center's įrašymo ir EPG paslaugomis. Dėkojame Tomba73 ir Hoopsdavis. Ypatingai ačiū DBurckh. @OS@ @ARCHITECTURE@ едиција. PVR клиент кој служи како интерфејс со EPG и сервисите за снимање на Windows Media Center. Благодарност кон Tomba73 и Hoopsdavis. Особено благодарност кон DBurckh. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/changelog.txt kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/changelog.txt --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/changelog.txt 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/changelog.txt 2015-02-20 11:24:58.000000000 +0000 @@ -1,3 +1,10 @@ +0.5.1 +- Updated to PVR API v1.9.4 +- Updated to GUI API v5.8.0 + +0.4.4 +- Updated Language files from Transifex + 0.4.003 - Revise previous ServerWMC stream stuttering fix diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/resources/language/Bulgarian/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/resources/language/Bulgarian/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/resources/language/Bulgarian/strings.po 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/resources/language/Bulgarian/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -28,6 +28,10 @@ msgid "Recording file not found" msgstr "Записаният файл не е открит" +msgctxt "#30026" +msgid "Sending WakeOnLAN to server..." +msgstr "Изпращане на WakeOnLAN към сървъра..." + msgctxt "#30101" msgid "Record this episode only" msgstr "Запиши само този епизод" @@ -40,6 +44,14 @@ msgid "Any Channel" msgstr "Всеки канал" +msgctxt "#30111" +msgid "Anytime" +msgstr "Всеки път" + msgctxt "#30120" msgid "Delete Timer" msgstr "Изтрий брояча" + +msgctxt "#30122" +msgid "Delete the entire series" +msgstr "Изтрий целия сериал" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/resources/language/French (Canada)/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/resources/language/French (Canada)/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/resources/language/French (Canada)/strings.po 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/resources/language/French (Canada)/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -94,7 +94,7 @@ msgctxt "#30019" msgid "ServerWMC version update is available (%s)" -msgstr "Une mise à jour de version (%s) est disponible pour ServerWMC" +msgstr "Une mise à jour de version (%s) est proposée pour ServerWMC" msgctxt "#30020" msgid "All tuners for this channel are busy" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/resources/language/Persian (Iran)/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/resources/language/Persian (Iran)/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/resources/language/Persian (Iran)/strings.po 1970-01-01 00:00:00.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/resources/language/Persian (Iran)/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -0,0 +1,21 @@ +# Kodi Media Center language file +# Addon Name: PVR WMC Client +# Addon id: pvr.wmc +# Addon Provider: KrustyReturns and scarecrow420 +msgid "" +msgstr "" +"Project-Id-Version: XBMC Main\n" +"Report-Msgid-Bugs-To: http://trac.xbmc.org/\n" +"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Kodi Translation Team\n" +"Language-Team: Persian (Iran) (http://www.transifex.com/projects/p/xbmc-main/language/fa_IR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: fa_IR\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +msgctxt "#30107" +msgid "Channel:" +msgstr "کانال:" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/resources/language/Turkish/strings.po kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/resources/language/Turkish/strings.po --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/addon/resources/language/Turkish/strings.po 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/addon/resources/language/Turkish/strings.po 2015-02-20 11:24:58.000000000 +0000 @@ -32,6 +32,10 @@ msgid "No video data found on this channel" msgstr "Bu kanalda video verisi bulunamadı" +msgctxt "#30005" +msgid "Tuner is needed for recording" +msgstr "Kayıt için alıcı gereklidir." + msgctxt "#30006" msgid "Recording delete failed, file in use or write protected" msgstr "Kayıt silme başarısız, dosya kullanımda veya yazma korumalı" @@ -52,6 +56,54 @@ msgid "Alternate time chosen: " msgstr "Seçilen alternatif zaman:" +msgctxt "#30011" +msgid "Can't start, tuner is no longer available" +msgstr "Başlayamadı, alıcı uzun süre algılanamadı" + +msgctxt "#30012" +msgid "Channel content is protected" +msgstr "Kanal içeriği korumalı" + +msgctxt "#30017" +msgid "Recorded TV folder not found" +msgstr "Kaydedilenler klasörü bulunamadı" + +msgctxt "#30018" +msgid "Recorded TV folder cannot be opened" +msgstr "Kaydedilenler klasörü açılamadı" + +msgctxt "#30019" +msgid "ServerWMC version update is available (%s)" +msgstr "Sunucu WMC sürümü güncellemesi gerçekleşiyor (%s)" + +msgctxt "#30020" +msgid "All tuners for this channel are busy" +msgstr "Tüm alıcılar bu kanal için meşgul" + +msgctxt "#30021" +msgid "LiveTV timed-out" +msgstr "Canlı yayın zaman aşımına uğradı" + +msgctxt "#30022" +msgid "LiveTV error, exited early" +msgstr "Canlı yayın hatası, erken çıkıldı" + +msgctxt "#30023" +msgid "Recording stream timed-out" +msgstr "Kayıt akışı zaman aşımına uğradı" + +msgctxt "#30024" +msgid "Recording stream exited early" +msgstr "Kayıt akışından erken çıkıldı" + +msgctxt "#30025" +msgid "Use WakeOnLAN to wake up server" +msgstr "Sunucuyu uyandırmak için WakeOnLan özelliğini kullan" + +msgctxt "#30026" +msgid "Sending WakeOnLAN to server..." +msgstr "WakeOnLAN isteği sunucuya gönderiliyor" + msgctxt "#30100" msgid "Recording Preference" msgstr "Kayıt Tercihi" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/src/client.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/src/client.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/addons/pvr.wmc/src/client.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/addons/pvr.wmc/src/client.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -325,6 +325,7 @@ pCapabilities->bSupportsTV = true; pCapabilities->bSupportsRadio = true; pCapabilities->bSupportsRecordings = true; + pCapabilities->bSupportsRecordingsUndelete = false; pCapabilities->bSupportsTimers = true; pCapabilities->bSupportsChannelGroups = true; pCapabilities->bSupportsChannelScan = false; @@ -480,14 +481,14 @@ } // recording file functions - PVR_ERROR GetRecordings(ADDON_HANDLE handle) +PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted) { if (_wmc) return _wmc->GetRecordings(handle); return PVR_ERROR_NO_ERROR; } - int GetRecordingsAmount(void) + int GetRecordingsAmount(bool deleted) { if (_wmc) return _wmc->GetRecordingsAmount(); @@ -685,12 +686,12 @@ } /** UNUSED API FUNCTIONS */ - PVR_ERROR DialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelScan(void) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR DeleteChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR RenameChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } PVR_ERROR MoveChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } - PVR_ERROR DialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } - PVR_ERROR DialogAddChannel(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL &channel) { return PVR_ERROR_NOT_IMPLEMENTED; } void DemuxReset(void) {} void DemuxFlush(void) {} void DemuxAbort(void) {} @@ -703,5 +704,7 @@ time_t GetPlayingTime() { return 0; } time_t GetBufferTimeStart() { return 0; } time_t GetBufferTimeEnd() { return 0; } +PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording) { return PVR_ERROR_NOT_IMPLEMENTED; } +PVR_ERROR DeleteAllRecordingsFromTrash() { return PVR_ERROR_NOT_IMPLEMENTED; } } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/changelog 2015-01-30 18:35:56.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/changelog 2015-02-20 11:27:45.000000000 +0000 @@ -1,4 +1,4 @@ -kodi-pvr-addons (1.0.0~git20150130.1935-b2dc035-0~utopic) utopic; urgency=high +kodi-pvr-addons (1.0.0~git20150220.1227-4657d8b-0~utopic) utopic; urgency=high [Bernd Kuhls] * Enable Filmon PVR addon only when all dependencies were met diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/changelog.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/changelog.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/changelog.in 2015-01-30 18:35:56.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/changelog.in 2015-02-20 11:27:45.000000000 +0000 @@ -1,4 +1,4 @@ -kodi-pvr-addons (1.0.0~git20150130.1935-b2dc035-0~#DIST#) #DIST#; urgency=high +kodi-pvr-addons (1.0.0~git20150220.1227-4657d8b-0~#DIST#) #DIST#; urgency=high [Bernd Kuhls] * Enable Filmon PVR addon only when all dependencies were met diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/control kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/control --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/control 2015-01-30 18:35:56.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/control 2015-02-20 11:27:45.000000000 +0000 @@ -11,7 +11,7 @@ Package: kodi-pvr-mythtv Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Addon MythTv - Cmyth - PVR API:1.9.3 +Description: Kodi PVR Addon MythTv - Cmyth - PVR API:1.9.4 This package contains the MythTV PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -19,7 +19,7 @@ Package: kodi-pvr-vuplus Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Addon Vuplus - PVR API:1.9.3 +Description: Kodi PVR Addon Vuplus - PVR API:1.9.4 This package contains the Vuplus PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -27,7 +27,7 @@ Package: kodi-pvr-vdr-vnsi Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Addon VDR Vnsi - PVR API:1.9.3 +Description: Kodi PVR Addon VDR Vnsi - PVR API:1.9.4 This package contains the VDR Vnsi PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -35,13 +35,13 @@ #Package: vdr-plugin-vnsiserver #Architecture: any #Depends: ${shlibs:Depends}, ${misc:Depends}, ${vdr:Depends} -#Description: VDR-Network-Streaming-Interface - PVR API:1.9.3 +#Description: VDR-Network-Streaming-Interface - PVR API:1.9.4 # VDR-Network-Streaming-Interface Package: kodi-pvr-njoy Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Addon Njoy - PVR API:1.9.3 +Description: Kodi PVR Addon Njoy - PVR API:1.9.4 This package contains the Njoy PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -49,7 +49,7 @@ Package: kodi-pvr-nextpvr Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Addon NextPvr - PVR API:1.9.3 +Description: Kodi PVR Addon NextPvr - PVR API:1.9.4 This package contains the NextPvr PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -57,7 +57,7 @@ Package: kodi-pvr-mediaportal-tvserver Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Addon Mediaportal Tvserver - PVR API:1.9.3 +Description: Kodi PVR Addon Mediaportal Tvserver - PVR API:1.9.4 This package contains the Mediaportal PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -65,7 +65,7 @@ Package: kodi-pvr-tvheadend-hts Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Addon TvHeadend Hts - PVR API:1.9.3 +Description: Kodi PVR Addon TvHeadend Hts - PVR API:1.9.4 This package contains the TvHeadend PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -73,7 +73,7 @@ Package: kodi-pvr-dvbviewer Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Addon Dvbviewer - PVR API:1.9.3 +Description: Kodi PVR Addon Dvbviewer - PVR API:1.9.4 This package contains the Dvbviewer PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -81,7 +81,7 @@ Package: kodi-pvr-argustv Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Addon Argustv - PVR API:1.9.3 +Description: Kodi PVR Addon Argustv - PVR API:1.9.4 This package contains the Argustv PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -89,7 +89,7 @@ Package: kodi-pvr-demo Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Demo Addon - PVR API:1.9.3 +Description: Kodi PVR Demo Addon - PVR API:1.9.4 This package contains the Demo PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media @@ -97,7 +97,7 @@ Package: kodi-pvr-iptvsimple Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Description: Kodi PVR Iptv Addon - PVR API:1.9.3 +Description: Kodi PVR Iptv Addon - PVR API:1.9.4 This package contains the Iptv PVR (Personal Video Recorder) Addon for Kodi, the award winning free and open source software media-player and entertainment hub for all your digital media diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-argustv.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-argustv.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-argustv.changelog 2015-01-30 18:36:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-argustv.changelog 2015-02-20 11:27:47.000000000 +0000 @@ -1,24 +1,24 @@ -kodi-pvr-addons (1.9.189-5utopic) utopic; urgency=low +kodi-pvr-addons (1.10.1-5utopic) utopic; urgency=medium * v0.0.1.133 (31-03-2012) - The add-on now sets the time a recording was last watched on the server v0.0.1.132 (20-03-2012) - Small fix - to correct one invalid GUID error message at start v0.0.1.131 (16- - 03-2012) - Added many internal verifications to the to - channel mappings. External factors can break the - mapping and these checks will hopefully warn the user to reset the - PVR database v0.0.1.130 (11-03-2012) - Fixed 64-bit Linux .tsbuffer - processing v0.0.1.129 (04-03-2012) - Media Portal TV-Server will now - work with the FTR - FTR Addon - XBMC combination Recording titles - with trailing periods '...' will show up in XBMC, NOTICE: this - requires FTR 1.6.1.0 Beta 5 or newer v0.0.1.128 (23-01-2012) - - Added: System Info - PVR Information now shows FTR version info - Timers do no longer retrieve the cancelled 'upcomingprograms' from - ForTheRecord v0.0.1.127 (20-01-2012) - Added: System Info - PVR - Information now shows total and used disk sizes v0.0.1.126 (10-01- - 2012) - Added: titles of recordings changed to be more descriptive - v0.0.1.125 (04-01-2012) - Added: validation of the shares for all - ForTheRecord tuners at startup v0.0.1.124 (01-01-2012) - Fixed Linux - mutex initialisation, caused by C++ not having static constructors + to correct one invalid GUID error message at start v0.0.1.131 (16-03- + 2012) - Added many internal verifications to the to channel mappings. External factors can break the mapping and + these checks will hopefully warn the user to reset the PVR database + v0.0.1.130 (11-03-2012) - Fixed 64-bit Linux .tsbuffer processing + v0.0.1.129 (04-03-2012) - Media Portal TV-Server will now work with + the FTR - FTR Addon - XBMC combination Recording titles with + trailing periods '...' will show up in XBMC, NOTICE: this requires + FTR 1.6.1.0 Beta 5 or newer v0.0.1.128 (23-01-2012) - Added: System + Info - PVR Information now shows FTR version info Timers do no + longer retrieve the cancelled 'upcomingprograms' from ForTheRecord + v0.0.1.127 (20-01-2012) - Added: System Info - PVR Information now + shows total and used disk sizes v0.0.1.126 (10-01-2012) - Added: + titles of recordings changed to be more descriptive v0.0.1.125 (04- + 01-2012) - Added: validation of the shares for all ForTheRecord + tuners at startup v0.0.1.124 (01-01-2012) - Fixed Linux mutex + initialisation, caused by C++ not having static constructors v0.0.1.123 (20-12-2011) - Pressing 'record' while viewing will schedule the recording of the show watched - Delete Timer: will abort an active recording, will remove the upcoming program from the @@ -51,12 +51,12 @@ recording via the ForTheRecord shares - Fixes some memory corruptions - Support for retrieval of recordings on the ForTheRecord Argus server - Overview of recordings, grouped by - Title, including recording starttime, and description - Credits: - Red-F v0.0.1.108 (08-01-2011) - EPG data retrieval fixed for dates - where month and day have less than 2 digits (credits: Red-F) - v0.0.1.107 (27-11-2010) - First release of the ForTheRecord PVR - client (Windows only, TSReader) - Implemented: Channel retrieval, - tuning of live TV and live radio (tsbuffer only, no rtsp), basic EPG - - Tested ForTheRecord Argus version: v1.5.0.3 + Title, including recording starttime, and description - Credits: Red- + F v0.0.1.108 (08-01-2011) - EPG data retrieval fixed for dates where + month and day have less than 2 digits (credits: Red-F) v0.0.1.107 + (27-11-2010) - First release of the ForTheRecord PVR client (Windows + only, TSReader) - Implemented: Channel retrieval, tuning of live TV + and live radio (tsbuffer only, no rtsp), basic EPG - Tested + ForTheRecord Argus version: v1.5.0.3 - -- wsnipex Fri, 30 Jan 2015 19:36:07 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:47 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-argustv.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-argustv.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-argustv.version 2015-01-30 18:36:05.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-argustv.version 2015-02-20 11:27:47.000000000 +0000 @@ -1 +1 @@ -1.9.189-5utopic +1.10.1-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-demo.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-demo.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-demo.changelog 2015-01-30 18:36:27.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-demo.changelog 2015-02-20 11:27:52.000000000 +0000 @@ -1,5 +1,5 @@ -kodi-pvr-addons (1.9.16-5utopic) utopic; urgency=low +kodi-pvr-addons (1.10.1-5utopic) utopic; urgency=medium * no upstream changelog available - -- wsnipex Fri, 30 Jan 2015 19:36:27 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:52 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-demo.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-demo.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-demo.version 2015-01-30 18:36:25.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-demo.version 2015-02-20 11:27:51.000000000 +0000 @@ -1 +1 @@ -1.9.16-5utopic +1.10.1-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-dvbviewer.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-dvbviewer.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-dvbviewer.changelog 2015-01-30 18:36:25.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-dvbviewer.changelog 2015-02-20 11:27:51.000000000 +0000 @@ -1,48 +1,57 @@ -kodi-pvr-addons (1.9.26-5utopic) utopic; urgency=low +kodi-pvr-addons (1.10.29-5utopic) utopic; urgency=medium - * [fixed] After changing certain settings live TV wasn't work anymore - and XBMC restart was required [fixed] possible crash (2x) 1.8.9 - [updated] sync with PVR API v1.8.0 1.7.9 [fixed] loading favourites - without groups/folders 1.7.8 [fixed] fix crash with Recording - Service 1.25.0 1.7.7 [fixed] fix possible crash during timer updates - 1.7.6 [added] Basic timeshift support. [added] Use channel names - from favourites. This allows easy channelname changes. [fixed] Use - 64 bit channel ids. Fall back to 32 bit if favourites.xml still - contain the old ones. [fixed] Replace "/"-character by " " in - channel logo url [updated] A lot of code cleanup 1.7.5 [updated] - Bump after PVR API version bump 1.6.5 [updated] Language files from - Transifex 1.6.4 [fixed] Use utf-8 encoding to get and set the - timers. [fixed] Channel names with more than 25 chars could crash - the add-on. 1.6.3 [updated] Language files from Transifex 1.6.2 New - version number by Team XBMC 0.1.8 [fixed] Changed the way timers are - calculated. This should fix problems with scheduled and instant - recordings on some machines. [fixed] Favourites didn't show channels - if the audio track wasn't the first one. [fixed] Channel settings - weren't saved/restored after a channel switch with the channels OSD. - [fixed] XBMC could hang after a channel switch with the channels - OSD. 0.1.7 [added] The Recording Service version 1.21 or higher is - now required. Download the latest version from the DVBViewer members - area and install it. [added] Display a notification if the add-on - can't connect to the Recording Service. Please, check that the RS is - enabled and the IP, webinterface port, username and pass are - correct. [added] If the favourites.xml selector is empty, the - favourites are loaded from the web interface. [added] Don't fetch - recording thumbnails at startup if there are more than 20 - recordings. [fixed] The add-on crashed if favourites.xml had entries - with the old 32 bits ID. [fixed] Channel names with ansi chars are - converted to utf8 so they can be displayed properly (a reset of the - PVR database may be required). [fixed] Channel names with more than - 25 chars. 0.1.5 [added] Timers support. [added] An option to load - the channels from favourites.xml instead of from channels.dat (a - reset of the PVR database is required). It is usually located at - c:\ProgramData\CMUV\DVBViewer\ This is a hidden folder so be sure to - enable the "Settings\Appearance\File Lists\Show hidden files and - directories" option. [added] Always grab the EPG data after a - channel switch. [added] Recording thumbnails. [added] Receiving - device name to the status info. [fixed] The preferred language is - loaded from the DVBViewer config and used to get the correct EPG in - case it supports multi language entries. [fixed] When the EPG is - missing the description entry, the event entry is used instead. - 0.1.0 First version. + * [updated] Language files from Transifex 1.9.11 [added] add timeshift + buffer functions 1.8.10 [updated] Require DVB Viewer Recording + Service 1.25.0 or later [updated] In general use RS XML API instead + of HTML/channeldat parsing [updated] Rewrote channel parsing. Use + favourites if you want fast startups. [updated] Rewrote recording + parsing, generate unique recording IDs [added] Show available + diskspace [added] RTSP support (Note: RTSP is only available if + timeshift is disabled) [fixed] Removed signal status information. + Not available anymore [fixed] Channel logos not being displayed for + some channels [fixed] After changing certain settings live TV wasn't + work anymore and XBMC restart was required [fixed] possible crash + (2x) 1.8.9 [updated] sync with PVR API v1.8.0 1.7.9 [fixed] loading + favourites without groups/folders 1.7.8 [fixed] fix crash with + Recording Service 1.25.0 1.7.7 [fixed] fix possible crash during + timer updates 1.7.6 [added] Basic timeshift support. [added] Use + channel names from favourites. This allows easy channelname changes. + [fixed] Use 64 bit channel ids. Fall back to 32 bit if + favourites.xml still contain the old ones. [fixed] Replace "/"- + character by " " in channel logo url [updated] A lot of code cleanup + 1.7.5 [updated] Bump after PVR API version bump 1.6.5 [updated] + Language files from Transifex 1.6.4 [fixed] Use utf-8 encoding to + get and set the timers. [fixed] Channel names with more than 25 + chars could crash the add-on. 1.6.3 [updated] Language files from + Transifex 1.6.2 New version number by Team XBMC 0.1.8 [fixed] + Changed the way timers are calculated. This should fix problems with + scheduled and instant recordings on some machines. [fixed] + Favourites didn't show channels if the audio track wasn't the first + one. [fixed] Channel settings weren't saved/restored after a channel + switch with the channels OSD. [fixed] XBMC could hang after a + channel switch with the channels OSD. 0.1.7 [added] The Recording + Service version 1.21 or higher is now required. Download the latest + version from the DVBViewer members area and install it. [added] + Display a notification if the add-on can't connect to the Recording + Service. Please, check that the RS is enabled and the IP, + webinterface port, username and pass are correct. [added] If the + favourites.xml selector is empty, the favourites are loaded from the + web interface. [added] Don't fetch recording thumbnails at startup + if there are more than 20 recordings. [fixed] The add-on crashed if + favourites.xml had entries with the old 32 bits ID. [fixed] Channel + names with ansi chars are converted to utf8 so they can be displayed + properly (a reset of the PVR database may be required). [fixed] + Channel names with more than 25 chars. 0.1.5 [added] Timers support. + [added] An option to load the channels from favourites.xml instead + of from channels.dat (a reset of the PVR database is required). It + is usually located at c:\ProgramData\CMUV\DVBViewer\ This is a + hidden folder so be sure to enable the "Settings\Appearance\File + Lists\Show hidden files and directories" option. [added] Always grab + the EPG data after a channel switch. [added] Recording thumbnails. + [added] Receiving device name to the status info. [fixed] The + preferred language is loaded from the DVBViewer config and used to + get the correct EPG in case it supports multi language entries. + [fixed] When the EPG is missing the description entry, the event + entry is used instead. 0.1.0 First version. - -- wsnipex Fri, 30 Jan 2015 19:36:25 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:51 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-dvbviewer.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-dvbviewer.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-dvbviewer.version 2015-01-30 18:36:22.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-dvbviewer.version 2015-02-20 11:27:50.000000000 +0000 @@ -1 +1 @@ -1.9.26-5utopic +1.10.29-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-iptvsimple.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-iptvsimple.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-iptvsimple.changelog 2015-01-30 18:36:19.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-iptvsimple.changelog 2015-02-20 11:27:50.000000000 +0000 @@ -1,18 +1,19 @@ -kodi-pvr-addons (1.9.13-5utopic) utopic; urgency=low +kodi-pvr-addons (1.10.1-5utopic) utopic; urgency=medium - * v1.9.14 - language files from Transifex - minor changes to conform - with C++11 v1.9.12 - added getBackendHostname function v1.9.10 - - change library name to Kodi v1.9.9 - fixed deadlock when activating - the addon on some darwin (osx, ios) runtimes v1.9.6 - updated to API - v1.9.2 v1.9.3 - added setting to disable cache m3u/epg - added - support for programme in epg - added possibility to - specify logo path as URL - changed tvg-logo should contains full - logo filename (with extention) - changed don't try download xmltv if - it doesn't load after 3 attempt. v1.9.2 - add timeshift buffer - functions v1.8.1 - fixed issue with BOM header in EPG XML - fixed - issue with update channels if they are changed in m3u - added - setting starting number of channels v1.8.0 - Initial version - - Supports m3u as Live TV streams source and XMLTV as EPG source - - Supports Live TV, Radio channels and EPG + * v1.10.1 - language files from Transifex - minor changes to conform + with C++11 - Updated to API v1.9.4 v1.9.12 - added + getBackendHostname function v1.9.10 - change library name to Kodi + v1.9.9 - fixed deadlock when activating the addon on some darwin + (osx, ios) runtimes v1.9.6 - updated to API v1.9.2 v1.9.3 - added + setting to disable cache m3u/epg - added support for + programme in epg - added possibility to specify logo path as URL - + changed tvg-logo should contains full logo filename (with extention) + - changed don't try download xmltv if it doesn't load after 3 + attempt. v1.9.2 - add timeshift buffer functions v1.8.1 - fixed + issue with BOM header in EPG XML - fixed issue with update channels + if they are changed in m3u - added setting starting number of + channels v1.8.0 - Initial version - Supports m3u as Live TV streams + source and XMLTV as EPG source - Supports Live TV, Radio channels + and EPG - -- wsnipex Fri, 30 Jan 2015 19:36:19 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:50 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-iptvsimple.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-iptvsimple.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-iptvsimple.version 2015-01-30 18:36:16.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-iptvsimple.version 2015-02-20 11:27:49.000000000 +0000 @@ -1 +1 @@ -1.9.13-5utopic +1.10.1-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-mediaportal-tvserver.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-mediaportal-tvserver.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-mediaportal-tvserver.changelog 2015-01-30 18:36:10.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-mediaportal-tvserver.changelog 2015-02-20 11:27:48.000000000 +0000 @@ -1,4 +1,4 @@ -kodi-pvr-addons (1.9.26-5utopic) utopic; urgency=low +kodi-pvr-addons (1.10.1-5utopic) utopic; urgency=medium * - Added: use channel icons from MediaPortal (Windows, localhost only) - Changed: switch from libPlatform + libTcpSocket to platform @@ -51,4 +51,4 @@ client should abort connection when the TVServerXBMC version is too old v1.1.0.60 - Fix PVR client destroy - -- wsnipex Fri, 30 Jan 2015 19:36:10 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:48 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-mediaportal-tvserver.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-mediaportal-tvserver.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-mediaportal-tvserver.version 2015-01-30 18:36:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-mediaportal-tvserver.version 2015-02-20 11:27:47.000000000 +0000 @@ -1 +1 @@ -1.9.26-5utopic +1.10.1-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-mythtv.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-mythtv.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-mythtv.changelog 2015-01-30 18:36:22.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-mythtv.changelog 2015-02-20 11:27:50.000000000 +0000 @@ -1,4 +1,4 @@ -kodi-pvr-addons (1.11.4-5utopic) utopic; urgency=low +kodi-pvr-addons (2.0.2-5utopic) utopic; urgency=medium * - Adding WS API Security Pin parameter - Adding episode info (subtitle) to EPG title v1.9.29 - fixed resource leak on file cache @@ -36,4 +36,4 @@ parsing of 'airdate' in proto v1.9.14 - Fork of pvr.mythtv.cmyth - Use C++ library CPPMyth for MythTV backend 0.27 to 0.28-pre - -- wsnipex Fri, 30 Jan 2015 19:36:22 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:50 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-mythtv.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-mythtv.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-mythtv.version 2015-01-30 18:36:19.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-mythtv.version 2015-02-20 11:27:50.000000000 +0000 @@ -1 +1 @@ -1.11.4-5utopic +2.0.2-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-nextpvr.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-nextpvr.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-nextpvr.changelog 2015-01-30 18:36:04.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-nextpvr.changelog 2015-02-20 11:27:47.000000000 +0000 @@ -1,4 +1,4 @@ -kodi-pvr-addons (1.9.20-5utopic) utopic; urgency=low +kodi-pvr-addons (1.10.1-5utopic) utopic; urgency=medium * v1.9.19 - added getBackendHostname function - added support for ATSC subchannel numbers, fixing 'no tuner available' message users were @@ -34,4 +34,4 @@ Shows user a notification message when this was required. v1.0.0.0 - Created - -- wsnipex Fri, 30 Jan 2015 19:36:04 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:47 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-nextpvr.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-nextpvr.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-nextpvr.version 2015-01-30 18:36:02.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-nextpvr.version 2015-02-20 11:27:46.000000000 +0000 @@ -1 +1 @@ -1.9.20-5utopic +1.10.1-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-njoy.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-njoy.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-njoy.changelog 2015-01-30 18:36:16.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-njoy.changelog 2015-02-20 11:27:49.000000000 +0000 @@ -1,5 +1,5 @@ -kodi-pvr-addons (1.9.15-5utopic) utopic; urgency=low +kodi-pvr-addons (1.10.1-5utopic) utopic; urgency=medium * no upstream changelog available - -- wsnipex Fri, 30 Jan 2015 19:36:16 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:49 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-njoy.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-njoy.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-njoy.version 2015-01-30 18:36:13.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-njoy.version 2015-02-20 11:27:49.000000000 +0000 @@ -1 +1 @@ -1.9.15-5utopic +1.10.1-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-tvheadend-hts.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-tvheadend-hts.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-tvheadend-hts.changelog 2015-01-30 18:36:02.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-tvheadend-hts.changelog 2015-02-20 11:27:46.000000000 +0000 @@ -1,4 +1,4 @@ -kodi-pvr-addons (2.0.5-5utopic) utopic; urgency=low +kodi-pvr-addons (2.1.1-5utopic) utopic; urgency=medium * - add timeshift skip support (FF/RW still not working) - fix bug in tvh webroot processing 1.6.18 - ensure channel count is not cleared @@ -32,4 +32,4 @@ removed unneeded member in CHTSPDemux - better handling of disconnect and reconnects 1.6.4 - initial release - -- wsnipex Fri, 30 Jan 2015 19:36:02 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:46 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-tvheadend-hts.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-tvheadend-hts.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-tvheadend-hts.version 2015-01-30 18:35:59.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-tvheadend-hts.version 2015-02-20 11:27:45.000000000 +0000 @@ -1 +1 @@ -2.0.5-5utopic +2.1.1-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-vdr-vnsi.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-vdr-vnsi.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-vdr-vnsi.changelog 2015-01-30 18:35:59.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-vdr-vnsi.changelog 2015-02-20 11:27:45.000000000 +0000 @@ -1,5 +1,5 @@ -kodi-pvr-addons (1.9.27-5utopic) utopic; urgency=low +kodi-pvr-addons (1.10.2-5utopic) utopic; urgency=medium * no upstream changelog available - -- wsnipex Fri, 30 Jan 2015 19:35:59 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:45 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-vdr-vnsi.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-vdr-vnsi.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-vdr-vnsi.version 2015-01-30 18:35:56.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-vdr-vnsi.version 2015-02-20 11:27:45.000000000 +0000 @@ -1 +1 @@ -1.9.27-5utopic +1.10.2-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-vuplus.changelog kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-vuplus.changelog --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-vuplus.changelog 2015-01-30 18:36:13.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-vuplus.changelog 2015-02-20 11:27:48.000000000 +0000 @@ -1,4 +1,4 @@ -kodi-pvr-addons (1.9.22-5utopic) utopic; urgency=low +kodi-pvr-addons (1.10.1-5utopic) utopic; urgency=medium * 0.2.4 - fix: put username & password into the streaming url 0.2.3 - fix: put username & password into recording-url 0.2.2: - fix: escape @@ -33,8 +33,8 @@ win32 release target (thanks to 'trans' for patch) 0.1.8 - change: fetch the recording locations and use these locations when querying the recordings - fix: Stop update thread when destroying the PVR - addon - fixes shutdown issues 0.1.7 - fix: Copy & Paste error 0.1.6 - - fix: Change the logic to determine the picon file name from the + addon - fixes shutdown issues 0.1.7 - fix: Copy & Paste error 0.1.6 - + fix: Change the logic to determine the picon file name from the service reference. 0.1.5 - fix: Fix access violation errors on windows (thanks to 'trans' for finding the correct compiler / linker settings) - fix: do not return out of scope local variable for the @@ -48,4 +48,4 @@ 0.1.1 - fix: URLEncode the service reference when fetching EPG 0.1.0 - Iniital Version - -- wsnipex Fri, 30 Jan 2015 19:36:13 +0100 + -- wsnipex Fri, 20 Feb 2015 12:27:48 +0100 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-vuplus.version kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-vuplus.version --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/debian/kodi-pvr-vuplus.version 2015-01-30 18:36:10.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/debian/kodi-pvr-vuplus.version 2015-02-20 11:27:48.000000000 +0000 @@ -1 +1 @@ -1.9.22-5utopic +1.10.1-5utopic diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/CMakeLists.txt kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/CMakeLists.txt --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/CMakeLists.txt 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/CMakeLists.txt 2015-02-20 11:24:58.000000000 +0000 @@ -4,7 +4,6 @@ # Every module has a CMakeLists.txt in it's root. As we saw, those files # provide the necessary directions to build each module. set (MODULES - ${CMAKE_SOURCE_DIR}/jansson ${CMAKE_SOURCE_DIR}/cppmyth # diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/configure.ac kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/configure.ac --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/configure.ac 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/configure.ac 2015-02-20 11:24:58.000000000 +0000 @@ -7,7 +7,6 @@ AC_CONFIG_HEADERS([config.h]) # Configure external packages. -AC_CONFIG_SUBDIRS([jansson]) # Checks for programs. AC_PROG_CC diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/CMakeLists.txt kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/CMakeLists.txt --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/CMakeLists.txt 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/CMakeLists.txt 2015-02-20 11:24:58.000000000 +0000 @@ -14,23 +14,22 @@ ############################################################################### # set lib version here -set (CPPMYTH_LIB_VERSION "1.1.2") +set (CPPMYTH_LIB_VERSION "1.1.8") set (CPPMYTH_LIB_SOVERSION "1.1") ############################################################################### # add definitions if (MSVC) # Turn off Microsofts "security" warnings. - add_definitions("/W3 /D_USE_32BIT_TIME_T /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo") + add_definitions ("/W3 /D_USE_32BIT_TIME_T /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo") if (STATIC_CRT) set (CMAKE_C_FLAGS_RELEASE "/MT") set (CMAKE_C_FLAGS_DEBUG "/MTd") endif () endif () -if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) - set (CMAKE_C_FLAGS "-fPIC") - set (CMAKE_CXX_FLAGS "-fPIC") +if (NOT WIN32 AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)) + add_definitions ("-fPIC") endif () ############################################################################### @@ -120,8 +119,7 @@ DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/proto/) include_directories ( - ${CMAKE_CURRENT_BINARY_DIR}/include/. - ${CMAKE_BINARY_DIR}/jansson/include/.) + ${CMAKE_CURRENT_BINARY_DIR}/include/.) ############################################################################### # add sources @@ -147,7 +145,16 @@ # add targets if (BUILD_SHARED_LIBS) add_library (cppmyth SHARED ${CPPMYTH_SOURCES}) - target_link_libraries (cppmyth pthread jansson) + if (MSVC) + set (DEPLIBS ws2_32) + else () + set (DEPLIBS pthread m) + find_library (LIBRT rt) + if (LIBRT) + list (APPEND DEPLIBS rt) + endif () + endif () + target_link_libraries (cppmyth ${DEPLIBS}) set_target_properties (cppmyth PROPERTIES VERSION "${CPPMYTH_LIB_VERSION}" SOVERSION "${CPPMYTH_LIB_SOVERSION}") diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/Makefile.am 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/Makefile.am 2015-02-20 11:24:58.000000000 +0000 @@ -2,8 +2,7 @@ #lib_LTLIBRARIES = libcppmyth.la AM_CPPFLAGS = -fPIC -Wall -Wextra \ - -I@abs_srcdir@/src \ - -I@abs_top_srcdir@/jansson/src + -I@abs_srcdir@/src libcppmyth_la_SOURCES = \ src/private/mythdto/mythdto.cpp \ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/atomic.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/atomic.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/atomic.h 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/atomic.h 2015-02-20 11:24:58.000000000 +0000 @@ -45,6 +45,33 @@ typedef volatile unsigned atomic_t; #endif +#if defined __arm__ && (!defined __thumb__ || defined __thumb2__) +/* The __ARM_ARCH define is provided by gcc 4.8. Construct it otherwise. */ +#ifndef __ARM_ARCH +#ifdef __ARM_ARCH_2__ +#define __ARM_ARCH 2 +#elif defined (__ARM_ARCH_3__) || defined (__ARM_ARCH_3M__) +#define __ARM_ARCH 3 +#elif defined (__ARM_ARCH_4__) || defined (__ARM_ARCH_4T__) +#define __ARM_ARCH 4 +#elif defined (__ARM_ARCH_5__) || defined (__ARM_ARCH_5E__) \ + || defined(__ARM_ARCH_5T__) || defined(__ARM_ARCH_5TE__) \ + || defined(__ARM_ARCH_5TEJ__) +#define __ARM_ARCH 5 +#elif defined (__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ + || defined (__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \ + || defined (__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) +#define __ARM_ARCH 6 +#elif defined (__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ + || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ + || defined(__ARM_ARCH_7EM__) +#define __ARM_ARCH 7 +#else +#warning could not detect ARM architecture +#define __ARM_ARCH 8 +#endif +#endif +#endif /** * Atomically incremente a reference count variable. @@ -118,7 +145,20 @@ /* The value for __val is in '__oldval' */ __val = __oldval; -#elif defined __arm__ && !defined __thumb__ +#elif (defined __ARM_ARCH && __ARM_ARCH >= 6) + int inc = 1; + __asm__ volatile ( + "1:" + "ldrex %0, [%1]\n" + "add %0, %0, %2\n" + "strex r1, %0, [%1]\n" + "cmp r1, #0\n" + "bne 1b\n" + : "=&r" (__val) + : "r"(valp), "r"(inc) + : "r1"); + +#elif (defined __ARM_ARCH && __ARM_ARCH < 6) int tmp1, tmp2; int inc = 1; __asm__ volatile ( @@ -221,7 +261,20 @@ /* The value for __val is in '__oldval' */ __val = __oldval; -#elif defined __arm__ && !defined __thumb__ +#elif (defined __ARM_ARCH && __ARM_ARCH >= 6) + int dec = 1; + __asm__ volatile ( + "1:" + "ldrex %0, [%1]\n" + "sub %0, %0, %2\n" + "strex r1, %0, [%1]\n" + "cmp r1, #0\n" + "bne 1b\n" + : "=&r" (__val) + : "r"(valp), "r"(dec) + : "r1"); + +#elif (defined __ARM_ARCH && __ARM_ARCH < 6) int tmp1, tmp2; int inc = -1; __asm__ volatile ( diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythcontrol.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythcontrol.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythcontrol.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythcontrol.h 2015-02-20 11:24:58.000000000 +0000 @@ -199,6 +199,16 @@ } /** + * @brief Query information on a single item from recordings + * @param recordedid + * @return ProgramPtr + */ + ProgramPtr GetRecorded(uint32_t recordedid) + { + return m_wsapi.GetRecorded(recordedid); + } + + /** * @brief Update watched status for a recorded * @param chanid * @param recstartts @@ -206,6 +216,9 @@ */ bool UpdateRecordedWatchedStatus(const Program& program, bool watched) { + WSServiceVersion_t wsv = m_wsapi.CheckService(WS_Dvr); + if (wsv.ranking >= 0x00060000) + return m_wsapi.UpdateRecordedWatchedStatus(program.recording.recordedId, watched); return m_wsapi.UpdateRecordedWatchedStatus(program.channel.chanId, program.recording.startTs, watched); } @@ -219,6 +232,8 @@ bool DeleteRecording(const Program& program, bool forceDelete = false, bool allowRerecord = false) { WSServiceVersion_t wsv = m_wsapi.CheckService(WS_Dvr); + if (wsv.ranking >= 0x00060000) + return m_wsapi.DeleteRecording(program.recording.recordedId, forceDelete, allowRerecord); if (wsv.ranking >= 0x00020001) return m_wsapi.DeleteRecording(program.channel.chanId, program.recording.startTs, forceDelete, allowRerecord); return m_monitor.DeleteRecording(program, forceDelete, allowRerecord); @@ -227,6 +242,8 @@ bool UndeleteRecording(const Program& program) { WSServiceVersion_t wsv = m_wsapi.CheckService(WS_Dvr); + if (wsv.ranking >= 0x00060000) + return m_wsapi.UnDeleteRecording(program.recording.recordedId); if (wsv.ranking >= 0x00020001) return m_wsapi.UnDeleteRecording(program.channel.chanId, program.recording.startTs); return m_monitor.UndeleteRecording(program); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mytheventhandler.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mytheventhandler.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mytheventhandler.cpp 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mytheventhandler.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -242,10 +242,9 @@ void BasicEventHandler::AnnounceTimer() { - char buf[32]; EventMessage msg; msg.event = EVENT_HANDLER_TIMER; - msg.subject.push_back(buf); + msg.subject.push_back(""); DispatchEvent(msg); } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythlivetvplayback.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythlivetvplayback.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythlivetvplayback.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythlivetvplayback.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -404,29 +404,42 @@ } break; case EVENT_UPDATE_FILE_SIZE: - if (msg.subject.size() >= 4) + if (msg.subject.size() >= 3) { PLATFORM::CLockObject lock(*m_mutex); // Lock chain if (m_chain.lastSequence > 0) { int64_t newsize; - uint32_t chanid; - time_t startts; - if (str2uint32(msg.subject[1].c_str(), &chanid) == 0 - && str2time(msg.subject[2].c_str(), &startts) == 0 - && m_chain.chained[m_chain.lastSequence -1].second->channel.chanId == chanid - && m_chain.chained[m_chain.lastSequence -1].second->recording.startTs == startts - && str2int64(msg.subject[3].c_str(), &newsize) == 0 - && m_chain.chained[m_chain.lastSequence - 1].first->fileSize < newsize) + // Message contains chanid + starttime as recorded key + if (msg.subject.size() >= 4) { - // Update transfer file size - m_chain.chained[m_chain.lastSequence - 1].first->fileSize = newsize; - // Is wait the filling before switching ? - if (m_chain.switchOnCreate && SwitchChainLast()) - m_chain.switchOnCreate = false; - DBG(MYTH_DBG_DEBUG, "%s: liveTV (%s): chain last (%u) filesize %" PRIi64 "\n", __FUNCTION__, - m_chain.UID.c_str(), m_chain.lastSequence, newsize); + uint32_t chanid; + time_t startts; + if (str2uint32(msg.subject[1].c_str(), &chanid) + || str2time(msg.subject[2].c_str(), &startts) + || m_chain.chained[m_chain.lastSequence -1].second->channel.chanId != chanid + || m_chain.chained[m_chain.lastSequence -1].second->recording.startTs != startts + || str2int64(msg.subject[3].c_str(), &newsize) + || m_chain.chained[m_chain.lastSequence - 1].first->fileSize >= newsize) + break; } + // Message contains recordedid as key + else + { + uint32_t recordedid; + if (str2uint32(msg.subject[1].c_str(), &recordedid) + || m_chain.chained[m_chain.lastSequence -1].second->recording.recordedId != recordedid + || str2int64(msg.subject[2].c_str(), &newsize) + || m_chain.chained[m_chain.lastSequence - 1].first->fileSize >= newsize) + break; + } + // Update transfer file size + m_chain.chained[m_chain.lastSequence - 1].first->fileSize = newsize; + // Is wait the filling before switching ? + if (m_chain.switchOnCreate && SwitchChainLast()) + m_chain.switchOnCreate = false; + DBG(MYTH_DBG_DEBUG, "%s: liveTV (%s): chain last (%u) filesize %" PRIi64 "\n", __FUNCTION__, + m_chain.UID.c_str(), m_chain.lastSequence, newsize); } } break; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythrecordingplayback.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythrecordingplayback.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythrecordingplayback.cpp 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythrecordingplayback.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -191,24 +191,35 @@ switch (msg.event) { case EVENT_UPDATE_FILE_SIZE: - if (msg.subject.size() >= 4 && recording && transfer) + if (msg.subject.size() >= 3 && recording && transfer) { - uint32_t chanid; - time_t startts; - if (str2uint32(msg.subject[1].c_str(), &chanid) || str2time(msg.subject[2].c_str(), &startts)) - break; - if (recording->channel.chanId == chanid && recording->recording.startTs == startts) + int64_t newsize; + // Message contains chanid + starttime as recorded key + if (msg.subject.size() >= 4) { - int64_t newsize; - if (0 == str2int64(msg.subject[3].c_str(), &newsize)) - { - // The file grows. Allow reading ahead - m_readAhead = true; - recording->fileSize = transfer->fileSize = newsize; - DBG(MYTH_DBG_DEBUG, "%s: (%d) %s %" PRIi64 "\n", __FUNCTION__, - msg.event, recording->fileName.c_str(), newsize); - } + uint32_t chanid; + time_t startts; + if (str2uint32(msg.subject[1].c_str(), &chanid) + || str2time(msg.subject[2].c_str(), &startts) + || recording->channel.chanId != chanid + || recording->recording.startTs != startts + || str2int64(msg.subject[3].c_str(), &newsize)) + break; } + // Message contains recordedid as key + else + { + uint32_t recordedid; + if (str2uint32(msg.subject[1].c_str(), &recordedid) + || recording->recording.recordedId != recordedid + || str2int64(msg.subject[2].c_str(), &newsize)) + break; + } + // The file grows. Allow reading ahead + m_readAhead = true; + recording->fileSize = transfer->fileSize = newsize; + DBG(MYTH_DBG_DEBUG, "%s: (%d) %s %" PRIi64 "\n", __FUNCTION__, + msg.event, recording->fileName.c_str(), newsize); } break; //case EVENT_HANDLER_STATUS: diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythtypes.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythtypes.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythtypes.cpp 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythtypes.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -144,8 +144,9 @@ static protoref_t ruleType[] = { + { 79, RT_TemplateRecord, 11, "Recording Template" }, + { 79, RT_NotRecording, 0, "Not Recording" }, { 76, RT_OneRecord, 6, "Record One" }, - { 75, RT_NotRecording, 0, "Not Recording" }, { 75, RT_SingleRecord, 1, "Single Record" }, { 75, RT_DailyRecord, 2, "Record Daily" }, { 75, RT_ChannelRecord, 3, "Channel Record" }, @@ -156,7 +157,8 @@ { 75, RT_DontRecord, 8, "Do not Record" }, { 75, RT_FindDailyRecord, 9, "Find Daily" }, { 75, RT_FindWeeklyRecord, 10, "Find Weekly" }, - { 75, RT_TemplateRecord, 11, "Recording Template" }, + { 75, RT_TemplateRecord, 11, "Not Recording" }, + { 75, RT_NotRecording, 0, "Not Recording" }, }; RT_t Myth::RuleTypeFromString(unsigned proto, const std::string& type) diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythwsapi.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythwsapi.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythwsapi.cpp 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythwsapi.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -25,16 +25,14 @@ #include "private/mythsocket.h" #include "private/mythwsrequest.h" #include "private/mythwsresponse.h" -#include "private/janssonptr.h" #include "private/mythjsonparser.h" #include "private/mythjsonbinder.h" #include "private/platform/threads/mutex.h" #include "private/platform/util/util.h" #include "private/uriparser.h" -#include - #define BOOLSTR(a) ((a) ? "true" : "false") +#define FETCHSIZE 100 using namespace Myth; @@ -116,20 +114,18 @@ if (resp.IsSuccessful()) { // Parse content response - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (root.isValid() && json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (json.IsValid() && root.IsObject()) { - const json_t *field = json_object_get(root.get(), "String"); - if (field != NULL) + const MythJSON::Node& field = root.GetObjectValue("String"); + if (field.IsString()) { - const char *val = json_string_value(field); - if (val != NULL) + const std::string& val = field.GetStringValue(); + if (sscanf(val.c_str(), "%d.%d", &(wsv.major), &(wsv.minor)) == 2) { - if (sscanf(val, "%d.%d", &(wsv.major), &(wsv.minor)) == 2) - { - wsv.ranking = ((wsv.major & 0xFFFF) << 16) | (wsv.minor & 0xFFFF); - return true; - } + wsv.ranking = ((wsv.major & 0xFFFF) << 16) | (wsv.minor & 0xFFFF); + return true; } } } @@ -154,19 +150,17 @@ return false; } // Parse content response - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (root.isValid() && json_is_object(root.get())) - { - const json_t *field = json_object_get(root.get(), "String"); - if (field != NULL) - { - const char *val = json_string_value(field); - if (val != NULL) - { - m_serverHostName = val; - m_namedCache[val] = m_server; - return true; - } + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (json.IsValid() && root.IsObject()) + { + const MythJSON::Node& field = root.GetObjectValue("String"); + if (field.IsString()) + { + const std::string& val = field.GetStringValue(); + m_serverHostName = val; + m_namedCache[val] = m_server; + return true; } } return false; @@ -194,13 +188,14 @@ return false; } // Parse content response - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (root.isValid() && json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (json.IsValid() && root.IsObject()) { - const json_t *con = json_object_get(root.get(), "ConnectionInfo"); - if (con != NULL) + const MythJSON::Node& con = root.GetObjectValue("ConnectionInfo"); + if (con.IsObject()) { - const json_t *ver = json_object_get(con, "Version"); + const MythJSON::Node& ver = con.GetObjectValue("Version"); MythJSON::BindObject(ver, &m_version, MythDTO::getVersionBindArray(wsv.ranking)); if (m_version.protocol) return true; @@ -288,8 +283,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return ret; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return ret; @@ -297,20 +293,19 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: SettingList - const json_t *slist = json_object_get(root.get(), "SettingList"); + const MythJSON::Node& slist = root.GetObjectValue("SettingList"); // Object: Settings - json_t *sts = json_object_get(slist, "Settings"); - if (json_is_object(sts)) + const MythJSON::Node& sts = slist.GetObjectValue("Settings"); + if (sts.IsObject()) { - void *it = json_object_iter(sts); - if (it != NULL) + if (sts.Size()) { - const json_t *val = json_object_iter_value(it); - if (val != NULL) + const MythJSON::Node& val = sts.GetObjectValue(static_cast(0)); + if (val.IsString()) { ret.reset(new Setting()); // Using default constructor - ret->key = json_object_iter_key(it); - ret->value = json_string_value(val); + ret->key = sts.GetObjectKey(0); + ret->value = val.GetStringValue(); } } } @@ -340,8 +335,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return ret; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return ret; @@ -349,23 +345,22 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: SettingList - const json_t *slist = json_object_get(root.get(), "SettingList"); + const MythJSON::Node& slist = root.GetObjectValue("SettingList"); // Object: Settings - json_t *sts = json_object_get(slist, "Settings"); - if (json_is_object(sts)) + const MythJSON::Node& sts = slist.GetObjectValue("Settings"); + if (sts.IsObject()) { - void *it = json_object_iter(sts); - while (it) + size_t s = sts.Size(); + for (size_t i = 0; i < s; ++i) { - const json_t *val = json_object_iter_value(it); - if (val != NULL) + const MythJSON::Node& val = sts.GetObjectValue(i); + if (val.IsString()) { SettingPtr setting(new Setting()); // Using default constructor - setting->key = json_object_iter_key(it); - setting->value = json_string_value(val); + setting->key = sts.GetObjectKey(i); + setting->value = val.GetStringValue(); ret->insert(SettingMap::value_type(setting->key, setting)); } - it = json_object_iter_next(sts, it); } } return ret; @@ -397,16 +392,17 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "bool"); - if (!field || strcmp(json_string_value(field), "true")) + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) return false; return true; } @@ -434,8 +430,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return ret; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return ret; @@ -443,13 +440,14 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: CaptureCardList - const json_t *clist = json_object_get(root.get(), "CaptureCardList"); + const MythJSON::Node& clist = root.GetObjectValue("CaptureCardList"); // Object: CaptureCards[] - const json_t *cards = json_object_get(clist, "CaptureCards"); + const MythJSON::Node& cards = clist.GetObjectValue("CaptureCards"); // Iterates over the sequence elements. - for (size_t ci = 0; ci < json_array_size(cards); ++ci) + size_t cs = cards.Size(); + for (size_t ci = 0; ci < cs; ++ci) { - const json_t *card = json_array_get(cards, ci); + const MythJSON::Node& card = cards.GetArrayElement(ci); CaptureCardPtr captureCard(new CaptureCard()); // Using default constructor // Bind the new captureCard MythJSON::BindObject(card, captureCard.get(), bindcard); @@ -480,8 +478,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return ret; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return ret; @@ -489,13 +488,14 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: VideoSourceList - const json_t *slist = json_object_get(root.get(), "VideoSourceList"); + const MythJSON::Node& slist = root.GetObjectValue("VideoSourceList"); // Object: VideoSources[] - const json_t *vsrcs = json_object_get(slist, "VideoSources"); + const MythJSON::Node& vsrcs = slist.GetObjectValue("VideoSources"); // Iterates over the sequence elements. - for (size_t vi = 0; vi < json_array_size(vsrcs); ++vi) + size_t vs = vsrcs.Size(); + for (size_t vi = 0; vi < vs; ++vi) { - const json_t *vsrc = json_array_get(vsrcs, vi); + const MythJSON::Node& vsrc = vsrcs.GetArrayElement(vi); VideoSourcePtr videoSource(new VideoSource()); // Using default constructor // Bind the new videoSource MythJSON::BindObject(vsrc, videoSource.get(), bindvsrc); @@ -508,7 +508,7 @@ { ChannelListPtr ret(new ChannelList); char buf[32]; - int32_t req_index = 0, req_count = 100, count = 0; + int32_t req_index = 0, req_count = FETCHSIZE, count = 0; unsigned proto = (unsigned)m_version.protocol; // Get bindings for protocol version @@ -537,8 +537,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); break; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); break; @@ -546,7 +547,7 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: ChannelInfoList - const json_t *clist = json_object_get(root.get(), "ChannelInfoList"); + const MythJSON::Node& clist = root.GetObjectValue("ChannelInfoList"); ItemList list = ItemList(); // Using default constructor MythJSON::BindObject(clist, &list, bindlist); // List has ProtoVer. Check it or sound alarm @@ -557,12 +558,13 @@ } count = 0; // Object: ChannelInfos[] - const json_t *chans = json_object_get(clist, "ChannelInfos"); + const MythJSON::Node& chans = clist.GetObjectValue("ChannelInfos"); // Iterates over the sequence elements. - for (size_t ci = 0; ci < json_array_size(chans); ++ci) + size_t cs = chans.Size(); + for (size_t ci = 0; ci < cs; ++ci) { ++count; - const json_t *chan = json_array_get(chans, ci); + const MythJSON::Node& chan = chans.GetArrayElement(ci); ChannelPtr channel(new Channel()); // Using default constructor // Bind the new channel MythJSON::BindObject(chan, channel.get(), bindchan); @@ -581,7 +583,7 @@ { ChannelListPtr ret(new ChannelList); char buf[32]; - int32_t req_index = 0, req_count = 100, count = 0; + int32_t req_index = 0, req_count = FETCHSIZE, count = 0; unsigned proto = (unsigned)m_version.protocol; // Get bindings for protocol version @@ -612,8 +614,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); break; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); break; @@ -621,7 +624,7 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: ChannelInfoList - const json_t *clist = json_object_get(root.get(), "ChannelInfoList"); + const MythJSON::Node& clist = root.GetObjectValue("ChannelInfoList"); ItemList list = ItemList(); // Using default constructor MythJSON::BindObject(clist, &list, bindlist); // List has ProtoVer. Check it or sound alarm @@ -632,12 +635,13 @@ } count = 0; // Object: ChannelInfos[] - const json_t *chans = json_object_get(clist, "ChannelInfos"); + const MythJSON::Node& chans = clist.GetObjectValue("ChannelInfos"); // Iterates over the sequence elements. - for (size_t ci = 0; ci < json_array_size(chans); ++ci) + size_t cs = chans.Size(); + for (size_t ci = 0; ci < cs; ++ci) { ++count; - const json_t *chan = json_array_get(chans, ci); + const MythJSON::Node& chan = chans.GetArrayElement(ci); ChannelPtr channel(new Channel()); // Using default constructor // Bind the new channel MythJSON::BindObject(chan, channel.get(), bindchan); @@ -687,8 +691,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return ret; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return ret; @@ -696,7 +701,7 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: ProgramGuide - const json_t *glist = json_object_get(root.get(), "ProgramGuide"); + const MythJSON::Node& glist = root.GetObjectValue("ProgramGuide"); ItemList list = ItemList(); // Using default constructor MythJSON::BindObject(glist, &list, bindlist); // List has ProtoVer. Check it or sound alarm @@ -706,20 +711,22 @@ return ret; } // Object: Channels[] - const json_t *chans = json_object_get(glist, "Channels"); + const MythJSON::Node& chans = glist.GetObjectValue("Channels"); // Iterates over the sequence elements. - for (size_t ci = 0; ci < json_array_size(chans); ++ci) + size_t cs = chans.Size(); + for (size_t ci = 0; ci < cs; ++ci) { - const json_t *chan = json_array_get(chans, ci); + const MythJSON::Node& chan = chans.GetArrayElement(ci); Channel channel; MythJSON::BindObject(chan, &channel, bindchan); // Object: Programs[] - const json_t *progs = json_object_get(chan, "Programs"); + const MythJSON::Node& progs = chan.GetObjectValue("Programs"); // Iterates over the sequence elements. - for (size_t pi = 0; pi < json_array_size(progs); ++pi) + size_t ps = progs.Size(); + for (size_t pi = 0; pi < ps; ++pi) { ++count; - const json_t *prog = json_array_get(progs, pi); + const MythJSON::Node& prog = progs.GetArrayElement(pi); ProgramPtr program(new Program()); // Using default constructor // Bind the new program MythJSON::BindObject(prog, program.get(), bindprog); @@ -740,7 +747,7 @@ { ProgramListPtr ret(new ProgramList); char buf[32]; - uint32_t req_index = 0, req_count = 100, count = 0, total = 0; + uint32_t req_index = 0, req_count = FETCHSIZE, count = 0, total = 0; unsigned proto = (unsigned)m_version.protocol; // Get bindings for protocol version @@ -775,8 +782,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); break; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); break; @@ -784,7 +792,7 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: ProgramList - const json_t *plist = json_object_get(root.get(), "ProgramList"); + const MythJSON::Node& plist = root.GetObjectValue("ProgramList"); ItemList list = ItemList(); // Using default constructor MythJSON::BindObject(plist, &list, bindlist); // List has ProtoVer. Check it or sound alarm @@ -795,26 +803,28 @@ } count = 0; // Object: Programs[] - const json_t *progs = json_object_get(plist, "Programs"); + const MythJSON::Node& progs = plist.GetObjectValue("Programs"); // Iterates over the sequence elements. - for (size_t pi = 0; pi < json_array_size(progs); ++pi) + size_t ps = progs.Size(); + for (size_t pi = 0; pi < ps; ++pi) { ++count; - const json_t *prog = json_array_get(progs, pi); + const MythJSON::Node& prog = progs.GetArrayElement(pi); ProgramPtr program(new Program()); // Using default constructor // Bind the new program MythJSON::BindObject(prog, program.get(), bindprog); // Bind channel of program - const json_t *chan = json_object_get(prog, "Channel"); + const MythJSON::Node& chan = prog.GetObjectValue("Channel"); MythJSON::BindObject(chan, &(program->channel), bindchan); // Bind recording of program - const json_t *reco = json_object_get(prog, "Recording"); + const MythJSON::Node& reco = prog.GetObjectValue("Recording"); MythJSON::BindObject(reco, &(program->recording), bindreco); // Bind artwork list of program - const json_t *arts = json_object_get(json_object_get(prog, "Artwork"), "ArtworkInfos"); - for (size_t pa = 0; pa < json_array_size(arts); ++pa) + const MythJSON::Node& arts = prog.GetObjectValue("Artwork").GetObjectValue("ArtworkInfos"); + size_t as = arts.Size(); + for (size_t pa = 0; pa < as; ++pa) { - const json_t *artw = json_array_get(arts, pa); + const MythJSON::Node& artw = arts.GetArrayElement(pa); Artwork artwork = Artwork(); // Using default constructor MythJSON::BindObject(artw, &artwork, bindartw); program->artwork.push_back(artwork); @@ -855,29 +865,89 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return ret; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) + { + DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); + return ret; + } + DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); + + const MythJSON::Node& prog = root.GetObjectValue("Program"); + ProgramPtr program(new Program()); // Using default constructor + // Bind the new program + MythJSON::BindObject(prog, program.get(), bindprog); + // Bind channel of program + const MythJSON::Node& chan = prog.GetObjectValue("Channel"); + MythJSON::BindObject(chan, &(program->channel), bindchan); + // Bind recording of program + const MythJSON::Node& reco = prog.GetObjectValue("Recording"); + MythJSON::BindObject(reco, &(program->recording), bindreco); + // Bind artwork list of program + const MythJSON::Node& arts = prog.GetObjectValue("Artwork").GetObjectValue("ArtworkInfos"); + size_t as = arts.Size(); + for (size_t pa = 0; pa < as; ++pa) + { + const MythJSON::Node& artw = arts.GetArrayElement(pa); + Artwork artwork = Artwork(); // Using default constructor + MythJSON::BindObject(artw, &artwork, bindartw); + program->artwork.push_back(artwork); + } + // Return valid program + if (program->recording.startTs != INVALID_TIME) + ret = program; + return ret; +} + +ProgramPtr WSAPI::GetRecorded6_0(uint32_t recordedid) +{ + ProgramPtr ret; + char buf[32]; + unsigned proto = (unsigned)m_version.protocol; + + // Get bindings for protocol version + const bindings_t *bindprog = MythDTO::getProgramBindArray(proto); + const bindings_t *bindchan = MythDTO::getChannelBindArray(proto); + const bindings_t *bindreco = MythDTO::getRecordingBindArray(proto); + const bindings_t *bindartw = MythDTO::getArtworkBindArray(proto); + + WSRequest req = WSRequest(m_server, m_port); + req.RequestAccept(CT_JSON); + req.RequestService("/Dvr/GetRecorded"); + uint32str(recordedid, buf); + req.SetContentParam("RecordedId", buf); + WSResponse resp(req); + if (!resp.IsSuccessful()) + { + DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); + return ret; + } + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return ret; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *prog = json_object_get(root.get(), "Program"); + const MythJSON::Node& prog = root.GetObjectValue("Program"); ProgramPtr program(new Program()); // Using default constructor // Bind the new program MythJSON::BindObject(prog, program.get(), bindprog); // Bind channel of program - const json_t *chan = json_object_get(prog, "Channel"); + const MythJSON::Node& chan = prog.GetObjectValue("Channel"); MythJSON::BindObject(chan, &(program->channel), bindchan); // Bind recording of program - const json_t *reco = json_object_get(prog, "Recording"); + const MythJSON::Node& reco = prog.GetObjectValue("Recording"); MythJSON::BindObject(reco, &(program->recording), bindreco); // Bind artwork list of program - const json_t *arts = json_object_get(json_object_get(prog, "Artwork"), "ArtworkInfos"); - for (size_t pa = 0; pa < json_array_size(arts); ++pa) + const MythJSON::Node& arts = prog.GetObjectValue("Artwork").GetObjectValue("ArtworkInfos"); + size_t as = arts.Size(); + for (size_t pa = 0; pa < as; ++pa) { - const json_t *artw = json_array_get(arts, pa); + const MythJSON::Node& artw = arts.GetArrayElement(pa); Artwork artwork = Artwork(); // Using default constructor MythJSON::BindObject(artw, &artwork, bindartw); program->artwork.push_back(artwork); @@ -908,16 +978,50 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) + { + DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); + return false; + } + DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); + + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) + return false; + return true; +} + +bool WSAPI::DeleteRecording6_0(uint32_t recordedid, bool forceDelete, bool allowRerecord) +{ + char buf[32]; + + // Initialize request header + WSRequest req = WSRequest(m_server, m_port); + req.RequestAccept(CT_JSON); + req.RequestService("/Dvr/DeleteRecording", HRM_POST); + uint32str(recordedid, buf); + req.SetContentParam("RecordedId", buf); + req.SetContentParam("ForceDelete", BOOLSTR(forceDelete)); + req.SetContentParam("AllowRerecord", BOOLSTR(allowRerecord)); + WSResponse resp(req); + if (!resp.IsSuccessful()) + { + DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); + return false; + } + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "bool"); - if (!field || strcmp(json_string_value(field), "true")) + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) return false; return true; } @@ -940,16 +1044,48 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) + { + DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); + return false; + } + DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); + + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) + return false; + return true; +} + +bool WSAPI::UnDeleteRecording6_0(uint32_t recordedid) +{ + char buf[32]; + + // Initialize request header + WSRequest req = WSRequest(m_server, m_port); + req.RequestAccept(CT_JSON); + req.RequestService("/Dvr/UnDeleteRecording", HRM_POST); + uint32str(recordedid, buf); + req.SetContentParam("RecordedId", buf); + WSResponse resp(req); + if (!resp.IsSuccessful()) + { + DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); + return false; + } + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "bool"); - if (!field || strcmp(json_string_value(field), "true")) + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) return false; return true; } @@ -973,16 +1109,49 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "bool"); - if (!field || strcmp(json_string_value(field), "true")) + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) + return false; + return true; +} + +bool WSAPI::UpdateRecordedWatchedStatus6_0(uint32_t recordedid, bool watched) +{ + char buf[32]; + + // Initialize request header + WSRequest req = WSRequest(m_server, m_port); + req.RequestAccept(CT_JSON); + req.RequestService("/Dvr/UpdateRecordedWatchedStatus", HRM_POST); + uint32str(recordedid, buf); + req.SetContentParam("RecordedId", buf); + req.SetContentParam("Watched", BOOLSTR(watched)); + WSResponse resp(req); + if (!resp.IsSuccessful()) + { + DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); + return false; + } + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) + { + DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); + return false; + } + DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); + + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) return false; return true; } @@ -1000,7 +1169,7 @@ { RecordScheduleListPtr ret(new RecordScheduleList); char buf[32]; - int32_t req_index = 0, req_count = 100, count = 0; + int32_t req_index = 0, req_count = FETCHSIZE, count = 0; unsigned proto = (unsigned)m_version.protocol; // Get bindings for protocol version @@ -1027,8 +1196,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); break; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); break; @@ -1036,9 +1206,9 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: RecRuleList - const json_t *clist = json_object_get(root.get(), "RecRuleList"); + const MythJSON::Node& rlist = root.GetObjectValue("RecRuleList"); ItemList list = ItemList(); // Using default constructor - MythJSON::BindObject(clist, &list, bindlist); + MythJSON::BindObject(rlist, &list, bindlist); // List has ProtoVer. Check it or sound alarm if (list.protoVer != proto) { @@ -1047,12 +1217,13 @@ } count = 0; // Object: RecRules[] - const json_t *recs = json_object_get(clist, "RecRules"); + const MythJSON::Node& recs = rlist.GetObjectValue("RecRules"); // Iterates over the sequence elements. - for (size_t ci = 0; ci < json_array_size(recs); ++ci) + size_t rs = recs.Size(); + for (size_t ri = 0; ri < rs; ++ri) { ++count; - const json_t *rec = json_array_get(recs, ci); + const MythJSON::Node& rec = recs.GetArrayElement(ri); RecordSchedulePtr record(new RecordSchedule()); // Using default constructor // Bind the new record MythJSON::BindObject(rec, record.get(), bindrec); @@ -1087,15 +1258,16 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return ret; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return ret; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *rec = json_object_get(root.get(), "RecRule"); + const MythJSON::Node& rec = root.GetObjectValue("RecRule"); RecordSchedulePtr record(new RecordSchedule()); // Using default constructor // Bind the new record MythJSON::BindObject(rec, record.get(), bindrec); @@ -1196,16 +1368,17 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "int"); - if (!field || str2uint32(json_string_value(field), &recordid)) + const MythJSON::Node& field = root.GetObjectValue("int"); + if (!field.IsString() || str2uint32(field.GetStringValue().c_str(), &recordid)) return false; record.recordId = recordid; return true; @@ -1286,16 +1459,17 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "uint"); - if (!field || str2uint32(json_string_value(field), &recordid)) + const MythJSON::Node& field = root.GetObjectValue("uint"); + if (!field.IsString() || str2uint32(field.GetStringValue().c_str(), &recordid)) return false; record.recordId = recordid; return true; @@ -1377,16 +1551,17 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "bool"); - if (!field || strcmp(json_string_value(field), "true")) + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) return false; return true; } @@ -1409,16 +1584,17 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "bool"); - if (!field || strcmp(json_string_value(field), "true")) + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) return false; return true; } @@ -1441,16 +1617,17 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "bool"); - if (!field || strcmp(json_string_value(field), "true")) + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) return false; return true; } @@ -1473,16 +1650,17 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return false; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return false; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *field = json_object_get(root.get(), "bool"); - if (!field || strcmp(json_string_value(field), "true")) + const MythJSON::Node& field = root.GetObjectValue("bool"); + if (!field.IsString() || strcmp(field.GetStringValue().c_str(), "true")) return false; return true; } @@ -1505,7 +1683,7 @@ { ProgramListPtr ret(new ProgramList); char buf[32]; - int32_t req_index = 0, req_count = 100, count = 0; + int32_t req_index = 0, req_count = FETCHSIZE, count = 0; unsigned proto = (unsigned)m_version.protocol; // Get bindings for protocol version @@ -1535,8 +1713,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); break; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); break; @@ -1544,7 +1723,7 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: ProgramList - const json_t *plist = json_object_get(root.get(), "ProgramList"); + const MythJSON::Node& plist = root.GetObjectValue("ProgramList"); ItemList list = ItemList(); // Using default constructor MythJSON::BindObject(plist, &list, bindlist); // List has ProtoVer. Check it or sound alarm @@ -1555,20 +1734,21 @@ } count = 0; // Object: Programs[] - const json_t *progs = json_object_get(plist, "Programs"); + const MythJSON::Node& progs = plist.GetObjectValue("Programs"); // Iterates over the sequence elements. - for (size_t pi = 0; pi < json_array_size(progs); ++pi) + size_t ps = progs.Size(); + for (size_t pi = 0; pi < ps; ++pi) { ++count; - const json_t *prog = json_array_get(progs, pi); + const MythJSON::Node& prog = progs.GetArrayElement(pi); ProgramPtr program(new Program()); // Using default constructor // Bind the new program MythJSON::BindObject(prog, program.get(), bindprog); // Bind channel of program - const json_t *chan = json_object_get(prog, "Channel"); + const MythJSON::Node& chan = prog.GetObjectValue("Channel"); MythJSON::BindObject(chan, &(program->channel), bindchan); // Bind recording of program - const json_t *reco = json_object_get(prog, "Recording"); + const MythJSON::Node& reco = prog.GetObjectValue("Recording"); MythJSON::BindObject(reco, &(program->recording), bindreco); ret->push_back(program); } @@ -1584,7 +1764,7 @@ { ProgramListPtr ret(new ProgramList); char buf[32]; - int32_t req_index = 0, req_count = 100, count = 0; + int32_t req_index = 0, req_count = FETCHSIZE, count = 0; unsigned proto = (unsigned)m_version.protocol; // Get bindings for protocol version @@ -1613,8 +1793,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); break; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); break; @@ -1622,7 +1803,7 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: ProgramList - const json_t *plist = json_object_get(root.get(), "ProgramList"); + const MythJSON::Node& plist = root.GetObjectValue("ProgramList"); ItemList list = ItemList(); // Using default constructor MythJSON::BindObject(plist, &list, bindlist); // List has ProtoVer. Check it or sound alarm @@ -1633,20 +1814,21 @@ } count = 0; // Object: Programs[] - const json_t *progs = json_object_get(plist, "Programs"); + const MythJSON::Node& progs = plist.GetObjectValue("Programs"); // Iterates over the sequence elements. - for (size_t pi = 0; pi < json_array_size(progs); ++pi) + size_t ps = progs.Size(); + for (size_t pi = 0; pi < ps; ++pi) { ++count; - const json_t *prog = json_array_get(progs, pi); + const MythJSON::Node& prog = progs.GetArrayElement(pi); ProgramPtr program(new Program()); // Using default constructor // Bind the new program MythJSON::BindObject(prog, program.get(), bindprog); // Bind channel of program - const json_t *chan = json_object_get(prog, "Channel"); + const MythJSON::Node& chan = prog.GetObjectValue("Channel"); MythJSON::BindObject(chan, &(program->channel), bindchan); // Bind recording of program - const json_t *reco = json_object_get(prog, "Recording"); + const MythJSON::Node& reco = prog.GetObjectValue("Recording"); MythJSON::BindObject(reco, &(program->recording), bindreco); ret->push_back(program); } @@ -1662,7 +1844,7 @@ { ProgramListPtr ret(new ProgramList); char buf[32]; - int32_t req_index = 0, req_count = 100, count = 0; + int32_t req_index = 0, req_count = FETCHSIZE, count = 0; unsigned proto = (unsigned)m_version.protocol; // Get bindings for protocol version @@ -1691,8 +1873,9 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); break; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); break; @@ -1700,7 +1883,7 @@ DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); // Object: ProgramList - const json_t *plist = json_object_get(root.get(), "ProgramList"); + const MythJSON::Node& plist = root.GetObjectValue("ProgramList"); ItemList list = ItemList(); // Using default constructor MythJSON::BindObject(plist, &list, bindlist); // List has ProtoVer. Check it or sound alarm @@ -1711,20 +1894,21 @@ } count = 0; // Object: Programs[] - const json_t *progs = json_object_get(plist, "Programs"); + const MythJSON::Node& progs = plist.GetObjectValue("Programs"); // Iterates over the sequence elements. - for (size_t pi = 0; pi < json_array_size(progs); ++pi) + size_t ps = progs.Size(); + for (size_t pi = 0; pi < ps; ++pi) { ++count; - const json_t *prog = json_array_get(progs, pi); + const MythJSON::Node& prog = progs.GetArrayElement(pi); ProgramPtr program(new Program()); // Using default constructor // Bind the new program MythJSON::BindObject(prog, program.get(), bindprog); // Bind channel of program - const json_t *chan = json_object_get(prog, "Channel"); + const MythJSON::Node& chan = prog.GetObjectValue("Channel"); MythJSON::BindObject(chan, &(program->channel), bindchan); // Bind recording of program - const json_t *reco = json_object_get(prog, "Recording"); + const MythJSON::Node& reco = prog.GetObjectValue("Recording"); MythJSON::BindObject(reco, &(program->recording), bindreco); ret->push_back(program); } @@ -1879,20 +2063,22 @@ DBG(MYTH_DBG_ERROR, "%s: invalid response\n", __FUNCTION__); return ret; } - JanssonPtr root = MythJSON::ParseResponseJSON(resp); - if (!root.isValid() || !json_is_object(root.get())) + const MythJSON::Document json(resp); + const MythJSON::Node& root = json.GetRoot(); + if (!json.IsValid() || !root.IsObject()) { DBG(MYTH_DBG_ERROR, "%s: unexpected content\n", __FUNCTION__); return ret; } DBG(MYTH_DBG_DEBUG, "%s: content parsed\n", __FUNCTION__); - const json_t *list = json_object_get(root.get(), "ArtworkInfoList"); + const MythJSON::Node& list = root.GetObjectValue("ArtworkInfoList"); // Bind artwork list - const json_t *arts = json_object_get(list, "ArtworkInfos"); - for (size_t pa = 0; pa < json_array_size(arts); ++pa) + const MythJSON::Node& arts = list.GetObjectValue("ArtworkInfos"); + size_t as = arts.Size(); + for (size_t pa = 0; pa < as; ++pa) { - const json_t *artw = json_array_get(arts, pa); + const MythJSON::Node& artw = arts.GetArrayElement(pa); ArtworkPtr artwork(new Artwork()); // Using default constructor MythJSON::BindObject(artw, artwork.get(), bindartw); ret->push_back(artwork); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythwsapi.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythwsapi.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/mythwsapi.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/mythwsapi.h 2015-02-20 11:24:58.000000000 +0000 @@ -169,6 +169,16 @@ } /** + * @brief GET Dvr/GetRecorded + */ + ProgramPtr GetRecorded(uint32_t recordedid) + { + WSServiceVersion_t wsv = CheckService(WS_Dvr); + if (wsv.ranking >= 0x00060000) return GetRecorded6_0(recordedid); + return ProgramPtr(); + } + + /** * @brief POST Dvr/UpdateRecordedWatchedStatus */ bool UpdateRecordedWatchedStatus(uint32_t chanid, time_t recstartts, bool watched) @@ -179,6 +189,16 @@ } /** + * @brief POST Dvr/UpdateRecordedWatchedStatus + */ + bool UpdateRecordedWatchedStatus(uint32_t recordedid, bool watched) + { + WSServiceVersion_t wsv = CheckService(WS_Dvr); + if (wsv.ranking >= 0x00060000) return UpdateRecordedWatchedStatus6_0(recordedid, watched); + return false; + } + + /** * @brief POST Dvr/DeleteRecording */ bool DeleteRecording(uint32_t chanid, time_t recstartts, bool forceDelete = false, bool allowRerecord = false) @@ -189,6 +209,16 @@ } /** + * @brief POST Dvr/DeleteRecording + */ + bool DeleteRecording(uint32_t recordedid, bool forceDelete = false, bool allowRerecord = false) + { + WSServiceVersion_t wsv = CheckService(WS_Dvr); + if (wsv.ranking >= 0x00060000) return DeleteRecording6_0(recordedid, forceDelete, allowRerecord); + return false; + } + + /** * @brief POST Dvr/UnDeleteRecording */ bool UnDeleteRecording(uint32_t chanid, time_t recstartts) @@ -199,6 +229,16 @@ } /** + * @brief POST Dvr/UnDeleteRecording + */ + bool UnDeleteRecording(uint32_t recordedid) + { + WSServiceVersion_t wsv = CheckService(WS_Dvr); + if (wsv.ranking >= 0x00060000) return UnDeleteRecording6_0(recordedid); + return false; + } + + /** * @brief GET Dvr/GetRecordScheduleList */ RecordScheduleListPtr GetRecordScheduleList() @@ -384,9 +424,13 @@ ProgramListPtr GetRecordedList1_5(unsigned n, bool descending); ProgramPtr GetRecorded1_5(uint32_t chanid, time_t recstartts); + ProgramPtr GetRecorded6_0(uint32_t recordedid); bool DeleteRecording2_1(uint32_t chanid, time_t recstartts, bool forceDelete, bool allowRerecord); + bool DeleteRecording6_0(uint32_t recordedid, bool forceDelete, bool allowRerecord); bool UnDeleteRecording2_1(uint32_t chanid, time_t recstartts); + bool UnDeleteRecording6_0(uint32_t recordedid); bool UpdateRecordedWatchedStatus4_5(uint32_t chanid, time_t recstartts, bool watched); + bool UpdateRecordedWatchedStatus6_0(uint32_t recordedid, bool watched); RecordScheduleListPtr GetRecordScheduleList1_5(); RecordSchedulePtr GetRecordSchedule1_5(uint32_t recordid); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/janssonptr.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/janssonptr.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/janssonptr.h 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/janssonptr.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2014 Jean-Luc Barriere - * - * This Program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This Program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301 USA - * http://www.gnu.org/copyleft/gpl.html - * - */ - -#ifndef JANSSONPTR_H -#define JANSSONPTR_H - -#include "../atomic.h" - -#include -#include // for NULL - -class JanssonPtr -{ -public: - - JanssonPtr() : p(NULL), c(NULL) { } - - explicit JanssonPtr(json_t *s) : p(s), c(NULL) - { - if (p != NULL) - c = new atomic_t(1); - } - - JanssonPtr(const JanssonPtr& s) : p(s.p), c(s.c) - { - if (c != NULL) - atomic_increment(c); - } - - JanssonPtr& operator=(const JanssonPtr& s) - { - if (this != &s) - { - reset(); - p = s.p; - c = s.c; - if (c != NULL) - atomic_increment(c); - } - return *this; - } - - ~JanssonPtr() - { - reset(); - } - - bool isValid() - { - return p != NULL; - } - - void reset() - { - if (c != NULL) - { - if (*c == 1) - json_decref(p); - if (!atomic_decrement(c)) - delete c; - } - c = NULL; - p = NULL; - } - - void reset(json_t *s) - { - if (p != s) - { - reset(); - if (s != NULL) - { - p = s; - c = new atomic_t(1); - } - } - } - - json_t *get() const - { - return (c != NULL) ? p : NULL; - } - - unsigned use_count() const - { - return (unsigned) (c != NULL ? *c : 0); - } - - json_t *operator->() const - { - return get(); - } - - json_t& operator*() const - { - return *get(); - } - - operator bool() const - { - return p != NULL; - } - - bool operator!() const - { - return p == NULL; - } - -protected: - json_t *p; - atomic_t *c; -}; - -#endif /* JANSSONPTR_H */ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/mythjsonbinder.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/mythjsonbinder.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/mythjsonbinder.cpp 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/mythjsonbinder.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -28,9 +28,8 @@ #include #include -void MythJSON::BindObject(const json_t *json, void *obj, const bindings_t *bl) +void MythJSON::BindObject(const Node& node, void *obj, const bindings_t *bl) { - const char *value; int i, err; if (bl == NULL) @@ -38,84 +37,83 @@ for (i = 0; i < bl->attr_count; ++i) { - // jansson - json_t *field = json_object_get(json, bl->attr_bind[i].field); - if (field == NULL) + const Node& field = node.GetObjectValue(bl->attr_bind[i].field); + if (field.IsNull()) continue; - value = json_string_value(field); - if (value != NULL) + if (field.IsString()) { + std::string value(field.GetStringValue()); err = 0; switch (bl->attr_bind[i].type) { case IS_STRING: - bl->attr_bind[i].set(obj, value); + bl->attr_bind[i].set(obj, value.c_str()); break; case IS_INT8: { int8_t num = 0; - err = str2int8(value, &num); + err = str2int8(value.c_str(), &num); bl->attr_bind[i].set(obj, &num); break; } case IS_INT16: { int16_t num = 0; - err = str2int16(value, &num); + err = str2int16(value.c_str(), &num); bl->attr_bind[i].set(obj, &num); break; } case IS_INT32: { int32_t num = 0; - err = str2int32(value, &num); + err = str2int32(value.c_str(), &num); bl->attr_bind[i].set(obj, &num); break; } case IS_INT64: { int64_t num = 0; - err = str2int64(value, &num); + err = str2int64(value.c_str(), &num); bl->attr_bind[i].set(obj, &num); break; } case IS_UINT8: { uint8_t num = 0; - err = str2uint8(value, &num); + err = str2uint8(value.c_str(), &num); bl->attr_bind[i].set(obj, &num); break; } case IS_UINT16: { uint16_t num = 0; - err = str2uint16(value, &num); + err = str2uint16(value.c_str(), &num); bl->attr_bind[i].set(obj, &num); break; } case IS_UINT32: { uint32_t num = 0; - err = str2uint32(value, &num); + err = str2uint32(value.c_str(), &num); bl->attr_bind[i].set(obj, &num); break; } case IS_DOUBLE: { - double num = atof(value); + double num = atof(value.c_str()); bl->attr_bind[i].set(obj, &num); break; } case IS_BOOLEAN: { - bool b = (strcmp(value, "true") == 0 ? true : false); + bool b = (strcmp(value.c_str(), "true") == 0 ? true : false); bl->attr_bind[i].set(obj, &b); break; } case IS_TIME: { time_t time = 0; - err = str2time(value, &time); + err = str2time(value.c_str(), &time); bl->attr_bind[i].set(obj, &time); break; } @@ -123,9 +121,9 @@ break; } if (err) - Myth::DBG(MYTH_DBG_ERROR, "%s: failed (%d) field \"%s\" type %d: %s\n", __FUNCTION__, err, bl->attr_bind[i].field, bl->attr_bind[i].type, value); + Myth::DBG(MYTH_DBG_ERROR, "%s: failed (%d) field \"%s\" type %d: %s\n", __FUNCTION__, err, bl->attr_bind[i].field, bl->attr_bind[i].type, value.c_str()); } else - Myth::DBG(MYTH_DBG_WARN, "%s: no value for field \"%s\" type %d\n", __FUNCTION__, bl->attr_bind[i].field, bl->attr_bind[i].type); + Myth::DBG(MYTH_DBG_WARN, "%s: invalid value for field \"%s\" type %d\n", __FUNCTION__, bl->attr_bind[i].field, bl->attr_bind[i].type); } } diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/mythjsonbinder.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/mythjsonbinder.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/mythjsonbinder.h 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/mythjsonbinder.h 2015-02-20 11:24:58.000000000 +0000 @@ -23,12 +23,11 @@ #define MYTHJSONBINDER_H #include "mythdto/mythdto.h" - -#include +#include "mythjsonparser.h" namespace MythJSON { - void BindObject(const json_t *json, void *obj, const bindings_t *bl); + void BindObject(const Node& node, void *obj, const bindings_t *bl); } #endif /* MYTHJSONBINDER_H */ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/mythjsonparser.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/mythjsonparser.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/mythjsonparser.cpp 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/mythjsonparser.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -24,26 +24,182 @@ using namespace Myth; -JanssonPtr MythJSON::ParseResponseJSON(Myth::WSResponse& resp) +/////////////////////////////////////////////////////////////////////////////// +//// +//// Node +//// + +MythJSON::Node::Node() +: m_value(sajson::TYPE_NULL, 0, 0) +{ +} + +MythJSON::Node::Node(const sajson::value& value) +: m_value(value) +{ +} + +bool MythJSON::Node::IsNull() const +{ + return (m_value.get_type() == sajson::TYPE_NULL); +} + +bool MythJSON::Node::IsObject() const +{ + return (m_value.get_type() == sajson::TYPE_OBJECT); +} + +bool MythJSON::Node::IsArray() const +{ + return (m_value.get_type() == sajson::TYPE_ARRAY); +} + +bool MythJSON::Node::IsString() const +{ + return (m_value.get_type() == sajson::TYPE_STRING); +} + +bool MythJSON::Node::IsDouble() const +{ + return (m_value.get_type() == sajson::TYPE_DOUBLE); +} + +bool MythJSON::Node::IsInt() const +{ + return (m_value.get_type() == sajson::TYPE_INTEGER); +} + +bool MythJSON::Node::IsTrue() const +{ + return (m_value.get_type() == sajson::TYPE_TRUE); +} + +bool MythJSON::Node::IsFalse() const +{ + return (m_value.get_type() == sajson::TYPE_FALSE); +} + +std::string MythJSON::Node::GetStringValue() const +{ + if (m_value.get_type() == sajson::TYPE_STRING) + return m_value.as_string(); + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return std::string(); +} + +size_t MythJSON::Node::GetStringSize() const +{ + if (m_value.get_type() == sajson::TYPE_STRING) + return m_value.get_string_length(); + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return 0; +} + +double MythJSON::Node::GetDoubleValue() const +{ + if (m_value.get_type() == sajson::TYPE_DOUBLE) + return m_value.get_double_value(); + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return 0.0; +} + +int64_t MythJSON::Node::GetBigIntValue() const +{ + if (m_value.get_type() == sajson::TYPE_DOUBLE || m_value.get_type() == sajson::TYPE_INTEGER) + return (int64_t) m_value.get_number_value(); + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return 0; +} + +int32_t MythJSON::Node::GetIntValue() const +{ + if (m_value.get_type() == sajson::TYPE_INTEGER) + return (int32_t) m_value.get_integer_value(); + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return 0; +} + +size_t MythJSON::Node::Size() const +{ + if (m_value.get_type() == sajson::TYPE_ARRAY || m_value.get_type() == sajson::TYPE_OBJECT) + return m_value.get_length(); + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return 0; +} + +MythJSON::Node MythJSON::Node::GetArrayElement(size_t index) const +{ + if (m_value.get_type() == sajson::TYPE_ARRAY) + return Node(m_value.get_array_element(index)); + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return Node(); +} + +std::string MythJSON::Node::GetObjectKey(size_t index) const +{ + if (m_value.get_type() == sajson::TYPE_OBJECT) + return m_value.get_object_key(index).as_string(); + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return std::string(); +} + +MythJSON::Node MythJSON::Node::GetObjectValue(size_t index) const +{ + if (m_value.get_type() == sajson::TYPE_OBJECT) + return Node(m_value.get_object_value(index)); + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return Node(); +} + +MythJSON::Node MythJSON::Node::GetObjectValue(const char *key) const +{ + if (m_value.get_type() == sajson::TYPE_OBJECT) + { + size_t idx = m_value.find_object_key(sajson::literal(key)); + if (idx < m_value.get_length()) + return Node(m_value.get_object_value(idx)); + return Node(); + } + DBG(MYTH_DBG_ERROR, "%s: bad type (%d)\n", __FUNCTION__, (int) m_value.get_type()); + return Node(); +} + +/////////////////////////////////////////////////////////////////////////////// +//// +//// Document +//// + +MythJSON::Document::Document(Myth::WSResponse& resp) +: m_isValid(false) +, m_document(NULL) { // Read content response - JanssonPtr root; size_t r, content_length = resp.GetContentLength(); char *content = new char[content_length + 1]; if ((r = resp.ReadContent(content, content_length)) == content_length) { - json_error_t error; content[content_length] = '\0'; - DBG(MYTH_DBG_PROTO,"%s: %s\n", __FUNCTION__, content); + DBG(MYTH_DBG_PROTO, "%s: %s\n", __FUNCTION__, content); // Parse JSON content - root.reset(json_loads(content, 0, &error)); - if (!root.isValid()) - DBG(MYTH_DBG_ERROR, "%s: failed to parse: %d: %s\n", __FUNCTION__, error.line, error.text); + m_document = new sajson::document(sajson::parse(sajson::string(content, content_length))); + if (!m_document) + DBG(MYTH_DBG_ERROR, "%s: memory allocation failed\n", __FUNCTION__); + else if (!m_document->is_valid()) + DBG(MYTH_DBG_ERROR, "%s: failed to parse: %d: %s\n", __FUNCTION__, (int)m_document->get_error_line(), m_document->get_error_message().c_str()); + else + m_isValid = true; } else { DBG(MYTH_DBG_ERROR, "%s: read error\n", __FUNCTION__); } delete[] content; - return root; } + +MythJSON::Node MythJSON::Document::GetRoot() const +{ + if (m_document) + return Node(m_document->get_root()); + return Node(); +} + diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/mythjsonparser.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/mythjsonparser.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/mythjsonparser.h 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/mythjsonparser.h 2015-02-20 11:24:58.000000000 +0000 @@ -22,12 +22,67 @@ #ifndef MYTHJSONPARSER_H #define MYTHJSONPARSER_H -#include "janssonptr.h" #include "mythwsresponse.h" +#include "sajson.h" +#include "platform/os.h" +#include "platform/util/util.h" + +#include namespace MythJSON { - JanssonPtr ParseResponseJSON(Myth::WSResponse& resp); + class Node + { + public: + Node(); + Node(const sajson::value& value); + ~Node() { } + + bool IsNull() const; + bool IsObject() const; + bool IsArray() const; + bool IsString() const; + bool IsDouble() const; + bool IsInt() const; + bool IsTrue() const; + bool IsFalse() const; + + std::string GetStringValue() const; + size_t GetStringSize() const; + double GetDoubleValue() const; + int64_t GetBigIntValue() const; + int32_t GetIntValue() const; + + size_t Size() const; + Node GetArrayElement(size_t index) const; + std::string GetObjectKey(size_t index) const; + Node GetObjectValue(size_t index) const; + Node GetObjectValue(const char *key) const; + + private: + sajson::value m_value; + }; + + class Document + { + public: + Document(Myth::WSResponse& resp); + ~Document() + { + SAFE_DELETE(m_document); + } + + bool IsValid() const + { + return m_isValid; + } + + Node GetRoot() const; + + private: + bool m_isValid; + sajson::document *m_document; + }; } #endif /* MYTHJSONPARSER_H */ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/platform/posix/os-threads.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/platform/posix/os-threads.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/platform/posix/os-threads.h 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/platform/posix/os-threads.h 2015-02-20 11:24:58.000000000 +0000 @@ -32,12 +32,6 @@ * http://www.pulse-eight.net/ */ -#if defined(TARGET_DARWIN) -# ifndef PTHREAD_MUTEX_RECURSIVE_NP -# define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE -# endif -#endif - namespace PLATFORM { inline pthread_mutexattr_t *GetRecursiveMutexAttribute(void) @@ -72,7 +66,20 @@ typedef pthread_t thread_t; - #define ThreadsCreate(thread, func, arg) (pthread_create(&thread, NULL, (void *(*) (void *))func, (void *)arg) == 0) + inline pthread_attr_t *GetDetachedThreadAttribute(void) + { + static pthread_attr_t g_threadAttr; + static bool bAttributeInitialised = false; + if (!bAttributeInitialised) + { + pthread_attr_init(&g_threadAttr); + pthread_attr_setdetachstate(&g_threadAttr, PTHREAD_CREATE_DETACHED); + bAttributeInitialised = true; + } + return &g_threadAttr; + } + + #define ThreadsCreate(thread, func, arg) (pthread_create(&thread, GetDetachedThreadAttribute(), (void *(*) (void *))func, (void *)arg) == 0) #define ThreadsWait(thread, retval) (pthread_join(thread, retval) == 0) typedef pthread_mutex_t mutex_t; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/platform/posix/os-types.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/platform/posix/os-types.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/platform/posix/os-types.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/platform/posix/os-types.h 2015-02-20 11:24:58.000000000 +0000 @@ -80,10 +80,10 @@ #define E_OUTOFMEMORY 0x8007000EL #define E_FAIL 0x8004005EL -#ifdef TARGET_LINUX +#if defined(__linux__) #include #define MAX_PATH PATH_MAX -#elif defined TARGET_DARWIN || defined __FreeBSD__ +#elif defined(__APPLE__) || defined(__FreeBSD__) #include #define MAX_PATH PATH_MAX #else @@ -129,27 +129,34 @@ #define PATH_SEPARATOR_STRING "/" #endif -#ifdef TARGET_LINUX -// Retrieve the number of milliseconds that have elapsed since the system was started +/* This is a replacement of the Windows GetTickCount() function which retrieve + * the number of milliseconds that have elapsed since the system was started + */ +#define GetTickCount __GetTickCount +#if defined(__APPLE__) +#include +#include +__inline__ unsigned long GetTickCount(void) +{ + int64_t ticks = 0; + static mach_timebase_info_data_t timebase; + /* Get the timebase if this is the first time we run. */ + if (timebase.denom == 0) + (void)mach_timebase_info(&timebase); + /* Use timebase to convert absolute time tick units into nanoseconds. */ + ticks = mach_absolute_time() * timebase.numer / timebase.denom; + return (unsigned long)(ticks / 1000000); +} +#else #include -inline unsigned long GetTickCount(void) +__inline__ unsigned long GetTickCount(void) { struct timespec ts; if(clock_gettime(CLOCK_MONOTONIC, &ts) != 0) - { return 0; - } return (unsigned long)( (ts.tv_sec * 1000) + (ts.tv_nsec / 1000000) ); }; -#else -#include -inline unsigned long GetTickCount(void) -{ - struct timeval tv; - gettimeofday(&tv, NULL); - return (unsigned long)( (tv.tv_sec * 1000) + (tv.tv_usec / 1000) ); -}; -#endif /* TARGET_LINUX || TARGET_DARWIN */ +#endif /* Handling of 2-byte Windows wchar strings on non-Windows targets */ typedef uint16_t Wchar_t; /* sizeof(wchar_t) = 4 bytes on Linux */ @@ -158,7 +165,8 @@ * wchar_t is a 2-byte character. * It is used for processing Windows wchar strings */ -inline size_t WcsLen(const Wchar_t *str) +#define WcsLen __WcsLen +__inline__ size_t WcsLen(const Wchar_t *str) { const unsigned short *eos = (const unsigned short*)str; while( *eos++ ) ; @@ -169,7 +177,8 @@ * wchar_t is a 2-byte character. * It is used for processing Windows wchar strings */ -inline size_t WcsToMbs(char *s, const Wchar_t *w, size_t n) +#define WcsToMbs __WcsToMbs +__inline__ size_t WcsToMbs(char *s, const Wchar_t *w, size_t n) { size_t i = 0; const unsigned short *wc = (const unsigned short*) w; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/platform/util/timeutils.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/platform/util/timeutils.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/platform/util/timeutils.h 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/platform/util/timeutils.h 2015-02-20 11:24:58.000000000 +0000 @@ -45,48 +45,15 @@ namespace PLATFORM { - #if defined(__WINDOWS__) - struct timezone - { - int tz_minuteswest; - int tz_dsttime; - }; - - #define usleep(t) Sleep((DWORD)(t)/1000) - #define sleep(t) Sleep((DWORD)(t)*1000) - - inline int gettimeofday(struct timeval *pcur_time, struct timezone *tz) - { - if (pcur_time == NULL) - { - SetLastError(EFAULT); - return -1; - } - struct _timeb current; - - _ftime(¤t); - - pcur_time->tv_sec = (long) current.time; - pcur_time->tv_usec = current.millitm * 1000L; - if (tz) - { - tz->tz_minuteswest = current.timezone; /* minutes west of Greenwich */ - tz->tz_dsttime = current.dstflag; /* type of dst correction */ - } - return 0; - } - #endif - inline int64_t GetTimeMs() { #if defined(__APPLE__) + // Recommended by Apple's QA1398. int64_t ticks = 0; static mach_timebase_info_data_t timebase; - if (timebase.denom == 0) { - // Get the timebase if this is the first time we run. - // Recommended by Apple's QA1398. + // Get the timebase if this is the first time we run. + if (timebase.denom == 0) (void)mach_timebase_info(&timebase); - } // Use timebase to convert absolute time tick units into nanoseconds. ticks = mach_absolute_time() * timebase.numer / timebase.denom; return ticks / 1000000; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/platform/windows/os-types.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/platform/windows/os-types.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/platform/windows/os-types.h 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/platform/windows/os-types.h 2015-02-20 11:24:58.000000000 +0000 @@ -92,6 +92,35 @@ #define _SSIZE_T_DEFINED #endif +#define usleep(t) Sleep((DWORD)(t)/1000) +#define sleep(t) Sleep((DWORD)(t)*1000) + +struct timezone +{ + int tz_minuteswest; + int tz_dsttime; +}; + +#define gettimeofday __gettimeofday +__inline int gettimeofday(struct timeval *pcur_time, struct timezone *tz) +{ + if (pcur_time == NULL) + { + SetLastError(EFAULT); + return -1; + } + struct _timeb current; + _ftime(¤t); + pcur_time->tv_sec = (long) current.time; + pcur_time->tv_usec = current.millitm * 1000L; + if (tz) + { + tz->tz_minuteswest = current.timezone; /* minutes west of Greenwich */ + tz->tz_dsttime = current.dstflag; /* type of dst correction */ + } + return 0; +} + /* Prevent deprecation warnings */ #define snprintf _snprintf #define strnicmp _strnicmp diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/sajson.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/sajson.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/private/sajson.h 1970-01-01 00:00:00.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/private/sajson.h 2015-02-20 11:24:58.000000000 +0000 @@ -0,0 +1,1132 @@ +/* + * Copyright (c) 2012, 2013, 2014 Chad Austin + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // for error messages. kill someday? + +#if defined(__GNUC__) || defined(__clang__) +#define SAJSON_LIKELY(x) __builtin_expect(!!(x), 1) +#define SAJSON_UNLIKELY(x) __builtin_expect(!!(x), 0) +#else +#define SAJSON_LIKELY(x) x +#define SAJSON_UNLIKELY(x) x +#endif + +namespace sajson { + enum type { + TYPE_INTEGER = 0, + TYPE_DOUBLE = 1, + TYPE_NULL = 2, + TYPE_FALSE = 3, + TYPE_TRUE = 4, + TYPE_STRING = 5, + TYPE_ARRAY = 6, + TYPE_OBJECT = 7, + }; + + inline std::ostream& operator<<(std::ostream& os, type t) { + switch (t) { + case TYPE_INTEGER: return os << ""; + case TYPE_DOUBLE: return os << ""; + case TYPE_NULL: return os << ""; + case TYPE_FALSE: return os << ""; + case TYPE_TRUE: return os << ""; + case TYPE_STRING: return os << ""; + case TYPE_ARRAY: return os << ""; + case TYPE_OBJECT: return os << ""; + default: return os << "> TYPE_BITS; + + static const size_t ROOT_MARKER = size_t(-1) & VALUE_MASK; + + inline type get_element_type(size_t s) { + return static_cast((s >> TYPE_SHIFT) & TYPE_MASK); + } + + inline size_t get_element_value(size_t s) { + return s & VALUE_MASK; + } + + inline size_t make_element(type t, size_t value) { + //assert(value & VALUE_MASK == 0); + //value &= VALUE_MASK; + return value | (static_cast(t) << TYPE_SHIFT); + } + + class string { + public: + string(const char* text, size_t length) + : text(text) + , _length(length) + {} + + const char* data() const { + return text; + } + + size_t length() const { + return _length; + } + + std::string as_string() const { + return std::string(text, text + _length); + } + + private: + const char* const text; + const size_t _length; + + string(); /*=delete*/ + }; + + class literal : public string { + public: + explicit literal(const char* text) + : string(text, strlen(text)) + {} + }; + + struct object_key_record + { + size_t key_start; + size_t key_end; + size_t value; + }; + + struct object_key_comparator + { + object_key_comparator(const char* object_data) + : data(object_data) + { + } + + bool operator()(const object_key_record& lhs, const string& rhs) const { + const size_t lhs_length = lhs.key_end - lhs.key_start; + const size_t rhs_length = rhs.length(); + if (lhs_length < rhs_length) { + return true; + } else if (lhs_length > rhs_length) { + return false; + } + return memcmp(data + lhs.key_start, rhs.data(), lhs_length) < 0; + } + + bool operator()(const string& lhs, const object_key_record& rhs) const { + return !(*this)(rhs, lhs); + } + + bool operator()(const object_key_record& lhs, const + object_key_record& rhs) + { + const size_t lhs_length = lhs.key_end - lhs.key_start; + const size_t rhs_length = rhs.key_end - rhs.key_start; + if (lhs_length < rhs_length) { + return true; + } else if (lhs_length > rhs_length) { + return false; + } + return memcmp(data + lhs.key_start, data + rhs.key_start, + lhs_length) < 0; + } + + const char* data; + }; + + class refcount { + public: + refcount() + : pn(new size_t(1)) + {} + + refcount(const refcount& rc) + : pn(rc.pn) + { + ++*pn; + } + + ~refcount() { + if (--*pn == 0) { + delete pn; + } + } + + size_t count() const { + return *pn; + } + + private: + size_t* pn; + + refcount& operator=(const refcount&); + }; + + class mutable_string_view { + public: + mutable_string_view() + : length(0) + , data(0) + {} + + mutable_string_view(const literal& s) + : length(s.length()) + { + data = new char[length]; + memcpy(data, s.data(), length); + } + + mutable_string_view(const string& s) + : length(s.length()) + { + data = new char[length]; + memcpy(data, s.data(), length); + } + + ~mutable_string_view() { + if (uses.count() == 1) { + delete[] data; + } + } + + size_t get_length() const { + return length; + } + + char* get_data() const { + return data; + } + + private: + refcount uses; + size_t length; + char* data; + }; + + union integer_storage { + int i; + size_t u; + }; + // TODO: reinstate with c++03 implementation + //static_assert(sizeof(integer_storage) == sizeof(size_t), "integer_storage must have same size as one structure slot"); + + union double_storage { + enum { + word_length = sizeof(double) / sizeof(size_t) + }; + +#if defined(_M_IX86) || defined(__i386__) || defined(_X86_) + static double load(const size_t* location) { + return *reinterpret_cast(location); + } + static void store(size_t* location, double value) { + *reinterpret_cast(location) = value; + } +#else + static double load(const size_t* location) { + double_storage s; + for (unsigned i = 0; i < double_storage::word_length; ++i) { + s.u[i] = location[i]; + } + return s.d; + } + + static void store(size_t* location, double value) { + double_storage ns; + ns.d = value; + + for (int i = 0; i < ns.word_length; ++i) { + location[i] = ns.u[i]; + } + } + + double d; + size_t u[word_length]; +#endif + }; + // TODO: reinstate with c++03 implementation + //static_assert(sizeof(double_storage) == sizeof(double), "double_storage should have same size as double"); + + class value { + public: + explicit value(type value_type, const size_t* payload, const char* text) + : value_type(value_type) + , payload(payload) + , text(text) + {} + + type get_type() const { + return value_type; + } + + // valid iff get_type() is TYPE_ARRAY or TYPE_OBJECT + size_t get_length() const { + assert_type_2(TYPE_ARRAY, TYPE_OBJECT); + return payload[0]; + } + + // valid iff get_type() is TYPE_ARRAY + value get_array_element(size_t index) const { + assert_type(TYPE_ARRAY); + size_t element = payload[1 + index]; + return value(get_element_type(element), payload + get_element_value(element), text); + } + + // valid iff get_type() is TYPE_OBJECT + string get_object_key(size_t index) const { + assert_type(TYPE_OBJECT); + const size_t* s = payload + 1 + index * 3; + return string(text + s[0], s[1] - s[0]); + } + + // valid iff get_type() is TYPE_OBJECT + value get_object_value(size_t index) const { + assert_type(TYPE_OBJECT); + size_t element = payload[3 + index * 3]; + return value(get_element_type(element), payload + get_element_value(element), text); + } + + + // valid iff get_type() is TYPE_OBJECT + // return get_length() if there is no such key + size_t find_object_key(const string& key) const { + assert_type(TYPE_OBJECT); + const object_key_record* start = reinterpret_cast(payload + 1); + const object_key_record* end = start + get_length(); + const object_key_record* i = std::lower_bound(start, end, key, object_key_comparator(text)); + return (i != end + && (i->key_end - i->key_start) == key.length() + && memcmp(key.data(), text + i->key_start, key.length()) == 0)? i - start : get_length(); + } + + // valid iff get_type() is TYPE_INTEGER + int get_integer_value() const { + assert_type(TYPE_INTEGER); + integer_storage s; + s.u = payload[0]; + return s.i; + } + + // valid iff get_type() is TYPE_DOUBLE + double get_double_value() const { + assert_type(TYPE_DOUBLE); + return double_storage::load(payload); + } + + // valid iff get_type() is TYPE_INTEGER or TYPE_DOUBLE + double get_number_value() const { + assert_type_2(TYPE_INTEGER, TYPE_DOUBLE); + if (get_type() == TYPE_INTEGER) { + return get_integer_value(); + } else { + return get_double_value(); + } + } + + // valid iff get_type() is TYPE_STRING + size_t get_string_length() const { + assert_type(TYPE_STRING); + return payload[1] - payload[0]; + } + + // valid iff get_type() is TYPE_STRING + std::string as_string() const { + assert_type(TYPE_STRING); + return std::string(text + payload[0], text + payload[1]); + } + + private: + void assert_type(type expected) const { + assert(expected == get_type()); + } + + void assert_type_2(type e1, type e2) const { + assert(e1 == get_type() || e2 == get_type()); + } + + const type value_type; + const size_t* const payload; + const char* const text; + + }; + + class document { + public: + explicit document(mutable_string_view& input, const size_t* structure, type root_type, const size_t* root, size_t error_line, size_t error_column, const std::string& error_message) + : input(input) + , structure(structure) + , root_type(root_type) + , root(root) + , error_line(error_line) + , error_column(error_column) + , error_message(error_message) + {} + + document(const document& rhs) + : uses(rhs.uses) + , input(rhs.input) + , structure(rhs.structure) + , root_type(rhs.root_type) + , root(rhs.root) + , error_line(rhs.error_line) + , error_column(rhs.error_column) + , error_message(rhs.error_message) + {} + + ~document() { + if (uses.count() == 1) { + delete[] structure; + } + } + + bool is_valid() const { + return !!structure; + } + + value get_root() const { + return value(root_type, root, input.get_data()); + } + + size_t get_error_line() const { + return error_line; + } + + size_t get_error_column() const { + return error_column; + } + + std::string get_error_message() const { + return error_message; + } + + private: + refcount uses; + mutable_string_view input; + const size_t* structure; + const type root_type; + const size_t* const root; + const size_t error_line; + const size_t error_column; + const std::string error_message; + + document& operator=(const document&); + }; + + class parser { + public: + parser(const mutable_string_view& msv, size_t* structure) + : input(msv) + , input_end(input.get_data() + input.get_length()) + , structure(structure) + , p(input.get_data()) + , temp(structure) + , root_type(TYPE_NULL) + , out(structure + input.get_length()) + , error_line(0) + , error_column(0) + {} + + document get_document() { + if (parse()) { + return document(input, structure, root_type, out, 0, 0, std::string()); + } else { + delete[] structure; + return document(input, 0, TYPE_NULL, 0, error_line, error_column, error_message); + } + } + + private: + struct error_result { + operator bool() const { + return false; + } + }; + + struct parse_result { + parse_result(error_result) + : success(false) + , value_type(TYPE_NULL) + {} + + parse_result(type t) + : success(true) + , value_type(t) + {} + + bool operator!() const { + return !success; + } + + bool success; + type value_type; + }; + + bool at_eof() { + return p == input_end; + } + + char peek_structure() { + for (;;) { + if (p == input_end) { + // 0 is never legal as a structural character in json text so treat it as eof + return 0; + } + switch (*p) { + case 0x20: + case 0x09: + case 0x0A: + case 0x0D: + ++p; + continue; + default: + return *p; + } + } + } + + error_result error(const char* message) { + error_line = 1; + error_column = 1; + error_message = message; + return error_result(); + } + + bool parse() { + char c = peek_structure(); + if (c == 0) { + return error("no root element"); + } + + type current_structure_type; + if (c == '[') { + current_structure_type = TYPE_ARRAY; + } else if (c == '{') { + current_structure_type = TYPE_OBJECT; + } else { + return error("document root must be object or array"); + } + ++p; + + size_t* current_base = temp; + *temp++ = make_element(current_structure_type, ROOT_MARKER); + + parse_result result = error_result(); + + for (;;) { + char closing_bracket = (current_structure_type == TYPE_OBJECT ? '}' : ']'); + + c = peek_structure(); + if (temp > current_base + 1) { + if (c != closing_bracket) { + if (c == ',') { + ++p; + c = peek_structure(); + } else { + return error("expected ,"); + } + } + } + + if (current_structure_type == TYPE_OBJECT && c != '}') { + if (c != '"') { + return error("object key must be quoted"); + } + result = parse_string(temp); + if (peek_structure() != ':') { + return error("expected :"); + } + ++p; + temp += 2; + } + + switch (peek_structure()) { + type next_type; + parse_result (parser::*structure_installer)(size_t* base); + + case 0: + return error("unexpected end of input"); + case 'n': + result = parse_null(); + break; + case 'f': + result = parse_false(); + break; + case 't': + result = parse_true(); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '-': + result = parse_number(); + break; + case '"': + result = parse_string(); + break; + + case '[': + next_type = TYPE_ARRAY; + goto push; + case '{': + next_type = TYPE_OBJECT; + goto push; + push: { + ++p; + size_t* previous_base = current_base; + current_base = temp; + *temp++ = make_element(current_structure_type, previous_base - structure); + current_structure_type = next_type; + continue; + } + + case ']': + if (current_structure_type == TYPE_ARRAY) { + structure_installer = &parser::install_array; + goto pop; + } else { + return error("expected }"); + } + case '}': + if (current_structure_type == TYPE_OBJECT) { + structure_installer = &parser::install_object; + goto pop; + } else { + return error("expected ]"); + } + pop: { + ++p; + size_t element = *current_base; + result = (this->*structure_installer)(current_base + 1); + size_t parent = get_element_value(element); + if (parent == ROOT_MARKER) { + root_type = result.value_type; + goto done; + } + temp = current_base; + current_base = structure + parent; + current_structure_type = get_element_type(element); + break; + } + default: + return error("cannot parse unknown value"); + } + + if (!result) { + return result.success; + } + + *temp++ = make_element(result.value_type, out - current_base - 1); + } + + done: + if (0 == peek_structure()) { + return true; + } else { + return error("expected end of input"); + } + } + + bool has_remaining_characters(ptrdiff_t remaining) { + return input_end - p >= remaining; + } + + parse_result parse_null() { + if (SAJSON_UNLIKELY(!has_remaining_characters(4))) { + return error("unexpected end of input"); + } + char p1 = p[1]; + char p2 = p[2]; + char p3 = p[3]; + if (SAJSON_UNLIKELY(p1 != 'u' || p2 != 'l' || p3 != 'l')) { + return error("expected 'null'"); + } + p += 4; + return TYPE_NULL; + } + + parse_result parse_false() { + if (SAJSON_UNLIKELY(!has_remaining_characters(5))) { + return error("unexpected end of input"); + } + char p1 = p[1]; + char p2 = p[2]; + char p3 = p[3]; + char p4 = p[4]; + if (SAJSON_UNLIKELY(p1 != 'a' || p2 != 'l' || p3 != 's' || p4 != 'e')) { + return error("expected 'false'"); + } + p += 5; + return TYPE_FALSE; + } + + parse_result parse_true() { + if (SAJSON_UNLIKELY(!has_remaining_characters(4))) { + return error("unexpected end of input"); + } + char p1 = p[1]; + char p2 = p[2]; + char p3 = p[3]; + if (SAJSON_UNLIKELY(p1 != 'r' || p2 != 'u' || p3 != 'e')) { + return error("expected 'true'"); + } + p += 4; + return TYPE_TRUE; + } + + static double pow10(int exponent) { + if (exponent > 308) { + return std::numeric_limits::infinity(); + } else if (exponent < -323) { + return 0.0; + } + static const double constants[] = { + 1e-323,1e-322,1e-321,1e-320,1e-319,1e-318,1e-317,1e-316,1e-315,1e-314, + 1e-313,1e-312,1e-311,1e-310,1e-309,1e-308,1e-307,1e-306,1e-305,1e-304, + 1e-303,1e-302,1e-301,1e-300,1e-299,1e-298,1e-297,1e-296,1e-295,1e-294, + 1e-293,1e-292,1e-291,1e-290,1e-289,1e-288,1e-287,1e-286,1e-285,1e-284, + 1e-283,1e-282,1e-281,1e-280,1e-279,1e-278,1e-277,1e-276,1e-275,1e-274, + 1e-273,1e-272,1e-271,1e-270,1e-269,1e-268,1e-267,1e-266,1e-265,1e-264, + 1e-263,1e-262,1e-261,1e-260,1e-259,1e-258,1e-257,1e-256,1e-255,1e-254, + 1e-253,1e-252,1e-251,1e-250,1e-249,1e-248,1e-247,1e-246,1e-245,1e-244, + 1e-243,1e-242,1e-241,1e-240,1e-239,1e-238,1e-237,1e-236,1e-235,1e-234, + 1e-233,1e-232,1e-231,1e-230,1e-229,1e-228,1e-227,1e-226,1e-225,1e-224, + 1e-223,1e-222,1e-221,1e-220,1e-219,1e-218,1e-217,1e-216,1e-215,1e-214, + 1e-213,1e-212,1e-211,1e-210,1e-209,1e-208,1e-207,1e-206,1e-205,1e-204, + 1e-203,1e-202,1e-201,1e-200,1e-199,1e-198,1e-197,1e-196,1e-195,1e-194, + 1e-193,1e-192,1e-191,1e-190,1e-189,1e-188,1e-187,1e-186,1e-185,1e-184, + 1e-183,1e-182,1e-181,1e-180,1e-179,1e-178,1e-177,1e-176,1e-175,1e-174, + 1e-173,1e-172,1e-171,1e-170,1e-169,1e-168,1e-167,1e-166,1e-165,1e-164, + 1e-163,1e-162,1e-161,1e-160,1e-159,1e-158,1e-157,1e-156,1e-155,1e-154, + 1e-153,1e-152,1e-151,1e-150,1e-149,1e-148,1e-147,1e-146,1e-145,1e-144, + 1e-143,1e-142,1e-141,1e-140,1e-139,1e-138,1e-137,1e-136,1e-135,1e-134, + 1e-133,1e-132,1e-131,1e-130,1e-129,1e-128,1e-127,1e-126,1e-125,1e-124, + 1e-123,1e-122,1e-121,1e-120,1e-119,1e-118,1e-117,1e-116,1e-115,1e-114, + 1e-113,1e-112,1e-111,1e-110,1e-109,1e-108,1e-107,1e-106,1e-105,1e-104, + 1e-103,1e-102,1e-101,1e-100,1e-99,1e-98,1e-97,1e-96,1e-95,1e-94,1e-93, + 1e-92,1e-91,1e-90,1e-89,1e-88,1e-87,1e-86,1e-85,1e-84,1e-83,1e-82,1e-81, + 1e-80,1e-79,1e-78,1e-77,1e-76,1e-75,1e-74,1e-73,1e-72,1e-71,1e-70,1e-69, + 1e-68,1e-67,1e-66,1e-65,1e-64,1e-63,1e-62,1e-61,1e-60,1e-59,1e-58,1e-57, + 1e-56,1e-55,1e-54,1e-53,1e-52,1e-51,1e-50,1e-49,1e-48,1e-47,1e-46,1e-45, + 1e-44,1e-43,1e-42,1e-41,1e-40,1e-39,1e-38,1e-37,1e-36,1e-35,1e-34,1e-33, + 1e-32,1e-31,1e-30,1e-29,1e-28,1e-27,1e-26,1e-25,1e-24,1e-23,1e-22,1e-21, + 1e-20,1e-19,1e-18,1e-17,1e-16,1e-15,1e-14,1e-13,1e-12,1e-11,1e-10,1e-9, + 1e-8,1e-7,1e-6,1e-5,1e-4,1e-3,1e-2,1e-1,1e0,1e1,1e2,1e3,1e4,1e5,1e6,1e7, + 1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15,1e16,1e17,1e18,1e19,1e20,1e21, + 1e22,1e23,1e24,1e25,1e26,1e27,1e28,1e29,1e30,1e31,1e32,1e33,1e34,1e35, + 1e36,1e37,1e38,1e39,1e40,1e41,1e42,1e43,1e44,1e45,1e46,1e47,1e48,1e49, + 1e50,1e51,1e52,1e53,1e54,1e55,1e56,1e57,1e58,1e59,1e60,1e61,1e62,1e63, + 1e64,1e65,1e66,1e67,1e68,1e69,1e70,1e71,1e72,1e73,1e74,1e75,1e76,1e77, + 1e78,1e79,1e80,1e81,1e82,1e83,1e84,1e85,1e86,1e87,1e88,1e89,1e90,1e91, + 1e92,1e93,1e94,1e95,1e96,1e97,1e98,1e99,1e100,1e101,1e102,1e103,1e104, + 1e105,1e106,1e107,1e108,1e109,1e110,1e111,1e112,1e113,1e114,1e115,1e116, + 1e117,1e118,1e119,1e120,1e121,1e122,1e123,1e124,1e125,1e126,1e127,1e128, + 1e129,1e130,1e131,1e132,1e133,1e134,1e135,1e136,1e137,1e138,1e139,1e140, + 1e141,1e142,1e143,1e144,1e145,1e146,1e147,1e148,1e149,1e150,1e151,1e152, + 1e153,1e154,1e155,1e156,1e157,1e158,1e159,1e160,1e161,1e162,1e163,1e164, + 1e165,1e166,1e167,1e168,1e169,1e170,1e171,1e172,1e173,1e174,1e175,1e176, + 1e177,1e178,1e179,1e180,1e181,1e182,1e183,1e184,1e185,1e186,1e187,1e188, + 1e189,1e190,1e191,1e192,1e193,1e194,1e195,1e196,1e197,1e198,1e199,1e200, + 1e201,1e202,1e203,1e204,1e205,1e206,1e207,1e208,1e209,1e210,1e211,1e212, + 1e213,1e214,1e215,1e216,1e217,1e218,1e219,1e220,1e221,1e222,1e223,1e224, + 1e225,1e226,1e227,1e228,1e229,1e230,1e231,1e232,1e233,1e234,1e235,1e236, + 1e237,1e238,1e239,1e240,1e241,1e242,1e243,1e244,1e245,1e246,1e247,1e248, + 1e249,1e250,1e251,1e252,1e253,1e254,1e255,1e256,1e257,1e258,1e259,1e260, + 1e261,1e262,1e263,1e264,1e265,1e266,1e267,1e268,1e269,1e270,1e271,1e272, + 1e273,1e274,1e275,1e276,1e277,1e278,1e279,1e280,1e281,1e282,1e283,1e284, + 1e285,1e286,1e287,1e288,1e289,1e290,1e291,1e292,1e293,1e294,1e295,1e296, + 1e297,1e298,1e299,1e300,1e301,1e302,1e303,1e304,1e305,1e306,1e307,1e308 + }; + return constants[exponent + 323]; + } + + parse_result parse_number() { + bool negative = false; + if ('-' == *p) { + ++p; + negative = true; + + if (at_eof()) { + return error("unexpected end of input"); + } + } + + bool try_double = false; + + int i = 0; + double d = 0.0; // gcc complains that d might be used uninitialized which isn't true. appease the warning anyway. + for (;;) { + char c = *p; + if (c < '0' || c > '9') { + break; + } + + ++p; + if (at_eof()) { + return error("unexpected end of input"); + } + + char digit = c - '0'; + + if (SAJSON_UNLIKELY(!try_double && i > INT_MAX / 10 - 9)) { + // TODO: could split this into two loops + try_double = true; + d = i; + } + if (SAJSON_UNLIKELY(try_double)) { + d = 10.0 * d + digit; + } else { + i = 10 * i + digit; + } + } + + int exponent = 0; + + if ('.' == *p) { + if (!try_double) { + try_double = true; + d = i; + } + ++p; + if (at_eof()) { + return error("unexpected end of input"); + } + for (;;) { + char c = *p; + if (c < '0' || c > '9') { + break; + } + + ++p; + if (at_eof()) { + return error("unexpected end of input"); + } + d = d * 10 + (c - '0'); + --exponent; + } + } + + char e = *p; + if ('e' == e || 'E' == e) { + if (!try_double) { + try_double = true; + d = i; + } + ++p; + if (at_eof()) { + return error("unexpected end of input"); + } + + bool negativeExponent = false; + if ('-' == *p) { + ++p; + negativeExponent = true; + if (at_eof()) { + return error("unexpected end of input"); + } + } else if ('+' == *p) { + ++p; + if (at_eof()) { + return error("unexpected end of input"); + } + } + + int exp = 0; + for (;;) { + char c = *p; + if (c < '0' || c > '9') { + break; + } + + ++p; + if (at_eof()) { + return error("unexpected end of input"); + } + + exp = 10 * exp + (c - '0'); + } + exponent += (negativeExponent ? -exp : exp); + } + + if (exponent) { + assert(try_double); + d *= pow10(exponent); + } + + if (negative) { + if (try_double) { + d = -d; + } else { + i = -i; + } + } + if (try_double) { + out -= double_storage::word_length; + double_storage::store(out, d); + return TYPE_DOUBLE; + } else { + integer_storage is; + is.i = i; + + *--out = is.u; + return TYPE_INTEGER; + } + } + + parse_result install_array(size_t* array_base) { + const size_t length = temp - array_base; + size_t* const new_base = out - length - 1; + while (temp > array_base) { + // I think this addition is legal because the tag bits are at the top? + *(--out) = *(--temp) + (array_base - new_base); + } + *(--out) = length; + + return TYPE_ARRAY; + } + + parse_result install_object(size_t* object_base) { + const size_t length = (temp - object_base) / 3; + object_key_record* oir = reinterpret_cast(object_base); + std::sort( + oir, + oir + length, + object_key_comparator(input.get_data())); + + size_t* const new_base = out - length * 3 - 1; + size_t i = length; + while (i--) { + // I think this addition is legal because the tag bits are at the top? + *(--out) = *(--temp) + (object_base - new_base); + *(--out) = *(--temp); + *(--out) = *(--temp); + } + *(--out) = length; + + return TYPE_OBJECT; + } + + parse_result parse_string(size_t* tag = 0) { + if (!tag) { + out -= 2; + tag = out; + } + + ++p; // " + size_t start = p - input.get_data(); + for (;;) { + if (SAJSON_UNLIKELY(p >= input_end)) { + return error("unexpected end of input"); + } + + if (SAJSON_UNLIKELY(*p == 0)) { + return error("illegal unprintable codepoint in string"); + } + + switch (*p) { + case '"': + tag[0] = start; + tag[1] = p - input.get_data(); + ++p; + return TYPE_STRING; + + case '\\': + return parse_string_slow(tag, start); + + default: + ++p; + break; + } + } + } + + parse_result read_hex(unsigned& u) { + unsigned v = 0; + int i = 4; + while (i--) { + unsigned char c = *p++; + if (c >= '0' && c <= '9') { + c -= '0'; + } else if (c >= 'a' && c <= 'f') { + c = c - 'a' + 10; + } else if (c >= 'A' && c <= 'F') { + c = c - 'A' + 10; + } else { + return error("invalid character in unicode escape"); + } + v = (v << 4) + c; + } + + u = v; + return TYPE_NULL; // ??? + } + + void write_utf8(unsigned codepoint, char*& end) { + if (codepoint < 0x80) { + *end++ = codepoint; + } else if (codepoint < 0x800) { + *end++ = 0xC0 | (codepoint >> 6); + *end++ = 0x80 | (codepoint & 0x3F); + } else if (codepoint < 0x10000) { + *end++ = 0xE0 | (codepoint >> 12); + *end++ = 0x80 | ((codepoint >> 6) & 0x3F); + *end++ = 0x80 | (codepoint & 0x3F); + } else { + assert(codepoint < 0x200000); + *end++ = 0xF0 | (codepoint >> 18); + *end++ = 0x80 | ((codepoint >> 12) & 0x3F); + *end++ = 0x80 | ((codepoint >> 6) & 0x3F); + *end++ = 0x80 | (codepoint & 0x3F); + } + } + + parse_result parse_string_slow(size_t* tag, size_t start) { + char* end = p; + + for (;;) { + if (SAJSON_UNLIKELY(p >= input_end)) { + return error("unexpected end of input"); + } + + if (SAJSON_UNLIKELY(*p == 0)) { + return error("illegal unprintable codepoint in string"); + } + + switch (*p) { + case '"': + tag[0] = start; + tag[1] = end - input.get_data(); + ++p; + return TYPE_STRING; + + case '\\': + ++p; + if (SAJSON_UNLIKELY(p >= input_end)) { + return error("unexpected end of input"); + } + + char replacement; + switch (*p) { + case '"': replacement = '"'; goto replace; + case '\\': replacement = '\\'; goto replace; + case '/': replacement = '/'; goto replace; + case 'b': replacement = '\b'; goto replace; + case 'f': replacement = '\f'; goto replace; + case 'n': replacement = '\n'; goto replace; + case 'r': replacement = '\r'; goto replace; + case 't': replacement = '\t'; goto replace; + replace: + *end++ = replacement; + ++p; + break; + case 'u': { + ++p; + if (SAJSON_UNLIKELY(!has_remaining_characters(4))) { + return error("unexpected end of input"); + } + unsigned u = 0; // gcc's complaining that this could be used uninitialized. wrong. + parse_result result = read_hex(u); + if (!result) { + return result; + } + if (u >= 0xD800 && u <= 0xDBFF) { + if (SAJSON_UNLIKELY(!has_remaining_characters(6))) { + return error("unexpected end of input during UTF-16 surrogate pair"); + } + char p0 = p[0]; + char p1 = p[1]; + if (p0 != '\\' || p1 != 'u') { + return error("expected \\u"); + } + p += 2; + unsigned v = 0; // gcc's complaining that this could be used uninitialized. wrong. + result = read_hex(v); + if (!result) { + return result; + } + + if (v < 0xDC00 || v > 0xDFFF) { + return error("invalid UTF-16 trail surrogate"); + } + u = 0x10000 + (((u - 0xD800) << 10) | (v - 0xDC00)); + } + write_utf8(u, end); + break; + } + default: + return error("unknown escape"); + } + break; + + default: + *end++ = *p++; + break; + } + } + } + + mutable_string_view input; + char* const input_end; + size_t* const structure; + + char* p; + size_t* temp; + type root_type; + size_t* out; + size_t error_line; + size_t error_column; + std::string error_message; + }; + + template + document parse(const StringType& string) { + mutable_string_view ms(string); + + size_t length = string.length(); + size_t* structure = new size_t[length]; + + return parser(ms, structure).get_document(); + } +} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/proto/mythprotobase.cpp kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/proto/mythprotobase.cpp --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/cppmyth/src/proto/mythprotobase.cpp 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/cppmyth/src/proto/mythprotobase.cpp 2015-02-20 11:24:58.000000000 +0000 @@ -34,7 +34,7 @@ typedef struct { unsigned version; - char token[14]; // up to 13 chars used in v74 + the terminating NULL character + char token[15]; // up to 14 chars used in v84 + the terminating NULL character } myth_protomap_t; static myth_protomap_t protomap[] = { @@ -46,6 +46,8 @@ {81, "MultiRecDos"}, {82, "IdIdO"}, {83, "BreakingGlass"}, + {84, "CanaryCoalmine"}, + {85, "BluePool"}, {0, ""} }; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/.gitignore kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/.gitignore --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/.gitignore 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/.gitignore 2015-02-20 11:24:58.000000000 +0000 @@ -6,12 +6,6 @@ install_manifest.txt build/ CMakeFiles/ -/jansson/CTestTestfile.cmake -/jansson/include/ -/jansson/lib/ -/jansson/bin/ -/jansson/compile -/jansson/test-driver /cppmyth/include/ /cppmyth/lib/ /cppmyth/bin/ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/android/jansson_config.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/android/jansson_config.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/android/jansson_config.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/android/jansson_config.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2010-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - * - * - * This file specifies a part of the site-specific configuration for - * Jansson, namely those things that affect the public API in - * jansson.h. - * - * The configure script copies this file to jansson_config.h and - * replaces @var@ substitutions by values that fit your system. If you - * cannot run the configure script, you can do the value substitution - * by hand. - */ - -#ifndef JANSSON_CONFIG_H -#define JANSSON_CONFIG_H - -/* If your compiler supports the inline keyword in C, JSON_INLINE is - defined to `inline', otherwise empty. In C++, the inline is always - supported. */ -#ifdef __cplusplus -#define JSON_INLINE inline -#else -#define JSON_INLINE inline -#endif - -/* If your compiler supports the `long long` type and the strtoll() - library function, JSON_INTEGER_IS_LONG_LONG is defined to 1, - otherwise to 0. */ -#define JSON_INTEGER_IS_LONG_LONG 1 - -/* If locale.h and localeconv() are available, define to 1, - otherwise to 0. */ -#define JSON_HAVE_LOCALECONV 0 - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/Android.mk kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/Android.mk --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/Android.mk 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/Android.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_ARM_MODE := arm - -LOCAL_SRC_FILES := \ - src/dump.c \ - src/error.c \ - src/hashtable.c \ - src/hashtable_seed.c \ - src/load.c \ - src/memory.c \ - src/pack_unpack.c \ - src/strbuffer.c \ - src/strconv.c \ - src/utf.c \ - src/value.c - -LOCAL_C_INCLUDES += \ - $(LOCAL_PATH) \ - $(LOCAL_PATH)/android \ - $(LOCAL_PATH)/src - -LOCAL_MODULE_TAGS := optional -LOCAL_SHARED_LIBRARIES := libc -LOCAL_CFLAGS += -O3 -DHAVE_STDINT_H=1 - -LOCAL_MODULE:= libjansson - -include $(BUILD_SHARED_LIBRARY) diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/appveyor.yml kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/appveyor.yml --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/appveyor.yml 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/appveyor.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -build_script: - - md build - - cd build - - cmake .. - - cmake --build . --config Release - - ctest --output-on-failure \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/CHANGES kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/CHANGES --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/CHANGES 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/CHANGES 1970-01-01 00:00:00.000000000 +0000 @@ -1,679 +0,0 @@ -Version 2.7 -=========== - -Released 2014-10-02 - -* New features: - - - `json_pack()` and friends: Add format specifiers ``s%`` and ``+%`` - for a size_t string length (#141). - - - `json_unpack()` and friends: Add format specifier ``s%`` for - unpacking the string length along with the string itself (#141). - - - Add length-aware string constructors `json_stringn()` and - `json_stringn_nocheck()`, length-aware string mutators - `json_string_setn()` and `json_string_setn_nocheck()`, and a - function for getting string's length `json_string_length()` (#141, - #143). - - - Support ``\u0000`` escapes in the decoder. The support can be - enabled by using the ``JSON_ALLOW_NUL`` decoding flag (#141). - - - Add `json_boolean_value()` as an alias for `json_is_true()` - (#146). - - - Add JSON_REAL_PRECISION encoding flag/macro for controlling real - number precision (#178). - - - Define the maximum indentation as JSON_MAX_INDENT (#191). - -* Bug fixes: - - - Some malformed ``\uNNNN`` escapes could crash the decoder with an - assertion failure. - - - Avoid integer overflows with very long strings in UTF-8 decoder and - hashtable. - - - Check for *NULL* key in `json_object_get()` and - `json_object_del()` (#151). - - - Enhance hashtable seeding on Windows (#162). - - - `json_unpack()`: Allow mixing JSON_STRICT with optional keys - (#162, #163). - - - Fix int/int32 mismatch (#142). - - - Parse subnormal numbers correctly (#202). - -* Build: - - - Remove VS2010 build files. CMake should be used on Windows instead - (#165). - - - Fix CMake build flags for MinGW (#193). - - - Add CMake config files for find_package. Rename config.h to - jansson_private_config.h (#157, #159). - - - Make Valgrind checks work with CMake (#160). - - - Fix feature checks to use correct __ATOMIC flags. - - - Fix CMake checks for uint16_t and uint8_t support (#177). - - - Make Jansson build on SmartOS/Solaris (#171). - - - Work around a GCC bug on Solaris (#175). - - - Fix autoreconf on Debian (#182). - - - Don't use GNU make specific export for global AM_CFLAGS (#203, - #204). - - - Fix building on Android using the supplied Android.mk (#166, - #174). - - - Android.mk: Add -DHAVE_STDINT_H to LOCAL_CFLAGS (#200). - -* Documentation: - - - Document JANSSON_BUILD_SHARED_LIBS CMake option (#187). - -* Tests: - - - Close file handles correctly (#198). - -* Other changes: - - - ``\uNNNN`` escapes are now encoded in upper case for better - readability. - - - Enable usage of AddressSanitizer (#180). - - -Version 2.6 -=========== - -Released 2014-02-11 - -* Security: - - - CVE-2013-6401: The hash function used by the hashtable - implementation has been changed, and is automatically seeded with - random data when the first JSON object is created. This prevents - an attacker from causing large JSON objects with specially crafted - keys perform poorly. - -* New features: - - - `json_object_seed()`: Set the seed value of the hash function. - -* Bug fixes: - - - Include CMake specific files in the release tarball. - -* Documentation: - - - Fix tutorial source to send a User-Agent header, which is now - required by the GitHub API. - - - Set all memory to zero in secure_free() example. - - -Version 2.5 -=========== - -Released 2013-09-19 - -* New features: - - - `json_pack()` and friends: Add format specifiers ``s#``, ``+`` and - ``+#``. - - - Add ``JSON_DECODE_INT_AS_REAL`` decoding flag to treat all numbers - as real in the decoder (#123). - - - Add `json_array_foreach()`, paralleling `json_object_foreach()` - (#118). - -* Bug fixes: - - - `json_dumps()` and friends: Don't crash if json is *NULL* and - ``JSON_ENCODE_ANY`` is set. - - - Fix a theoretical integer overflow in `jsonp_strdup()`. - - - Fix `l_isxdigit()` macro (#97). - - - Fix an off-by-one error in `json_array_remove()`. - -* Build: - - - Support CMake in addition to GNU Autotools (#106, #107, #112, - #115, #120, #127). - - - Support building for Android (#109). - - - Don't use ``-Werror`` by default. - - - Support building and testing with VPATH (#93). - - - Fix compilation when ``NDEBUG`` is defined (#128) - -* Tests: - - - Fix a refleak in ``test/bin/json_process.c``. - -* Documentation: - - - Clarify the return value of `json_load_callback_t`. - - - Document how to circumvent problems with separate heaps on Windows. - - - Fix memory leaks and warnings in ``github_commits.c``. - - - Use `json_decref()` properly in tutorial. - -* Other: - - - Make it possible to forward declare ``struct json_t``. - - -Version 2.4 -=========== - -Released 2012-09-23 - -* New features: - - - Add `json_boolean()` macro that returns the JSON true or false - value based on its argument (#86). - - - Add `json_load_callback()` that calls a callback function - repeatedly to read the JSON input (#57). - - - Add JSON_ESCAPE_SLASH encoding flag to escape all occurences of - ``/`` with ``\/``. - -* Bug fixes: - - - Check for and reject NaN and Inf values for reals. Encoding these - values resulted in invalid JSON. - - - Fix `json_real_set()` to return -1 on error. - -* Build: - - - Jansson now builds on Windows with Visual Studio 2010, and - includes solution and project files in ``win32/vs2010/`` - directory. - - - Fix build warnings (#77, #78). - - - Add ``-no-undefined`` to LDFLAGS (#90). - -* Tests: - - - Fix the symbol exports test on Linux/PPC64 (#88). - -* Documentation: - - - Fix typos (#73, #84). - - -Version 2.3.1 -============= - -Released 2012-04-20 - -* Build issues: - - - Only use ``long long`` if ``strtoll()`` is also available. - -* Documentation: - - - Fix the names of library version constants in documentation. (#52) - - - Change the tutorial to use GitHub API v3. (#65) - -* Tests: - - - Make some tests locale independent. (#51) - - - Distribute the library exports test in the tarball. - - - Make test run on shells that don't support the ``export FOO=bar`` - syntax. - - -Version 2.3 -=========== - -Released 2012-01-27 - -* New features: - - - `json_unpack()` and friends: Add support for optional object keys - with the ``{s?o}`` syntax. - - - Add `json_object_update_existing()` and - `json_object_update_missing()`, for updating only existing keys or - only adding missing keys to an object. (#37) - - - Add `json_object_foreach()` for more convenient iteration over - objects. (#45, #46) - - - When decoding JSON, write the number of bytes that were read from - input to ``error.position`` also on success. This is handy with - ``JSON_DISABLE_EOF_CHECK``. - - - Add support for decoding any JSON value, not just arrays or - objects. The support is enabled with the new ``JSON_DECODE_ANY`` - flag. Patch by Andrea Marchesini. (#4) - -* Bug fixes - - - Avoid problems with object's serial number growing too big. (#40, - #41) - - - Decoding functions now return NULL if the first argument is NULL. - Patch by Andrea Marchesini. - - - Include ``jansson_config.h.win32`` in the distribution tarball. - - - Remove ``+`` and leading zeros from exponents in the encoder. - (#39) - - - Make Jansson build and work on MinGW. (#39, #38) - -* Documentation - - - Note that the same JSON values must not be encoded in parallel by - separate threads. (#42) - - - Document MinGW support. - - -Version 2.2.1 -============= - -Released 2011-10-06 - -* Bug fixes: - - - Fix real number encoding and decoding under non-C locales. (#32) - - - Fix identifier decoding under non-UTF-8 locales. (#35) - - - `json_load_file()`: Open the input file in binary mode for maximum - compatiblity. - -* Documentation: - - - Clarify the lifecycle of the result of the ``s`` fromat of - `json_unpack()`. (#31) - - - Add some portability info. (#36) - - - Little clarifications here and there. - -* Other: - - - Some style fixes, issues detected by static analyzers. - - -Version 2.2 -=========== - -Released 2011-09-03 - -* New features: - - - `json_dump_callback()`: Pass the encoder output to a callback - function in chunks. - -* Bug fixes: - - - `json_string_set()`: Check that target is a string and value is - not NULL. - -* Other: - - - Documentation typo fixes and clarifications. - - -Version 2.1 -=========== - -Released 2011-06-10 - -* New features: - - - `json_loadb()`: Decode a string with a given size, useful if the - string is not null terminated. - - - Add ``JSON_ENCODE_ANY`` encoding flag to allow encoding any JSON - value. By default, only arrays and objects can be encoded. (#19) - - - Add ``JSON_REJECT_DUPLICATES`` decoding flag to issue a decoding - error if any JSON object in the input contins duplicate keys. (#3) - - - Add ``JSON_DISABLE_EOF_CHECK`` decoding flag to stop decoding after a - valid JSON input. This allows other data after the JSON data. - -* Bug fixes: - - - Fix an additional memory leak when memory allocation fails in - `json_object_set()` and friends. - - - Clear errno before calling `strtod()` for better portability. (#27) - -* Building: - - - Avoid set-but-not-used warning/error in a test. (#20) - -* Other: - - - Minor clarifications to documentation. - - -Version 2.0.1 -============= - -Released 2011-03-31 - -* Bug fixes: - - - Replace a few `malloc()` and `free()` calls with their - counterparts that support custom memory management. - - - Fix object key hashing in json_unpack() strict checking mode. - - - Fix the parentheses in ``JANSSON_VERSION_HEX`` macro. - - - Fix `json_object_size()` return value. - - - Fix a few compilation issues. - -* Portability: - - - Enhance portability of `va_copy()`. - - - Test framework portability enhancements. - -* Documentation: - - - Distribute ``doc/upgrading.rst`` with the source tarball. - - - Build documentation in strict mode in ``make distcheck``. - - -Version 2.0 -=========== - -Released 2011-02-28 - -This release is backwards incompatible with the 1.x release series. -See the chapter "Upgrading from older versions" in documentation for -details. - -* Backwards incompatible changes: - - - Unify unsigned integer usage in the API: All occurences of - unsigned int and unsigned long have been replaced with size_t. - - - Change JSON integer's underlying type to the widest signed integer - type available, i.e. long long if it's supported, otherwise long. - Add a typedef json_int_t that defines the type. - - - Change the maximum indentation depth to 31 spaces in encoder. This - frees up bits from the flags parameter of encoding functions - `json_dumpf()`, `json_dumps()` and `json_dump_file()`. - - - For future needs, add a flags parameter to all decoding functions - `json_loadf()`, `json_loads()` and `json_load_file()`. - -* New features - - - `json_pack()`, `json_pack_ex()`, `json_vpack_ex()`: Create JSON - values based on a format string. - - - `json_unpack()`, `json_unpack_ex()`, `json_vunpack_ex()`: Simple - value extraction and validation functionality based on a format - string. - - - Add column, position and source fields to the ``json_error_t`` - struct. - - - Enhance error reporting in the decoder. - - - ``JANSSON_VERSION`` et al.: Preprocessor constants that define the - library version. - - - `json_set_alloc_funcs()`: Set custom memory allocation functions. - -* Fix many portability issues, especially on Windows. - -* Configuration - - - Add file ``jansson_config.h`` that contains site specific - configuration. It's created automatically by the configure script, - or can be created by hand if the configure script cannot be used. - The file ``jansson_config.h.win32`` can be used without - modifications on Windows systems. - - - Add a section to documentation describing how to build Jansson on - Windows. - - - Documentation now requires Sphinx 1.0 or newer. - - -Version 1.3 -=========== - -Released 2010-06-13 - -* New functions: - - - `json_object_iter_set()`, `json_object_iter_set_new()`: Change - object contents while iterating over it. - - - `json_object_iter_at()`: Return an iterator that points to a - specific object item. - -* New encoding flags: - - - ``JSON_PRESERVE_ORDER``: Preserve the insertion order of object - keys. - -* Bug fixes: - - - Fix an error that occured when an array or object was first - encoded as empty, then populated with some data, and then - re-encoded - - - Fix the situation like above, but when the first encoding resulted - in an error - -* Documentation: - - - Clarify the documentation on reference stealing, providing an - example usage pattern - - -Version 1.2.1 -============= - -Released 2010-04-03 - -* Bug fixes: - - - Fix reference counting on ``true``, ``false`` and ``null`` - - Estimate real number underflows in decoder with 0.0 instead of - issuing an error - -* Portability: - - - Make ``int32_t`` available on all systems - - Support compilers that don't have the ``inline`` keyword - - Require Autoconf 2.60 (for ``int32_t``) - -* Tests: - - - Print test names correctly when ``VERBOSE=1`` - - ``test/suites/api``: Fail when a test fails - - Enhance tests for iterators - - Enhance tests for decoding texts that contain null bytes - -* Documentation: - - - Don't remove ``changes.rst`` in ``make clean`` - - Add a chapter on RFC conformance - - -Version 1.2 -=========== - -Released 2010-01-21 - -* New functions: - - - `json_equal()`: Test whether two JSON values are equal - - `json_copy()` and `json_deep_copy()`: Make shallow and deep copies - of JSON values - - Add a version of all functions taking a string argument that - doesn't check for valid UTF-8: `json_string_nocheck()`, - `json_string_set_nocheck()`, `json_object_set_nocheck()`, - `json_object_set_new_nocheck()` - -* New encoding flags: - - - ``JSON_SORT_KEYS``: Sort objects by key - - ``JSON_ENSURE_ASCII``: Escape all non-ASCII Unicode characters - - ``JSON_COMPACT``: Use a compact representation with all unneeded - whitespace stripped - -* Bug fixes: - - - Revise and unify whitespace usage in encoder: Add spaces between - array and object items, never append newline to output. - - Remove const qualifier from the ``json_t`` parameter in - `json_string_set()`, `json_integer_set()` and `json_real_set`. - - Use ``int32_t`` internally for representing Unicode code points - (int is not enough on all platforms) - -* Other changes: - - - Convert ``CHANGES`` (this file) to reStructured text and add it to - HTML documentation - - The test system has been refactored. Python is no longer required - to run the tests. - - Documentation can now be built by invoking ``make html`` - - Support for pkg-config - - -Version 1.1.3 -============= - -Released 2009-12-18 - -* Encode reals correctly, so that first encoding and then decoding a - real always produces the same value -* Don't export private symbols in ``libjansson.so`` - - -Version 1.1.2 -============= - -Released 2009-11-08 - -* Fix a bug where an error message was not produced if the input file - could not be opened in `json_load_file()` -* Fix an assertion failure in decoder caused by a minus sign without a - digit after it -* Remove an unneeded include of ``stdint.h`` in ``jansson.h`` - - -Version 1.1.1 -============= - -Released 2009-10-26 - -* All documentation files were not distributed with v1.1; build - documentation in make distcheck to prevent this in the future -* Fix v1.1 release date in ``CHANGES`` - - -Version 1.1 -=========== - -Released 2009-10-20 - -* API additions and improvements: - - - Extend array and object APIs - - Add functions to modify integer, real and string values - - Improve argument validation - - Use unsigned int instead of ``uint32_t`` for encoding flags - -* Enhance documentation - - - Add getting started guide and tutorial - - Fix some typos - - General clarifications and cleanup - -* Check for integer and real overflows and underflows in decoder -* Make singleton values thread-safe (``true``, ``false`` and ``null``) -* Enhance circular reference handling -* Don't define ``-std=c99`` in ``AM_CFLAGS`` -* Add C++ guards to ``jansson.h`` -* Minor performance and portability improvements -* Expand test coverage - - -Version 1.0.4 -============= - -Released 2009-10-11 - -* Relax Autoconf version requirement to 2.59 -* Make Jansson compile on platforms where plain ``char`` is unsigned -* Fix API tests for object - - -Version 1.0.3 -============= - -Released 2009-09-14 - -* Check for integer and real overflows and underflows in decoder -* Use the Python json module for tests, or simplejson if the json - module is not found -* Distribute changelog (this file) - - -Version 1.0.2 -============= - -Released 2009-09-08 - -* Handle EOF correctly in decoder - - -Version 1.0.1 -============= - -Released 2009-09-04 - -* Fixed broken `json_is_boolean()` - - -Version 1.0 -=========== - -Released 2009-08-25 - -* Initial release diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/CleanSpec.mk kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/CleanSpec.mk --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/CleanSpec.mk 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/CleanSpec.mk 1970-01-01 00:00:00.000000000 +0000 @@ -1,49 +0,0 @@ -# Copyright (C) 2007 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# If you don't need to do a full clean build but would like to touch -# a file or delete some intermediate files, add a clean step to the end -# of the list. These steps will only be run once, if they haven't been -# run before. -# -# E.g.: -# $(call add-clean-step, touch -c external/sqlite/sqlite3.h) -# $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates) -# -# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with -# files that are missing or have been moved. -# -# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory. -# Use $(OUT_DIR) to refer to the "out" directory. -# -# If you need to re-do something that's already mentioned, just copy -# the command and add it to the bottom of the list. E.g., if a change -# that you made last week required touching a file and a change you -# made today requires touching the same file, just copy the old -# touch step and add it to the end of the list. -# -# ************************************************ -# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST -# ************************************************ - -# For example: -#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates) -#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates) -#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f) -#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*) - -# ************************************************ -# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST -# ************************************************ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/CheckFunctionKeywords.cmake kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/CheckFunctionKeywords.cmake --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/CheckFunctionKeywords.cmake 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/CheckFunctionKeywords.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -include(CheckCSourceCompiles) - -macro(check_function_keywords _wordlist) - set(${_result} "") - foreach(flag ${_wordlist}) - string(REGEX REPLACE "[-+/ ()]" "_" flagname "${flag}") - string(TOUPPER "${flagname}" flagname) - set(have_flag "HAVE_${flagname}") - check_c_source_compiles("${flag} void func(); void func() { } int main() { func(); return 0; }" ${have_flag}) - if(${have_flag} AND NOT ${_result}) - set(${_result} "${flag}") -# break() - endif(${have_flag} AND NOT ${_result}) - endforeach(flag) -endmacro(check_function_keywords) diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/FindSphinx.cmake kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/FindSphinx.cmake --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/FindSphinx.cmake 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/FindSphinx.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,301 +0,0 @@ -# -# PART B. DOWNLOADING AGREEMENT - LICENSE FROM SBIA WITH RIGHT TO SUBLICENSE ("SOFTWARE LICENSE"). -# ------------------------------------------------------------------------------------------------ -# -# 1. As used in this Software License, "you" means the individual downloading and/or -# using, reproducing, modifying, displaying and/or distributing the Software and -# the institution or entity which employs or is otherwise affiliated with such -# individual in connection therewith. The Section of Biomedical Image Analysis, -# Department of Radiology at the Universiy of Pennsylvania ("SBIA") hereby grants -# you, with right to sublicense, with respect to SBIA's rights in the software, -# and data, if any, which is the subject of this Software License (collectively, -# the "Software"), a royalty-free, non-exclusive license to use, reproduce, make -# derivative works of, display and distribute the Software, provided that: -# (a) you accept and adhere to all of the terms and conditions of this Software -# License; (b) in connection with any copy of or sublicense of all or any portion -# of the Software, all of the terms and conditions in this Software License shall -# appear in and shall apply to such copy and such sublicense, including without -# limitation all source and executable forms and on any user documentation, -# prefaced with the following words: "All or portions of this licensed product -# (such portions are the "Software") have been obtained under license from the -# Section of Biomedical Image Analysis, Department of Radiology at the University -# of Pennsylvania and are subject to the following terms and conditions:" -# (c) you preserve and maintain all applicable attributions, copyright notices -# and licenses included in or applicable to the Software; (d) modified versions -# of the Software must be clearly identified and marked as such, and must not -# be misrepresented as being the original Software; and (e) you consider making, -# but are under no obligation to make, the source code of any of your modifications -# to the Software freely available to others on an open source basis. -# -# 2. The license granted in this Software License includes without limitation the -# right to (i) incorporate the Software into proprietary programs (subject to -# any restrictions applicable to such programs), (ii) add your own copyright -# statement to your modifications of the Software, and (iii) provide additional -# or different license terms and conditions in your sublicenses of modifications -# of the Software; provided that in each case your use, reproduction or -# distribution of such modifications otherwise complies with the conditions -# stated in this Software License. -# -# 3. This Software License does not grant any rights with respect to third party -# software, except those rights that SBIA has been authorized by a third -# party to grant to you, and accordingly you are solely responsible for -# (i) obtaining any permissions from third parties that you need to use, -# reproduce, make derivative works of, display and distribute the Software, -# and (ii) informing your sublicensees, including without limitation your -# end-users, of their obligations to secure any such required permissions. -# -# 4. The Software has been designed for research purposes only and has not been -# reviewed or approved by the Food and Drug Administration or by any other -# agency. YOU ACKNOWLEDGE AND AGREE THAT CLINICAL APPLICATIONS ARE NEITHER -# RECOMMENDED NOR ADVISED. Any commercialization of the Software is at the -# sole risk of the party or parties engaged in such commercialization. -# You further agree to use, reproduce, make derivative works of, display -# and distribute the Software in compliance with all applicable governmental -# laws, regulations and orders, including without limitation those relating -# to export and import control. -# -# 5. The Software is provided "AS IS" and neither SBIA nor any contributor to -# the software (each a "Contributor") shall have any obligation to provide -# maintenance, support, updates, enhancements or modifications thereto. -# SBIA AND ALL CONTRIBUTORS SPECIFICALLY DISCLAIM ALL EXPRESS AND IMPLIED -# WARRANTIES OF ANY KIND INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF -# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -# IN NO EVENT SHALL SBIA OR ANY CONTRIBUTOR BE LIABLE TO ANY PARTY FOR -# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES -# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ARISING IN ANY WAY RELATED -# TO THE SOFTWARE, EVEN IF SBIA OR ANY CONTRIBUTOR HAS BEEN ADVISED OF THE -# POSSIBILITY OF SUCH DAMAGES. TO THE MAXIMUM EXTENT NOT PROHIBITED BY LAW OR -# REGULATION, YOU FURTHER ASSUME ALL LIABILITY FOR YOUR USE, REPRODUCTION, -# MAKING OF DERIVATIVE WORKS, DISPLAY, LICENSE OR DISTRIBUTION OF THE SOFTWARE -# AND AGREE TO INDEMNIFY AND HOLD HARMLESS SBIA AND ALL CONTRIBUTORS FROM -# AND AGAINST ANY AND ALL CLAIMS, SUITS, ACTIONS, DEMANDS AND JUDGMENTS ARISING -# THEREFROM. -# -# 6. None of the names, logos or trademarks of SBIA or any of SBIA's affiliates -# or any of the Contributors, or any funding agency, may be used to endorse -# or promote products produced in whole or in part by operation of the Software -# or derived from or based on the Software without specific prior written -# permission from the applicable party. -# -# 7. Any use, reproduction or distribution of the Software which is not in accordance -# with this Software License shall automatically revoke all rights granted to you -# under this Software License and render Paragraphs 1 and 2 of this Software -# License null and void. -# -# 8. This Software License does not grant any rights in or to any intellectual -# property owned by SBIA or any Contributor except those rights expressly -# granted hereunder. -# -# -# PART C. MISCELLANEOUS -# --------------------- -# -# This Agreement shall be governed by and construed in accordance with the laws -# of The Commonwealth of Pennsylvania without regard to principles of conflicts -# of law. This Agreement shall supercede and replace any license terms that you -# may have agreed to previously with respect to Software from SBIA. -# -############################################################################## -# @file FindSphinx.cmake -# @brief Find Sphinx documentation build tools. -# -# @par Input variables: -# -# -# @tp @b Sphinx_DIR @endtp -# -# -# -# @tp @b SPHINX_DIR @endtp -# -# -# -# @tp @b Sphinx_FIND_COMPONENTS @endtp -# -# -#
Installation directory of Sphinx tools. Can also be set as environment variable.
Alternative environment variable for @c Sphinx_DIR.
Sphinx build tools to look for, i.e., 'apidoc' and/or 'build'.
-# -# @par Output variables: -# -# -# @tp @b Sphinx_FOUND @endtp -# -# -# -# @tp @b SPHINX_FOUND @endtp -# -# -# @tp @b SPHINX_EXECUTABLE @endtp -# -# -# -# @tp @b Sphinx_PYTHON_EXECUTABLE @endtp -# -# -# -# @tp @b Sphinx_PYTHON_OPTIONS @endtp -# -# -# -# @tp @b Sphinx-build_EXECUTABLE @endtp -# -# -# -# @tp @b Sphinx-apidoc_EXECUTABLE @endtp -# -# -# -# @tp @b Sphinx_VERSION_STRING @endtp -# -# -# -# @tp @b Sphinx_VERSION_MAJOR @endtp -# -# -# -# @tp @b Sphinx_VERSION_MINOR @endtp -# -# -# -# @tp @b Sphinx_VERSION_PATCH @endtp -# -# -#
Whether all or only the requested Sphinx build tools were found.
Alias for @c Sphinx_FOUND. -#
Non-cached alias for @c Sphinx-build_EXECUTABLE.
Python executable used to run sphinx-build. This is either the -# by default found Python interpreter or a specific version as -# specified by the shebang (#!) of the sphinx-build script.
A list of Python options extracted from the shebang (#!) of the -# sphinx-build script. The -E option is added by this module -# if the Python executable is not the system default to avoid -# problems with a differing setting of the @c PYTHONHOME.
Absolute path of the found sphinx-build tool.
Absolute path of the found sphinx-apidoc tool.
Sphinx version found e.g. 1.1.2.
Sphinx major version found e.g. 1.
Sphinx minor version found e.g. 1.
Sphinx patch version found e.g. 2.
-# -# @ingroup CMakeFindModules -############################################################################## - -set (_Sphinx_REQUIRED_VARS) - -# ---------------------------------------------------------------------------- -# initialize search -if (NOT Sphinx_DIR) - if (NOT $ENV{Sphinx_DIR} STREQUAL "") - set (Sphinx_DIR "$ENV{Sphinx_DIR}" CACHE PATH "Installation prefix of Sphinx (docutils)." FORCE) - else () - set (Sphinx_DIR "$ENV{SPHINX_DIR}" CACHE PATH "Installation prefix of Sphinx (docutils)." FORCE) - endif () -endif () - -# ---------------------------------------------------------------------------- -# default components to look for -if (NOT Sphinx_FIND_COMPONENTS) - set (Sphinx_FIND_COMPONENTS "build") -elseif (NOT Sphinx_FIND_COMPONENTS MATCHES "^(build|apidoc)$") - message (FATAL_ERROR "Invalid Sphinx component in: ${Sphinx_FIND_COMPONENTS}") -endif () - -# ---------------------------------------------------------------------------- -# find components, i.e., build tools -foreach (_Sphinx_TOOL IN LISTS Sphinx_FIND_COMPONENTS) - if (Sphinx_DIR) - find_program ( - Sphinx-${_Sphinx_TOOL}_EXECUTABLE - NAMES sphinx-${_Sphinx_TOOL} sphinx-${_Sphinx_TOOL}.py - HINTS "${Sphinx_DIR}" - PATH_SUFFIXES bin - DOC "The sphinx-${_Sphinx_TOOL} Python script." - NO_DEFAULT_PATH - ) - else () - find_program ( - Sphinx-${_Sphinx_TOOL}_EXECUTABLE - NAMES sphinx-${_Sphinx_TOOL} sphinx-${_Sphinx_TOOL}.py - DOC "The sphinx-${_Sphinx_TOOL} Python script." - ) - endif () - mark_as_advanced (Sphinx-${_Sphinx_TOOL}_EXECUTABLE) - list (APPEND _Sphinx_REQUIRED_VARS Sphinx-${_Sphinx_TOOL}_EXECUTABLE) -endforeach () - -# ---------------------------------------------------------------------------- -# determine Python executable used by Sphinx -if (Sphinx-build_EXECUTABLE) - # extract python executable from shebang of sphinx-build - find_package (PythonInterp QUIET) - set (Sphinx_PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE}") - set (Sphinx_PYTHON_OPTIONS) - file (STRINGS "${Sphinx-build_EXECUTABLE}" FIRST_LINE LIMIT_COUNT 1) - if (FIRST_LINE MATCHES "^#!(.*/python.*)") # does not match "#!/usr/bin/env python" ! - string (REGEX REPLACE "^ +| +$" "" Sphinx_PYTHON_EXECUTABLE "${CMAKE_MATCH_1}") - if (Sphinx_PYTHON_EXECUTABLE MATCHES "([^ ]+) (.*)") - set (Sphinx_PYTHON_EXECUTABLE "${CMAKE_MATCH_1}") - string (REGEX REPLACE " +" ";" Sphinx_PYTHON_OPTIONS "${CMAKE_MATCH_2}") - endif () - endif () - # this is done to avoid problems with multiple Python versions being installed - # remember: CMake command if(STR EQUAL STR) is bad and may cause many troubles ! - string (REGEX REPLACE "([.+*?^$])" "\\\\\\1" _Sphinx_PYTHON_EXECUTABLE_RE "${PYTHON_EXECUTABLE}") - list (FIND Sphinx_PYTHON_OPTIONS -E IDX) - if (IDX EQUAL -1 AND NOT Sphinx_PYTHON_EXECUTABLE MATCHES "^${_Sphinx_PYTHON_EXECUTABLE_RE}$") - list (INSERT Sphinx_PYTHON_OPTIONS 0 -E) - endif () - unset (_Sphinx_PYTHON_EXECUTABLE_RE) -endif () - -# ---------------------------------------------------------------------------- -# determine Sphinx version -if (Sphinx-build_EXECUTABLE) - # intentionally use invalid -h option here as the help that is shown then - # will include the Sphinx version information - if (Sphinx_PYTHON_EXECUTABLE) - execute_process ( - COMMAND "${Sphinx_PYTHON_EXECUTABLE}" ${Sphinx_PYTHON_OPTIONS} "${Sphinx-build_EXECUTABLE}" -h - OUTPUT_VARIABLE _Sphinx_VERSION - ERROR_VARIABLE _Sphinx_VERSION - ) - elseif (UNIX) - execute_process ( - COMMAND "${Sphinx-build_EXECUTABLE}" -h - OUTPUT_VARIABLE _Sphinx_VERSION - ERROR_VARIABLE _Sphinx_VERSION - ) - endif () - - # The sphinx version can also contain a "b" instead of the last dot. - # For example "Sphinx v1.2b1" so we cannot just split on "." - if (_Sphinx_VERSION MATCHES "Sphinx v([0-9]+\\.[0-9]+(\\.|b)[0-9]+)") - set (Sphinx_VERSION_STRING "${CMAKE_MATCH_1}") - string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.|b)[0-9]+" "\\1" Sphinx_VERSION_MAJOR ${Sphinx_VERSION_STRING}) - string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.|b)[0-9]+" "\\1" Sphinx_VERSION_MINOR ${Sphinx_VERSION_STRING}) - string(REGEX REPLACE "[0-9]+\\.[0-9]+(\\.|b)([0-9]+)" "\\1" Sphinx_VERSION_PATCH ${Sphinx_VERSION_STRING}) - - # v1.2.0 -> v1.2 - if (Sphinx_VERSION_PATCH EQUAL 0) - string (REGEX REPLACE "\\.0$" "" Sphinx_VERSION_STRING "${Sphinx_VERSION_STRING}") - endif () - endif() -endif () - -# ---------------------------------------------------------------------------- -# compatibility with FindPythonInterp.cmake and FindPerl.cmake -set (SPHINX_EXECUTABLE "${Sphinx-build_EXECUTABLE}") - -# ---------------------------------------------------------------------------- -# handle the QUIETLY and REQUIRED arguments and set SPHINX_FOUND to TRUE if -# all listed variables are TRUE -include (FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS ( - Sphinx - REQUIRED_VARS - ${_Sphinx_REQUIRED_VARS} -# VERSION_VAR # This isn't available until CMake 2.8.8 so don't use it. - Sphinx_VERSION_STRING -) - -# ---------------------------------------------------------------------------- -# set Sphinx_DIR -if (NOT Sphinx_DIR AND Sphinx-build_EXECUTABLE) - get_filename_component (Sphinx_DIR "${Sphinx-build_EXECUTABLE}" PATH) - string (REGEX REPLACE "/bin/?" "" Sphinx_DIR "${Sphinx_DIR}") - set (Sphinx_DIR "${Sphinx_DIR}" CACHE PATH "Installation directory of Sphinx tools." FORCE) -endif () - -unset (_Sphinx_VERSION) -unset (_Sphinx_REQUIRED_VARS) \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/JanssonConfig.cmake.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/JanssonConfig.cmake.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/JanssonConfig.cmake.in 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/JanssonConfig.cmake.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -# - Config file for the jansson package -# It defines the following variables -# JANSSON_INCLUDE_DIRS - include directories for FooBar -# JANSSON_LIBRARIES - libraries to link against - -# Get the path of the current file. -get_filename_component(JANSSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) - -# Set the include directories. -set(JANSSON_INCLUDE_DIRS "@JANSSON__INCLUDE_DIRS@") - -# Include the project Targets file, this contains definitions for IMPORTED targets. -include(${JANSSON_CMAKE_DIR}/JanssonTargets.cmake) - -# IMPORTED targets from JanssonTargets.cmake -set(JANSSON_LIBRARIES jansson) - diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/jansson_config.h.cmake kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/jansson_config.h.cmake --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/jansson_config.h.cmake 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/jansson_config.h.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2010-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - * - * - * This file specifies a part of the site-specific configuration for - * Jansson, namely those things that affect the public API in - * jansson.h. - * - * The CMake system will generate the jansson_config.h file and - * copy it to the build and install directories. - */ - -#ifndef JANSSON_CONFIG_H -#define JANSSON_CONFIG_H - -/* Define this so that we can disable scattered automake configuration in source files */ -#ifndef JANSSON_USING_CMAKE -#define JANSSON_USING_CMAKE -#endif - -/* Note: when using cmake, JSON_INTEGER_IS_LONG_LONG is not defined nor used, - * as we will also check for __int64 etc types. - * (the definition was used in the automake system) */ - -/* Bring in the cmake-detected defines */ -#cmakedefine HAVE_STDINT_H 1 -#cmakedefine HAVE_INTTYPES_H 1 -#cmakedefine HAVE_SYS_TYPES_H 1 - -/* Include our standard type header for the integer typedef */ - -#if defined(HAVE_STDINT_H) -# include -#elif defined(HAVE_INTTYPES_H) -# include -#elif defined(HAVE_SYS_TYPES_H) -# include -#endif - - -/* If your compiler supports the inline keyword in C, JSON_INLINE is - defined to `inline', otherwise empty. In C++, the inline is always - supported. */ -#ifdef __cplusplus -#define JSON_INLINE inline -#else -#define JSON_INLINE @JSON_INLINE@ -#endif - - -#define json_int_t @JSON_INT_T@ -#define json_strtoint @JSON_STRTOINT@ -#define JSON_INTEGER_FORMAT @JSON_INTEGER_FORMAT@ - - -/* If locale.h and localeconv() are available, define to 1, otherwise to 0. */ -#define JSON_HAVE_LOCALECONV @JSON_HAVE_LOCALECONV@ - - - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/JanssonConfigVersion.cmake.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/JanssonConfigVersion.cmake.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/JanssonConfigVersion.cmake.in 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/JanssonConfigVersion.cmake.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -set(PACKAGE_VERSION "@JANSSON_DISPLAY_VERSION@") - -# Check whether the requested PACKAGE_FIND_VERSION is compatible -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") - set(PACKAGE_VERSION_EXACT TRUE) - endif() -endif() diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/jansson_private_config.h.cmake kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/jansson_private_config.h.cmake --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/cmake/jansson_private_config.h.cmake 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/cmake/jansson_private_config.h.cmake 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -#cmakedefine HAVE_ENDIAN_H 1 -#cmakedefine HAVE_FCNTL_H 1 -#cmakedefine HAVE_SCHED_H 1 -#cmakedefine HAVE_UNISTD_H 1 -#cmakedefine HAVE_SYS_PARAM_H 1 -#cmakedefine HAVE_SYS_STAT_H 1 -#cmakedefine HAVE_SYS_TIME_H 1 -#cmakedefine HAVE_SYS_TYPES_H 1 -#cmakedefine HAVE_STDINT_H 1 - -#cmakedefine HAVE_CLOSE 1 -#cmakedefine HAVE_GETPID 1 -#cmakedefine HAVE_GETTIMEOFDAY 1 -#cmakedefine HAVE_OPEN 1 -#cmakedefine HAVE_READ 1 -#cmakedefine HAVE_SCHED_YIELD 1 - -#cmakedefine HAVE_SYNC_BUILTINS 1 -#cmakedefine HAVE_ATOMIC_BUILTINS 1 - -#cmakedefine HAVE_LOCALE_H 1 -#cmakedefine HAVE_SETLOCALE 1 - -#cmakedefine HAVE_INT32_T 1 -#ifndef HAVE_INT32_T -# define int32_t @JSON_INT32@ -#endif - -#cmakedefine HAVE_UINT32_T 1 -#ifndef HAVE_UINT32_T -# define uint32_t @JSON_UINT32@ -#endif - -#cmakedefine HAVE_UINT16_T 1 -#ifndef HAVE_UINT16_T -# define uint16_t @JSON_UINT16@ -#endif - -#cmakedefine HAVE_UINT8_T 1 -#ifndef HAVE_UINT8_T -# define uint8_t @JSON_UINT8@ -#endif - -#cmakedefine HAVE_SSIZE_T 1 - -#ifndef HAVE_SSIZE_T -# define ssize_t @JSON_SSIZE@ -#endif - -#cmakedefine HAVE_SNPRINTF 1 - -#ifndef HAVE_SNPRINTF -# define snprintf @JSON_SNPRINTF@ -#endif - -#cmakedefine HAVE_VSNPRINTF - -#cmakedefine USE_URANDOM 1 -#cmakedefine USE_WINDOWS_CRYPTOAPI 1 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/CMakeLists.txt kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/CMakeLists.txt --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/CMakeLists.txt 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,658 +0,0 @@ -# Notes: -# -# Author: Paul Harris, June 2012 -# Additions: Joakim Soderberg, Febuary 2013 -# -# Supports: building static/shared, release/debug/etc, can also build html docs -# and some of the tests. -# Note that its designed for out-of-tree builds, so it will not pollute your -# source tree. -# -# TODO 1: Finish implementing tests. api tests are working, but the valgrind -# variants are not flagging problems. -# -# TODO 2: There is a check_exports script that would try and incorporate. -# -# TODO 3: Consolidate version numbers, currently the version number is written -# into: * cmake (here) * autotools (the configure) * source code header files. -# Should not be written directly into header files, autotools/cmake can do -# that job. -# -# Brief intro on how to use cmake: -# > mkdir build (somewhere - we do out-of-tree builds) -# > use cmake, ccmake, or cmake-gui to configure the project. for linux, you -# can only choose one variant: release,debug,etc... and static or shared. -# >> example: -# >> cd build -# >> ccmake -i ../path_to_jansson_dir -# >> inside, configure your options. press C until there are no lines -# with * next to them. -# >> note, I like to configure the 'install' path to ../install, so I get -# self-contained clean installs I can point other projects to. -# >> press G to 'generate' the project files. -# >> make (to build the project) -# >> make install -# >> make test (to run the tests, if you enabled them) -# -# Brief description on how it works: -# There is a small heirachy of CMakeLists.txt files which define how the -# project is built. -# Header file detection etc is done, and the results are written into config.h -# and jansson_config.h, which are generated from the corresponding -# config.h.cmake and jansson_config.h.cmake template files. -# The generated header files end up in the build directory - not in -# the source directory. -# The rest is down to the usual make process. - - - -cmake_minimum_required (VERSION 2.8) -# required for exports? cmake_minimum_required (VERSION 2.8.6) -project (jansson C) - -# Options -option(JANSSON_BUILD_SHARED_LIBS "Build shared libraries." OFF) -option(USE_URANDOM "Use /dev/urandom to seed the hash function." ON) -option(USE_WINDOWS_CRYPTOAPI "Use CryptGenRandom to seed the hash function." ON) - -if (MSVC) - # This option must match the settings used in your program, in particular if you - # are linking statically - option(JANSSON_STATIC_CRT "Link the static CRT libraries" OFF ) -endif () - -# Set some nicer output dirs. -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) - -# Give the debug version a different postfix for windows, -# so both the debug and release version can be built in the -# same build-tree on Windows (MSVC). -if (WIN32) - set(CMAKE_DEBUG_POSTFIX "_d") -else (WIN32) -endif (WIN32) - -# This is how I thought it should go -# set (JANSSON_VERSION "2.3.1") -# set (JANSSON_SOVERSION 2) - -set(JANSSON_DISPLAY_VERSION "2.7") - -# This is what is required to match the same numbers as automake's -set(JANSSON_VERSION "4.7.0") -set(JANSSON_SOVERSION 4) - -# for CheckFunctionKeywords -set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") - -include (CheckCSourceCompiles) -include (CheckFunctionExists) -include (CheckFunctionKeywords) -include (CheckIncludeFiles) -include (CheckTypeSize) - -if (MSVC) - # Turn off Microsofts "security" warnings. - add_definitions( "/W3 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo" ) - - if (JANSSON_STATIC_CRT) - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT") - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd") - endif() - -endif() - -if (NOT WIN32 AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)) - add_definitions("-fPIC") -endif() - -check_include_files (endian.h HAVE_ENDIAN_H) -check_include_files (fcntl.h HAVE_FCNTL_H) -check_include_files (sched.h HAVE_SCHED_H) -check_include_files (unistd.h HAVE_UNISTD_H) -check_include_files (sys/param.h HAVE_SYS_PARAM_H) -check_include_files (sys/stat.h HAVE_SYS_STAT_H) -check_include_files (sys/time.h HAVE_SYS_TIME_H) -check_include_files (sys/time.h HAVE_SYS_TYPES_H) - -check_function_exists (close HAVE_CLOSE) -check_function_exists (getpid HAVE_GETPID) -check_function_exists (gettimeofday HAVE_GETTIMEOFDAY) -check_function_exists (open HAVE_OPEN) -check_function_exists (read HAVE_READ) -check_function_exists (sched_yield HAVE_SCHED_YIELD) - -# Check for the int-type includes -check_include_files (stdint.h HAVE_STDINT_H) - -# Check our 64 bit integer sizes -check_type_size (__int64 __INT64) -check_type_size (int64_t INT64_T) -check_type_size ("long long" LONG_LONG_INT) - -# Check our 32 bit integer sizes -check_type_size (int32_t INT32_T) -check_type_size (__int32 __INT32) -check_type_size ("long" LONG_INT) -check_type_size ("int" INT) -if (HAVE_INT32_T) - set (JSON_INT32 int32_t) -elseif (HAVE___INT32) - set (JSON_INT32 __int32) -elseif (HAVE_LONG_INT AND (${LONG_INT} EQUAL 4)) - set (JSON_INT32 long) -elseif (HAVE_INT AND (${INT} EQUAL 4)) - set (JSON_INT32 int) -else () - message (FATAL_ERROR "Could not detect a valid 32-bit integer type") -endif () - -check_type_size ("unsigned long" UNSIGNED_LONG_INT) -check_type_size ("unsigned int" UNSIGNED_INT) -check_type_size ("unsigned short" UNSIGNED_SHORT) - -check_type_size (uint32_t UINT32_T) -check_type_size (__uint32 __UINT32) -if (HAVE_UINT32_T) - set (JSON_UINT32 uint32_t) -elseif (HAVE___UINT32) - set (JSON_UINT32 __uint32) -elseif (HAVE_UNSIGNED_LONG_INT AND (${UNSIGNED_LONG_INT} EQUAL 4)) - set (JSON_UINT32 "unsigned long") -elseif (HAVE_UNSIGNED_INT AND (${UNSIGNED_INT} EQUAL 4)) - set (JSON_UINT32 "unsigned int") -else () - message (FATAL_ERROR "Could not detect a valid unsigned 32-bit integer type") -endif () - -check_type_size (uint16_t UINT16_T) -check_type_size (__uint16 __UINT16) -if (HAVE_UINT16_T) - set (JSON_UINT16 uint16_t) -elseif (HAVE___UINT16) - set (JSON_UINT16 __uint16) -elseif (HAVE_UNSIGNED_INT AND (${UNSIGNED_INT} EQUAL 2)) - set (JSON_UINT16 "unsigned int") -elseif (HAVE_UNSIGNED_SHORT AND (${UNSIGNED_SHORT} EQUAL 2)) - set (JSON_UINT16 "unsigned short") -else () - message (FATAL_ERROR "Could not detect a valid unsigned 16-bit integer type") -endif () - -check_type_size (uint8_t UINT8_T) -check_type_size (__uint8 __UINT8) -if (HAVE_UINT8_T) - set (JSON_UINT8 uint8_t) -elseif (HAVE___UINT8) - set (JSON_UINT8 __uint8) -else () - set (JSON_UINT8 "unsigned char") -endif () - -# Check for ssize_t and SSIZE_T existance. -check_type_size(ssize_t SSIZE_T) -check_type_size(SSIZE_T UPPERCASE_SSIZE_T) -if(NOT HAVE_SSIZE_T) - if(HAVE_UPPERCASE_SSIZE_T) - set(JSON_SSIZE SSIZE_T) - else() - set(JSON_SSIZE int) - endif() -endif() -set(CMAKE_EXTRA_INCLUDE_FILES "") - -# Check for all the variants of strtoll -check_function_exists (strtoll HAVE_STRTOLL) -check_function_exists (strtoq HAVE_STRTOQ) -check_function_exists (_strtoi64 HAVE__STRTOI64) - -# Figure out what variant we should use -if (HAVE_STRTOLL) - set (JSON_STRTOINT strtoll) -elseif (HAVE_STRTOQ) - set (JSON_STRTOINT strtoq) -elseif (HAVE__STRTOI64) - set (JSON_STRTOINT _strtoi64) -else () - # fallback to strtol (32 bit) - # this will set all the required variables - set (JSON_STRTOINT strtol) - set (JSON_INT_T long) - set (JSON_INTEGER_FORMAT "\"ld\"") -endif () - -# if we haven't defined JSON_INT_T, then we have a 64 bit conversion function. -# detect what to use for the 64 bit type. -# Note: I will prefer long long if I can get it, as that is what the automake system aimed for. -if (NOT DEFINED JSON_INT_T) - if (HAVE_LONG_LONG_INT AND (${LONG_LONG_INT} EQUAL 8)) - set (JSON_INT_T "long long") - elseif (HAVE_INT64_T) - set (JSON_INT_T int64_t) - elseif (HAVE___INT64) - set (JSON_INT_T __int64) - else () - message (FATAL_ERROR "Could not detect 64 bit type, although I detected the strtoll equivalent") - endif () - - # Apparently, Borland BCC and MSVC wants I64d, - # Borland BCC could also accept LD - # and gcc wants ldd, - # I am not sure what cygwin will want, so I will assume I64d - - if (WIN32) # matches both msvc and cygwin - set (JSON_INTEGER_FORMAT "\"I64d\"") - else () - set (JSON_INTEGER_FORMAT "\"lld\"") - endif () -endif () - - -# If locale.h and localeconv() are available, define to 1, otherwise to 0. -check_include_files (locale.h HAVE_LOCALE_H) -check_function_exists (localeconv HAVE_LOCALECONV) - -if (HAVE_LOCALECONV AND HAVE_LOCALE_H) - set (JSON_HAVE_LOCALECONV 1) -else () - set (JSON_HAVE_LOCALECONV 0) -endif() - -# check if we have setlocale -check_function_exists(setlocale HAVE_SETLOCALE) - -# Check what the inline keyword is. -# Note that the original JSON_INLINE was always set to just 'inline', so this goes further. -check_function_keywords("inline") -check_function_keywords("__inline") -check_function_keywords("__inline__") - -if (HAVE_INLINE) - set(JSON_INLINE inline) -elseif (HAVE___INLINE) - set(JSON_INLINE __inline) -elseif (HAVE___INLINE__) - set(JSON_INLINE __inline__) -else() - # no inline on this platform - set (JSON_INLINE) -endif() - -# Find our snprintf -check_function_exists (snprintf HAVE_SNPRINTF) -check_function_exists (_snprintf HAVE__SNPRINTF) - -if (HAVE_SNPRINTF) - set(JSON_SNPRINTF snprintf) -elseif (HAVE__SNPRINTF) - set(JSON_SNPRINTF _snprintf) -endif () - -check_c_source_compiles ("int main() { unsigned long val; __sync_bool_compare_and_swap(&val, 0, 1); return 0; } " HAVE_SYNC_BUILTINS) -check_c_source_compiles ("int main() { char l; unsigned long v; __atomic_test_and_set(&l, __ATOMIC_RELAXED); __atomic_store_n(&v, 1, __ATOMIC_RELEASE); __atomic_load_n(&v, __ATOMIC_ACQUIRE); return 0; }" HAVE_ATOMIC_BUILTINS) - -# Create pkg-conf file. -# (We use the same files as ./configure does, so we -# have to defined the same variables used there). -if(NOT DEFINED CMAKE_INSTALL_LIBDIR) - set(CMAKE_INSTALL_LIBDIR lib) -endif(NOT DEFINED CMAKE_INSTALL_LIBDIR) -set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix ${CMAKE_INSTALL_PREFIX}) -set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) -set(VERSION ${JANSSON_DISPLAY_VERSION}) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jansson.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/jansson.pc @ONLY) - -# configure the public config file -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/jansson_config.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/include/jansson_config.h) - -# Copy the jansson.h file to the public include folder -file (COPY ${CMAKE_CURRENT_SOURCE_DIR}/src/jansson.h - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/) - -add_definitions(-DJANSSON_USING_CMAKE) - -# configure the private config file -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/cmake/jansson_private_config.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/private_include/jansson_private_config.h) - -# and tell the source code to include it -add_definitions(-DHAVE_CONFIG_H) - -include_directories (${CMAKE_CURRENT_BINARY_DIR}/include) -include_directories (${CMAKE_CURRENT_BINARY_DIR}/private_include) - -# Add the lib sources. -file(GLOB JANSSON_SRC src/*.c) - -set(JANSSON_HDR_PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/src/hashtable.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/jansson_private.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/strbuffer.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/utf.h - ${CMAKE_CURRENT_BINARY_DIR}/private_include/jansson_private_config.h) - -set(JANSSON_HDR_PUBLIC - ${CMAKE_CURRENT_BINARY_DIR}/include/jansson_config.h - ${CMAKE_CURRENT_SOURCE_DIR}/src/jansson.h) - -source_group("Library Sources" FILES ${JANSSON_SRC}) -source_group("Library Private Headers" FILES ${JANSSON_HDR_PRIVATE}) -source_group("Library Public Headers" FILES ${JANSSON_HDR_PUBLIC}) - -if(JANSSON_BUILD_SHARED_LIBS) - add_library(jansson SHARED - ${JANSSON_SRC} - ${JANSSON_HDR_PRIVATE} - ${JANSSON_HDR_PUBLIC} - src/jansson.def) - - set_target_properties(jansson PROPERTIES - VERSION ${JANSSON_VERSION} - SOVERSION ${JANSSON_SOVERSION}) -else() - add_library(jansson - ${JANSSON_SRC} - ${JANSSON_HDR_PRIVATE} - ${JANSSON_HDR_PUBLIC}) -endif() - - -# For building Documentation (uses Sphinx) -option(JANSSON_BUILD_DOCS "Build documentation (uses python-sphinx)." OFF) -if (JANSSON_BUILD_DOCS) - find_package(Sphinx) - - if (NOT SPHINX_FOUND) - message(WARNING "Sphinx not found. Cannot generate documentation! - Set -DJANSSON_BUILD_DOCS=OFF to get rid of this message.") - else() - if (Sphinx_VERSION_STRING VERSION_LESS 1.0) - message(WARNING "Your Sphinx version is too old! - This project requires Sphinx v1.0 or above to produce - proper documentation (you have v${Sphinx_VERSION_STRING}). - You will get output but it will have errors.") - endif() - - # configured documentation tools and intermediate build results - set(BINARY_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build") - - # Sphinx cache with pickled ReST documents - set(SPHINX_CACHE_DIR "${CMAKE_CURRENT_BINARY_DIR}/_doctrees") - - # CMake could be used to build the conf.py file too, - # eg it could automatically write the version of the program or change the theme. - # if(NOT DEFINED SPHINX_THEME) - # set(SPHINX_THEME default) - # endif() - # - # if(NOT DEFINED SPHINX_THEME_DIR) - # set(SPHINX_THEME_DIR) - # endif() - # - # configure_file( - # "${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" - # "${BINARY_BUILD_DIR}/conf.py" - # @ONLY) - - # TODO: Add support for all sphinx builders: http://sphinx-doc.org/builders.html - - # Add documentation targets. - set(DOC_TARGETS html) - - option(JANSSON_BUILD_MAN "Create a target for building man pages." ON) - - if (JANSSON_BUILD_MAN) - if (Sphinx_VERSION_STRING VERSION_LESS 1.0) - message(WARNING "Sphinx version 1.0 > is required to build man pages. You have v${Sphinx_VERSION_STRING}.") - else() - list(APPEND DOC_TARGETS man) - endif() - endif() - - option(JANSSON_BUILD_LATEX "Create a target for building latex docs (to create PDF)." OFF) - - if (JANSSON_BUILD_LATEX) - find_package(LATEX) - - if (NOT LATEX_COMPILER) - message("Couldn't find Latex, can't build latex docs using Sphinx") - else() - message("Latex found! If you have problems building, see Sphinx documentation for required Latex packages.") - list(APPEND DOC_TARGETS latex) - endif() - endif() - - # The doc target will build all documentation targets. - add_custom_target(doc) - - foreach (DOC_TARGET ${DOC_TARGETS}) - add_custom_target(${DOC_TARGET} - ${SPHINX_EXECUTABLE} - # -q # Enable for quiet mode - -b ${DOC_TARGET} - -d "${SPHINX_CACHE_DIR}" - # -c "${BINARY_BUILD_DIR}" # enable if using cmake-generated conf.py - "${CMAKE_CURRENT_SOURCE_DIR}/doc" - "${CMAKE_CURRENT_BINARY_DIR}/doc/${DOC_TARGET}" - COMMENT "Building ${DOC_TARGET} documentation with Sphinx") - - add_dependencies(doc ${DOC_TARGET}) - endforeach() - - message("Building documentation enabled for: ${DOC_TARGETS}") - endif() -endif () - - -option(JANSSON_WITHOUT_TESTS "Don't build tests ('make test' to execute tests)" OFF) - -if (NOT JANSSON_WITHOUT_TESTS) - option(JANSSON_TEST_WITH_VALGRIND "Enable valgrind tests." OFF) - - ENABLE_TESTING() - - if (JANSSON_TEST_WITH_VALGRIND) - # TODO: Add FindValgrind.cmake instead of having a hardcoded path. - - add_definitions(-DVALGRIND) - - # enable valgrind - set(CMAKE_MEMORYCHECK_COMMAND valgrind) - set(CMAKE_MEMORYCHECK_COMMAND_OPTIONS - "--error-exitcode=1 --leak-check=full --show-reachable=yes --track-origins=yes -q") - - set(MEMCHECK_COMMAND - "${CMAKE_MEMORYCHECK_COMMAND} ${CMAKE_MEMORYCHECK_COMMAND_OPTIONS}") - separate_arguments(MEMCHECK_COMMAND) - endif () - - # - # Test suites. - # - if (CMAKE_COMPILER_IS_GNUCC) - add_definitions(-Wall -Wextra -Wdeclaration-after-statement) - endif () - - set(api_tests - test_array - test_copy - test_dump - test_dump_callback - test_equal - test_load - test_loadb - test_number - test_object - test_pack - test_simple - test_unpack) - - # Doing arithmetic on void pointers is not allowed by Microsofts compiler - # such as secure_malloc and secure_free is doing, so exclude it for now. - if (NOT MSVC) - list(APPEND api_tests test_memory_funcs) - endif() - - # Helper macro for building and linking a test program. - macro(build_testprog name dir) - add_executable(${name} ${dir}/${name}.c) - add_dependencies(${name} jansson) - target_link_libraries(${name} jansson) - endmacro(build_testprog) - - # Create executables and tests/valgrind tests for API tests. - foreach (test ${api_tests}) - build_testprog(${test} ${PROJECT_SOURCE_DIR}/test/suites/api) - - if (JANSSON_TEST_WITH_VALGRIND) - add_test(memcheck__${test} - ${MEMCHECK_COMMAND} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test}) - else() - add_test(${test} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${test}) - endif () - endforeach () - - # Test harness for the suites tests. - build_testprog(json_process ${PROJECT_SOURCE_DIR}/test/bin) - - set(SUITES encoding-flags valid invalid invalid-unicode) - foreach (SUITE ${SUITES}) - file(GLOB TESTDIRS ${jansson_SOURCE_DIR}/test/suites/${SUITE}/*) - - foreach (TESTDIR ${TESTDIRS}) - if (IS_DIRECTORY ${TESTDIR}) - get_filename_component(TNAME ${TESTDIR} NAME) - - set(SUITE_TEST_CMD ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/json_process) - - if (JANSSON_TEST_WITH_VALGRIND) - add_test(memcheck__${SUITE}__${TNAME} - ${MEMCHECK_COMMAND} ${SUITE_TEST_CMD} ${TESTDIR}) - else() - add_test(${SUITE}__${TNAME} - ${SUITE_TEST_CMD} ${TESTDIR}) - endif() - - if ((${SUITE} STREQUAL "valid" OR ${SUITE} STREQUAL "invalid") AND NOT EXISTS ${TESTDIR}/nostrip) - if (JANSSON_TEST_WITH_VALGRIND) - add_test(memcheck__${SUITE}__${TNAME}__strip - ${MEMCHECK_COMMAND} ${SUITE_TEST_CMD} --strip ${TESTDIR}) - else() - add_test(${SUITE}__${TNAME}__strip - ${SUITE_TEST_CMD} --strip ${TESTDIR}) - endif() - endif () - endif () - endforeach () - endforeach () - - add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} - DEPENDS json_process ${api_tests}) -endif () - -# -# Installation preparation. -# - -# Allow the user to override installation directories. -set(JANSSON_INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries") -set(JANSSON_INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables") -set(JANSSON_INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header files") - -if(WIN32 AND NOT CYGWIN) - set(DEF_INSTALL_CMAKE_DIR cmake) -else() - set(DEF_INSTALL_CMAKE_DIR lib/cmake/jansson) -endif() - -set(JANSSON_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files") - -# Make sure the paths are absolute. -foreach(p LIB BIN INCLUDE CMAKE) - set(var JANSSON_INSTALL_${p}_DIR) - if(NOT IS_ABSOLUTE "${${var}}") - set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}") - endif() -endforeach() - -# Export targets (This is used for other CMake projects to easily find the libraries and include files). -export(TARGETS jansson - FILE "${PROJECT_BINARY_DIR}/JanssonTargets.cmake") -export(PACKAGE jansson) - -# Generate the config file for the build-tree. -set(JANSSON__INCLUDE_DIRS - "${PROJECT_SOURCE_DIR}/include" - "${PROJECT_BINARY_DIR}/include") -set(JANSSON_INCLUDE_DIRS ${JANSSON__INCLUDE_DIRS} CACHE PATH "Jansson include directories") -configure_file(${PROJECT_SOURCE_DIR}/cmake/JanssonConfig.cmake.in - ${PROJECT_BINARY_DIR}/JanssonConfig.cmake - @ONLY) - -# Generate the config file for the installation tree. -file(RELATIVE_PATH - REL_INCLUDE_DIR - "${JANSSON_INSTALL_CMAKE_DIR}" - "${JANSSON_INSTALL_INCLUDE_DIR}") # Calculate the relative directory from the Cmake dir. - -# Note the EVENT_CMAKE_DIR is defined in JanssonConfig.cmake.in, -# we escape it here so it's evaluated when it is included instead -# so that the include dirs are given relative to where the -# config file is located. -set(JANSSON__INCLUDE_DIRS - "\${JANSSON_CMAKE_DIR}/${REL_INCLUDE_DIR}") -configure_file(${PROJECT_SOURCE_DIR}/cmake/JanssonConfig.cmake.in - ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/JanssonConfig.cmake - @ONLY) - -# Generate version info for both build-tree and install-tree. -configure_file(${PROJECT_SOURCE_DIR}/cmake/JanssonConfigVersion.cmake.in - ${PROJECT_BINARY_DIR}/JanssonConfigVersion.cmake - @ONLY) - -# Define the public headers. -set_target_properties(jansson PROPERTIES PUBLIC_HEADER "${JANSSON_HDR_PUBLIC}") -#TODO: fix this. - -# Create pkg-conf file. -# (We use the same files as ./configure does, so we -# have to defined the same variables used there). -set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix ${CMAKE_INSTALL_PREFIX}) -set(libdir ${CMAKE_INSTALL_PREFIX}/${JANSSON_INSTALL_LIB_DIR}) -set(VERSION ${JANSSON_DISPLAY_VERSION}) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/jansson.pc.in - ${CMAKE_CURRENT_BINARY_DIR}/jansson.pc @ONLY) - -# -# Install targets. -# -install(TARGETS jansson - EXPORT JanssonTargets - LIBRARY DESTINATION "${JANSSON_INSTALL_LIB_DIR}" COMPONENT lib - ARCHIVE DESTINATION "${JANSSON_INSTALL_LIB_DIR}" COMPONENT lib - RUNTIME DESTINATION "${JANSSON_INSTALL_BIN_DIR}" COMPONENT lib # Windows DLLs - PUBLIC_HEADER DESTINATION "${JANSSON_INSTALL_INCLUDE_DIR}" COMPONENT dev) - -# Install the pkg-config. -install (FILES - ${CMAKE_CURRENT_BINARY_DIR}/jansson.pc - DESTINATION ${JANSSON_INSTALL_LIB_DIR}/pkgconfig COMPONENT dev) - -# Install the configs. -install(FILES - ${PROJECT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/JanssonConfig.cmake - ${PROJECT_BINARY_DIR}/JanssonConfigVersion.cmake - DESTINATION "${JANSSON_INSTALL_CMAKE_DIR}" COMPONENT dev) - -# Install exports for the install-tree. -install(EXPORT JanssonTargets - DESTINATION "${JANSSON_INSTALL_CMAKE_DIR}" COMPONENT dev) - -# For use when simply using add_library from a parent project to build jansson. -set(JANSSON_LIBRARIES jansson CACHE STRING "Jansson libraries") diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/configure.ac kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/configure.ac --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/configure.ac 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/configure.ac 1970-01-01 00:00:00.000000000 +0000 @@ -1,111 +0,0 @@ -AC_PREREQ([2.60]) -AC_INIT([jansson], [2.7], [petri@digip.org]) - -AC_CONFIG_AUX_DIR([.]) -AM_INIT_AUTOMAKE([1.10 foreign]) - -AC_CONFIG_SRCDIR([src/value.c]) -AC_CONFIG_HEADERS([jansson_private_config.h]) - -# Checks for programs. -AC_PROG_CC -AC_PROG_LIBTOOL -AM_CONDITIONAL([GCC], [test x$GCC = xyes]) - -# Checks for libraries. - -# Checks for header files. -AC_CHECK_HEADERS([endian.h fcntl.h locale.h sched.h unistd.h sys/param.h sys/stat.h sys/time.h sys/types.h]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_TYPE_INT32_T -AC_TYPE_UINT32_T -AC_TYPE_UINT16_T -AC_TYPE_UINT8_T -AC_TYPE_LONG_LONG_INT - -AC_C_INLINE -case $ac_cv_c_inline in - yes) json_inline=inline;; - no) json_inline=;; - *) json_inline=$ac_cv_c_inline;; -esac -AC_SUBST([json_inline]) - -# Checks for library functions. -AC_CHECK_FUNCS([close getpid gettimeofday localeconv open read sched_yield strtoll]) - -AC_MSG_CHECKING([for gcc __sync builtins]) -have_sync_builtins=no -AC_TRY_LINK( - [], [unsigned long val; __sync_bool_compare_and_swap(&val, 0, 1);], - [have_sync_builtins=yes], -) -if test "x$have_sync_builtins" = "xyes"; then - AC_DEFINE([HAVE_SYNC_BUILTINS], [1], - [Define to 1 if gcc's __sync builtins are available]) -fi -AC_MSG_RESULT([$have_sync_builtins]) - -AC_MSG_CHECKING([for gcc __atomic builtins]) -have_atomic_builtins=no -AC_TRY_LINK( - [], [char l; unsigned long v; __atomic_test_and_set(&l, __ATOMIC_RELAXED); __atomic_store_n(&v, 1, __ATOMIC_RELEASE); __atomic_load_n(&v, __ATOMIC_ACQUIRE);], - [have_atomic_builtins=yes], -) -if test "x$have_atomic_builtins" = "xyes"; then - AC_DEFINE([HAVE_ATOMIC_BUILTINS], [1], - [Define to 1 if gcc's __atomic builtins are available]) -fi -AC_MSG_RESULT([$have_atomic_builtins]) - -case "$ac_cv_type_long_long_int$ac_cv_func_strtoll" in - yesyes) json_have_long_long=1;; - *) json_have_long_long=0;; -esac -AC_SUBST([json_have_long_long]) - -case "$ac_cv_header_locale_h$ac_cv_func_localeconv" in - yesyes) json_have_localeconv=1;; - *) json_have_localeconv=0;; -esac -AC_SUBST([json_have_localeconv]) - -# Features -AC_ARG_ENABLE([urandom], - [AS_HELP_STRING([--disable-urandom], - [Don't use /dev/urandom to seed the hash function])], - [use_urandom=$enableval], [use_urandom=yes]) - -if test "x$use_urandom" = xyes; then -AC_DEFINE([USE_URANDOM], [1], - [Define to 1 if /dev/urandom should be used for seeding the hash function]) -fi - -AC_ARG_ENABLE([windows-cryptoapi], - [AS_HELP_STRING([--disable-windows-cryptoapi], - [Don't use CryptGenRandom to seed the hash function])], - [use_windows_cryptoapi=$enableval], [use_windows_cryptoapi=yes]) - -if test "x$use_windows_cryptoapi" = xyes; then -AC_DEFINE([USE_WINDOWS_CRYPTOAPI], [1], - [Define to 1 if CryptGenRandom should be used for seeding the hash function]) -fi - -if test x$GCC = xyes; then - AM_CFLAGS="-Wall -Wextra -Wdeclaration-after-statement" -fi -AC_SUBST([AM_CFLAGS]) - -AC_CONFIG_FILES([ - jansson.pc - Makefile - doc/Makefile - src/Makefile - src/jansson_config.h - test/Makefile - test/bin/Makefile - test/suites/Makefile - test/suites/api/Makefile -]) -AC_OUTPUT diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/apiref.rst kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/apiref.rst --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/apiref.rst 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/apiref.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,1602 +0,0 @@ -.. _apiref: - -************* -API Reference -************* - -.. highlight:: c - -Preliminaries -============= - -All declarations are in :file:`jansson.h`, so it's enough to - -:: - - #include - -in each source file. - -All constants are prefixed with ``JSON_`` (except for those describing -the library version, prefixed with ``JANSSON_``). Other identifiers -are prefixed with ``json_``. Type names are suffixed with ``_t`` and -``typedef``\ 'd so that the ``struct`` keyword need not be used. - - -Library Version -=============== - -The Jansson version is of the form *A.B.C*, where *A* is the major -version, *B* is the minor version and *C* is the micro version. If the -micro version is zero, it's omitted from the version string, i.e. the -version string is just *A.B*. - -When a new release only fixes bugs and doesn't add new features or -functionality, the micro version is incremented. When new features are -added in a backwards compatible way, the minor version is incremented -and the micro version is set to zero. When there are backwards -incompatible changes, the major version is incremented and others are -set to zero. - -The following preprocessor constants specify the current version of -the library: - -``JANSSON_MAJOR_VERSION``, ``JANSSON_MINOR_VERSION``, ``JANSSON_MICRO_VERSION`` - Integers specifying the major, minor and micro versions, - respectively. - -``JANSSON_VERSION`` - A string representation of the current version, e.g. ``"1.2.1"`` or - ``"1.3"``. - -``JANSSON_VERSION_HEX`` - A 3-byte hexadecimal representation of the version, e.g. - ``0x010201`` for version 1.2.1 and ``0x010300`` for version 1.3. - This is useful in numeric comparisions, e.g.:: - - #if JANSSON_VERSION_HEX >= 0x010300 - /* Code specific to version 1.3 and above */ - #endif - - -Value Representation -==================== - -The JSON specification (:rfc:`4627`) defines the following data types: -*object*, *array*, *string*, *number*, *boolean*, and *null*. JSON -types are used dynamically; arrays and objects can hold any other data -type, including themselves. For this reason, Jansson's type system is -also dynamic in nature. There's one C type to represent all JSON -values, and this structure knows the type of the JSON value it holds. - -.. type:: json_t - - This data structure is used throughout the library to represent all - JSON values. It always contains the type of the JSON value it holds - and the value's reference count. The rest depends on the type of the - value. - -Objects of :type:`json_t` are always used through a pointer. There -are APIs for querying the type, manipulating the reference count, and -for constructing and manipulating values of different types. - -Unless noted otherwise, all API functions return an error value if an -error occurs. Depending on the function's signature, the error value -is either *NULL* or -1. Invalid arguments or invalid input are -apparent sources for errors. Memory allocation and I/O operations may -also cause errors. - - -Type ----- - -The type of a JSON value is queried and tested using the following -functions: - -.. type:: enum json_type - - The type of a JSON value. The following members are defined: - - +--------------------+ - | ``JSON_OBJECT`` | - +--------------------+ - | ``JSON_ARRAY`` | - +--------------------+ - | ``JSON_STRING`` | - +--------------------+ - | ``JSON_INTEGER`` | - +--------------------+ - | ``JSON_REAL`` | - +--------------------+ - | ``JSON_TRUE`` | - +--------------------+ - | ``JSON_FALSE`` | - +--------------------+ - | ``JSON_NULL`` | - +--------------------+ - - These correspond to JSON object, array, string, number, boolean and - null. A number is represented by either a value of the type - ``JSON_INTEGER`` or of the type ``JSON_REAL``. A true boolean value - is represented by a value of the type ``JSON_TRUE`` and false by a - value of the type ``JSON_FALSE``. - -.. function:: int json_typeof(const json_t *json) - - Return the type of the JSON value (a :type:`json_type` cast to - :type:`int`). *json* MUST NOT be *NULL*. This function is actually - implemented as a macro for speed. - -.. function:: json_is_object(const json_t *json) - json_is_array(const json_t *json) - json_is_string(const json_t *json) - json_is_integer(const json_t *json) - json_is_real(const json_t *json) - json_is_true(const json_t *json) - json_is_false(const json_t *json) - json_is_null(const json_t *json) - - These functions (actually macros) return true (non-zero) for values - of the given type, and false (zero) for values of other types and - for *NULL*. - -.. function:: json_is_number(const json_t *json) - - Returns true for values of types ``JSON_INTEGER`` and - ``JSON_REAL``, and false for other types and for *NULL*. - -.. function:: json_is_boolean(const json_t *json) - - Returns true for types ``JSON_TRUE`` and ``JSON_FALSE``, and false - for values of other types and for *NULL*. - -.. function:: json_boolean_value(const json_t *json) - - Alias of :func:`json_is_true()`, i.e. returns 1 for ``JSON_TRUE`` - and 0 otherwise. - - .. versionadded:: 2.7 - - -.. _apiref-reference-count: - -Reference Count ---------------- - -The reference count is used to track whether a value is still in use -or not. When a value is created, it's reference count is set to 1. If -a reference to a value is kept (e.g. a value is stored somewhere for -later use), its reference count is incremented, and when the value is -no longer needed, the reference count is decremented. When the -reference count drops to zero, there are no references left, and the -value can be destroyed. - -The following functions are used to manipulate the reference count. - -.. function:: json_t *json_incref(json_t *json) - - Increment the reference count of *json* if it's not *NULL*. - Returns *json*. - -.. function:: void json_decref(json_t *json) - - Decrement the reference count of *json*. As soon as a call to - :func:`json_decref()` drops the reference count to zero, the value - is destroyed and it can no longer be used. - -Functions creating new JSON values set the reference count to 1. These -functions are said to return a **new reference**. Other functions -returning (existing) JSON values do not normally increase the -reference count. These functions are said to return a **borrowed -reference**. So, if the user will hold a reference to a value returned -as a borrowed reference, he must call :func:`json_incref`. As soon as -the value is no longer needed, :func:`json_decref` should be called -to release the reference. - -Normally, all functions accepting a JSON value as an argument will -manage the reference, i.e. increase and decrease the reference count -as needed. However, some functions **steal** the reference, i.e. they -have the same result as if the user called :func:`json_decref()` on -the argument right after calling the function. These functions are -suffixed with ``_new`` or have ``_new_`` somewhere in their name. - -For example, the following code creates a new JSON array and appends -an integer to it:: - - json_t *array, *integer; - - array = json_array(); - integer = json_integer(42); - - json_array_append(array, integer); - json_decref(integer); - -Note how the caller has to release the reference to the integer value -by calling :func:`json_decref()`. By using a reference stealing -function :func:`json_array_append_new()` instead of -:func:`json_array_append()`, the code becomes much simpler:: - - json_t *array = json_array(); - json_array_append_new(array, json_integer(42)); - -In this case, the user doesn't have to explicitly release the -reference to the integer value, as :func:`json_array_append_new()` -steals the reference when appending the value to the array. - -In the following sections it is clearly documented whether a function -will return a new or borrowed reference or steal a reference to its -argument. - - -Circular References -------------------- - -A circular reference is created when an object or an array is, -directly or indirectly, inserted inside itself. The direct case is -simple:: - - json_t *obj = json_object(); - json_object_set(obj, "foo", obj); - -Jansson will refuse to do this, and :func:`json_object_set()` (and -all the other such functions for objects and arrays) will return with -an error status. The indirect case is the dangerous one:: - - json_t *arr1 = json_array(), *arr2 = json_array(); - json_array_append(arr1, arr2); - json_array_append(arr2, arr1); - -In this example, the array ``arr2`` is contained in the array -``arr1``, and vice versa. Jansson cannot check for this kind of -indirect circular references without a performance hit, so it's up to -the user to avoid them. - -If a circular reference is created, the memory consumed by the values -cannot be freed by :func:`json_decref()`. The reference counts never -drops to zero because the values are keeping the references to each -other. Moreover, trying to encode the values with any of the encoding -functions will fail. The encoder detects circular references and -returns an error status. - - -True, False and Null -==================== - -These three values are implemented as singletons, so the returned -pointers won't change between invocations of these functions. - -.. function:: json_t *json_true(void) - - .. refcounting:: new - - Returns the JSON true value. - -.. function:: json_t *json_false(void) - - .. refcounting:: new - - Returns the JSON false value. - -.. function:: json_t *json_boolean(val) - - .. refcounting:: new - - Returns JSON false if ``val`` is zero, and JSON true otherwise. - This is a macro, and equivalent to ``val ? json_true() : - json_false()``. - - .. versionadded:: 2.4 - - -.. function:: json_t *json_null(void) - - .. refcounting:: new - - Returns the JSON null value. - - -String -====== - -Jansson uses UTF-8 as the character encoding. All JSON strings must be -valid UTF-8 (or ASCII, as it's a subset of UTF-8). All Unicode -codepoints U+0000 through U+10FFFF are allowed, but you must use -length-aware functions if you wish to embed NUL bytes in strings. - -.. function:: json_t *json_string(const char *value) - - .. refcounting:: new - - Returns a new JSON string, or *NULL* on error. *value* must be a - valid null terminated UTF-8 encoded Unicode string. - -.. function:: json_t *json_stringn(const char *value, size_t len) - - .. refcounting:: new - - Like :func:`json_string`, but with explicit length, so *value* may - contain null characters or not be null terminated. - -.. function:: json_t *json_string_nocheck(const char *value) - - .. refcounting:: new - - Like :func:`json_string`, but doesn't check that *value* is valid - UTF-8. Use this function only if you are certain that this really - is the case (e.g. you have already checked it by other means). - -.. function:: json_t *json_stringn_nocheck(const char *value, size_t len) - - .. refcounting:: new - - Like :func:`json_string_nocheck`, but with explicit length, so - *value* may contain null characters or not be null terminated. - -.. function:: const char *json_string_value(const json_t *string) - - Returns the associated value of *string* as a null terminated UTF-8 - encoded string, or *NULL* if *string* is not a JSON string. - - The retuned value is read-only and must not be modified or freed by - the user. It is valid as long as *string* exists, i.e. as long as - its reference count has not dropped to zero. - -.. function:: size_t json_string_length(const json_t *string) - - Returns the length of *string* in its UTF-8 presentation, or zero - if *string* is not a JSON string. - -.. function:: int json_string_set(const json_t *string, const char *value) - - Sets the associated value of *string* to *value*. *value* must be a - valid UTF-8 encoded Unicode string. Returns 0 on success and -1 on - error. - -.. function:: int json_string_setn(json_t *string, const char *value, size_t len) - - Like :func:`json_string_set`, but with explicit length, so *value* - may contain null characters or not be null terminated. - -.. function:: int json_string_set_nocheck(const json_t *string, const char *value) - - Like :func:`json_string_set`, but doesn't check that *value* is - valid UTF-8. Use this function only if you are certain that this - really is the case (e.g. you have already checked it by other - means). - -.. function:: int json_string_setn_nocheck(json_t *string, const char *value, size_t len) - - Like :func:`json_string_set_nocheck`, but with explicit length, - so *value* may contain null characters or not be null terminated. - - -Number -====== - -The JSON specification only contains one numeric type, "number". The C -programming language has distinct types for integer and floating-point -numbers, so for practical reasons Jansson also has distinct types for -the two. They are called "integer" and "real", respectively. For more -information, see :ref:`rfc-conformance`. - -.. type:: json_int_t - - This is the C type that is used to store JSON integer values. It - represents the widest integer type available on your system. In - practice it's just a typedef of ``long long`` if your compiler - supports it, otherwise ``long``. - - Usually, you can safely use plain ``int`` in place of - ``json_int_t``, and the implicit C integer conversion handles the - rest. Only when you know that you need the full 64-bit range, you - should use ``json_int_t`` explicitly. - -``JSON_INTEGER_IS_LONG_LONG`` - This is a preprocessor variable that holds the value 1 if - :type:`json_int_t` is ``long long``, and 0 if it's ``long``. It - can be used as follows:: - - #if JSON_INTEGER_IS_LONG_LONG - /* Code specific for long long */ - #else - /* Code specific for long */ - #endif - -``JSON_INTEGER_FORMAT`` - This is a macro that expands to a :func:`printf()` conversion - specifier that corresponds to :type:`json_int_t`, without the - leading ``%`` sign, i.e. either ``"lld"`` or ``"ld"``. This macro - is required because the actual type of :type:`json_int_t` can be - either ``long`` or ``long long``, and :func:`printf()` reuiqres - different length modifiers for the two. - - Example:: - - json_int_t x = 123123123; - printf("x is %" JSON_INTEGER_FORMAT "\n", x); - - -.. function:: json_t *json_integer(json_int_t value) - - .. refcounting:: new - - Returns a new JSON integer, or *NULL* on error. - -.. function:: json_int_t json_integer_value(const json_t *integer) - - Returns the associated value of *integer*, or 0 if *json* is not a - JSON integer. - -.. function:: int json_integer_set(const json_t *integer, json_int_t value) - - Sets the associated value of *integer* to *value*. Returns 0 on - success and -1 if *integer* is not a JSON integer. - -.. function:: json_t *json_real(double value) - - .. refcounting:: new - - Returns a new JSON real, or *NULL* on error. - -.. function:: double json_real_value(const json_t *real) - - Returns the associated value of *real*, or 0.0 if *real* is not a - JSON real. - -.. function:: int json_real_set(const json_t *real, double value) - - Sets the associated value of *real* to *value*. Returns 0 on - success and -1 if *real* is not a JSON real. - -In addition to the functions above, there's a common query function -for integers and reals: - -.. function:: double json_number_value(const json_t *json) - - Returns the associated value of the JSON integer or JSON real - *json*, cast to double regardless of the actual type. If *json* is - neither JSON real nor JSON integer, 0.0 is returned. - - -Array -===== - -A JSON array is an ordered collection of other JSON values. - -.. function:: json_t *json_array(void) - - .. refcounting:: new - - Returns a new JSON array, or *NULL* on error. Initially, the array - is empty. - -.. function:: size_t json_array_size(const json_t *array) - - Returns the number of elements in *array*, or 0 if *array* is NULL - or not a JSON array. - -.. function:: json_t *json_array_get(const json_t *array, size_t index) - - .. refcounting:: borrow - - Returns the element in *array* at position *index*. The valid range - for *index* is from 0 to the return value of - :func:`json_array_size()` minus 1. If *array* is not a JSON array, - if *array* is *NULL*, or if *index* is out of range, *NULL* is - returned. - -.. function:: int json_array_set(json_t *array, size_t index, json_t *value) - - Replaces the element in *array* at position *index* with *value*. - The valid range for *index* is from 0 to the return value of - :func:`json_array_size()` minus 1. Returns 0 on success and -1 on - error. - -.. function:: int json_array_set_new(json_t *array, size_t index, json_t *value) - - Like :func:`json_array_set()` but steals the reference to *value*. - This is useful when *value* is newly created and not used after - the call. - -.. function:: int json_array_append(json_t *array, json_t *value) - - Appends *value* to the end of *array*, growing the size of *array* - by 1. Returns 0 on success and -1 on error. - -.. function:: int json_array_append_new(json_t *array, json_t *value) - - Like :func:`json_array_append()` but steals the reference to - *value*. This is useful when *value* is newly created and not used - after the call. - -.. function:: int json_array_insert(json_t *array, size_t index, json_t *value) - - Inserts *value* to *array* at position *index*, shifting the - elements at *index* and after it one position towards the end of - the array. Returns 0 on success and -1 on error. - -.. function:: int json_array_insert_new(json_t *array, size_t index, json_t *value) - - Like :func:`json_array_insert()` but steals the reference to - *value*. This is useful when *value* is newly created and not used - after the call. - -.. function:: int json_array_remove(json_t *array, size_t index) - - Removes the element in *array* at position *index*, shifting the - elements after *index* one position towards the start of the array. - Returns 0 on success and -1 on error. The reference count of the - removed value is decremented. - -.. function:: int json_array_clear(json_t *array) - - Removes all elements from *array*. Returns 0 on sucess and -1 on - error. The reference count of all removed values are decremented. - -.. function:: int json_array_extend(json_t *array, json_t *other_array) - - Appends all elements in *other_array* to the end of *array*. - Returns 0 on success and -1 on error. - -The following macro can be used to iterate through all elements -in an array. - -.. function:: json_array_foreach(array, index, value) - - Iterate over every element of ``array``, running the block - of code that follows each time with the proper values set to - variables ``index`` and ``value``, of types :type:`size_t` and - :type:`json_t *` respectively. Example:: - - /* array is a JSON array */ - size_t index; - json_t *value; - - json_array_foreach(array, index, value) { - /* block of code that uses index and value */ - } - - The items are returned in increasing index order. - - This macro expands to an ordinary ``for`` statement upon - preprocessing, so its performance is equivalent to that of - hand-written code using the array access functions. - The main advantage of this macro is that it abstracts - away the complexity, and makes for shorter, more - concise code. - - .. versionadded:: 2.5 - - -Object -====== - -A JSON object is a dictionary of key-value pairs, where the key is a -Unicode string and the value is any JSON value. - -Even though NUL bytes are allowed in string values, they are not -allowed in object keys. - -.. function:: json_t *json_object(void) - - .. refcounting:: new - - Returns a new JSON object, or *NULL* on error. Initially, the - object is empty. - -.. function:: size_t json_object_size(const json_t *object) - - Returns the number of elements in *object*, or 0 if *object* is not - a JSON object. - -.. function:: json_t *json_object_get(const json_t *object, const char *key) - - .. refcounting:: borrow - - Get a value corresponding to *key* from *object*. Returns *NULL* if - *key* is not found and on error. - -.. function:: int json_object_set(json_t *object, const char *key, json_t *value) - - Set the value of *key* to *value* in *object*. *key* must be a - valid null terminated UTF-8 encoded Unicode string. If there - already is a value for *key*, it is replaced by the new value. - Returns 0 on success and -1 on error. - -.. function:: int json_object_set_nocheck(json_t *object, const char *key, json_t *value) - - Like :func:`json_object_set`, but doesn't check that *key* is - valid UTF-8. Use this function only if you are certain that this - really is the case (e.g. you have already checked it by other - means). - -.. function:: int json_object_set_new(json_t *object, const char *key, json_t *value) - - Like :func:`json_object_set()` but steals the reference to - *value*. This is useful when *value* is newly created and not used - after the call. - -.. function:: int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value) - - Like :func:`json_object_set_new`, but doesn't check that *key* is - valid UTF-8. Use this function only if you are certain that this - really is the case (e.g. you have already checked it by other - means). - -.. function:: int json_object_del(json_t *object, const char *key) - - Delete *key* from *object* if it exists. Returns 0 on success, or - -1 if *key* was not found. The reference count of the removed value - is decremented. - -.. function:: int json_object_clear(json_t *object) - - Remove all elements from *object*. Returns 0 on success and -1 if - *object* is not a JSON object. The reference count of all removed - values are decremented. - -.. function:: int json_object_update(json_t *object, json_t *other) - - Update *object* with the key-value pairs from *other*, overwriting - existing keys. Returns 0 on success or -1 on error. - -.. function:: int json_object_update_existing(json_t *object, json_t *other) - - Like :func:`json_object_update()`, but only the values of existing - keys are updated. No new keys are created. Returns 0 on success or - -1 on error. - - .. versionadded:: 2.3 - -.. function:: int json_object_update_missing(json_t *object, json_t *other) - - Like :func:`json_object_update()`, but only new keys are created. - The value of any existing key is not changed. Returns 0 on success - or -1 on error. - - .. versionadded:: 2.3 - -The following macro can be used to iterate through all key-value pairs -in an object. - -.. function:: json_object_foreach(object, key, value) - - Iterate over every key-value pair of ``object``, running the block - of code that follows each time with the proper values set to - variables ``key`` and ``value``, of types :type:`const char *` and - :type:`json_t *` respectively. Example:: - - /* obj is a JSON object */ - const char *key; - json_t *value; - - json_object_foreach(obj, key, value) { - /* block of code that uses key and value */ - } - - The items are not returned in any particular order. - - This macro expands to an ordinary ``for`` statement upon - preprocessing, so its performance is equivalent to that of - hand-written iteration code using the object iteration protocol - (see below). The main advantage of this macro is that it abstracts - away the complexity behind iteration, and makes for shorter, more - concise code. - - .. versionadded:: 2.3 - - -The following functions implement an iteration protocol for objects, -allowing to iterate through all key-value pairs in an object. The -items are not returned in any particular order, as this would require -sorting due to the internal hashtable implementation. - -.. function:: void *json_object_iter(json_t *object) - - Returns an opaque iterator which can be used to iterate over all - key-value pairs in *object*, or *NULL* if *object* is empty. - -.. function:: void *json_object_iter_at(json_t *object, const char *key) - - Like :func:`json_object_iter()`, but returns an iterator to the - key-value pair in *object* whose key is equal to *key*, or NULL if - *key* is not found in *object*. Iterating forward to the end of - *object* only yields all key-value pairs of the object if *key* - happens to be the first key in the underlying hash table. - -.. function:: void *json_object_iter_next(json_t *object, void *iter) - - Returns an iterator pointing to the next key-value pair in *object* - after *iter*, or *NULL* if the whole object has been iterated - through. - -.. function:: const char *json_object_iter_key(void *iter) - - Extract the associated key from *iter*. - -.. function:: json_t *json_object_iter_value(void *iter) - - .. refcounting:: borrow - - Extract the associated value from *iter*. - -.. function:: int json_object_iter_set(json_t *object, void *iter, json_t *value) - - Set the value of the key-value pair in *object*, that is pointed to - by *iter*, to *value*. - -.. function:: int json_object_iter_set_new(json_t *object, void *iter, json_t *value) - - Like :func:`json_object_iter_set()`, but steals the reference to - *value*. This is useful when *value* is newly created and not used - after the call. - -.. function:: void *json_object_key_to_iter(const char *key) - - Like :func:`json_object_iter_at()`, but much faster. Only works for - values returned by :func:`json_object_iter_key()`. Using other keys - will lead to segfaults. This function is used internally to - implement :func:`json_object_foreach`. - - .. versionadded:: 2.3 - -The iteration protocol can be used for example as follows:: - - /* obj is a JSON object */ - const char *key; - json_t *value; - - void *iter = json_object_iter(obj); - while(iter) - { - key = json_object_iter_key(iter); - value = json_object_iter_value(iter); - /* use key and value ... */ - iter = json_object_iter_next(obj, iter); - } - -.. function:: void json_object_seed(size_t seed) - - Seed the hash function used in Jansson's hashtable implementation. - The seed is used to randomize the hash function so that an - attacker cannot control its output. - - If *seed* is 0, Jansson generates the seed itselfy by reading - random data from the operating system's entropy sources. If no - entropy sources are available, falls back to using a combination - of the current timestamp (with microsecond precision if possible) - and the process ID. - - If called at all, this function must be called before any calls to - :func:`json_object()`, either explicit or implicit. If this - function is not called by the user, the first call to - :func:`json_object()` (either explicit or implicit) seeds the hash - function. See :ref:`portability-thread-safety` for notes on thread - safety. - - If repeatable results are required, for e.g. unit tests, the hash - function can be "unrandomized" by calling :func:`json_object_seed` - with a constant value on program startup, e.g. - ``json_object_seed(1)``. - - .. versionadded:: 2.6 - - -Error reporting -=============== - -Jansson uses a single struct type to pass error information to the -user. See sections :ref:`apiref-decoding`, :ref:`apiref-pack` and -:ref:`apiref-unpack` for functions that pass error information using -this struct. - -.. type:: json_error_t - - .. member:: char text[] - - The error message (in UTF-8), or an empty string if a message is - not available. - - .. member:: char source[] - - Source of the error. This can be (a part of) the file name or a - special identifier in angle brackers (e.g. ````). - - .. member:: int line - - The line number on which the error occurred. - - .. member:: int column - - The column on which the error occurred. Note that this is the - *character column*, not the byte column, i.e. a multibyte UTF-8 - character counts as one column. - - .. member:: size_t position - - The position in bytes from the start of the input. This is - useful for debugging Unicode encoding problems. - -The normal use of :type:`json_error_t` is to allocate it on the stack, -and pass a pointer to a function. Example:: - - int main() { - json_t *json; - json_error_t error; - - json = json_load_file("/path/to/file.json", 0, &error); - if(!json) { - /* the error variable contains error information */ - } - ... - } - -Also note that if the call succeeded (``json != NULL`` in the above -example), the contents of ``error`` are generally left unspecified. -The decoding functions write to the ``position`` member also on -success. See :ref:`apiref-decoding` for more info. - -All functions also accept *NULL* as the :type:`json_error_t` pointer, -in which case no error information is returned to the caller. - - -Encoding -======== - -This sections describes the functions that can be used to encode -values to JSON. By default, only objects and arrays can be encoded -directly, since they are the only valid *root* values of a JSON text. -To encode any JSON value, use the ``JSON_ENCODE_ANY`` flag (see -below). - -By default, the output has no newlines, and spaces are used between -array and object elements for a readable output. This behavior can be -altered by using the ``JSON_INDENT`` and ``JSON_COMPACT`` flags -described below. A newline is never appended to the end of the encoded -JSON data. - -Each function takes a *flags* parameter that controls some aspects of -how the data is encoded. Its default value is 0. The following macros -can be ORed together to obtain *flags*. - -``JSON_INDENT(n)`` - Pretty-print the result, using newlines between array and object - items, and indenting with *n* spaces. The valid range for *n* is - between 0 and 31 (inclusive), other values result in an undefined - output. If ``JSON_INDENT`` is not used or *n* is 0, no newlines are - inserted between array and object items. - - The ``JSON_MAX_INDENT`` constant defines the maximum indentation - that can be used, and its value is 31. - - .. versionchanged:: 2.7 - Added ``JSON_MAX_INDENT``. - -``JSON_COMPACT`` - This flag enables a compact representation, i.e. sets the separator - between array and object items to ``","`` and between object keys - and values to ``":"``. Without this flag, the corresponding - separators are ``", "`` and ``": "`` for more readable output. - -``JSON_ENSURE_ASCII`` - If this flag is used, the output is guaranteed to consist only of - ASCII characters. This is achived by escaping all Unicode - characters outside the ASCII range. - -``JSON_SORT_KEYS`` - If this flag is used, all the objects in output are sorted by key. - This is useful e.g. if two JSON texts are diffed or visually - compared. - -``JSON_PRESERVE_ORDER`` - If this flag is used, object keys in the output are sorted into the - same order in which they were first inserted to the object. For - example, decoding a JSON text and then encoding with this flag - preserves the order of object keys. - -``JSON_ENCODE_ANY`` - Specifying this flag makes it possible to encode any JSON value on - its own. Without it, only objects and arrays can be passed as the - *root* value to the encoding functions. - - **Note:** Encoding any value may be useful in some scenarios, but - it's generally discouraged as it violates strict compatiblity with - :rfc:`4627`. If you use this flag, don't expect interoperatibility - with other JSON systems. - - .. versionadded:: 2.1 - -``JSON_ESCAPE_SLASH`` - Escape the ``/`` characters in strings with ``\/``. - - .. versionadded:: 2.4 - -``JSON_REAL_PRECISION(n)`` - Output all real numbers with at most *n* digits of precision. The - valid range for *n* is between 0 and 31 (inclusive), and other - values result in an undefined behavior. - - By default, the precision is 17, to correctly and losslessly encode - all IEEE 754 double precision floating point numbers. - - .. versionadded:: 2.7 - -The following functions perform the actual JSON encoding. The result -is in UTF-8. - -.. function:: char *json_dumps(const json_t *root, size_t flags) - - Returns the JSON representation of *root* as a string, or *NULL* on - error. *flags* is described above. The return value must be freed - by the caller using :func:`free()`. - -.. function:: int json_dumpf(const json_t *root, FILE *output, size_t flags) - - Write the JSON representation of *root* to the stream *output*. - *flags* is described above. Returns 0 on success and -1 on error. - If an error occurs, something may have already been written to - *output*. In this case, the output is undefined and most likely not - valid JSON. - -.. function:: int json_dump_file(const json_t *json, const char *path, size_t flags) - - Write the JSON representation of *root* to the file *path*. If - *path* already exists, it is overwritten. *flags* is described - above. Returns 0 on success and -1 on error. - -.. type:: json_dump_callback_t - - A typedef for a function that's called by - :func:`json_dump_callback()`:: - - typedef int (*json_dump_callback_t)(const char *buffer, size_t size, void *data); - - *buffer* points to a buffer containing a chunk of output, *size* is - the length of the buffer, and *data* is the corresponding - :func:`json_dump_callback()` argument passed through. - - On error, the function should return -1 to stop the encoding - process. On success, it should return 0. - - .. versionadded:: 2.2 - -.. function:: int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags) - - Call *callback* repeatedly, passing a chunk of the JSON - representation of *root* each time. *flags* is described above. - Returns 0 on success and -1 on error. - - .. versionadded:: 2.2 - - -.. _apiref-decoding: - -Decoding -======== - -This sections describes the functions that can be used to decode JSON -text to the Jansson representation of JSON data. The JSON -specification requires that a JSON text is either a serialized array -or object, and this requirement is also enforced with the following -functions. In other words, the top level value in the JSON text being -decoded must be either array or object. To decode any JSON value, use -the ``JSON_DECODE_ANY`` flag (see below). - -See :ref:`rfc-conformance` for a discussion on Jansson's conformance -to the JSON specification. It explains many design decisions that -affect especially the behavior of the decoder. - -Each function takes a *flags* parameter that can be used to control -the behavior of the decoder. Its default value is 0. The following -macros can be ORed together to obtain *flags*. - -``JSON_REJECT_DUPLICATES`` - Issue a decoding error if any JSON object in the input text - contains duplicate keys. Without this flag, the value of the last - occurence of each key ends up in the result. Key equivalence is - checked byte-by-byte, without special Unicode comparison - algorithms. - - .. versionadded:: 2.1 - -``JSON_DECODE_ANY`` - By default, the decoder expects an array or object as the input. - With this flag enabled, the decoder accepts any valid JSON value. - - **Note:** Decoding any value may be useful in some scenarios, but - it's generally discouraged as it violates strict compatiblity with - :rfc:`4627`. If you use this flag, don't expect interoperatibility - with other JSON systems. - - .. versionadded:: 2.3 - -``JSON_DISABLE_EOF_CHECK`` - By default, the decoder expects that its whole input constitutes a - valid JSON text, and issues an error if there's extra data after - the otherwise valid JSON input. With this flag enabled, the decoder - stops after decoding a valid JSON array or object, and thus allows - extra data after the JSON text. - - Normally, reading will stop when the last ``]`` or ``}`` in the - JSON input is encountered. If both ``JSON_DISABLE_EOF_CHECK`` and - ``JSON_DECODE_ANY`` flags are used, the decoder may read one extra - UTF-8 code unit (up to 4 bytes of input). For example, decoding - ``4true`` correctly decodes the integer 4, but also reads the - ``t``. For this reason, if reading multiple consecutive values that - are not arrays or objects, they should be separated by at least one - whitespace character. - - .. versionadded:: 2.1 - -``JSON_DECODE_INT_AS_REAL`` - JSON defines only one number type. Jansson distinguishes between - ints and reals. For more information see :ref:`real-vs-integer`. - With this flag enabled the decoder interprets all numbers as real - values. Integers that do not have an exact double representation - will silently result in a loss of precision. Integers that cause - a double overflow will cause an error. - - .. versionadded:: 2.5 - -``JSON_ALLOW_NUL`` - Allow ``\u0000`` escape inside string values. This is a safety - measure; If you know your input can contain NUL bytes, use this - flag. If you don't use this flag, you don't have to worry about NUL - bytes inside strings unless you explicitly create themselves by - using e.g. :func:`json_stringn()` or ``s#`` format specifier for - :func:`json_pack()`. - - Object keys cannot have embedded NUL bytes even if this flag is - used. - - .. versionadded:: 2.6 - -Each function also takes an optional :type:`json_error_t` parameter -that is filled with error information if decoding fails. It's also -updated on success; the number of bytes of input read is written to -its ``position`` field. This is especially useful when using -``JSON_DISABLE_EOF_CHECK`` to read multiple consecutive JSON texts. - -.. versionadded:: 2.3 - Number of bytes of input read is written to the ``position`` field - of the :type:`json_error_t` structure. - -If no error or position information is needed, you can pass *NULL*. - -The following functions perform the actual JSON decoding. - -.. function:: json_t *json_loads(const char *input, size_t flags, json_error_t *error) - - .. refcounting:: new - - Decodes the JSON string *input* and returns the array or object it - contains, or *NULL* on error, in which case *error* is filled with - information about the error. *flags* is described above. - -.. function:: json_t *json_loadb(const char *buffer, size_t buflen, size_t flags, json_error_t *error) - - .. refcounting:: new - - Decodes the JSON string *buffer*, whose length is *buflen*, and - returns the array or object it contains, or *NULL* on error, in - which case *error* is filled with information about the error. This - is similar to :func:`json_loads()` except that the string doesn't - need to be null-terminated. *flags* is described above. - - .. versionadded:: 2.1 - -.. function:: json_t *json_loadf(FILE *input, size_t flags, json_error_t *error) - - .. refcounting:: new - - Decodes the JSON text in stream *input* and returns the array or - object it contains, or *NULL* on error, in which case *error* is - filled with information about the error. *flags* is described - above. - - This function will start reading the input from whatever position - the input file was, without attempting to seek first. If an error - occurs, the file position will be left indeterminate. On success, - the file position will be at EOF, unless ``JSON_DISABLE_EOF_CHECK`` - flag was used. In this case, the file position will be at the first - character after the last ``]`` or ``}`` in the JSON input. This - allows calling :func:`json_loadf()` on the same ``FILE`` object - multiple times, if the input consists of consecutive JSON texts, - possibly separated by whitespace. - -.. function:: json_t *json_load_file(const char *path, size_t flags, json_error_t *error) - - .. refcounting:: new - - Decodes the JSON text in file *path* and returns the array or - object it contains, or *NULL* on error, in which case *error* is - filled with information about the error. *flags* is described - above. - -.. type:: json_load_callback_t - - A typedef for a function that's called by - :func:`json_load_callback()` to read a chunk of input data:: - - typedef size_t (*json_load_callback_t)(void *buffer, size_t buflen, void *data); - - *buffer* points to a buffer of *buflen* bytes, and *data* is the - corresponding :func:`json_load_callback()` argument passed through. - - On success, the function should return the number of bytes read; a - returned value of 0 indicates that no data was read and that the - end of file has been reached. On error, the function should return - ``(size_t)-1`` to abort the decoding process. - - .. versionadded:: 2.4 - -.. function:: json_t *json_load_callback(json_load_callback_t callback, void *data, size_t flags, json_error_t *error) - - .. refcounting:: new - - Decodes the JSON text produced by repeated calls to *callback*, and - returns the array or object it contains, or *NULL* on error, in - which case *error* is filled with information about the error. - *data* is passed through to *callback* on each call. *flags* is - described above. - - .. versionadded:: 2.4 - - -.. _apiref-pack: - -Building Values -=============== - -This section describes functions that help to create, or *pack*, -complex JSON values, especially nested objects and arrays. Value -building is based on a *format string* that is used to tell the -functions about the expected arguments. - -For example, the format string ``"i"`` specifies a single integer -value, while the format string ``"[ssb]"`` or the equivalent ``"[s, s, -b]"`` specifies an array value with two strings and a boolean as its -items:: - - /* Create the JSON integer 42 */ - json_pack("i", 42); - - /* Create the JSON array ["foo", "bar", true] */ - json_pack("[ssb]", "foo", "bar", 1); - -Here's the full list of format specifiers. The type in parentheses -denotes the resulting JSON type, and the type in brackets (if any) -denotes the C type that is expected as the corresponding argument or -arguments. - -``s`` (string) [const char \*] - Convert a NULL terminated UTF-8 string to a JSON string. - -``s#`` (string) [const char \*, int] - Convert a UTF-8 buffer of a given length to a JSON string. - - .. versionadded:: 2.5 - -``s%`` (string) [const char \*, size_t] - Like ``s#`` but the length argument is of type :type:`size_t`. - - .. versionadded:: 2.6 - -``+`` [const char \*] - Like ``s``, but concatenate to the previous string. Only valid - after ``s``, ``s#``, ``+`` or ``+#``. - - .. versionadded:: 2.5 - -``+#`` [const char \*, int] - Like ``s#``, but concatenate to the previous string. Only valid - after ``s``, ``s#``, ``+`` or ``+#``. - - .. versionadded:: 2.5 - -``+%`` (string) [const char \*, size_t] - Like ``+#`` but the length argument is of type :type:`size_t`. - - .. versionadded:: 2.6 - -``n`` (null) - Output a JSON null value. No argument is consumed. - -``b`` (boolean) [int] - Convert a C :type:`int` to JSON boolean value. Zero is converted - to ``false`` and non-zero to ``true``. - -``i`` (integer) [int] - Convert a C :type:`int` to JSON integer. - -``I`` (integer) [json_int_t] - Convert a C :type:`json_int_t` to JSON integer. - -``f`` (real) [double] - Convert a C :type:`double` to JSON real. - -``o`` (any value) [json_t \*] - Output any given JSON value as-is. If the value is added to an - array or object, the reference to the value passed to ``o`` is - stolen by the container. - -``O`` (any value) [json_t \*] - Like ``o``, but the argument's reference count is incremented. - This is useful if you pack into an array or object and want to - keep the reference for the JSON value consumed by ``O`` to - yourself. - -``[fmt]`` (array) - Build an array with contents from the inner format string. ``fmt`` - may contain objects and arrays, i.e. recursive value building is - supported. - -``{fmt}`` (object) - Build an object with contents from the inner format string - ``fmt``. The first, third, etc. format specifier represent a key, - and must be a string (see ``s``, ``s#``, ``+`` and ``+#`` above), - as object keys are always strings. The second, fourth, etc. format - specifier represent a value. Any value may be an object or array, - i.e. recursive value building is supported. - -Whitespace, ``:`` and ``,`` are ignored. - -The following functions compose the value building API: - -.. function:: json_t *json_pack(const char *fmt, ...) - - .. refcounting:: new - - Build a new JSON value according to the format string *fmt*. For - each format specifier (except for ``{}[]n``), one or more arguments - are consumed and used to build the corresponding value. Returns - *NULL* on error. - -.. function:: json_t *json_pack_ex(json_error_t *error, size_t flags, const char *fmt, ...) - json_t *json_vpack_ex(json_error_t *error, size_t flags, const char *fmt, va_list ap) - - .. refcounting:: new - - Like :func:`json_pack()`, but an in the case of an error, an error - message is written to *error*, if it's not *NULL*. The *flags* - parameter is currently unused and should be set to 0. - - As only the errors in format string (and out-of-memory errors) can - be caught by the packer, these two functions are most likely only - useful for debugging format strings. - -More examples:: - - /* Build an empty JSON object */ - json_pack("{}"); - - /* Build the JSON object {"foo": 42, "bar": 7} */ - json_pack("{sisi}", "foo", 42, "bar", 7); - - /* Like above, ':', ',' and whitespace are ignored */ - json_pack("{s:i, s:i}", "foo", 42, "bar", 7); - - /* Build the JSON array [[1, 2], {"cool": true}] */ - json_pack("[[i,i],{s:b}]", 1, 2, "cool", 1); - - /* Build a string from a non-NUL terminated buffer */ - char buffer[4] = {'t', 'e', 's', 't'}; - json_pack("s#", buffer, 4); - - /* Concatentate strings together to build the JSON string "foobarbaz" */ - json_pack("s++", "foo", "bar", "baz"); - - -.. _apiref-unpack: - -Parsing and Validating Values -============================= - -This section describes functions that help to validate complex values -and extract, or *unpack*, data from them. Like :ref:`building values -`, this is also based on format strings. - -While a JSON value is unpacked, the type specified in the format -string is checked to match that of the JSON value. This is the -validation part of the process. In addition to this, the unpacking -functions can also check that all items of arrays and objects are -unpacked. This check be enabled with the format specifier ``!`` or by -using the flag ``JSON_STRICT``. See below for details. - -Here's the full list of format specifiers. The type in parentheses -denotes the JSON type, and the type in brackets (if any) denotes the C -type whose address should be passed. - -``s`` (string) [const char \*] - Convert a JSON string to a pointer to a NULL terminated UTF-8 - string. The resulting string is extracted by using - :func:`json_string_value()` internally, so it exists as long as - there are still references to the corresponding JSON string. - -``s%`` (string) [const char \*, size_t \*] - Convert a JSON string to a pointer to a NULL terminated UTF-8 - string and its length. - - .. versionadded:: 2.6 - -``n`` (null) - Expect a JSON null value. Nothing is extracted. - -``b`` (boolean) [int] - Convert a JSON boolean value to a C :type:`int`, so that ``true`` - is converted to 1 and ``false`` to 0. - -``i`` (integer) [int] - Convert a JSON integer to C :type:`int`. - -``I`` (integer) [json_int_t] - Convert a JSON integer to C :type:`json_int_t`. - -``f`` (real) [double] - Convert a JSON real to C :type:`double`. - -``F`` (integer or real) [double] - Convert a JSON number (integer or real) to C :type:`double`. - -``o`` (any value) [json_t \*] - Store a JSON value with no conversion to a :type:`json_t` pointer. - -``O`` (any value) [json_t \*] - Like ``O``, but the JSON value's reference count is incremented. - -``[fmt]`` (array) - Convert each item in the JSON array according to the inner format - string. ``fmt`` may contain objects and arrays, i.e. recursive - value extraction is supporetd. - -``{fmt}`` (object) - Convert each item in the JSON object according to the inner format - string ``fmt``. The first, third, etc. format specifier represent - a key, and must be ``s``. The corresponding argument to unpack - functions is read as the object key. The second fourth, etc. - format specifier represent a value and is written to the address - given as the corresponding argument. **Note** that every other - argument is read from and every other is written to. - - ``fmt`` may contain objects and arrays as values, i.e. recursive - value extraction is supporetd. - - .. versionadded:: 2.3 - Any ``s`` representing a key may be suffixed with a ``?`` to - make the key optional. If the key is not found, nothing is - extracted. See below for an example. - -``!`` - This special format specifier is used to enable the check that - all object and array items are accessed, on a per-value basis. It - must appear inside an array or object as the last format specifier - before the closing bracket or brace. To enable the check globally, - use the ``JSON_STRICT`` unpacking flag. - -``*`` - This special format specifier is the opposite of ``!``. If the - ``JSON_STRICT`` flag is used, ``*`` can be used to disable the - strict check on a per-value basis. It must appear inside an array - or object as the last format specifier before the closing bracket - or brace. - -Whitespace, ``:`` and ``,`` are ignored. - -The following functions compose the parsing and validation API: - -.. function:: int json_unpack(json_t *root, const char *fmt, ...) - - Validate and unpack the JSON value *root* according to the format - string *fmt*. Returns 0 on success and -1 on failure. - -.. function:: int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...) - int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap) - - Validate and unpack the JSON value *root* according to the format - string *fmt*. If an error occurs and *error* is not *NULL*, write - error information to *error*. *flags* can be used to control the - behaviour of the unpacker, see below for the flags. Returns 0 on - success and -1 on failure. - -.. note:: - - The first argument of all unpack functions is ``json_t *root`` - instead of ``const json_t *root``, because the use of ``O`` format - specifier causes the reference count of ``root``, or some value - reachable from ``root``, to be increased. Furthermore, the ``o`` - format specifier may be used to extract a value as-is, which allows - modifying the structure or contents of a value reachable from - ``root``. - - If the ``O`` and ``o`` format specifiers are not used, it's - perfectly safe to cast a ``const json_t *`` variable to plain - ``json_t *`` when used with these functions. - -The following unpacking flags are available: - -``JSON_STRICT`` - Enable the extra validation step checking that all object and - array items are unpacked. This is equivalent to appending the - format specifier ``!`` to the end of every array and object in the - format string. - -``JSON_VALIDATE_ONLY`` - Don't extract any data, just validate the JSON value against the - given format string. Note that object keys must still be specified - after the format string. - -Examples:: - - /* root is the JSON integer 42 */ - int myint; - json_unpack(root, "i", &myint); - assert(myint == 42); - - /* root is the JSON object {"foo": "bar", "quux": true} */ - const char *str; - int boolean; - json_unpack(root, "{s:s, s:b}", "foo", &str, "quux", &boolean); - assert(strcmp(str, "bar") == 0 && boolean == 1); - - /* root is the JSON array [[1, 2], {"baz": null} */ - json_error_t error; - json_unpack_ex(root, &error, JSON_VALIDATE_ONLY, "[[i,i], {s:n}]", "baz"); - /* returns 0 for validation success, nothing is extracted */ - - /* root is the JSON array [1, 2, 3, 4, 5] */ - int myint1, myint2; - json_unpack(root, "[ii!]", &myint1, &myint2); - /* returns -1 for failed validation */ - - /* root is an empty JSON object */ - int myint = 0, myint2 = 0; - json_unpack(root, "{s?i, s?[ii]}", - "foo", &myint1, - "bar", &myint2, &myint3); - /* myint1, myint2 or myint3 is no touched as "foo" and "bar" don't exist */ - - -Equality -======== - -Testing for equality of two JSON values cannot, in general, be -achieved using the ``==`` operator. Equality in the terms of the -``==`` operator states that the two :type:`json_t` pointers point to -exactly the same JSON value. However, two JSON values can be equal not -only if they are exactly the same value, but also if they have equal -"contents": - -* Two integer or real values are equal if their contained numeric - values are equal. An integer value is never equal to a real value, - though. - -* Two strings are equal if their contained UTF-8 strings are equal, - byte by byte. Unicode comparison algorithms are not implemented. - -* Two arrays are equal if they have the same number of elements and - each element in the first array is equal to the corresponding - element in the second array. - -* Two objects are equal if they have exactly the same keys and the - value for each key in the first object is equal to the value of the - corresponding key in the second object. - -* Two true, false or null values have no "contents", so they are equal - if their types are equal. (Because these values are singletons, - their equality can actually be tested with ``==``.) - -The following function can be used to test whether two JSON values are -equal. - -.. function:: int json_equal(json_t *value1, json_t *value2) - - Returns 1 if *value1* and *value2* are equal, as defined above. - Returns 0 if they are inequal or one or both of the pointers are - *NULL*. - - -Copying -======= - -Because of reference counting, passing JSON values around doesn't -require copying them. But sometimes a fresh copy of a JSON value is -needed. For example, if you need to modify an array, but still want to -use the original afterwards, you should take a copy of it first. - -Jansson supports two kinds of copying: shallow and deep. There is a -difference between these methods only for arrays and objects. Shallow -copying only copies the first level value (array or object) and uses -the same child values in the copied value. Deep copying makes a fresh -copy of the child values, too. Moreover, all the child values are deep -copied in a recursive fashion. - -.. function:: json_t *json_copy(json_t *value) - - .. refcounting:: new - - Returns a shallow copy of *value*, or *NULL* on error. - -.. function:: json_t *json_deep_copy(const json_t *value) - - .. refcounting:: new - - Returns a deep copy of *value*, or *NULL* on error. - - -.. _apiref-custom-memory-allocation: - -Custom Memory Allocation -======================== - -By default, Jansson uses :func:`malloc()` and :func:`free()` for -memory allocation. These functions can be overridden if custom -behavior is needed. - -.. type:: json_malloc_t - - A typedef for a function pointer with :func:`malloc()`'s - signature:: - - typedef void *(*json_malloc_t)(size_t); - -.. type:: json_free_t - - A typedef for a function pointer with :func:`free()`'s - signature:: - - typedef void (*json_free_t)(void *); - -.. function:: void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn) - - Use *malloc_fn* instead of :func:`malloc()` and *free_fn* instead - of :func:`free()`. This function has to be called before any other - Jansson's API functions to ensure that all memory operations use - the same functions. - -**Examples:** - -Circumvent problems with different CRT heaps on Windows by using -application's :func:`malloc()` and :func:`free()`:: - - json_set_alloc_funcs(malloc, free); - -Use the `Boehm's conservative garbage collector`_ for memory -operations:: - - json_set_alloc_funcs(GC_malloc, GC_free); - -.. _Boehm's conservative garbage collector: http://www.hpl.hp.com/personal/Hans_Boehm/gc/ - -Allow storing sensitive data (e.g. passwords or encryption keys) in -JSON structures by zeroing all memory when freed:: - - static void *secure_malloc(size_t size) - { - /* Store the memory area size in the beginning of the block */ - void *ptr = malloc(size + 8); - *((size_t *)ptr) = size; - return ptr + 8; - } - - static void secure_free(void *ptr) - { - size_t size; - - ptr -= 8; - size = *((size_t *)ptr); - - guaranteed_memset(ptr, 0, size + 8); - free(ptr); - } - - int main() - { - json_set_alloc_funcs(secure_malloc, secure_free); - /* ... */ - } - -For more information about the issues of storing sensitive data in -memory, see -http://www.dwheeler.com/secure-programs/Secure-Programs-HOWTO/protect-secrets.html. -The page also explains the :func:`guaranteed_memset()` function used -in the example and gives a sample implementation for it. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/changes.rst kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/changes.rst --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/changes.rst 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/changes.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -****************** -Changes in Jansson -****************** - -.. include:: ../CHANGES diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/conformance.rst kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/conformance.rst --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/conformance.rst 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/conformance.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,110 +0,0 @@ -.. _rfc-conformance: - -*************** -RFC Conformance -*************** - -JSON is specified in :rfc:`4627`, *"The application/json Media Type -for JavaScript Object Notation (JSON)"*. - -Character Encoding -================== - -Jansson only supports UTF-8 encoded JSON texts. It does not support or -auto-detect any of the other encodings mentioned in the RFC, namely -UTF-16LE, UTF-16BE, UTF-32LE or UTF-32BE. Pure ASCII is supported, as -it's a subset of UTF-8. - -Strings -======= - -JSON strings are mapped to C-style null-terminated character arrays, -and UTF-8 encoding is used internally. - -All Unicode codepoints U+0000 through U+10FFFF are allowed in string -values. However, U+0000 is not allowed in object keys because of API -restrictions. - -Unicode normalization or any other transformation is never performed -on any strings (string values or object keys). When checking for -equivalence of strings or object keys, the comparison is performed -byte by byte between the original UTF-8 representations of the -strings. - -Numbers -======= - -.. _real-vs-integer: - -Real vs. Integer ----------------- - -JSON makes no distinction between real and integer numbers; Jansson -does. Real numbers are mapped to the ``double`` type and integers to -the ``json_int_t`` type, which is a typedef of ``long long`` or -``long``, depending on whether ``long long`` is supported by your -compiler or not. - -A JSON number is considered to be a real number if its lexical -representation includes one of ``e``, ``E``, or ``.``; regardless if -its actual numeric value is a true integer (e.g., all of ``1E6``, -``3.0``, ``400E-2``, and ``3.14E3`` are mathematical integers, but -will be treated as real values). With the ``JSON_DECODE_INT_AS_REAL`` -decoder flag set all numbers are interpreted as real. - -All other JSON numbers are considered integers. - -When encoding to JSON, real values are always represented -with a fractional part; e.g., the ``double`` value 3.0 will be -represented in JSON as ``3.0``, not ``3``. - -Overflow, Underflow & Precision -------------------------------- - -Real numbers whose absolute values are too small to be represented in -a C ``double`` will be silently estimated with 0.0. Thus, depending on -platform, JSON numbers very close to zero such as 1E-999 may result in -0.0. - -Real numbers whose absolute values are too large to be represented in -a C ``double`` will result in an overflow error (a JSON decoding -error). Thus, depending on platform, JSON numbers like 1E+999 or --1E+999 may result in a parsing error. - -Likewise, integer numbers whose absolute values are too large to be -represented in the ``json_int_t`` type (see above) will result in an -overflow error (a JSON decoding error). Thus, depending on platform, -JSON numbers like 1000000000000000 may result in parsing error. - -Parsing JSON real numbers may result in a loss of precision. As long -as overflow does not occur (i.e. a total loss of precision), the -rounded approximate value is silently used. Thus the JSON number -1.000000000000000005 may, depending on platform, result in the -``double`` value 1.0. - -Signed zeros ------------- - -JSON makes no statement about what a number means; however Javascript -(ECMAscript) does state that +0.0 and -0.0 must be treated as being -distinct values, i.e. -0.0 |not-equal| 0.0. Jansson relies on the -underlying floating point library in the C environment in which it is -compiled. Therefore it is platform-dependent whether 0.0 and -0.0 will -be distinct values. Most platforms that use the IEEE 754 -floating-point standard will support signed zeros. - -Note that this only applies to floating-point; neither JSON, C, or -IEEE support the concept of signed integer zeros. - -.. |not-equal| unicode:: U+2260 - -Types ------ - -No support is provided in Jansson for any C numeric types other than -``json_int_t`` and ``double``. This excludes things such as unsigned -types, ``long double``, etc. Obviously, shorter types like ``short``, -``int``, ``long`` (if ``json_int_t`` is ``long long``) and ``float`` -are implicitly handled via the ordinary C type coercion rules (subject -to overflow semantics). Also, no support or hooks are provided for any -supplemental "bignum" type add-on packages. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/conf.py kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/conf.py --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/conf.py 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/conf.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,217 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Jansson documentation build configuration file, created by -# sphinx-quickstart on Sun Sep 5 21:47:20 2010. -# -# This file is execfile()d with the current directory set to its containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys, os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('ext')) - -# -- General configuration ----------------------------------------------------- - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be extensions -# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['refcounting'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'Jansson' -copyright = u'2009-2014, Petri Lehtinen' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '2.7' -# The full version, including alpha/beta/rc tags. -release = version - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['_build'] - -# The reST default role (used for this markup: `text`) to use for all documents. -default_role = 'c:func' -primary_domain = 'c' - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - - -# -- Options for HTML output --------------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -#html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -#html_static_path = ['_static'] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'Janssondoc' - - -# -- Options for LaTeX output -------------------------------------------------- - -# The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' - -# The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, author, documentclass [howto/manual]). -latex_documents = [ - ('index', 'Jansson.tex', u'Jansson Documentation', - u'Petri Lehtinen', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Additional stuff for the LaTeX preamble. -#latex_preamble = '' - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output -------------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'jansson', u'Jansson Documentation', - [u'Petri Lehtinen'], 1) -] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/ext/refcounting.py kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/ext/refcounting.py --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/ext/refcounting.py 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/ext/refcounting.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -""" - refcounting - ~~~~~~~~~~~ - - Reference count annotations for C API functions. Has the same - result as the sphinx.ext.refcounting extension but works for all - functions regardless of the signature, and the reference counting - information is written inline with the documentation instead of a - separate file. - - Adds a new directive "refcounting". The directive has no content - and one required positional parameter:: "new" or "borrow". - - Example: - - .. cfunction:: json_t *json_object(void) - - .. refcounting:: new - - - - :copyright: Copyright (c) 2009-2014 Petri Lehtinen - :license: MIT, see LICENSE for details. -""" - -from docutils import nodes - -class refcounting(nodes.emphasis): pass - -def visit(self, node): - self.visit_emphasis(node) - -def depart(self, node): - self.depart_emphasis(node) - -def html_visit(self, node): - self.body.append(self.starttag(node, 'em', '', CLASS='refcount')) - -def html_depart(self, node): - self.body.append('') - - -def refcounting_directive(name, arguments, options, content, lineno, - content_offset, block_text, state, state_machine): - if arguments[0] == 'borrow': - text = 'Return value: Borrowed reference.' - elif arguments[0] == 'new': - text = 'Return value: New reference.' - else: - raise Error('Valid arguments: new, borrow') - - return [refcounting(text, text)] - -def setup(app): - app.add_node(refcounting, - html=(html_visit, html_depart), - latex=(visit, depart), - text=(visit, depart)) - app.add_directive('refcounting', refcounting_directive, 0, (1, 0, 0)) diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/gettingstarted.rst kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/gettingstarted.rst --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/gettingstarted.rst 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/gettingstarted.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,227 +0,0 @@ -*************** -Getting Started -*************** - -.. highlight:: c - -Compiling and Installing Jansson -================================ - -The Jansson source is available at -http://www.digip.org/jansson/releases/. - -Unix-like systems (including MinGW) ------------------------------------ - -Unpack the source tarball and change to the source directory: - -.. parsed-literal:: - - bunzip2 -c jansson-|release|.tar.bz2 | tar xf - - cd jansson-|release| - -The source uses GNU Autotools (autoconf_, automake_, libtool_), so -compiling and installing is extremely simple:: - - ./configure - make - make check - make install - -To change the destination directory (``/usr/local`` by default), use -the ``--prefix=DIR`` argument to ``./configure``. See ``./configure ---help`` for the list of all possible installation options. (There are -no options to customize the resulting Jansson binary.) - -The command ``make check`` runs the test suite distributed with -Jansson. This step is not strictly necessary, but it may find possible -problems that Jansson has on your platform. If any problems are found, -please report them. - -If you obtained the source from a Git repository (or any other source -control system), there's no ``./configure`` script as it's not kept in -version control. To create the script, the build system needs to be -bootstrapped. There are many ways to do this, but the easiest one is -to use ``autoreconf``:: - - autoreconf -vi - -This command creates the ``./configure`` script, which can then be -used as described above. - -.. _autoconf: http://www.gnu.org/software/autoconf/ -.. _automake: http://www.gnu.org/software/automake/ -.. _libtool: http://www.gnu.org/software/libtool/ - - -.. _build-cmake: - -CMake (various platforms, including Windows) --------------------------------------------- - -Jansson can be built using CMake_. Create a build directory for an -out-of-tree build, change to that directory, and run ``cmake`` (or ``ccmake``, -``cmake-gui``, or similar) to configure the project. - -See the examples below for more detailed information. - -.. note:: In the below examples ``..`` is used as an argument for ``cmake``. - This is simply the path to the jansson project root directory. - In the example it is assumed you've created a sub-directory ``build`` - and are using that. You could use any path you want. - -.. _build-cmake-unix: - -Unix (Make files) -^^^^^^^^^^^^^^^^^ -Generating make files on unix: - -.. parsed-literal:: - - bunzip2 -c jansson-|release|.tar.bz2 | tar xf - - cd jansson-|release| - - mkdir build - cd build - cmake .. # or `ccmake ..` for a GUI. - -Then to build:: - - make - make check - make install - -Windows (Visual Studio) -^^^^^^^^^^^^^^^^^^^^^^^ -Creating Visual Studio project files from the command line: - -.. parsed-literal:: - - - cd jansson-|release| - - md build - cd build - cmake -G "Visual Studio 10" .. - -You will now have a *Visual Studio Solution* in your build directory. -To run the unit tests build the ``RUN_TESTS`` project. - -If you prefer a GUI the ``cmake`` line in the above example can -be replaced with:: - - cmake-gui .. - -For command line help (including a list of available generators) -for CMake_ simply run:: - - cmake - -To list available CMake_ settings (and what they are currently set to) -for the project, run:: - - cmake -LH .. - -Mac OSX (Xcode) -^^^^^^^^^^^^^^^ -If you prefer using Xcode instead of make files on OSX, -do the following. (Use the same steps as -for :ref:`Unix `):: - - ... - cmake -G "Xcode" .. - -Additional CMake settings -^^^^^^^^^^^^^^^^^^^^^^^^^ - -Shared library -"""""""""""""" -By default the CMake_ project will generate build files for building the -static library. To build the shared version use:: - - ... - cmake -DJANSSON_BUILD_SHARED_LIBS=1 .. - -Changing install directory (same as autoconf --prefix) -"""""""""""""""""""""""""""""""""""""""""""""""""""""" -Just as with the autoconf_ project you can change the destination directory -for ``make install``. The equivalent for autoconfs ``./configure --prefix`` -in CMake_ is:: - - ... - cmake -DCMAKE_INSTALL_PREFIX:PATH=/some/other/path .. - make install - -.. _CMake: http://www.cmake.org - - -Android -------- - -Jansson can be built for Android platforms. Android.mk is in the -source root directory. The configuration header file is located in the -``android`` directory in the source distribution. - - -Other Systems -------------- - -On non Unix-like systems, you may be unable to run the ``./configure`` -script. In this case, follow these steps. All the files mentioned can -be found in the ``src/`` directory. - -1. Create ``jansson_config.h`` (which has some platform-specific - parameters that are normally filled in by the ``./configure`` - script). Edit ``jansson_config.h.in``, replacing all ``@variable@`` - placeholders, and rename the file to ``jansson_config.h``. - -2. Make ``jansson.h`` and ``jansson_config.h`` available to the - compiler, so that they can be found when compiling programs that - use Jansson. - -3. Compile all the ``.c`` files (in the ``src/`` directory) into a - library file. Make the library available to the compiler, as in - step 2. - - -Building the Documentation --------------------------- - -(This subsection describes how to build the HTML documentation you are -currently reading, so it can be safely skipped.) - -Documentation is in the ``doc/`` subdirectory. It's written in -reStructuredText_ with Sphinx_ annotations. To generate the HTML -documentation, invoke:: - - make html - -and point your browser to ``doc/_build/html/index.html``. Sphinx_ 1.0 -or newer is required to generate the documentation. - -.. _reStructuredText: http://docutils.sourceforge.net/rst.html -.. _Sphinx: http://sphinx.pocoo.org/ - - -Compiling Programs that Use Jansson -=================================== - -Jansson involves one C header file, :file:`jansson.h`, so it's enough -to put the line - -:: - - #include - -in the beginning of every source file that uses Jansson. - -There's also just one library to link with, ``libjansson``. Compile and -link the program as follows:: - - cc -o prog prog.c -ljansson - -Starting from version 1.2, there's also support for pkg-config_:: - - cc -o prog prog.c `pkg-config --cflags --libs jansson` - -.. _pkg-config: http://pkg-config.freedesktop.org/ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/github_commits.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/github_commits.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/github_commits.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/github_commits.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include - -#include -#include - -#define BUFFER_SIZE (256 * 1024) /* 256 KB */ - -#define URL_FORMAT "https://api.github.com/repos/%s/%s/commits" -#define URL_SIZE 256 - -/* Return the offset of the first newline in text or the length of - text if there's no newline */ -static int newline_offset(const char *text) -{ - const char *newline = strchr(text, '\n'); - if(!newline) - return strlen(text); - else - return (int)(newline - text); -} - -struct write_result -{ - char *data; - int pos; -}; - -static size_t write_response(void *ptr, size_t size, size_t nmemb, void *stream) -{ - struct write_result *result = (struct write_result *)stream; - - if(result->pos + size * nmemb >= BUFFER_SIZE - 1) - { - fprintf(stderr, "error: too small buffer\n"); - return 0; - } - - memcpy(result->data + result->pos, ptr, size * nmemb); - result->pos += size * nmemb; - - return size * nmemb; -} - -static char *request(const char *url) -{ - CURL *curl = NULL; - CURLcode status; - struct curl_slist *headers = NULL; - char *data = NULL; - long code; - - curl_global_init(CURL_GLOBAL_ALL); - curl = curl_easy_init(); - if(!curl) - goto error; - - data = malloc(BUFFER_SIZE); - if(!data) - goto error; - - struct write_result write_result = { - .data = data, - .pos = 0 - }; - - curl_easy_setopt(curl, CURLOPT_URL, url); - - /* GitHub commits API v3 requires a User-Agent header */ - headers = curl_slist_append(headers, "User-Agent: Jansson-Tutorial"); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_response); - curl_easy_setopt(curl, CURLOPT_WRITEDATA, &write_result); - - status = curl_easy_perform(curl); - if(status != 0) - { - fprintf(stderr, "error: unable to request data from %s:\n", url); - fprintf(stderr, "%s\n", curl_easy_strerror(status)); - goto error; - } - - curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &code); - if(code != 200) - { - fprintf(stderr, "error: server responded with code %ld\n", code); - goto error; - } - - curl_easy_cleanup(curl); - curl_slist_free_all(headers); - curl_global_cleanup(); - - /* zero-terminate the result */ - data[write_result.pos] = '\0'; - - return data; - -error: - if(data) - free(data); - if(curl) - curl_easy_cleanup(curl); - if(headers) - curl_slist_free_all(headers); - curl_global_cleanup(); - return NULL; -} - -int main(int argc, char *argv[]) -{ - size_t i; - char *text; - char url[URL_SIZE]; - - json_t *root; - json_error_t error; - - if(argc != 3) - { - fprintf(stderr, "usage: %s USER REPOSITORY\n\n", argv[0]); - fprintf(stderr, "List commits at USER's REPOSITORY.\n\n"); - return 2; - } - - snprintf(url, URL_SIZE, URL_FORMAT, argv[1], argv[2]); - - text = request(url); - if(!text) - return 1; - - root = json_loads(text, 0, &error); - free(text); - - if(!root) - { - fprintf(stderr, "error: on line %d: %s\n", error.line, error.text); - return 1; - } - - if(!json_is_array(root)) - { - fprintf(stderr, "error: root is not an array\n"); - json_decref(root); - return 1; - } - - for(i = 0; i < json_array_size(root); i++) - { - json_t *data, *sha, *commit, *message; - const char *message_text; - - data = json_array_get(root, i); - if(!json_is_object(data)) - { - fprintf(stderr, "error: commit data %d is not an object\n", (int)(i + 1)); - json_decref(root); - return 1; - } - - sha = json_object_get(data, "sha"); - if(!json_is_string(sha)) - { - fprintf(stderr, "error: commit %d: sha is not a string\n", (int)(i + 1)); - return 1; - } - - commit = json_object_get(data, "commit"); - if(!json_is_object(commit)) - { - fprintf(stderr, "error: commit %d: commit is not an object\n", (int)(i + 1)); - json_decref(root); - return 1; - } - - message = json_object_get(commit, "message"); - if(!json_is_string(message)) - { - fprintf(stderr, "error: commit %d: message is not a string\n", (int)(i + 1)); - json_decref(root); - return 1; - } - - message_text = json_string_value(message); - printf("%.8s %.*s\n", - json_string_value(sha), - newline_offset(message_text), - message_text); - } - - json_decref(root); - return 0; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/.gitignore kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/.gitignore --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/.gitignore 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -_build/ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/index.rst kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/index.rst --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/index.rst 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/index.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -Jansson Documentation -===================== - -This is the documentation for Jansson_ |release|, last updated |today|. - -Introduction ------------- - -Jansson_ is a C library for encoding, decoding and manipulating JSON -data. Its main features and design principles are: - -- Simple and intuitive API and data model - -- Comprehensive documentation - -- No dependencies on other libraries - -- Full Unicode support (UTF-8) - -- Extensive test suite - -Jansson is licensed under the `MIT license`_; see LICENSE in the -source distribution for details. - -Jansson is used in production and its API is stable. It works on -numerous platforms, including numerous Unix like systems and Windows. -It's suitable for use on any system, including desktop, server, and -small embedded systems. - - -.. _`MIT license`: http://www.opensource.org/licenses/mit-license.php -.. _Jansson: http://www.digip.org/jansson/ - -Contents --------- - -.. toctree:: - :maxdepth: 2 - - gettingstarted - upgrading - tutorial - conformance - portability - apiref - changes - - -Indices and Tables -================== - -* :ref:`genindex` -* :ref:`search` diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/Makefile.am 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -EXTRA_DIST = conf.py apiref.rst changes.rst conformance.rst \ - gettingstarted.rst github_commits.c index.rst portability.rst \ - tutorial.rst upgrading.rst ext/refcounting.py - -SPHINXBUILD = sphinx-build -SPHINXOPTS = -d _build/doctrees $(SPHINXOPTS_EXTRA) - -html-local: - $(SPHINXBUILD) -b html $(SPHINXOPTS) $(srcdir) _build/html - -install-html-local: html - mkdir -p $(DESTDIR)$(htmldir) - cp -r _build/html $(DESTDIR)$(htmldir) - -uninstall-local: - rm -rf $(DESTDIR)$(htmldir) - -clean-local: - rm -rf _build - rm -f ext/refcounting.pyc diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/portability.rst kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/portability.rst --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/portability.rst 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/portability.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,83 +0,0 @@ -*********** -Portability -*********** - -.. _portability-thread-safety: - -Thread safety -------------- - -Jansson is thread safe and has no mutable global state. The only -exceptions are the hash function seed and memory allocation functions, -see below. - -There's no locking performed inside Jansson's code, so a multithreaded -program must perform its own locking if JSON values are shared by -multiple threads. Jansson's reference counting semantics may make this -a bit harder than it seems, as it's possible to have a reference to a -value that's also stored inside a list or object. Modifying the -container (adding or removing values) may trigger concurrent access to -such values, as containers manage the reference count of their -contained values. Bugs involving concurrent incrementing or -decrementing of deference counts may be hard to track. - -The encoding functions (:func:`json_dumps()` and friends) track -reference loops by modifying the internal state of objects and arrays. -For this reason, encoding functions must not be run on the same JSON -values in two separate threads at the same time. As already noted -above, be especially careful if two arrays or objects share their -contained values with another array or object. - -If you want to make sure that two JSON value hierarchies do not -contain shared values, use :func:`json_deep_copy()` to make copies. - - -Hash function seed -================== - -To prevent an attacker from intentionally causing large JSON objects -with specially crafted keys to perform very slow, the hash function -used by Jansson is randomized using a seed value. The seed is -automatically generated on the first explicit or implicit call to -:func:`json_object()`, if :func:`json_object_seed()` has not been -called beforehand. - -The seed is generated by using operating system's entropy sources if -they are available (``/dev/urandom``, ``CryptGenRandom()``). The -initialization is done in as thread safe manner as possible, by using -architecture specific lockless operations if provided by the platform -or the compiler. - -If you're using threads, it's recommended to autoseed the hashtable -explicitly before spawning any threads by calling -``json_object_seed(0)`` , especially if you're unsure whether the -initialization is thread safe on your platform. - - -Memory allocation functions -=========================== - -Memory allocation functions should be set at most once, and only on -program startup. See :ref:`apiref-custom-memory-allocation`. - - -Locale ------- - -Jansson works fine under any locale. - -However, if the host program is multithreaded and uses ``setlocale()`` -to switch the locale in one thread while Jansson is currently encoding -or decoding JSON data in another thread, the result may be wrong or -the program may even crash. - -Jansson uses locale specific functions for certain string conversions -in the encoder and decoder, and then converts the locale specific -values to/from the JSON representation. This fails if the locale -changes between the string conversion and the locale-to-JSON -conversion. This can only happen in multithreaded programs that use -``setlocale()``, because ``setlocale()`` switches the locale for all -running threads, not only the thread that calls ``setlocale()``. - -If your program uses ``setlocale()`` as described above, consider -using the thread-safe ``uselocale()`` instead. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/README kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/README --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/README 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -To build the documentation, invoke - - make html - -Then point your browser to _build/html/index.html. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/tutorial.rst kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/tutorial.rst --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/tutorial.rst 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/tutorial.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,286 +0,0 @@ -.. _tutorial: - -******** -Tutorial -******** - -.. highlight:: c - -In this tutorial, we create a program that fetches the latest commits -of a repository in GitHub_ over the web. `GitHub API`_ uses JSON, so -the result can be parsed using Jansson. - -To stick to the the scope of this tutorial, we will only cover the the -parts of the program related to handling JSON data. For the best user -experience, the full source code is available: -:download:`github_commits.c`. To compile it (on Unix-like systems with -gcc), use the following command:: - - gcc -o github_commits github_commits.c -ljansson -lcurl - -libcurl_ is used to communicate over the web, so it is required to -compile the program. - -The command line syntax is:: - - github_commits USER REPOSITORY - -``USER`` is a GitHub user ID and ``REPOSITORY`` is the repository -name. Please note that the GitHub API is rate limited, so if you run -the program too many times within a short period of time, the sever -starts to respond with an error. - -.. _GitHub: https://github.com/ -.. _GitHub API: http://developer.github.com/ -.. _libcurl: http://curl.haxx.se/ - - -.. _tutorial-github-commits-api: - -The GitHub Repo Commits API -=========================== - -The `GitHub Repo Commits API`_ is used by sending HTTP requests to -URLs like ``https://api.github.com/repos/USER/REPOSITORY/commits``, -where ``USER`` and ``REPOSITORY`` are the GitHub user ID and the name -of the repository whose commits are to be listed, respectively. - -GitHub responds with a JSON array of the following form: - -.. code-block:: none - - [ - { - "sha": "", - "commit": { - "message": "", - - }, - - }, - { - "sha": "", - "commit": { - "message": "", - - }, - - }, - - ] - -In our program, the HTTP request is sent using the following -function:: - - static char *request(const char *url); - -It takes the URL as a parameter, preforms a HTTP GET request, and -returns a newly allocated string that contains the response body. If -the request fails, an error message is printed to stderr and the -return value is *NULL*. For full details, refer to :download:`the code -`, as the actual implementation is not important -here. - -.. _GitHub Repo Commits API: http://developer.github.com/v3/repos/commits/ - -.. _tutorial-the-program: - -The Program -=========== - -First the includes:: - - #include - #include - -Like all the programs using Jansson, we need to include -:file:`jansson.h`. - -The following definitions are used to build the GitHub API request -URL:: - - #define URL_FORMAT "https://api.github.com/repos/%s/%s/commits" - #define URL_SIZE 256 - -The following function is used when formatting the result to find the -first newline in the commit message:: - - /* Return the offset of the first newline in text or the length of - text if there's no newline */ - static int newline_offset(const char *text) - { - const char *newline = strchr(text, '\n'); - if(!newline) - return strlen(text); - else - return (int)(newline - text); - } - -The main function follows. In the beginning, we first declare a bunch -of variables and check the command line parameters:: - - int main(int argc, char *argv[]) - { - size_t i; - char *text; - char url[URL_SIZE]; - - json_t *root; - json_error_t error; - - if(argc != 3) - { - fprintf(stderr, "usage: %s USER REPOSITORY\n\n", argv[0]); - fprintf(stderr, "List commits at USER's REPOSITORY.\n\n"); - return 2; - } - -Then we build the request URL using the user and repository names -given as command line parameters:: - - snprintf(url, URL_SIZE, URL_FORMAT, argv[1], argv[2]); - -This uses the ``URL_SIZE`` and ``URL_FORMAT`` constants defined above. -Now we're ready to actually request the JSON data over the web:: - - text = request(url); - if(!text) - return 1; - -If an error occurs, our function ``request`` prints the error and -returns *NULL*, so it's enough to just return 1 from the main -function. - -Next we'll call :func:`json_loads()` to decode the JSON text we got -as a response:: - - root = json_loads(text, 0, &error); - free(text); - - if(!root) - { - fprintf(stderr, "error: on line %d: %s\n", error.line, error.text); - return 1; - } - -We don't need the JSON text anymore, so we can free the ``text`` -variable right after decoding it. If :func:`json_loads()` fails, it -returns *NULL* and sets error information to the :type:`json_error_t` -structure given as the second parameter. In this case, our program -prints the error information out and returns 1 from the main function. - -Now we're ready to extract the data out of the decoded JSON response. -The structure of the response JSON was explained in section -:ref:`tutorial-github-commits-api`. - -We check that the returned value really is an array:: - - if(!json_is_array(root)) - { - fprintf(stderr, "error: root is not an array\n"); - json_decref(root); - return 1; - } - -Then we proceed to loop over all the commits in the array:: - - for(i = 0; i < json_array_size(root); i++) - { - json_t *data, *sha, *commit, *message; - const char *message_text; - - data = json_array_get(root, i); - if(!json_is_object(data)) - { - fprintf(stderr, "error: commit data %d is not an object\n", i + 1); - json_decref(root); - return 1; - } - ... - -The function :func:`json_array_size()` returns the size of a JSON -array. First, we again declare some variables and then extract the -i'th element of the ``root`` array using :func:`json_array_get()`. -We also check that the resulting value is a JSON object. - -Next we'll extract the commit ID (a hexadecimal SHA-1 sum), -intermediate commit info object, and the commit message from that -object. We also do proper type checks:: - - sha = json_object_get(data, "sha"); - if(!json_is_string(sha)) - { - fprintf(stderr, "error: commit %d: sha is not a string\n", i + 1); - json_decref(root); - return 1; - } - - commit = json_object_get(data, "commit"); - if(!json_is_object(commit)) - { - fprintf(stderr, "error: commit %d: commit is not an object\n", i + 1); - json_decref(root); - return 1; - } - - message = json_object_get(commit, "message"); - if(!json_is_string(message)) - { - fprintf(stderr, "error: commit %d: message is not a string\n", i + 1); - json_decref(root); - return 1; - } - ... - -And finally, we'll print the first 8 characters of the commit ID and -the first line of the commit message. A C-style string is extracted -from a JSON string using :func:`json_string_value()`:: - - message_text = json_string_value(message); - printf("%.8s %.*s\n", - json_string_value(id), - newline_offset(message_text), - message_text); - } - -After sending the HTTP request, we decoded the JSON text using -:func:`json_loads()`, remember? It returns a *new reference* to the -JSON value it decodes. When we're finished with the value, we'll need -to decrease the reference count using :func:`json_decref()`. This way -Jansson can release the resources:: - - json_decref(root); - return 0; - -For a detailed explanation of reference counting in Jansson, see -:ref:`apiref-reference-count` in :ref:`apiref`. - -The program's ready, let's test it and view the latest commits in -Jansson's repository:: - - $ ./github_commits akheron jansson - 1581f26a Merge branch '2.3' - aabfd493 load: Change buffer_pos to be a size_t - bd72efbd load: Avoid unexpected behaviour in macro expansion - e8fd3e30 Document and tweak json_load_callback() - 873eddaf Merge pull request #60 from rogerz/contrib - bd2c0c73 Ignore the binary test_load_callback - 17a51a4b Merge branch '2.3' - 09c39adc Add json_load_callback to the list of exported symbols - cbb80baf Merge pull request #57 from rogerz/contrib - 040bd7b0 Add json_load_callback() - 2637faa4 Make test stripping locale independent - <...> - - -Conclusion -========== - -In this tutorial, we implemented a program that fetches the latest -commits of a GitHub repository using the GitHub Repo Commits API. -Jansson was used to decode the JSON response and to extract the commit -data. - -This tutorial only covered a small part of Jansson. For example, we -did not create or manipulate JSON values at all. Proceed to -:ref:`apiref` to explore all features of Jansson. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/upgrading.rst kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/upgrading.rst --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/doc/upgrading.rst 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/doc/upgrading.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,76 +0,0 @@ -.. highlight:: c - -****************** -Upgrading from 1.x -****************** - -This chapter lists the backwards incompatible changes introduced in -Jansson 2.0, and the steps that are needed for upgrading your code. - -**The incompatibilities are not dramatic.** The biggest change is that -all decoding functions now require and extra parameter. Most programs -can be modified to work with 2.0 by adding a ``0`` as the second -parameter to all calls of :func:`json_loads()`, :func:`json_loadf()` -and :func:`json_load_file()`. - - -Compatibility -============= - -Jansson 2.0 is backwards incompatible with the Jansson 1.x releases. -It is ABI incompatible, i.e. all programs dynamically linking to the -Jansson library need to be recompiled. It's also API incompatible, -i.e. the source code of programs using Jansson 1.x may need -modifications to make them compile against Jansson 2.0. - -All the 2.x releases are guaranteed to be backwards compatible for -both ABI and API, so no recompilation or source changes are needed -when upgrading from 2.x to 2.y. - - -List of Incompatible Changes -============================ - -**Decoding flags** - For future needs, a ``flags`` parameter was added as the second - parameter to all decoding functions, i.e. :func:`json_loads()`, - :func:`json_loadf()` and :func:`json_load_file()`. All calls to - these functions need to be changed by adding a ``0`` as the second - argument. For example:: - - /* old code */ - json_loads(input, &error); - - /* new code */ - json_loads(input, 0, &error); - - -**Underlying type of JSON integers** - The underlying C type of JSON integers has been changed from - :type:`int` to the widest available signed integer type, i.e. - :type:`long long` or :type:`long`, depending on whether - :type:`long long` is supported on your system or not. This makes - the whole 64-bit integer range available on most modern systems. - - ``jansson.h`` has a typedef :type:`json_int_t` to the underlying - integer type. :type:`int` should still be used in most cases when - dealing with smallish JSON integers, as the compiler handles - implicit type coercion. Only when the full 64-bit range is needed, - :type:`json_int_t` should be explicitly used. - - -**Maximum encoder indentation depth** - The maximum argument of the ``JSON_INDENT()`` macro has been - changed from 255 to 31, to free up bits from the ``flags`` - parameter of :func:`json_dumps()`, :func:`json_dumpf()` and - :func:`json_dump_file()`. If your code uses a bigger indentation - than 31, it needs to be changed. - - -**Unsigned integers in API functions** - Version 2.0 unifies unsigned integer usage in the API. All uses of - :type:`unsigned int` and :type:`unsigned long` have been replaced - with :type:`size_t`. This includes flags, container sizes, etc. - This should not require source code changes, as both - :type:`unsigned int` and :type:`unsigned long` are usually - compatible with :type:`size_t`. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/.gitignore kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/.gitignore --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/.gitignore 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -*~ -*.o -*.a -.libs -.deps -Makefile -Makefile.in -aclocal.m4 -autom4te.cache -config.guess -config.h -config.h.in -config.log -config.status -config.sub -configure -depcomp -install-sh -libtool -ltmain.sh -missing -compile -test-driver -*.lo -*.la -stamp-h1 -*.pyc -*.pc -/src/jansson_config.h -/jansson_private_config.h.in -/jansson_private_config.h -/build -*.exe diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/jansson.pc.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/jansson.pc.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/jansson.pc.in 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/jansson.pc.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=${prefix}/include - -Name: Jansson -Description: Library for encoding, decoding and manipulating JSON data -Version: @VERSION@ -Libs: -L${libdir} -ljansson -Cflags: -I${includedir} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/LICENSE kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/LICENSE --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/LICENSE 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/LICENSE 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ -Copyright (c) 2009-2014 Petri Lehtinen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/Makefile.am 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -EXTRA_DIST = CHANGES LICENSE README.rst CMakeLists.txt cmake android -SUBDIRS = doc src test - -# "make distcheck" builds the dvi target, so use it to check that the -# documentation is built correctly. -dvi: - $(MAKE) SPHINXOPTS_EXTRA=-W html - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = jansson.pc diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/README.rst kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/README.rst --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/README.rst 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/README.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -Jansson README -============== - -.. image:: https://travis-ci.org/akheron/jansson.png - :target: https://travis-ci.org/akheron/jansson - -.. image:: https://ci.appveyor.com/api/projects/status/lmhkkc4q8cwc65ko - :target: https://ci.appveyor.com/project/akheron/jansson - -Jansson_ is a C library for encoding, decoding and manipulating JSON -data. Its main features and design principles are: - -- Simple and intuitive API and data model - -- Comprehensive documentation - -- No dependencies on other libraries - -- Full Unicode support (UTF-8) - -- Extensive test suite - -Jansson is licensed under the `MIT license`_; see LICENSE in the -source distribution for details. - - -Compilation and Installation ----------------------------- - -If you obtained a source tarball, just use the standard autotools -commands:: - - $ ./configure - $ make - $ make install - -To run the test suite, invoke:: - - $ make check - -If the source has been checked out from a Git repository, the -./configure script has to be generated first. The easiest way is to -use autoreconf:: - - $ autoreconf -i - - -Documentation -------------- - -Documentation is available at http://jansson.readthedocs.org/en/latest/. - -The documentation source is in the ``doc/`` subdirectory. To generate -HTML documentation, invoke:: - - $ make html - -Then, point your browser to ``doc/_build/html/index.html``. Sphinx_ -1.0 or newer is required to generate the documentation. - - -.. _Jansson: http://www.digip.org/jansson/ -.. _`MIT license`: http://www.opensource.org/licenses/mit-license.php -.. _Sphinx: http://sphinx.pocoo.org/ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/release.sh kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/release.sh --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/release.sh 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/release.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -#!/bin/sh -# -# Use this script to easily make releases of Jansson. It configures -# the source tree, and builds and signs all tarballs. - -die() { - echo $1 >&2 - exit 1 -} - -confirm() { - local answer - read -p "$1 [yN]: " answer - [ "$answer" = "Y" -o "$answer" = "y" ] || exit 0 -} - -set -e -[ -f configure.ac ] || die "Must be run at project root directory" - -# Determine version -v=$(grep AC_INIT configure.ac | sed -r 's/.*, \[(.+?)\],.*/\1/') -[ -n "$v" ] || die "Unable to determine version" -confirm "Version is $v, proceed?" - -# Sanity checks -vi=$(grep version-info src/Makefile.am | sed 's/^[ \t]*//g' | cut -d" " -f2) -confirm "Libtool version-info is $vi, proceed?" - -r=$(grep 'Released ' CHANGES | head -n 1) -confirm "Last CHANGES entry says \"$r\", proceed??" - -dv=$(grep ^version doc/conf.py | sed -r "s/.*'(.*)'.*/\1/") -if [ "$dv" != "$v" ]; then - die "Documentation version ($dv) doesn't match library version" -fi - -[ -f Makefile ] && make distclean || true -rm -f jansson-$v.tar.* -rm -rf jansson-$v-doc -rm -f jansson-$v-doc.tar.* - -autoreconf -fi -./configure - -# Run tests and make gz source tarball -: ${VALGRIND:=1} -export VALGRIND -make distcheck - -# Make bzip2 source tarball -make dist-bzip2 - -# Sign source tarballs -for s in gz bz2; do - gpg --detach-sign --armor jansson-$v.tar.$s -done - -# Build documentation -make html -mv doc/_build/html jansson-$v-doc - -# Make and sign documentation tarballs -for s in gz bz2; do - [ $s = gz ] && compress=gzip - [ $s = bz2 ] && compress=bzip2 - tar cf - jansson-$v-doc | $compress -9 -c > jansson-$v-doc.tar.$s - gpg --detach-sign --armor jansson-$v-doc.tar.$s -done - -echo "All done" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/dump.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/dump.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/dump.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/dump.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,463 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include -#include -#include -#include - -#include "jansson.h" -#include "jansson_private.h" -#include "strbuffer.h" -#include "utf.h" - -#define MAX_INTEGER_STR_LENGTH 100 -#define MAX_REAL_STR_LENGTH 100 - -#define FLAGS_TO_INDENT(f) ((f) & 0x1F) -#define FLAGS_TO_PRECISION(f) (((f) >> 11) & 0x1F) - -struct object_key { - size_t serial; - const char *key; -}; - -static int dump_to_strbuffer(const char *buffer, size_t size, void *data) -{ - return strbuffer_append_bytes((strbuffer_t *)data, buffer, size); -} - -static int dump_to_file(const char *buffer, size_t size, void *data) -{ - FILE *dest = (FILE *)data; - if(fwrite(buffer, size, 1, dest) != 1) - return -1; - return 0; -} - -/* 32 spaces (the maximum indentation size) */ -static const char whitespace[] = " "; - -static int dump_indent(size_t flags, int depth, int space, json_dump_callback_t dump, void *data) -{ - if(FLAGS_TO_INDENT(flags) > 0) - { - int i, ws_count = FLAGS_TO_INDENT(flags); - - if(dump("\n", 1, data)) - return -1; - - for(i = 0; i < depth; i++) - { - if(dump(whitespace, ws_count, data)) - return -1; - } - } - else if(space && !(flags & JSON_COMPACT)) - { - return dump(" ", 1, data); - } - return 0; -} - -static int dump_string(const char *str, size_t len, json_dump_callback_t dump, void *data, size_t flags) -{ - const char *pos, *end, *lim; - int32_t codepoint; - - if(dump("\"", 1, data)) - return -1; - - end = pos = str; - lim = str + len; - while(1) - { - const char *text; - char seq[13]; - int length; - - while(end < lim) - { - end = utf8_iterate(pos, lim - pos, &codepoint); - if(!end) - return -1; - - /* mandatory escape or control char */ - if(codepoint == '\\' || codepoint == '"' || codepoint < 0x20) - break; - - /* slash */ - if((flags & JSON_ESCAPE_SLASH) && codepoint == '/') - break; - - /* non-ASCII */ - if((flags & JSON_ENSURE_ASCII) && codepoint > 0x7F) - break; - - pos = end; - } - - if(pos != str) { - if(dump(str, pos - str, data)) - return -1; - } - - if(end == pos) - break; - - /* handle \, /, ", and control codes */ - length = 2; - switch(codepoint) - { - case '\\': text = "\\\\"; break; - case '\"': text = "\\\""; break; - case '\b': text = "\\b"; break; - case '\f': text = "\\f"; break; - case '\n': text = "\\n"; break; - case '\r': text = "\\r"; break; - case '\t': text = "\\t"; break; - case '/': text = "\\/"; break; - default: - { - /* codepoint is in BMP */ - if(codepoint < 0x10000) - { - sprintf(seq, "\\u%04X", codepoint); - length = 6; - } - - /* not in BMP -> construct a UTF-16 surrogate pair */ - else - { - int32_t first, last; - - codepoint -= 0x10000; - first = 0xD800 | ((codepoint & 0xffc00) >> 10); - last = 0xDC00 | (codepoint & 0x003ff); - - sprintf(seq, "\\u%04X\\u%04X", first, last); - length = 12; - } - - text = seq; - break; - } - } - - if(dump(text, length, data)) - return -1; - - str = pos = end; - } - - return dump("\"", 1, data); -} - -static int object_key_compare_keys(const void *key1, const void *key2) -{ - return strcmp(((const struct object_key *)key1)->key, - ((const struct object_key *)key2)->key); -} - -static int object_key_compare_serials(const void *key1, const void *key2) -{ - size_t a = ((const struct object_key *)key1)->serial; - size_t b = ((const struct object_key *)key2)->serial; - - return a < b ? -1 : a == b ? 0 : 1; -} - -static int do_dump(const json_t *json, size_t flags, int depth, - json_dump_callback_t dump, void *data) -{ - if(!json) - return -1; - - switch(json_typeof(json)) { - case JSON_NULL: - return dump("null", 4, data); - - case JSON_TRUE: - return dump("true", 4, data); - - case JSON_FALSE: - return dump("false", 5, data); - - case JSON_INTEGER: - { - char buffer[MAX_INTEGER_STR_LENGTH]; - int size; - - size = snprintf(buffer, MAX_INTEGER_STR_LENGTH, - "%" JSON_INTEGER_FORMAT, - json_integer_value(json)); - if(size < 0 || size >= MAX_INTEGER_STR_LENGTH) - return -1; - - return dump(buffer, size, data); - } - - case JSON_REAL: - { - char buffer[MAX_REAL_STR_LENGTH]; - int size; - double value = json_real_value(json); - - size = jsonp_dtostr(buffer, MAX_REAL_STR_LENGTH, value, - FLAGS_TO_PRECISION(flags)); - if(size < 0) - return -1; - - return dump(buffer, size, data); - } - - case JSON_STRING: - return dump_string(json_string_value(json), json_string_length(json), dump, data, flags); - - case JSON_ARRAY: - { - size_t n; - size_t i; - - json_array_t *array; - - /* detect circular references */ - array = json_to_array(json); - if(array->visited) - goto array_error; - array->visited = 1; - - n = json_array_size(json); - - if(dump("[", 1, data)) - goto array_error; - if(n == 0) { - array->visited = 0; - return dump("]", 1, data); - } - if(dump_indent(flags, depth + 1, 0, dump, data)) - goto array_error; - - for(i = 0; i < n; ++i) { - if(do_dump(json_array_get(json, i), flags, depth + 1, - dump, data)) - goto array_error; - - if(i < n - 1) - { - if(dump(",", 1, data) || - dump_indent(flags, depth + 1, 1, dump, data)) - goto array_error; - } - else - { - if(dump_indent(flags, depth, 0, dump, data)) - goto array_error; - } - } - - array->visited = 0; - return dump("]", 1, data); - - array_error: - array->visited = 0; - return -1; - } - - case JSON_OBJECT: - { - json_object_t *object; - void *iter; - const char *separator; - int separator_length; - - if(flags & JSON_COMPACT) { - separator = ":"; - separator_length = 1; - } - else { - separator = ": "; - separator_length = 2; - } - - /* detect circular references */ - object = json_to_object(json); - if(object->visited) - goto object_error; - object->visited = 1; - - iter = json_object_iter((json_t *)json); - - if(dump("{", 1, data)) - goto object_error; - if(!iter) { - object->visited = 0; - return dump("}", 1, data); - } - if(dump_indent(flags, depth + 1, 0, dump, data)) - goto object_error; - - if(flags & JSON_SORT_KEYS || flags & JSON_PRESERVE_ORDER) - { - struct object_key *keys; - size_t size, i; - int (*cmp_func)(const void *, const void *); - - size = json_object_size(json); - keys = jsonp_malloc(size * sizeof(struct object_key)); - if(!keys) - goto object_error; - - i = 0; - while(iter) - { - keys[i].serial = hashtable_iter_serial(iter); - keys[i].key = json_object_iter_key(iter); - iter = json_object_iter_next((json_t *)json, iter); - i++; - } - assert(i == size); - - if(flags & JSON_SORT_KEYS) - cmp_func = object_key_compare_keys; - else - cmp_func = object_key_compare_serials; - - qsort(keys, size, sizeof(struct object_key), cmp_func); - - for(i = 0; i < size; i++) - { - const char *key; - json_t *value; - - key = keys[i].key; - value = json_object_get(json, key); - assert(value); - - dump_string(key, strlen(key), dump, data, flags); - if(dump(separator, separator_length, data) || - do_dump(value, flags, depth + 1, dump, data)) - { - jsonp_free(keys); - goto object_error; - } - - if(i < size - 1) - { - if(dump(",", 1, data) || - dump_indent(flags, depth + 1, 1, dump, data)) - { - jsonp_free(keys); - goto object_error; - } - } - else - { - if(dump_indent(flags, depth, 0, dump, data)) - { - jsonp_free(keys); - goto object_error; - } - } - } - - jsonp_free(keys); - } - else - { - /* Don't sort keys */ - - while(iter) - { - void *next = json_object_iter_next((json_t *)json, iter); - const char *key = json_object_iter_key(iter); - - dump_string(key, strlen(key), dump, data, flags); - if(dump(separator, separator_length, data) || - do_dump(json_object_iter_value(iter), flags, depth + 1, - dump, data)) - goto object_error; - - if(next) - { - if(dump(",", 1, data) || - dump_indent(flags, depth + 1, 1, dump, data)) - goto object_error; - } - else - { - if(dump_indent(flags, depth, 0, dump, data)) - goto object_error; - } - - iter = next; - } - } - - object->visited = 0; - return dump("}", 1, data); - - object_error: - object->visited = 0; - return -1; - } - - default: - /* not reached */ - return -1; - } -} - -char *json_dumps(const json_t *json, size_t flags) -{ - strbuffer_t strbuff; - char *result; - - if(strbuffer_init(&strbuff)) - return NULL; - - if(json_dump_callback(json, dump_to_strbuffer, (void *)&strbuff, flags)) - result = NULL; - else - result = jsonp_strdup(strbuffer_value(&strbuff)); - - strbuffer_close(&strbuff); - return result; -} - -int json_dumpf(const json_t *json, FILE *output, size_t flags) -{ - return json_dump_callback(json, dump_to_file, (void *)output, flags); -} - -int json_dump_file(const json_t *json, const char *path, size_t flags) -{ - int result; - - FILE *output = fopen(path, "w"); - if(!output) - return -1; - - result = json_dumpf(json, output, flags); - - fclose(output); - return result; -} - -int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags) -{ - if(!(flags & JSON_ENCODE_ANY)) { - if(!json_is_array(json) && !json_is_object(json)) - return -1; - } - - return do_dump(json, flags, 0, callback, data); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/error.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/error.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/error.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/error.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -#include -#include "jansson_private.h" - -void jsonp_error_init(json_error_t *error, const char *source) -{ - if(error) - { - error->text[0] = '\0'; - error->line = -1; - error->column = -1; - error->position = 0; - if(source) - jsonp_error_set_source(error, source); - else - error->source[0] = '\0'; - } -} - -void jsonp_error_set_source(json_error_t *error, const char *source) -{ - size_t length; - - if(!error || !source) - return; - - length = strlen(source); - if(length < JSON_ERROR_SOURCE_LENGTH) - strcpy(error->source, source); - else { - size_t extra = length - JSON_ERROR_SOURCE_LENGTH + 4; - strcpy(error->source, "..."); - strcpy(error->source + 3, source + extra); - } -} - -void jsonp_error_set(json_error_t *error, int line, int column, - size_t position, const char *msg, ...) -{ - va_list ap; - - va_start(ap, msg); - jsonp_error_vset(error, line, column, position, msg, ap); - va_end(ap); -} - -void jsonp_error_vset(json_error_t *error, int line, int column, - size_t position, const char *msg, va_list ap) -{ - if(!error) - return; - - if(error->text[0] != '\0') { - /* error already set */ - return; - } - - error->line = line; - error->column = column; - error->position = (int)position; - - vsnprintf(error->text, JSON_ERROR_TEXT_LENGTH, msg, ap); - error->text[JSON_ERROR_TEXT_LENGTH - 1] = '\0'; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/hashtable.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/hashtable.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/hashtable.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/hashtable.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,352 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#if HAVE_CONFIG_H -#include -#endif - -#include -#include - -#if HAVE_STDINT_H -#include -#endif - -#include /* for JSON_INLINE */ -#include "jansson_private.h" /* for container_of() */ -#include "hashtable.h" - -typedef struct hashtable_list list_t; -typedef struct hashtable_pair pair_t; -typedef struct hashtable_bucket bucket_t; - -extern volatile uint32_t hashtable_seed; - -/* Implementation of the hash function */ -#include "lookup3.h" - -#define list_to_pair(list_) container_of(list_, pair_t, list) -#define hash_str(key) ((size_t)hashlittle((key), strlen(key), hashtable_seed)) - -static JSON_INLINE void list_init(list_t *list) -{ - list->next = list; - list->prev = list; -} - -static JSON_INLINE void list_insert(list_t *list, list_t *node) -{ - node->next = list; - node->prev = list->prev; - list->prev->next = node; - list->prev = node; -} - -static JSON_INLINE void list_remove(list_t *list) -{ - list->prev->next = list->next; - list->next->prev = list->prev; -} - -static JSON_INLINE int bucket_is_empty(hashtable_t *hashtable, bucket_t *bucket) -{ - return bucket->first == &hashtable->list && bucket->first == bucket->last; -} - -static void insert_to_bucket(hashtable_t *hashtable, bucket_t *bucket, - list_t *list) -{ - if(bucket_is_empty(hashtable, bucket)) - { - list_insert(&hashtable->list, list); - bucket->first = bucket->last = list; - } - else - { - list_insert(bucket->first, list); - bucket->first = list; - } -} - -static pair_t *hashtable_find_pair(hashtable_t *hashtable, bucket_t *bucket, - const char *key, size_t hash) -{ - list_t *list; - pair_t *pair; - - if(bucket_is_empty(hashtable, bucket)) - return NULL; - - list = bucket->first; - while(1) - { - pair = list_to_pair(list); - if(pair->hash == hash && strcmp(pair->key, key) == 0) - return pair; - - if(list == bucket->last) - break; - - list = list->next; - } - - return NULL; -} - -/* returns 0 on success, -1 if key was not found */ -static int hashtable_do_del(hashtable_t *hashtable, - const char *key, size_t hash) -{ - pair_t *pair; - bucket_t *bucket; - size_t index; - - index = hash & hashmask(hashtable->order); - bucket = &hashtable->buckets[index]; - - pair = hashtable_find_pair(hashtable, bucket, key, hash); - if(!pair) - return -1; - - if(&pair->list == bucket->first && &pair->list == bucket->last) - bucket->first = bucket->last = &hashtable->list; - - else if(&pair->list == bucket->first) - bucket->first = pair->list.next; - - else if(&pair->list == bucket->last) - bucket->last = pair->list.prev; - - list_remove(&pair->list); - json_decref(pair->value); - - jsonp_free(pair); - hashtable->size--; - - return 0; -} - -static void hashtable_do_clear(hashtable_t *hashtable) -{ - list_t *list, *next; - pair_t *pair; - - for(list = hashtable->list.next; list != &hashtable->list; list = next) - { - next = list->next; - pair = list_to_pair(list); - json_decref(pair->value); - jsonp_free(pair); - } -} - -static int hashtable_do_rehash(hashtable_t *hashtable) -{ - list_t *list, *next; - pair_t *pair; - size_t i, index, new_size; - - jsonp_free(hashtable->buckets); - - hashtable->order++; - new_size = hashsize(hashtable->order); - - hashtable->buckets = jsonp_malloc(new_size * sizeof(bucket_t)); - if(!hashtable->buckets) - return -1; - - for(i = 0; i < hashsize(hashtable->order); i++) - { - hashtable->buckets[i].first = hashtable->buckets[i].last = - &hashtable->list; - } - - list = hashtable->list.next; - list_init(&hashtable->list); - - for(; list != &hashtable->list; list = next) { - next = list->next; - pair = list_to_pair(list); - index = pair->hash % new_size; - insert_to_bucket(hashtable, &hashtable->buckets[index], &pair->list); - } - - return 0; -} - - -int hashtable_init(hashtable_t *hashtable) -{ - size_t i; - - hashtable->size = 0; - hashtable->order = 3; - hashtable->buckets = jsonp_malloc(hashsize(hashtable->order) * sizeof(bucket_t)); - if(!hashtable->buckets) - return -1; - - list_init(&hashtable->list); - - for(i = 0; i < hashsize(hashtable->order); i++) - { - hashtable->buckets[i].first = hashtable->buckets[i].last = - &hashtable->list; - } - - return 0; -} - -void hashtable_close(hashtable_t *hashtable) -{ - hashtable_do_clear(hashtable); - jsonp_free(hashtable->buckets); -} - -int hashtable_set(hashtable_t *hashtable, - const char *key, size_t serial, - json_t *value) -{ - pair_t *pair; - bucket_t *bucket; - size_t hash, index; - - /* rehash if the load ratio exceeds 1 */ - if(hashtable->size >= hashsize(hashtable->order)) - if(hashtable_do_rehash(hashtable)) - return -1; - - hash = hash_str(key); - index = hash & hashmask(hashtable->order); - bucket = &hashtable->buckets[index]; - pair = hashtable_find_pair(hashtable, bucket, key, hash); - - if(pair) - { - json_decref(pair->value); - pair->value = value; - } - else - { - /* offsetof(...) returns the size of pair_t without the last, - flexible member. This way, the correct amount is - allocated. */ - - size_t len = strlen(key); - if(len >= (size_t)-1 - offsetof(pair_t, key)) { - /* Avoid an overflow if the key is very long */ - return -1; - } - - pair = jsonp_malloc(offsetof(pair_t, key) + len + 1); - if(!pair) - return -1; - - pair->hash = hash; - pair->serial = serial; - strcpy(pair->key, key); - pair->value = value; - list_init(&pair->list); - - insert_to_bucket(hashtable, bucket, &pair->list); - - hashtable->size++; - } - return 0; -} - -void *hashtable_get(hashtable_t *hashtable, const char *key) -{ - pair_t *pair; - size_t hash; - bucket_t *bucket; - - hash = hash_str(key); - bucket = &hashtable->buckets[hash & hashmask(hashtable->order)]; - - pair = hashtable_find_pair(hashtable, bucket, key, hash); - if(!pair) - return NULL; - - return pair->value; -} - -int hashtable_del(hashtable_t *hashtable, const char *key) -{ - size_t hash = hash_str(key); - return hashtable_do_del(hashtable, key, hash); -} - -void hashtable_clear(hashtable_t *hashtable) -{ - size_t i; - - hashtable_do_clear(hashtable); - - for(i = 0; i < hashsize(hashtable->order); i++) - { - hashtable->buckets[i].first = hashtable->buckets[i].last = - &hashtable->list; - } - - list_init(&hashtable->list); - hashtable->size = 0; -} - -void *hashtable_iter(hashtable_t *hashtable) -{ - return hashtable_iter_next(hashtable, &hashtable->list); -} - -void *hashtable_iter_at(hashtable_t *hashtable, const char *key) -{ - pair_t *pair; - size_t hash; - bucket_t *bucket; - - hash = hash_str(key); - bucket = &hashtable->buckets[hash & hashmask(hashtable->order)]; - - pair = hashtable_find_pair(hashtable, bucket, key, hash); - if(!pair) - return NULL; - - return &pair->list; -} - -void *hashtable_iter_next(hashtable_t *hashtable, void *iter) -{ - list_t *list = (list_t *)iter; - if(list->next == &hashtable->list) - return NULL; - return list->next; -} - -void *hashtable_iter_key(void *iter) -{ - pair_t *pair = list_to_pair((list_t *)iter); - return pair->key; -} - -size_t hashtable_iter_serial(void *iter) -{ - pair_t *pair = list_to_pair((list_t *)iter); - return pair->serial; -} - -void *hashtable_iter_value(void *iter) -{ - pair_t *pair = list_to_pair((list_t *)iter); - return pair->value; -} - -void hashtable_iter_set(void *iter, json_t *value) -{ - pair_t *pair = list_to_pair((list_t *)iter); - - json_decref(pair->value); - pair->value = value; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/hashtable.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/hashtable.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/hashtable.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/hashtable.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * This library is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef HASHTABLE_H -#define HASHTABLE_H - -struct hashtable_list { - struct hashtable_list *prev; - struct hashtable_list *next; -}; - -/* "pair" may be a bit confusing a name, but think of it as a - key-value pair. In this case, it just encodes some extra data, - too */ -struct hashtable_pair { - size_t hash; - struct hashtable_list list; - json_t *value; - size_t serial; - char key[1]; -}; - -struct hashtable_bucket { - struct hashtable_list *first; - struct hashtable_list *last; -}; - -typedef struct hashtable { - size_t size; - struct hashtable_bucket *buckets; - size_t order; /* hashtable has pow(2, order) buckets */ - struct hashtable_list list; -} hashtable_t; - - -#define hashtable_key_to_iter(key_) \ - (&(container_of(key_, struct hashtable_pair, key)->list)) - - -/** - * hashtable_init - Initialize a hashtable object - * - * @hashtable: The (statically allocated) hashtable object - * - * Initializes a statically allocated hashtable object. The object - * should be cleared with hashtable_close when it's no longer used. - * - * Returns 0 on success, -1 on error (out of memory). - */ -int hashtable_init(hashtable_t *hashtable); - -/** - * hashtable_close - Release all resources used by a hashtable object - * - * @hashtable: The hashtable - * - * Destroys a statically allocated hashtable object. - */ -void hashtable_close(hashtable_t *hashtable); - -/** - * hashtable_set - Add/modify value in hashtable - * - * @hashtable: The hashtable object - * @key: The key - * @serial: For addition order of keys - * @value: The value - * - * If a value with the given key already exists, its value is replaced - * with the new value. Value is "stealed" in the sense that hashtable - * doesn't increment its refcount but decreases the refcount when the - * value is no longer needed. - * - * Returns 0 on success, -1 on failure (out of memory). - */ -int hashtable_set(hashtable_t *hashtable, - const char *key, size_t serial, - json_t *value); - -/** - * hashtable_get - Get a value associated with a key - * - * @hashtable: The hashtable object - * @key: The key - * - * Returns value if it is found, or NULL otherwise. - */ -void *hashtable_get(hashtable_t *hashtable, const char *key); - -/** - * hashtable_del - Remove a value from the hashtable - * - * @hashtable: The hashtable object - * @key: The key - * - * Returns 0 on success, or -1 if the key was not found. - */ -int hashtable_del(hashtable_t *hashtable, const char *key); - -/** - * hashtable_clear - Clear hashtable - * - * @hashtable: The hashtable object - * - * Removes all items from the hashtable. - */ -void hashtable_clear(hashtable_t *hashtable); - -/** - * hashtable_iter - Iterate over hashtable - * - * @hashtable: The hashtable object - * - * Returns an opaque iterator to the first element in the hashtable. - * The iterator should be passed to hashtable_iter_* functions. - * The hashtable items are not iterated over in any particular order. - * - * There's no need to free the iterator in any way. The iterator is - * valid as long as the item that is referenced by the iterator is not - * deleted. Other values may be added or deleted. In particular, - * hashtable_iter_next() may be called on an iterator, and after that - * the key/value pair pointed by the old iterator may be deleted. - */ -void *hashtable_iter(hashtable_t *hashtable); - -/** - * hashtable_iter_at - Return an iterator at a specific key - * - * @hashtable: The hashtable object - * @key: The key that the iterator should point to - * - * Like hashtable_iter() but returns an iterator pointing to a - * specific key. - */ -void *hashtable_iter_at(hashtable_t *hashtable, const char *key); - -/** - * hashtable_iter_next - Advance an iterator - * - * @hashtable: The hashtable object - * @iter: The iterator - * - * Returns a new iterator pointing to the next element in the - * hashtable or NULL if the whole hastable has been iterated over. - */ -void *hashtable_iter_next(hashtable_t *hashtable, void *iter); - -/** - * hashtable_iter_key - Retrieve the key pointed by an iterator - * - * @iter: The iterator - */ -void *hashtable_iter_key(void *iter); - -/** - * hashtable_iter_serial - Retrieve the serial number pointed to by an iterator - * - * @iter: The iterator - */ -size_t hashtable_iter_serial(void *iter); - -/** - * hashtable_iter_value - Retrieve the value pointed by an iterator - * - * @iter: The iterator - */ -void *hashtable_iter_value(void *iter); - -/** - * hashtable_iter_set - Set the value pointed by an iterator - * - * @iter: The iterator - * @value: The value to set - */ -void hashtable_iter_set(void *iter, json_t *value); - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/hashtable_seed.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/hashtable_seed.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/hashtable_seed.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/hashtable_seed.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,277 +0,0 @@ -/* Generate sizeof(uint32_t) bytes of as random data as possible to seed - the hash function. -*/ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#ifdef HAVE_STDINT_H -#include -#endif - -#ifdef HAVE_FCNTL_H -#include -#endif - -#ifdef HAVE_SCHED_H -#include -#endif - -#ifdef HAVE_UNISTD_H -#include -#endif - -#ifdef HAVE_SYS_STAT_H -#include -#endif - -#ifdef HAVE_SYS_TIME_H -#include -#endif - -#ifdef HAVE_SYS_TYPES_H -#include -#endif - -#if defined(_WIN32) -/* For GetModuleHandle(), GetProcAddress() and GetCurrentProcessId() */ -#include -#endif - -#include "jansson.h" - - -static uint32_t buf_to_uint32(char *data) { - size_t i; - uint32_t result = 0; - - for (i = 0; i < sizeof(uint32_t); i++) - result = (result << 8) | (unsigned char)data[i]; - - return result; -} - - - -/* /dev/urandom */ -#if !defined(_WIN32) && defined(USE_URANDOM) -static int seed_from_urandom(uint32_t *seed) { - /* Use unbuffered I/O if we have open(), close() and read(). Otherwise - fall back to fopen() */ - - char data[sizeof(uint32_t)]; - int ok; - -#if defined(HAVE_OPEN) && defined(HAVE_CLOSE) && defined(HAVE_READ) - int urandom; - urandom = open("/dev/urandom", O_RDONLY); - if (urandom == -1) - return 1; - - ok = read(urandom, data, sizeof(uint32_t)) == sizeof(uint32_t); - close(urandom); -#else - FILE *urandom; - - urandom = fopen("/dev/urandom", "rb"); - if (!urandom) - return 1; - - ok = fread(data, 1, sizeof(uint32_t), urandom) == sizeof(uint32_t); - fclose(urandom); -#endif - - if (!ok) - return 1; - - *seed = buf_to_uint32(data); - return 0; -} -#endif - -/* Windows Crypto API */ -#if defined(_WIN32) && defined(USE_WINDOWS_CRYPTOAPI) -#include - -typedef BOOL (WINAPI *CRYPTACQUIRECONTEXTA)(HCRYPTPROV *phProv, LPCSTR pszContainer, LPCSTR pszProvider, DWORD dwProvType, DWORD dwFlags); -typedef BOOL (WINAPI *CRYPTGENRANDOM)(HCRYPTPROV hProv, DWORD dwLen, BYTE *pbBuffer); -typedef BOOL (WINAPI *CRYPTRELEASECONTEXT)(HCRYPTPROV hProv, DWORD dwFlags); - -static int seed_from_windows_cryptoapi(uint32_t *seed) -{ - HINSTANCE hAdvAPI32 = NULL; - CRYPTACQUIRECONTEXTA pCryptAcquireContext = NULL; - CRYPTGENRANDOM pCryptGenRandom = NULL; - CRYPTRELEASECONTEXT pCryptReleaseContext = NULL; - HCRYPTPROV hCryptProv = 0; - BYTE data[sizeof(uint32_t)]; - int ok; - - hAdvAPI32 = GetModuleHandle(TEXT("advapi32.dll")); - if(hAdvAPI32 == NULL) - return 1; - - pCryptAcquireContext = (CRYPTACQUIRECONTEXTA)GetProcAddress(hAdvAPI32, "CryptAcquireContextA"); - if (!pCryptAcquireContext) - return 1; - - pCryptGenRandom = (CRYPTGENRANDOM)GetProcAddress(hAdvAPI32, "CryptGenRandom"); - if (!pCryptGenRandom) - return 1; - - pCryptReleaseContext = (CRYPTRELEASECONTEXT)GetProcAddress(hAdvAPI32, "CryptReleaseContext"); - if (!pCryptReleaseContext) - return 1; - - if (!pCryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) - return 1; - - ok = pCryptGenRandom(hCryptProv, sizeof(uint32_t), data); - pCryptReleaseContext(hCryptProv, 0); - - if (!ok) - return 1; - - *seed = buf_to_uint32((char *)data); - return 0; -} -#endif - -/* gettimeofday() and getpid() */ -static int seed_from_timestamp_and_pid(uint32_t *seed) { -#ifdef HAVE_GETTIMEOFDAY - /* XOR of seconds and microseconds */ - struct timeval tv; - gettimeofday(&tv, NULL); - *seed = (uint32_t)tv.tv_sec ^ (uint32_t)tv.tv_usec; -#else - /* Seconds only */ - *seed = (uint32_t)time(NULL); -#endif - - /* XOR with PID for more randomness */ -#if defined(_WIN32) - *seed ^= (uint32_t)GetCurrentProcessId(); -#elif defined(HAVE_GETPID) - *seed ^= (uint32_t)getpid(); -#endif - - return 0; -} - -static uint32_t generate_seed() { - uint32_t seed; - int done = 0; - -#if !defined(_WIN32) && defined(USE_URANDOM) - if (!done && seed_from_urandom(&seed) == 0) - done = 1; -#endif - -#if defined(_WIN32) && defined(USE_WINDOWS_CRYPTOAPI) - if (!done && seed_from_windows_cryptoapi(&seed) == 0) - done = 1; -#endif - - if (!done) { - /* Fall back to timestamp and PID if no better randomness is - available */ - seed_from_timestamp_and_pid(&seed); - } - - /* Make sure the seed is never zero */ - if (seed == 0) - seed = 1; - - return seed; -} - - -volatile uint32_t hashtable_seed = 0; - -#if defined(HAVE_ATOMIC_BUILTINS) && (defined(HAVE_SCHED_YIELD) || !defined(_WIN32)) -static volatile char seed_initialized = 0; - -void json_object_seed(size_t seed) { - uint32_t new_seed = (uint32_t)seed; - - if (hashtable_seed == 0) { - if (__atomic_test_and_set(&seed_initialized, __ATOMIC_RELAXED) == 0) { - /* Do the seeding ourselves */ - if (new_seed == 0) - new_seed = generate_seed(); - - __atomic_store_n(&hashtable_seed, new_seed, __ATOMIC_RELEASE); - } else { - /* Wait for another thread to do the seeding */ - do { -#ifdef HAVE_SCHED_YIELD - sched_yield(); -#endif - } while(__atomic_load_n(&hashtable_seed, __ATOMIC_ACQUIRE) == 0); - } - } -} -#elif defined(HAVE_SYNC_BUILTINS) && (defined(HAVE_SCHED_YIELD) || !defined(_WIN32)) -void json_object_seed(size_t seed) { - uint32_t new_seed = (uint32_t)seed; - - if (hashtable_seed == 0) { - if (new_seed == 0) { - /* Explicit synchronization fences are not supported by the - __sync builtins, so every thread getting here has to - generate the seed value. - */ - new_seed = generate_seed(); - } - - do { - if (__sync_bool_compare_and_swap(&hashtable_seed, 0, new_seed)) { - /* We were the first to seed */ - break; - } else { - /* Wait for another thread to do the seeding */ -#ifdef HAVE_SCHED_YIELD - sched_yield(); -#endif - } - } while(hashtable_seed == 0); - } -} -#elif defined(_WIN32) -static long seed_initialized = 0; -void json_object_seed(size_t seed) { - uint32_t new_seed = (uint32_t)seed; - - if (hashtable_seed == 0) { - if (InterlockedIncrement(&seed_initialized) == 1) { - /* Do the seeding ourselves */ - if (new_seed == 0) - new_seed = generate_seed(); - - hashtable_seed = new_seed; - } else { - /* Wait for another thread to do the seeding */ - do { - SwitchToThread(); - } while (hashtable_seed == 0); - } - } -} -#else -/* Fall back to a thread-unsafe version */ -void json_object_seed(size_t seed) { - uint32_t new_seed = (uint32_t)seed; - - if (hashtable_seed == 0) { - if (new_seed == 0) - new_seed = generate_seed(); - - hashtable_seed = new_seed; - } -} -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/jansson_config.h.in kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/jansson_config.h.in --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/jansson_config.h.in 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/jansson_config.h.in 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2010-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - * - * - * This file specifies a part of the site-specific configuration for - * Jansson, namely those things that affect the public API in - * jansson.h. - * - * The configure script copies this file to jansson_config.h and - * replaces @var@ substitutions by values that fit your system. If you - * cannot run the configure script, you can do the value substitution - * by hand. - */ - -#ifndef JANSSON_CONFIG_H -#define JANSSON_CONFIG_H - -/* If your compiler supports the inline keyword in C, JSON_INLINE is - defined to `inline', otherwise empty. In C++, the inline is always - supported. */ -#ifdef __cplusplus -#define JSON_INLINE inline -#else -#define JSON_INLINE @json_inline@ -#endif - -/* If your compiler supports the `long long` type and the strtoll() - library function, JSON_INTEGER_IS_LONG_LONG is defined to 1, - otherwise to 0. */ -#define JSON_INTEGER_IS_LONG_LONG @json_have_long_long@ - -/* If locale.h and localeconv() are available, define to 1, - otherwise to 0. */ -#define JSON_HAVE_LOCALECONV @json_have_localeconv@ - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/jansson.def kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/jansson.def --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/jansson.def 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/jansson.def 1970-01-01 00:00:00.000000000 +0000 @@ -1,69 +0,0 @@ -EXPORTS - json_delete - json_true - json_false - json_null - json_string - json_stringn - json_string_nocheck - json_stringn_nocheck - json_string_value - json_string_length - json_string_set - json_string_setn - json_string_set_nocheck - json_string_setn_nocheck - json_integer - json_integer_value - json_integer_set - json_real - json_real_value - json_real_set - json_number_value - json_array - json_array_size - json_array_get - json_array_set_new - json_array_append_new - json_array_insert_new - json_array_remove - json_array_clear - json_array_extend - json_object - json_object_size - json_object_get - json_object_set_new - json_object_set_new_nocheck - json_object_del - json_object_clear - json_object_update - json_object_update_existing - json_object_update_missing - json_object_iter - json_object_iter_at - json_object_iter_next - json_object_iter_key - json_object_iter_value - json_object_iter_set_new - json_object_key_to_iter - json_object_seed - json_dumps - json_dumpf - json_dump_file - json_dump_callback - json_loads - json_loadb - json_loadf - json_load_file - json_load_callback - json_equal - json_copy - json_deep_copy - json_pack - json_pack_ex - json_vpack_ex - json_unpack - json_unpack_ex - json_vunpack_ex - json_set_alloc_funcs - diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/jansson.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/jansson.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/jansson.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/jansson.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,290 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef JANSSON_H -#define JANSSON_H - -#include -#include /* for size_t */ -#include - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* version */ - -#define JANSSON_MAJOR_VERSION 2 -#define JANSSON_MINOR_VERSION 7 -#define JANSSON_MICRO_VERSION 0 - -/* Micro version is omitted if it's 0 */ -#define JANSSON_VERSION "2.7" - -/* Version as a 3-byte hex number, e.g. 0x010201 == 1.2.1. Use this - for numeric comparisons, e.g. #if JANSSON_VERSION_HEX >= ... */ -#define JANSSON_VERSION_HEX ((JANSSON_MAJOR_VERSION << 16) | \ - (JANSSON_MINOR_VERSION << 8) | \ - (JANSSON_MICRO_VERSION << 0)) - - -/* types */ - -typedef enum { - JSON_OBJECT, - JSON_ARRAY, - JSON_STRING, - JSON_INTEGER, - JSON_REAL, - JSON_TRUE, - JSON_FALSE, - JSON_NULL -} json_type; - -typedef struct json_t { - json_type type; - size_t refcount; -} json_t; - -#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */ -#if JSON_INTEGER_IS_LONG_LONG -#ifdef _WIN32 -#define JSON_INTEGER_FORMAT "I64d" -#else -#define JSON_INTEGER_FORMAT "lld" -#endif -typedef long long json_int_t; -#else -#define JSON_INTEGER_FORMAT "ld" -typedef long json_int_t; -#endif /* JSON_INTEGER_IS_LONG_LONG */ -#endif - -#define json_typeof(json) ((json)->type) -#define json_is_object(json) ((json) && json_typeof(json) == JSON_OBJECT) -#define json_is_array(json) ((json) && json_typeof(json) == JSON_ARRAY) -#define json_is_string(json) ((json) && json_typeof(json) == JSON_STRING) -#define json_is_integer(json) ((json) && json_typeof(json) == JSON_INTEGER) -#define json_is_real(json) ((json) && json_typeof(json) == JSON_REAL) -#define json_is_number(json) (json_is_integer(json) || json_is_real(json)) -#define json_is_true(json) ((json) && json_typeof(json) == JSON_TRUE) -#define json_is_false(json) ((json) && json_typeof(json) == JSON_FALSE) -#define json_boolean_value json_is_true -#define json_is_boolean(json) (json_is_true(json) || json_is_false(json)) -#define json_is_null(json) ((json) && json_typeof(json) == JSON_NULL) - -/* construction, destruction, reference counting */ - -json_t *json_object(void); -json_t *json_array(void); -json_t *json_string(const char *value); -json_t *json_stringn(const char *value, size_t len); -json_t *json_string_nocheck(const char *value); -json_t *json_stringn_nocheck(const char *value, size_t len); -json_t *json_integer(json_int_t value); -json_t *json_real(double value); -json_t *json_true(void); -json_t *json_false(void); -#define json_boolean(val) ((val) ? json_true() : json_false()) -json_t *json_null(void); - -static JSON_INLINE -json_t *json_incref(json_t *json) -{ - if(json && json->refcount != (size_t)-1) - ++json->refcount; - return json; -} - -/* do not call json_delete directly */ -void json_delete(json_t *json); - -static JSON_INLINE -void json_decref(json_t *json) -{ - if(json && json->refcount != (size_t)-1 && --json->refcount == 0) - json_delete(json); -} - - -/* error reporting */ - -#define JSON_ERROR_TEXT_LENGTH 160 -#define JSON_ERROR_SOURCE_LENGTH 80 - -typedef struct { - int line; - int column; - int position; - char source[JSON_ERROR_SOURCE_LENGTH]; - char text[JSON_ERROR_TEXT_LENGTH]; -} json_error_t; - - -/* getters, setters, manipulation */ - -void json_object_seed(size_t seed); -size_t json_object_size(const json_t *object); -json_t *json_object_get(const json_t *object, const char *key); -int json_object_set_new(json_t *object, const char *key, json_t *value); -int json_object_set_new_nocheck(json_t *object, const char *key, json_t *value); -int json_object_del(json_t *object, const char *key); -int json_object_clear(json_t *object); -int json_object_update(json_t *object, json_t *other); -int json_object_update_existing(json_t *object, json_t *other); -int json_object_update_missing(json_t *object, json_t *other); -void *json_object_iter(json_t *object); -void *json_object_iter_at(json_t *object, const char *key); -void *json_object_key_to_iter(const char *key); -void *json_object_iter_next(json_t *object, void *iter); -const char *json_object_iter_key(void *iter); -json_t *json_object_iter_value(void *iter); -int json_object_iter_set_new(json_t *object, void *iter, json_t *value); - -#define json_object_foreach(object, key, value) \ - for(key = json_object_iter_key(json_object_iter(object)); \ - key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ - key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key)))) - -#define json_array_foreach(array, index, value) \ - for(index = 0; \ - index < json_array_size(array) && (value = json_array_get(array, index)); \ - index++) - -static JSON_INLINE -int json_object_set(json_t *object, const char *key, json_t *value) -{ - return json_object_set_new(object, key, json_incref(value)); -} - -static JSON_INLINE -int json_object_set_nocheck(json_t *object, const char *key, json_t *value) -{ - return json_object_set_new_nocheck(object, key, json_incref(value)); -} - -static JSON_INLINE -int json_object_iter_set(json_t *object, void *iter, json_t *value) -{ - return json_object_iter_set_new(object, iter, json_incref(value)); -} - -size_t json_array_size(const json_t *array); -json_t *json_array_get(const json_t *array, size_t index); -int json_array_set_new(json_t *array, size_t index, json_t *value); -int json_array_append_new(json_t *array, json_t *value); -int json_array_insert_new(json_t *array, size_t index, json_t *value); -int json_array_remove(json_t *array, size_t index); -int json_array_clear(json_t *array); -int json_array_extend(json_t *array, json_t *other); - -static JSON_INLINE -int json_array_set(json_t *array, size_t ind, json_t *value) -{ - return json_array_set_new(array, ind, json_incref(value)); -} - -static JSON_INLINE -int json_array_append(json_t *array, json_t *value) -{ - return json_array_append_new(array, json_incref(value)); -} - -static JSON_INLINE -int json_array_insert(json_t *array, size_t ind, json_t *value) -{ - return json_array_insert_new(array, ind, json_incref(value)); -} - -const char *json_string_value(const json_t *string); -size_t json_string_length(const json_t *string); -json_int_t json_integer_value(const json_t *integer); -double json_real_value(const json_t *real); -double json_number_value(const json_t *json); - -int json_string_set(json_t *string, const char *value); -int json_string_setn(json_t *string, const char *value, size_t len); -int json_string_set_nocheck(json_t *string, const char *value); -int json_string_setn_nocheck(json_t *string, const char *value, size_t len); -int json_integer_set(json_t *integer, json_int_t value); -int json_real_set(json_t *real, double value); - -/* pack, unpack */ - -json_t *json_pack(const char *fmt, ...); -json_t *json_pack_ex(json_error_t *error, size_t flags, const char *fmt, ...); -json_t *json_vpack_ex(json_error_t *error, size_t flags, const char *fmt, va_list ap); - -#define JSON_VALIDATE_ONLY 0x1 -#define JSON_STRICT 0x2 - -int json_unpack(json_t *root, const char *fmt, ...); -int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...); -int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, va_list ap); - - -/* equality */ - -int json_equal(json_t *value1, json_t *value2); - - -/* copying */ - -json_t *json_copy(json_t *value); -json_t *json_deep_copy(const json_t *value); - - -/* decoding */ - -#define JSON_REJECT_DUPLICATES 0x1 -#define JSON_DISABLE_EOF_CHECK 0x2 -#define JSON_DECODE_ANY 0x4 -#define JSON_DECODE_INT_AS_REAL 0x8 -#define JSON_ALLOW_NUL 0x10 - -typedef size_t (*json_load_callback_t)(void *buffer, size_t buflen, void *data); - -json_t *json_loads(const char *input, size_t flags, json_error_t *error); -json_t *json_loadb(const char *buffer, size_t buflen, size_t flags, json_error_t *error); -json_t *json_loadf(FILE *input, size_t flags, json_error_t *error); -json_t *json_load_file(const char *path, size_t flags, json_error_t *error); -json_t *json_load_callback(json_load_callback_t callback, void *data, size_t flags, json_error_t *error); - - -/* encoding */ - -#define JSON_MAX_INDENT 0x1F -#define JSON_INDENT(n) ((n) & JSON_MAX_INDENT) -#define JSON_COMPACT 0x20 -#define JSON_ENSURE_ASCII 0x40 -#define JSON_SORT_KEYS 0x80 -#define JSON_PRESERVE_ORDER 0x100 -#define JSON_ENCODE_ANY 0x200 -#define JSON_ESCAPE_SLASH 0x400 -#define JSON_REAL_PRECISION(n) (((n) & 0x1F) << 11) - -typedef int (*json_dump_callback_t)(const char *buffer, size_t size, void *data); - -char *json_dumps(const json_t *json, size_t flags); -int json_dumpf(const json_t *json, FILE *output, size_t flags); -int json_dump_file(const json_t *json, const char *path, size_t flags); -int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags); - -/* custom memory allocation */ - -typedef void *(*json_malloc_t)(size_t); -typedef void (*json_free_t)(void *); - -void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn); - -#ifdef __cplusplus -} -#endif - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/jansson_private.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/jansson_private.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/jansson_private.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/jansson_private.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef JANSSON_PRIVATE_H -#define JANSSON_PRIVATE_H - -#include -#include "jansson.h" -#include "hashtable.h" -#include "strbuffer.h" - -#define container_of(ptr_, type_, member_) \ - ((type_ *)((char *)ptr_ - offsetof(type_, member_))) - -/* On some platforms, max() may already be defined */ -#ifndef max -#define max(a, b) ((a) > (b) ? (a) : (b)) -#endif - -/* va_copy is a C99 feature. In C89 implementations, it's sometimes - available as __va_copy. If not, memcpy() should do the trick. */ -#ifndef va_copy -#ifdef __va_copy -#define va_copy __va_copy -#else -#define va_copy(a, b) memcpy(&(a), &(b), sizeof(va_list)) -#endif -#endif - -typedef struct { - json_t json; - hashtable_t hashtable; - size_t serial; - int visited; -} json_object_t; - -typedef struct { - json_t json; - size_t size; - size_t entries; - json_t **table; - int visited; -} json_array_t; - -typedef struct { - json_t json; - char *value; - size_t length; -} json_string_t; - -typedef struct { - json_t json; - double value; -} json_real_t; - -typedef struct { - json_t json; - json_int_t value; -} json_integer_t; - -#define json_to_object(json_) container_of(json_, json_object_t, json) -#define json_to_array(json_) container_of(json_, json_array_t, json) -#define json_to_string(json_) container_of(json_, json_string_t, json) -#define json_to_real(json_) container_of(json_, json_real_t, json) -#define json_to_integer(json_) container_of(json_, json_integer_t, json) - -/* Create a string by taking ownership of an existing buffer */ -json_t *jsonp_stringn_nocheck_own(const char *value, size_t len); - -/* Error message formatting */ -void jsonp_error_init(json_error_t *error, const char *source); -void jsonp_error_set_source(json_error_t *error, const char *source); -void jsonp_error_set(json_error_t *error, int line, int column, - size_t position, const char *msg, ...); -void jsonp_error_vset(json_error_t *error, int line, int column, - size_t position, const char *msg, va_list ap); - -/* Locale independent string<->double conversions */ -int jsonp_strtod(strbuffer_t *strbuffer, double *out); -int jsonp_dtostr(char *buffer, size_t size, double value, int prec); - -/* Wrappers for custom memory functions */ -void* jsonp_malloc(size_t size); -void jsonp_free(void *ptr); -char *jsonp_strndup(const char *str, size_t length); -char *jsonp_strdup(const char *str); -char *jsonp_strndup(const char *str, size_t len); - -/* Windows compatibility */ -#ifdef _WIN32 -#define snprintf _snprintf -#define vsnprintf _vsnprintf -#endif - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/load.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/load.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/load.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/load.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1105 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include -#include -#include -#include -#include -#include - -#include "jansson.h" -#include "jansson_private.h" -#include "strbuffer.h" -#include "utf.h" - -#define STREAM_STATE_OK 0 -#define STREAM_STATE_EOF -1 -#define STREAM_STATE_ERROR -2 - -#define TOKEN_INVALID -1 -#define TOKEN_EOF 0 -#define TOKEN_STRING 256 -#define TOKEN_INTEGER 257 -#define TOKEN_REAL 258 -#define TOKEN_TRUE 259 -#define TOKEN_FALSE 260 -#define TOKEN_NULL 261 - -/* Locale independent versions of isxxx() functions */ -#define l_isupper(c) ('A' <= (c) && (c) <= 'Z') -#define l_islower(c) ('a' <= (c) && (c) <= 'z') -#define l_isalpha(c) (l_isupper(c) || l_islower(c)) -#define l_isdigit(c) ('0' <= (c) && (c) <= '9') -#define l_isxdigit(c) \ - (l_isdigit(c) || ('A' <= (c) && (c) <= 'F') || ('a' <= (c) && (c) <= 'f')) - -/* Read one byte from stream, convert to unsigned char, then int, and - return. return EOF on end of file. This corresponds to the - behaviour of fgetc(). */ -typedef int (*get_func)(void *data); - -typedef struct { - get_func get; - void *data; - char buffer[5]; - size_t buffer_pos; - int state; - int line; - int column, last_column; - size_t position; -} stream_t; - -typedef struct { - stream_t stream; - strbuffer_t saved_text; - int token; - union { - struct { - char *val; - size_t len; - } string; - json_int_t integer; - double real; - } value; -} lex_t; - -#define stream_to_lex(stream) container_of(stream, lex_t, stream) - - -/*** error reporting ***/ - -static void error_set(json_error_t *error, const lex_t *lex, - const char *msg, ...) -{ - va_list ap; - char msg_text[JSON_ERROR_TEXT_LENGTH]; - char msg_with_context[JSON_ERROR_TEXT_LENGTH]; - - int line = -1, col = -1; - size_t pos = 0; - const char *result = msg_text; - - if(!error) - return; - - va_start(ap, msg); - vsnprintf(msg_text, JSON_ERROR_TEXT_LENGTH, msg, ap); - msg_text[JSON_ERROR_TEXT_LENGTH - 1] = '\0'; - va_end(ap); - - if(lex) - { - const char *saved_text = strbuffer_value(&lex->saved_text); - - line = lex->stream.line; - col = lex->stream.column; - pos = lex->stream.position; - - if(saved_text && saved_text[0]) - { - if(lex->saved_text.length <= 20) { - snprintf(msg_with_context, JSON_ERROR_TEXT_LENGTH, - "%s near '%s'", msg_text, saved_text); - msg_with_context[JSON_ERROR_TEXT_LENGTH - 1] = '\0'; - result = msg_with_context; - } - } - else - { - if(lex->stream.state == STREAM_STATE_ERROR) { - /* No context for UTF-8 decoding errors */ - result = msg_text; - } - else { - snprintf(msg_with_context, JSON_ERROR_TEXT_LENGTH, - "%s near end of file", msg_text); - msg_with_context[JSON_ERROR_TEXT_LENGTH - 1] = '\0'; - result = msg_with_context; - } - } - } - - jsonp_error_set(error, line, col, pos, "%s", result); -} - - -/*** lexical analyzer ***/ - -static void -stream_init(stream_t *stream, get_func get, void *data) -{ - stream->get = get; - stream->data = data; - stream->buffer[0] = '\0'; - stream->buffer_pos = 0; - - stream->state = STREAM_STATE_OK; - stream->line = 1; - stream->column = 0; - stream->position = 0; -} - -static int stream_get(stream_t *stream, json_error_t *error) -{ - int c; - - if(stream->state != STREAM_STATE_OK) - return stream->state; - - if(!stream->buffer[stream->buffer_pos]) - { - c = stream->get(stream->data); - if(c == EOF) { - stream->state = STREAM_STATE_EOF; - return STREAM_STATE_EOF; - } - - stream->buffer[0] = c; - stream->buffer_pos = 0; - - if(0x80 <= c && c <= 0xFF) - { - /* multi-byte UTF-8 sequence */ - size_t i, count; - - count = utf8_check_first(c); - if(!count) - goto out; - - assert(count >= 2); - - for(i = 1; i < count; i++) - stream->buffer[i] = stream->get(stream->data); - - if(!utf8_check_full(stream->buffer, count, NULL)) - goto out; - - stream->buffer[count] = '\0'; - } - else - stream->buffer[1] = '\0'; - } - - c = stream->buffer[stream->buffer_pos++]; - - stream->position++; - if(c == '\n') { - stream->line++; - stream->last_column = stream->column; - stream->column = 0; - } - else if(utf8_check_first(c)) { - /* track the Unicode character column, so increment only if - this is the first character of a UTF-8 sequence */ - stream->column++; - } - - return c; - -out: - stream->state = STREAM_STATE_ERROR; - error_set(error, stream_to_lex(stream), "unable to decode byte 0x%x", c); - return STREAM_STATE_ERROR; -} - -static void stream_unget(stream_t *stream, int c) -{ - if(c == STREAM_STATE_EOF || c == STREAM_STATE_ERROR) - return; - - stream->position--; - if(c == '\n') { - stream->line--; - stream->column = stream->last_column; - } - else if(utf8_check_first(c)) - stream->column--; - - assert(stream->buffer_pos > 0); - stream->buffer_pos--; - assert(stream->buffer[stream->buffer_pos] == c); -} - - -static int lex_get(lex_t *lex, json_error_t *error) -{ - return stream_get(&lex->stream, error); -} - -static void lex_save(lex_t *lex, int c) -{ - strbuffer_append_byte(&lex->saved_text, c); -} - -static int lex_get_save(lex_t *lex, json_error_t *error) -{ - int c = stream_get(&lex->stream, error); - if(c != STREAM_STATE_EOF && c != STREAM_STATE_ERROR) - lex_save(lex, c); - return c; -} - -static void lex_unget(lex_t *lex, int c) -{ - stream_unget(&lex->stream, c); -} - -static void lex_unget_unsave(lex_t *lex, int c) -{ - if(c != STREAM_STATE_EOF && c != STREAM_STATE_ERROR) { - /* Since we treat warnings as errors, when assertions are turned - * off the "d" variable would be set but never used. Which is - * treated as an error by GCC. - */ - #ifndef NDEBUG - char d; - #endif - stream_unget(&lex->stream, c); - #ifndef NDEBUG - d = - #endif - strbuffer_pop(&lex->saved_text); - assert(c == d); - } -} - -static void lex_save_cached(lex_t *lex) -{ - while(lex->stream.buffer[lex->stream.buffer_pos] != '\0') - { - lex_save(lex, lex->stream.buffer[lex->stream.buffer_pos]); - lex->stream.buffer_pos++; - lex->stream.position++; - } -} - -static void lex_free_string(lex_t *lex) -{ - jsonp_free(lex->value.string.val); - lex->value.string.val = NULL; - lex->value.string.len = 0; -} - -/* assumes that str points to 'u' plus at least 4 valid hex digits */ -static int32_t decode_unicode_escape(const char *str) -{ - int i; - int32_t value = 0; - - assert(str[0] == 'u'); - - for(i = 1; i <= 4; i++) { - char c = str[i]; - value <<= 4; - if(l_isdigit(c)) - value += c - '0'; - else if(l_islower(c)) - value += c - 'a' + 10; - else if(l_isupper(c)) - value += c - 'A' + 10; - else - return -1; - } - - return value; -} - -static void lex_scan_string(lex_t *lex, json_error_t *error) -{ - int c; - const char *p; - char *t; - int i; - - lex->value.string.val = NULL; - lex->token = TOKEN_INVALID; - - c = lex_get_save(lex, error); - - while(c != '"') { - if(c == STREAM_STATE_ERROR) - goto out; - - else if(c == STREAM_STATE_EOF) { - error_set(error, lex, "premature end of input"); - goto out; - } - - else if(0 <= c && c <= 0x1F) { - /* control character */ - lex_unget_unsave(lex, c); - if(c == '\n') - error_set(error, lex, "unexpected newline", c); - else - error_set(error, lex, "control character 0x%x", c); - goto out; - } - - else if(c == '\\') { - c = lex_get_save(lex, error); - if(c == 'u') { - c = lex_get_save(lex, error); - for(i = 0; i < 4; i++) { - if(!l_isxdigit(c)) { - error_set(error, lex, "invalid escape"); - goto out; - } - c = lex_get_save(lex, error); - } - } - else if(c == '"' || c == '\\' || c == '/' || c == 'b' || - c == 'f' || c == 'n' || c == 'r' || c == 't') - c = lex_get_save(lex, error); - else { - error_set(error, lex, "invalid escape"); - goto out; - } - } - else - c = lex_get_save(lex, error); - } - - /* the actual value is at most of the same length as the source - string, because: - - shortcut escapes (e.g. "\t") (length 2) are converted to 1 byte - - a single \uXXXX escape (length 6) is converted to at most 3 bytes - - two \uXXXX escapes (length 12) forming an UTF-16 surrogate pair - are converted to 4 bytes - */ - t = jsonp_malloc(lex->saved_text.length + 1); - if(!t) { - /* this is not very nice, since TOKEN_INVALID is returned */ - goto out; - } - lex->value.string.val = t; - - /* + 1 to skip the " */ - p = strbuffer_value(&lex->saved_text) + 1; - - while(*p != '"') { - if(*p == '\\') { - p++; - if(*p == 'u') { - size_t length; - int32_t value; - - value = decode_unicode_escape(p); - if(value < 0) { - error_set(error, lex, "invalid Unicode escape '%.6s'", p - 1); - goto out; - } - p += 5; - - if(0xD800 <= value && value <= 0xDBFF) { - /* surrogate pair */ - if(*p == '\\' && *(p + 1) == 'u') { - int32_t value2 = decode_unicode_escape(++p); - if(value2 < 0) { - error_set(error, lex, "invalid Unicode escape '%.6s'", p - 1); - goto out; - } - p += 5; - - if(0xDC00 <= value2 && value2 <= 0xDFFF) { - /* valid second surrogate */ - value = - ((value - 0xD800) << 10) + - (value2 - 0xDC00) + - 0x10000; - } - else { - /* invalid second surrogate */ - error_set(error, lex, - "invalid Unicode '\\u%04X\\u%04X'", - value, value2); - goto out; - } - } - else { - /* no second surrogate */ - error_set(error, lex, "invalid Unicode '\\u%04X'", - value); - goto out; - } - } - else if(0xDC00 <= value && value <= 0xDFFF) { - error_set(error, lex, "invalid Unicode '\\u%04X'", value); - goto out; - } - - if(utf8_encode(value, t, &length)) - assert(0); - t += length; - } - else { - switch(*p) { - case '"': case '\\': case '/': - *t = *p; break; - case 'b': *t = '\b'; break; - case 'f': *t = '\f'; break; - case 'n': *t = '\n'; break; - case 'r': *t = '\r'; break; - case 't': *t = '\t'; break; - default: assert(0); - } - t++; - p++; - } - } - else - *(t++) = *(p++); - } - *t = '\0'; - lex->value.string.len = t - lex->value.string.val; - lex->token = TOKEN_STRING; - return; - -out: - lex_free_string(lex); -} - -#ifndef JANSSON_USING_CMAKE /* disabled if using cmake */ -#if JSON_INTEGER_IS_LONG_LONG -#ifdef _MSC_VER /* Microsoft Visual Studio */ -#define json_strtoint _strtoi64 -#else -#define json_strtoint strtoll -#endif -#else -#define json_strtoint strtol -#endif -#endif - -static int lex_scan_number(lex_t *lex, int c, json_error_t *error) -{ - const char *saved_text; - char *end; - double doubleval; - - lex->token = TOKEN_INVALID; - - if(c == '-') - c = lex_get_save(lex, error); - - if(c == '0') { - c = lex_get_save(lex, error); - if(l_isdigit(c)) { - lex_unget_unsave(lex, c); - goto out; - } - } - else if(l_isdigit(c)) { - c = lex_get_save(lex, error); - while(l_isdigit(c)) - c = lex_get_save(lex, error); - } - else { - lex_unget_unsave(lex, c); - goto out; - } - - if(c != '.' && c != 'E' && c != 'e') { - json_int_t intval; - - lex_unget_unsave(lex, c); - - saved_text = strbuffer_value(&lex->saved_text); - - errno = 0; - intval = json_strtoint(saved_text, &end, 10); - if(errno == ERANGE) { - if(intval < 0) - error_set(error, lex, "too big negative integer"); - else - error_set(error, lex, "too big integer"); - goto out; - } - - assert(end == saved_text + lex->saved_text.length); - - lex->token = TOKEN_INTEGER; - lex->value.integer = intval; - return 0; - } - - if(c == '.') { - c = lex_get(lex, error); - if(!l_isdigit(c)) { - lex_unget(lex, c); - goto out; - } - lex_save(lex, c); - - c = lex_get_save(lex, error); - while(l_isdigit(c)) - c = lex_get_save(lex, error); - } - - if(c == 'E' || c == 'e') { - c = lex_get_save(lex, error); - if(c == '+' || c == '-') - c = lex_get_save(lex, error); - - if(!l_isdigit(c)) { - lex_unget_unsave(lex, c); - goto out; - } - - c = lex_get_save(lex, error); - while(l_isdigit(c)) - c = lex_get_save(lex, error); - } - - lex_unget_unsave(lex, c); - - if(jsonp_strtod(&lex->saved_text, &doubleval)) { - error_set(error, lex, "real number overflow"); - goto out; - } - - lex->token = TOKEN_REAL; - lex->value.real = doubleval; - return 0; - -out: - return -1; -} - -static int lex_scan(lex_t *lex, json_error_t *error) -{ - int c; - - strbuffer_clear(&lex->saved_text); - - if(lex->token == TOKEN_STRING) - lex_free_string(lex); - - c = lex_get(lex, error); - while(c == ' ' || c == '\t' || c == '\n' || c == '\r') - c = lex_get(lex, error); - - if(c == STREAM_STATE_EOF) { - lex->token = TOKEN_EOF; - goto out; - } - - if(c == STREAM_STATE_ERROR) { - lex->token = TOKEN_INVALID; - goto out; - } - - lex_save(lex, c); - - if(c == '{' || c == '}' || c == '[' || c == ']' || c == ':' || c == ',') - lex->token = c; - - else if(c == '"') - lex_scan_string(lex, error); - - else if(l_isdigit(c) || c == '-') { - if(lex_scan_number(lex, c, error)) - goto out; - } - - else if(l_isalpha(c)) { - /* eat up the whole identifier for clearer error messages */ - const char *saved_text; - - c = lex_get_save(lex, error); - while(l_isalpha(c)) - c = lex_get_save(lex, error); - lex_unget_unsave(lex, c); - - saved_text = strbuffer_value(&lex->saved_text); - - if(strcmp(saved_text, "true") == 0) - lex->token = TOKEN_TRUE; - else if(strcmp(saved_text, "false") == 0) - lex->token = TOKEN_FALSE; - else if(strcmp(saved_text, "null") == 0) - lex->token = TOKEN_NULL; - else - lex->token = TOKEN_INVALID; - } - - else { - /* save the rest of the input UTF-8 sequence to get an error - message of valid UTF-8 */ - lex_save_cached(lex); - lex->token = TOKEN_INVALID; - } - -out: - return lex->token; -} - -static char *lex_steal_string(lex_t *lex, size_t *out_len) -{ - char *result = NULL; - if(lex->token == TOKEN_STRING) { - result = lex->value.string.val; - *out_len = lex->value.string.len; - lex->value.string.val = NULL; - lex->value.string.len = 0; - } - return result; -} - -static int lex_init(lex_t *lex, get_func get, void *data) -{ - stream_init(&lex->stream, get, data); - if(strbuffer_init(&lex->saved_text)) - return -1; - - lex->token = TOKEN_INVALID; - return 0; -} - -static void lex_close(lex_t *lex) -{ - if(lex->token == TOKEN_STRING) - lex_free_string(lex); - strbuffer_close(&lex->saved_text); -} - - -/*** parser ***/ - -static json_t *parse_value(lex_t *lex, size_t flags, json_error_t *error); - -static json_t *parse_object(lex_t *lex, size_t flags, json_error_t *error) -{ - json_t *object = json_object(); - if(!object) - return NULL; - - lex_scan(lex, error); - if(lex->token == '}') - return object; - - while(1) { - char *key; - size_t len; - json_t *value; - - if(lex->token != TOKEN_STRING) { - error_set(error, lex, "string or '}' expected"); - goto error; - } - - key = lex_steal_string(lex, &len); - if(!key) - return NULL; - if (memchr(key, '\0', len)) { - jsonp_free(key); - error_set(error, lex, "NUL byte in object key not supported"); - goto error; - } - - if(flags & JSON_REJECT_DUPLICATES) { - if(json_object_get(object, key)) { - jsonp_free(key); - error_set(error, lex, "duplicate object key"); - goto error; - } - } - - lex_scan(lex, error); - if(lex->token != ':') { - jsonp_free(key); - error_set(error, lex, "':' expected"); - goto error; - } - - lex_scan(lex, error); - value = parse_value(lex, flags, error); - if(!value) { - jsonp_free(key); - goto error; - } - - if(json_object_set_nocheck(object, key, value)) { - jsonp_free(key); - json_decref(value); - goto error; - } - - json_decref(value); - jsonp_free(key); - - lex_scan(lex, error); - if(lex->token != ',') - break; - - lex_scan(lex, error); - } - - if(lex->token != '}') { - error_set(error, lex, "'}' expected"); - goto error; - } - - return object; - -error: - json_decref(object); - return NULL; -} - -static json_t *parse_array(lex_t *lex, size_t flags, json_error_t *error) -{ - json_t *array = json_array(); - if(!array) - return NULL; - - lex_scan(lex, error); - if(lex->token == ']') - return array; - - while(lex->token) { - json_t *elem = parse_value(lex, flags, error); - if(!elem) - goto error; - - if(json_array_append(array, elem)) { - json_decref(elem); - goto error; - } - json_decref(elem); - - lex_scan(lex, error); - if(lex->token != ',') - break; - - lex_scan(lex, error); - } - - if(lex->token != ']') { - error_set(error, lex, "']' expected"); - goto error; - } - - return array; - -error: - json_decref(array); - return NULL; -} - -static json_t *parse_value(lex_t *lex, size_t flags, json_error_t *error) -{ - json_t *json; - double value; - - switch(lex->token) { - case TOKEN_STRING: { - const char *value = lex->value.string.val; - size_t len = lex->value.string.len; - - if(!(flags & JSON_ALLOW_NUL)) { - if(memchr(value, '\0', len)) { - error_set(error, lex, "\\u0000 is not allowed without JSON_ALLOW_NUL"); - return NULL; - } - } - - json = jsonp_stringn_nocheck_own(value, len); - if(json) { - lex->value.string.val = NULL; - lex->value.string.len = 0; - } - break; - } - - case TOKEN_INTEGER: { - if (flags & JSON_DECODE_INT_AS_REAL) { - if(jsonp_strtod(&lex->saved_text, &value)) { - error_set(error, lex, "real number overflow"); - return NULL; - } - json = json_real(value); - } else { - json = json_integer(lex->value.integer); - } - break; - } - - case TOKEN_REAL: { - json = json_real(lex->value.real); - break; - } - - case TOKEN_TRUE: - json = json_true(); - break; - - case TOKEN_FALSE: - json = json_false(); - break; - - case TOKEN_NULL: - json = json_null(); - break; - - case '{': - json = parse_object(lex, flags, error); - break; - - case '[': - json = parse_array(lex, flags, error); - break; - - case TOKEN_INVALID: - error_set(error, lex, "invalid token"); - return NULL; - - default: - error_set(error, lex, "unexpected token"); - return NULL; - } - - if(!json) - return NULL; - - return json; -} - -static json_t *parse_json(lex_t *lex, size_t flags, json_error_t *error) -{ - json_t *result; - - lex_scan(lex, error); - if(!(flags & JSON_DECODE_ANY)) { - if(lex->token != '[' && lex->token != '{') { - error_set(error, lex, "'[' or '{' expected"); - return NULL; - } - } - - result = parse_value(lex, flags, error); - if(!result) - return NULL; - - if(!(flags & JSON_DISABLE_EOF_CHECK)) { - lex_scan(lex, error); - if(lex->token != TOKEN_EOF) { - error_set(error, lex, "end of file expected"); - json_decref(result); - return NULL; - } - } - - if(error) { - /* Save the position even though there was no error */ - error->position = (int)lex->stream.position; - } - - return result; -} - -typedef struct -{ - const char *data; - int pos; -} string_data_t; - -static int string_get(void *data) -{ - char c; - string_data_t *stream = (string_data_t *)data; - c = stream->data[stream->pos]; - if(c == '\0') - return EOF; - else - { - stream->pos++; - return (unsigned char)c; - } -} - -json_t *json_loads(const char *string, size_t flags, json_error_t *error) -{ - lex_t lex; - json_t *result; - string_data_t stream_data; - - jsonp_error_init(error, ""); - - if (string == NULL) { - error_set(error, NULL, "wrong arguments"); - return NULL; - } - - stream_data.data = string; - stream_data.pos = 0; - - if(lex_init(&lex, string_get, (void *)&stream_data)) - return NULL; - - result = parse_json(&lex, flags, error); - - lex_close(&lex); - return result; -} - -typedef struct -{ - const char *data; - size_t len; - size_t pos; -} buffer_data_t; - -static int buffer_get(void *data) -{ - char c; - buffer_data_t *stream = data; - if(stream->pos >= stream->len) - return EOF; - - c = stream->data[stream->pos]; - stream->pos++; - return (unsigned char)c; -} - -json_t *json_loadb(const char *buffer, size_t buflen, size_t flags, json_error_t *error) -{ - lex_t lex; - json_t *result; - buffer_data_t stream_data; - - jsonp_error_init(error, ""); - - if (buffer == NULL) { - error_set(error, NULL, "wrong arguments"); - return NULL; - } - - stream_data.data = buffer; - stream_data.pos = 0; - stream_data.len = buflen; - - if(lex_init(&lex, buffer_get, (void *)&stream_data)) - return NULL; - - result = parse_json(&lex, flags, error); - - lex_close(&lex); - return result; -} - -json_t *json_loadf(FILE *input, size_t flags, json_error_t *error) -{ - lex_t lex; - const char *source; - json_t *result; - - if(input == stdin) - source = ""; - else - source = ""; - - jsonp_error_init(error, source); - - if (input == NULL) { - error_set(error, NULL, "wrong arguments"); - return NULL; - } - - if(lex_init(&lex, (get_func)fgetc, input)) - return NULL; - - result = parse_json(&lex, flags, error); - - lex_close(&lex); - return result; -} - -json_t *json_load_file(const char *path, size_t flags, json_error_t *error) -{ - json_t *result; - FILE *fp; - - jsonp_error_init(error, path); - - if (path == NULL) { - error_set(error, NULL, "wrong arguments"); - return NULL; - } - - fp = fopen(path, "rb"); - if(!fp) - { - error_set(error, NULL, "unable to open %s: %s", - path, strerror(errno)); - return NULL; - } - - result = json_loadf(fp, flags, error); - - fclose(fp); - return result; -} - -#define MAX_BUF_LEN 1024 - -typedef struct -{ - char data[MAX_BUF_LEN]; - size_t len; - size_t pos; - json_load_callback_t callback; - void *arg; -} callback_data_t; - -static int callback_get(void *data) -{ - char c; - callback_data_t *stream = data; - - if(stream->pos >= stream->len) { - stream->pos = 0; - stream->len = stream->callback(stream->data, MAX_BUF_LEN, stream->arg); - if(stream->len == 0 || stream->len == (size_t)-1) - return EOF; - } - - c = stream->data[stream->pos]; - stream->pos++; - return (unsigned char)c; -} - -json_t *json_load_callback(json_load_callback_t callback, void *arg, size_t flags, json_error_t *error) -{ - lex_t lex; - json_t *result; - - callback_data_t stream_data; - - memset(&stream_data, 0, sizeof(stream_data)); - stream_data.callback = callback; - stream_data.arg = arg; - - jsonp_error_init(error, ""); - - if (callback == NULL) { - error_set(error, NULL, "wrong arguments"); - return NULL; - } - - if(lex_init(&lex, (get_func)callback_get, &stream_data)) - return NULL; - - result = parse_json(&lex, flags, error); - - lex_close(&lex); - return result; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/lookup3.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/lookup3.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/lookup3.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/lookup3.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,381 +0,0 @@ -/* -------------------------------------------------------------------------------- -lookup3.c, by Bob Jenkins, May 2006, Public Domain. - -These are functions for producing 32-bit hashes for hash table lookup. -hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() -are externally useful functions. Routines to test the hash are included -if SELF_TEST is defined. You can use this free for any purpose. It's in -the public domain. It has no warranty. - -You probably want to use hashlittle(). hashlittle() and hashbig() -hash byte arrays. hashlittle() is is faster than hashbig() on -little-endian machines. Intel and AMD are little-endian machines. -On second thought, you probably want hashlittle2(), which is identical to -hashlittle() except it returns two 32-bit hashes for the price of one. -You could implement hashbig2() if you wanted but I haven't bothered here. - -If you want to find a hash of, say, exactly 7 integers, do - a = i1; b = i2; c = i3; - mix(a,b,c); - a += i4; b += i5; c += i6; - mix(a,b,c); - a += i7; - final(a,b,c); -then use c as the hash value. If you have a variable length array of -4-byte integers to hash, use hashword(). If you have a byte array (like -a character string), use hashlittle(). If you have several byte arrays, or -a mix of things, see the comments above hashlittle(). - -Why is this so big? I read 12 bytes at a time into 3 4-byte integers, -then mix those integers. This is fast (you can do a lot more thorough -mixing with 12*3 instructions on 3 integers than you can with 3 instructions -on 1 byte), but shoehorning those bytes into integers efficiently is messy. -------------------------------------------------------------------------------- -*/ - -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef HAVE_STDINT_H -#include /* defines uint32_t etc */ -#endif - -#ifdef HAVE_SYS_PARAM_H -#include /* attempt to define endianness */ -#endif - -#ifdef HAVE_ENDIAN_H -# include /* attempt to define endianness */ -#endif - -/* - * My best guess at if you are big-endian or little-endian. This may - * need adjustment. - */ -#if (defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && \ - __BYTE_ORDER == __LITTLE_ENDIAN) || \ - (defined(i386) || defined(__i386__) || defined(__i486__) || \ - defined(__i586__) || defined(__i686__) || defined(vax) || defined(MIPSEL)) -# define HASH_LITTLE_ENDIAN 1 -# define HASH_BIG_ENDIAN 0 -#elif (defined(__BYTE_ORDER) && defined(__BIG_ENDIAN) && \ - __BYTE_ORDER == __BIG_ENDIAN) || \ - (defined(sparc) || defined(POWERPC) || defined(mc68000) || defined(sel)) -# define HASH_LITTLE_ENDIAN 0 -# define HASH_BIG_ENDIAN 1 -#else -# define HASH_LITTLE_ENDIAN 0 -# define HASH_BIG_ENDIAN 0 -#endif - -#define hashsize(n) ((uint32_t)1<<(n)) -#define hashmask(n) (hashsize(n)-1) -#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) - -/* -------------------------------------------------------------------------------- -mix -- mix 3 32-bit values reversibly. - -This is reversible, so any information in (a,b,c) before mix() is -still in (a,b,c) after mix(). - -If four pairs of (a,b,c) inputs are run through mix(), or through -mix() in reverse, there are at least 32 bits of the output that -are sometimes the same for one pair and different for another pair. -This was tested for: -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that -satisfy this are - 4 6 8 16 19 4 - 9 15 3 18 27 15 - 14 9 3 7 17 3 -Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing -for "differ" defined as + with a one-bit base and a two-bit delta. I -used http://burtleburtle.net/bob/hash/avalanche.html to choose -the operations, constants, and arrangements of the variables. - -This does not achieve avalanche. There are input bits of (a,b,c) -that fail to affect some output bits of (a,b,c), especially of a. The -most thoroughly mixed value is c, but it doesn't really even achieve -avalanche in c. - -This allows some parallelism. Read-after-writes are good at doubling -the number of bits affected, so the goal of mixing pulls in the opposite -direction as the goal of parallelism. I did what I could. Rotates -seem to cost as much as shifts on every machine I could lay my hands -on, and rotates are much kinder to the top and bottom bits, so I used -rotates. -------------------------------------------------------------------------------- -*/ -#define mix(a,b,c) \ -{ \ - a -= c; a ^= rot(c, 4); c += b; \ - b -= a; b ^= rot(a, 6); a += c; \ - c -= b; c ^= rot(b, 8); b += a; \ - a -= c; a ^= rot(c,16); c += b; \ - b -= a; b ^= rot(a,19); a += c; \ - c -= b; c ^= rot(b, 4); b += a; \ -} - -/* -------------------------------------------------------------------------------- -final -- final mixing of 3 32-bit values (a,b,c) into c - -Pairs of (a,b,c) values differing in only a few bits will usually -produce values of c that look totally different. This was tested for -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -These constants passed: - 14 11 25 16 4 14 24 - 12 14 25 16 4 14 24 -and these came close: - 4 8 15 26 3 22 24 - 10 8 15 26 3 22 24 - 11 8 15 26 3 22 24 -------------------------------------------------------------------------------- -*/ -#define final(a,b,c) \ -{ \ - c ^= b; c -= rot(b,14); \ - a ^= c; a -= rot(c,11); \ - b ^= a; b -= rot(a,25); \ - c ^= b; c -= rot(b,16); \ - a ^= c; a -= rot(c,4); \ - b ^= a; b -= rot(a,14); \ - c ^= b; c -= rot(b,24); \ -} - -/* -------------------------------------------------------------------------------- -hashlittle() -- hash a variable-length key into a 32-bit value - k : the key (the unaligned variable-length array of bytes) - length : the length of the key, counting by bytes - initval : can be any 4-byte value -Returns a 32-bit value. Every bit of the key affects every bit of -the return value. Two keys differing by one or two bits will have -totally different hash values. - -The best hash table sizes are powers of 2. There is no need to do -mod a prime (mod is sooo slow!). If you need less than 32 bits, -use a bitmask. For example, if you need only 10 bits, do - h = (h & hashmask(10)); -In which case, the hash table should have hashsize(10) elements. - -If you are hashing n strings (uint8_t **)k, do it like this: - for (i=0, h=0; i 12) - { - a += k[0]; - b += k[1]; - c += k[2]; - mix(a,b,c); - length -= 12; - k += 3; - } - - /*----------------------------- handle the last (probably partial) block */ - /* - * "k[2]&0xffffff" actually reads beyond the end of the string, but - * then masks off the part it's not allowed to read. Because the - * string is aligned, the masked-off tail is in the same word as the - * rest of the string. Every machine with memory protection I've seen - * does it on word boundaries, so is OK with this. But VALGRIND will - * still catch it and complain. The masking trick does make the hash - * noticably faster for short strings (like English words). - */ -#ifndef NO_MASKING_TRICK - - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; - case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; - case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=k[1]&0xffffff; a+=k[0]; break; - case 6 : b+=k[1]&0xffff; a+=k[0]; break; - case 5 : b+=k[1]&0xff; a+=k[0]; break; - case 4 : a+=k[0]; break; - case 3 : a+=k[0]&0xffffff; break; - case 2 : a+=k[0]&0xffff; break; - case 1 : a+=k[0]&0xff; break; - case 0 : return c; /* zero length strings require no mixing */ - } - -#else /* make valgrind happy */ - - k8 = (const uint8_t *)k; - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ - case 10: c+=((uint32_t)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ - case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]; break; - case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ - case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */ - case 1 : a+=k8[0]; break; - case 0 : return c; - } - -#endif /* !valgrind */ - - } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ - const uint8_t *k8; - - /*--------------- all but last block: aligned reads and different mixing */ - while (length > 12) - { - a += k[0] + (((uint32_t)k[1])<<16); - b += k[2] + (((uint32_t)k[3])<<16); - c += k[4] + (((uint32_t)k[5])<<16); - mix(a,b,c); - length -= 12; - k += 6; - } - - /*----------------------------- handle the last (probably partial) block */ - k8 = (const uint8_t *)k; - switch(length) - { - case 12: c+=k[4]+(((uint32_t)k[5])<<16); - b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ - case 10: c+=k[4]; - b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ - case 6 : b+=k[2]; - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ - case 2 : a+=k[0]; - break; - case 1 : a+=k8[0]; - break; - case 0 : return c; /* zero length requires no mixing */ - } - - } else { /* need to read the key one byte at a time */ - const uint8_t *k = (const uint8_t *)key; - - /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - a += ((uint32_t)k[1])<<8; - a += ((uint32_t)k[2])<<16; - a += ((uint32_t)k[3])<<24; - b += k[4]; - b += ((uint32_t)k[5])<<8; - b += ((uint32_t)k[6])<<16; - b += ((uint32_t)k[7])<<24; - c += k[8]; - c += ((uint32_t)k[9])<<8; - c += ((uint32_t)k[10])<<16; - c += ((uint32_t)k[11])<<24; - mix(a,b,c); - length -= 12; - k += 12; - } - - /*-------------------------------- last block: affect all 32 bits of (c) */ - switch(length) /* all the case statements fall through */ - { - case 12: c+=((uint32_t)k[11])<<24; - case 11: c+=((uint32_t)k[10])<<16; - case 10: c+=((uint32_t)k[9])<<8; - case 9 : c+=k[8]; - case 8 : b+=((uint32_t)k[7])<<24; - case 7 : b+=((uint32_t)k[6])<<16; - case 6 : b+=((uint32_t)k[5])<<8; - case 5 : b+=k[4]; - case 4 : a+=((uint32_t)k[3])<<24; - case 3 : a+=((uint32_t)k[2])<<16; - case 2 : a+=((uint32_t)k[1])<<8; - case 1 : a+=k[0]; - break; - case 0 : return c; - } - } - - final(a,b,c); - return c; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/Makefile.am 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -EXTRA_DIST = jansson.def - -include_HEADERS = jansson.h jansson_config.h - -noinst_LTLIBRARIES = libjansson.la -#lib_LTLIBRARIES = libjansson.la -libjansson_la_SOURCES = \ - dump.c \ - error.c \ - hashtable.c \ - hashtable.h \ - hashtable_seed.c \ - jansson_private.h \ - load.c \ - lookup3.h \ - memory.c \ - pack_unpack.c \ - strbuffer.c \ - strbuffer.h \ - strconv.c \ - utf.c \ - utf.h \ - value.c -libjansson_la_LDFLAGS = \ - -no-undefined \ - -export-symbols-regex '^json_' \ - -version-info 11:0:7 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/memory.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/memory.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/memory.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/memory.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * Copyright (c) 2011-2012 Basile Starynkevitch - * - * Jansson is free software; you can redistribute it and/or modify it - * under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include - -#include "jansson.h" -#include "jansson_private.h" - -/* C89 allows these to be macros */ -#undef malloc -#undef free - -/* memory function pointers */ -static json_malloc_t do_malloc = malloc; -static json_free_t do_free = free; - -void *jsonp_malloc(size_t size) -{ - if(!size) - return NULL; - - return (*do_malloc)(size); -} - -void jsonp_free(void *ptr) -{ - if(!ptr) - return; - - (*do_free)(ptr); -} - -char *jsonp_strdup(const char *str) -{ - return jsonp_strndup(str, strlen(str)); -} - -char *jsonp_strndup(const char *str, size_t len) -{ - char *new_str; - - new_str = jsonp_malloc(len + 1); - if(!new_str) - return NULL; - - memcpy(new_str, str, len); - new_str[len] = '\0'; - return new_str; -} - -void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn) -{ - do_malloc = malloc_fn; - do_free = free_fn; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/pack_unpack.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/pack_unpack.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/pack_unpack.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/pack_unpack.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,805 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * Copyright (c) 2011-2012 Graeme Smecher - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include "jansson.h" -#include "jansson_private.h" -#include "utf.h" - -typedef struct { - int line; - int column; - size_t pos; - char token; -} token_t; - -typedef struct { - const char *start; - const char *fmt; - token_t prev_token; - token_t token; - token_t next_token; - json_error_t *error; - size_t flags; - int line; - int column; - size_t pos; -} scanner_t; - -#define token(scanner) ((scanner)->token.token) - -static const char * const type_names[] = { - "object", - "array", - "string", - "integer", - "real", - "true", - "false", - "null" -}; - -#define type_name(x) type_names[json_typeof(x)] - -static const char unpack_value_starters[] = "{[siIbfFOon"; - - -static void scanner_init(scanner_t *s, json_error_t *error, - size_t flags, const char *fmt) -{ - s->error = error; - s->flags = flags; - s->fmt = s->start = fmt; - memset(&s->prev_token, 0, sizeof(token_t)); - memset(&s->token, 0, sizeof(token_t)); - memset(&s->next_token, 0, sizeof(token_t)); - s->line = 1; - s->column = 0; - s->pos = 0; -} - -static void next_token(scanner_t *s) -{ - const char *t; - s->prev_token = s->token; - - if(s->next_token.line) { - s->token = s->next_token; - s->next_token.line = 0; - return; - } - - t = s->fmt; - s->column++; - s->pos++; - - /* skip space and ignored chars */ - while(*t == ' ' || *t == '\t' || *t == '\n' || *t == ',' || *t == ':') { - if(*t == '\n') { - s->line++; - s->column = 1; - } - else - s->column++; - - s->pos++; - t++; - } - - s->token.token = *t; - s->token.line = s->line; - s->token.column = s->column; - s->token.pos = s->pos; - - t++; - s->fmt = t; -} - -static void prev_token(scanner_t *s) -{ - s->next_token = s->token; - s->token = s->prev_token; -} - -static void set_error(scanner_t *s, const char *source, const char *fmt, ...) -{ - va_list ap; - va_start(ap, fmt); - - jsonp_error_vset(s->error, s->token.line, s->token.column, s->token.pos, - fmt, ap); - - jsonp_error_set_source(s->error, source); - - va_end(ap); -} - -static json_t *pack(scanner_t *s, va_list *ap); - - -/* ours will be set to 1 if jsonp_free() must be called for the result - afterwards */ -static char *read_string(scanner_t *s, va_list *ap, - const char *purpose, size_t *out_len, int *ours) -{ - char t; - strbuffer_t strbuff; - const char *str; - size_t length; - - next_token(s); - t = token(s); - prev_token(s); - - if(t != '#' && t != '%' && t != '+') { - /* Optimize the simple case */ - str = va_arg(*ap, const char *); - - if(!str) { - set_error(s, "", "NULL string argument"); - return NULL; - } - - length = strlen(str); - - if(!utf8_check_string(str, length)) { - set_error(s, "", "Invalid UTF-8 %s", purpose); - return NULL; - } - - *out_len = length; - *ours = 0; - return (char *)str; - } - - strbuffer_init(&strbuff); - - while(1) { - str = va_arg(*ap, const char *); - if(!str) { - set_error(s, "", "NULL string argument"); - strbuffer_close(&strbuff); - return NULL; - } - - next_token(s); - - if(token(s) == '#') { - length = va_arg(*ap, int); - } - else if(token(s) == '%') { - length = va_arg(*ap, size_t); - } - else { - prev_token(s); - length = strlen(str); - } - - if(strbuffer_append_bytes(&strbuff, str, length) == -1) { - set_error(s, "", "Out of memory"); - strbuffer_close(&strbuff); - return NULL; - } - - next_token(s); - if(token(s) != '+') { - prev_token(s); - break; - } - } - - if(!utf8_check_string(strbuff.value, strbuff.length)) { - set_error(s, "", "Invalid UTF-8 %s", purpose); - strbuffer_close(&strbuff); - return NULL; - } - - *out_len = strbuff.length; - *ours = 1; - return strbuffer_steal_value(&strbuff); -} - -static json_t *pack_object(scanner_t *s, va_list *ap) -{ - json_t *object = json_object(); - next_token(s); - - while(token(s) != '}') { - char *key; - size_t len; - int ours; - json_t *value; - - if(!token(s)) { - set_error(s, "", "Unexpected end of format string"); - goto error; - } - - if(token(s) != 's') { - set_error(s, "", "Expected format 's', got '%c'", token(s)); - goto error; - } - - key = read_string(s, ap, "object key", &len, &ours); - if(!key) - goto error; - - next_token(s); - - value = pack(s, ap); - if(!value) { - if(ours) - jsonp_free(key); - - goto error; - } - - if(json_object_set_new_nocheck(object, key, value)) { - if(ours) - jsonp_free(key); - - set_error(s, "", "Unable to add key \"%s\"", key); - goto error; - } - - if(ours) - jsonp_free(key); - - next_token(s); - } - - return object; - -error: - json_decref(object); - return NULL; -} - -static json_t *pack_array(scanner_t *s, va_list *ap) -{ - json_t *array = json_array(); - next_token(s); - - while(token(s) != ']') { - json_t *value; - - if(!token(s)) { - set_error(s, "", "Unexpected end of format string"); - goto error; - } - - value = pack(s, ap); - if(!value) - goto error; - - if(json_array_append_new(array, value)) { - set_error(s, "", "Unable to append to array"); - goto error; - } - - next_token(s); - } - return array; - -error: - json_decref(array); - return NULL; -} - -static json_t *pack(scanner_t *s, va_list *ap) -{ - switch(token(s)) { - case '{': - return pack_object(s, ap); - - case '[': - return pack_array(s, ap); - - case 's': /* string */ - { - char *str; - size_t len; - int ours; - - str = read_string(s, ap, "string", &len, &ours); - if(!str) - return NULL; - - if (ours) - return jsonp_stringn_nocheck_own(str, len); - else - return json_stringn_nocheck(str, len); - } - - case 'n': /* null */ - return json_null(); - - case 'b': /* boolean */ - return va_arg(*ap, int) ? json_true() : json_false(); - - case 'i': /* integer from int */ - return json_integer(va_arg(*ap, int)); - - case 'I': /* integer from json_int_t */ - return json_integer(va_arg(*ap, json_int_t)); - - case 'f': /* real */ - return json_real(va_arg(*ap, double)); - - case 'O': /* a json_t object; increments refcount */ - return json_incref(va_arg(*ap, json_t *)); - - case 'o': /* a json_t object; doesn't increment refcount */ - return va_arg(*ap, json_t *); - - default: - set_error(s, "", "Unexpected format character '%c'", - token(s)); - return NULL; - } -} - -static int unpack(scanner_t *s, json_t *root, va_list *ap); - -static int unpack_object(scanner_t *s, json_t *root, va_list *ap) -{ - int ret = -1; - int strict = 0; - int gotopt = 0; - - /* Use a set (emulated by a hashtable) to check that all object - keys are accessed. Checking that the correct number of keys - were accessed is not enough, as the same key can be unpacked - multiple times. - */ - hashtable_t key_set; - - if(hashtable_init(&key_set)) { - set_error(s, "", "Out of memory"); - return -1; - } - - if(root && !json_is_object(root)) { - set_error(s, "", "Expected object, got %s", - type_name(root)); - goto out; - } - next_token(s); - - while(token(s) != '}') { - const char *key; - json_t *value; - int opt = 0; - - if(strict != 0) { - set_error(s, "", "Expected '}' after '%c', got '%c'", - (strict == 1 ? '!' : '*'), token(s)); - goto out; - } - - if(!token(s)) { - set_error(s, "", "Unexpected end of format string"); - goto out; - } - - if(token(s) == '!' || token(s) == '*') { - strict = (token(s) == '!' ? 1 : -1); - next_token(s); - continue; - } - - if(token(s) != 's') { - set_error(s, "", "Expected format 's', got '%c'", token(s)); - goto out; - } - - key = va_arg(*ap, const char *); - if(!key) { - set_error(s, "", "NULL object key"); - goto out; - } - - next_token(s); - - if(token(s) == '?') { - opt = gotopt = 1; - next_token(s); - } - - if(!root) { - /* skipping */ - value = NULL; - } - else { - value = json_object_get(root, key); - if(!value && !opt) { - set_error(s, "", "Object item not found: %s", key); - goto out; - } - } - - if(unpack(s, value, ap)) - goto out; - - hashtable_set(&key_set, key, 0, json_null()); - next_token(s); - } - - if(strict == 0 && (s->flags & JSON_STRICT)) - strict = 1; - - if(root && strict == 1) { - /* We need to check that all non optional items have been parsed */ - const char *key; - json_t *value; - long unpacked = 0; - if (gotopt) { - /* We have optional keys, we need to iter on each key */ - json_object_foreach(root, key, value) { - if(!hashtable_get(&key_set, key)) { - unpacked++; - } - } - } else { - /* No optional keys, we can just compare the number of items */ - unpacked = (long)json_object_size(root) - (long)key_set.size; - } - if (unpacked) { - set_error(s, "", "%li object item(s) left unpacked", unpacked); - goto out; - } - } - - ret = 0; - -out: - hashtable_close(&key_set); - return ret; -} - -static int unpack_array(scanner_t *s, json_t *root, va_list *ap) -{ - size_t i = 0; - int strict = 0; - - if(root && !json_is_array(root)) { - set_error(s, "", "Expected array, got %s", type_name(root)); - return -1; - } - next_token(s); - - while(token(s) != ']') { - json_t *value; - - if(strict != 0) { - set_error(s, "", "Expected ']' after '%c', got '%c'", - (strict == 1 ? '!' : '*'), - token(s)); - return -1; - } - - if(!token(s)) { - set_error(s, "", "Unexpected end of format string"); - return -1; - } - - if(token(s) == '!' || token(s) == '*') { - strict = (token(s) == '!' ? 1 : -1); - next_token(s); - continue; - } - - if(!strchr(unpack_value_starters, token(s))) { - set_error(s, "", "Unexpected format character '%c'", - token(s)); - return -1; - } - - if(!root) { - /* skipping */ - value = NULL; - } - else { - value = json_array_get(root, i); - if(!value) { - set_error(s, "", "Array index %lu out of range", - (unsigned long)i); - return -1; - } - } - - if(unpack(s, value, ap)) - return -1; - - next_token(s); - i++; - } - - if(strict == 0 && (s->flags & JSON_STRICT)) - strict = 1; - - if(root && strict == 1 && i != json_array_size(root)) { - long diff = (long)json_array_size(root) - (long)i; - set_error(s, "", "%li array item(s) left unpacked", diff); - return -1; - } - - return 0; -} - -static int unpack(scanner_t *s, json_t *root, va_list *ap) -{ - switch(token(s)) - { - case '{': - return unpack_object(s, root, ap); - - case '[': - return unpack_array(s, root, ap); - - case 's': - if(root && !json_is_string(root)) { - set_error(s, "", "Expected string, got %s", - type_name(root)); - return -1; - } - - if(!(s->flags & JSON_VALIDATE_ONLY)) { - const char **str_target; - size_t *len_target = NULL; - - str_target = va_arg(*ap, const char **); - if(!str_target) { - set_error(s, "", "NULL string argument"); - return -1; - } - - next_token(s); - - if(token(s) == '%') { - len_target = va_arg(*ap, size_t *); - if(!len_target) { - set_error(s, "", "NULL string length argument"); - return -1; - } - } - else - prev_token(s); - - if(root) { - *str_target = json_string_value(root); - if(len_target) - *len_target = json_string_length(root); - } - } - return 0; - - case 'i': - if(root && !json_is_integer(root)) { - set_error(s, "", "Expected integer, got %s", - type_name(root)); - return -1; - } - - if(!(s->flags & JSON_VALIDATE_ONLY)) { - int *target = va_arg(*ap, int*); - if(root) - *target = (int)json_integer_value(root); - } - - return 0; - - case 'I': - if(root && !json_is_integer(root)) { - set_error(s, "", "Expected integer, got %s", - type_name(root)); - return -1; - } - - if(!(s->flags & JSON_VALIDATE_ONLY)) { - json_int_t *target = va_arg(*ap, json_int_t*); - if(root) - *target = json_integer_value(root); - } - - return 0; - - case 'b': - if(root && !json_is_boolean(root)) { - set_error(s, "", "Expected true or false, got %s", - type_name(root)); - return -1; - } - - if(!(s->flags & JSON_VALIDATE_ONLY)) { - int *target = va_arg(*ap, int*); - if(root) - *target = json_is_true(root); - } - - return 0; - - case 'f': - if(root && !json_is_real(root)) { - set_error(s, "", "Expected real, got %s", - type_name(root)); - return -1; - } - - if(!(s->flags & JSON_VALIDATE_ONLY)) { - double *target = va_arg(*ap, double*); - if(root) - *target = json_real_value(root); - } - - return 0; - - case 'F': - if(root && !json_is_number(root)) { - set_error(s, "", "Expected real or integer, got %s", - type_name(root)); - return -1; - } - - if(!(s->flags & JSON_VALIDATE_ONLY)) { - double *target = va_arg(*ap, double*); - if(root) - *target = json_number_value(root); - } - - return 0; - - case 'O': - if(root && !(s->flags & JSON_VALIDATE_ONLY)) - json_incref(root); - /* Fall through */ - - case 'o': - if(!(s->flags & JSON_VALIDATE_ONLY)) { - json_t **target = va_arg(*ap, json_t**); - if(root) - *target = root; - } - - return 0; - - case 'n': - /* Never assign, just validate */ - if(root && !json_is_null(root)) { - set_error(s, "", "Expected null, got %s", - type_name(root)); - return -1; - } - return 0; - - default: - set_error(s, "", "Unexpected format character '%c'", - token(s)); - return -1; - } -} - -json_t *json_vpack_ex(json_error_t *error, size_t flags, - const char *fmt, va_list ap) -{ - scanner_t s; - va_list ap_copy; - json_t *value; - - if(!fmt || !*fmt) { - jsonp_error_init(error, ""); - jsonp_error_set(error, -1, -1, 0, "NULL or empty format string"); - return NULL; - } - jsonp_error_init(error, NULL); - - scanner_init(&s, error, flags, fmt); - next_token(&s); - - va_copy(ap_copy, ap); - value = pack(&s, &ap_copy); - va_end(ap_copy); - - if(!value) - return NULL; - - next_token(&s); - if(token(&s)) { - json_decref(value); - set_error(&s, "", "Garbage after format string"); - return NULL; - } - - return value; -} - -json_t *json_pack_ex(json_error_t *error, size_t flags, const char *fmt, ...) -{ - json_t *value; - va_list ap; - - va_start(ap, fmt); - value = json_vpack_ex(error, flags, fmt, ap); - va_end(ap); - - return value; -} - -json_t *json_pack(const char *fmt, ...) -{ - json_t *value; - va_list ap; - - va_start(ap, fmt); - value = json_vpack_ex(NULL, 0, fmt, ap); - va_end(ap); - - return value; -} - -int json_vunpack_ex(json_t *root, json_error_t *error, size_t flags, - const char *fmt, va_list ap) -{ - scanner_t s; - va_list ap_copy; - - if(!root) { - jsonp_error_init(error, ""); - jsonp_error_set(error, -1, -1, 0, "NULL root value"); - return -1; - } - - if(!fmt || !*fmt) { - jsonp_error_init(error, ""); - jsonp_error_set(error, -1, -1, 0, "NULL or empty format string"); - return -1; - } - jsonp_error_init(error, NULL); - - scanner_init(&s, error, flags, fmt); - next_token(&s); - - va_copy(ap_copy, ap); - if(unpack(&s, root, &ap_copy)) { - va_end(ap_copy); - return -1; - } - va_end(ap_copy); - - next_token(&s); - if(token(&s)) { - set_error(&s, "", "Garbage after format string"); - return -1; - } - - return 0; -} - -int json_unpack_ex(json_t *root, json_error_t *error, size_t flags, const char *fmt, ...) -{ - int ret; - va_list ap; - - va_start(ap, fmt); - ret = json_vunpack_ex(root, error, flags, fmt, ap); - va_end(ap); - - return ret; -} - -int json_unpack(json_t *root, const char *fmt, ...) -{ - int ret; - va_list ap; - - va_start(ap, fmt); - ret = json_vunpack_ex(root, NULL, 0, fmt, ap); - va_end(ap); - - return ret; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/strbuffer.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/strbuffer.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/strbuffer.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/strbuffer.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#include -#include -#include "jansson_private.h" -#include "strbuffer.h" - -#define STRBUFFER_MIN_SIZE 16 -#define STRBUFFER_FACTOR 2 -#define STRBUFFER_SIZE_MAX ((size_t)-1) - -int strbuffer_init(strbuffer_t *strbuff) -{ - strbuff->size = STRBUFFER_MIN_SIZE; - strbuff->length = 0; - - strbuff->value = jsonp_malloc(strbuff->size); - if(!strbuff->value) - return -1; - - /* initialize to empty */ - strbuff->value[0] = '\0'; - return 0; -} - -void strbuffer_close(strbuffer_t *strbuff) -{ - if(strbuff->value) - jsonp_free(strbuff->value); - - strbuff->size = 0; - strbuff->length = 0; - strbuff->value = NULL; -} - -void strbuffer_clear(strbuffer_t *strbuff) -{ - strbuff->length = 0; - strbuff->value[0] = '\0'; -} - -const char *strbuffer_value(const strbuffer_t *strbuff) -{ - return strbuff->value; -} - -char *strbuffer_steal_value(strbuffer_t *strbuff) -{ - char *result = strbuff->value; - strbuff->value = NULL; - return result; -} - -int strbuffer_append(strbuffer_t *strbuff, const char *string) -{ - return strbuffer_append_bytes(strbuff, string, strlen(string)); -} - -int strbuffer_append_byte(strbuffer_t *strbuff, char byte) -{ - return strbuffer_append_bytes(strbuff, &byte, 1); -} - -int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size) -{ - if(size >= strbuff->size - strbuff->length) - { - size_t new_size; - char *new_value; - - /* avoid integer overflow */ - if (strbuff->size > STRBUFFER_SIZE_MAX / STRBUFFER_FACTOR - || size > STRBUFFER_SIZE_MAX - 1 - || strbuff->length > STRBUFFER_SIZE_MAX - 1 - size) - return -1; - - new_size = max(strbuff->size * STRBUFFER_FACTOR, - strbuff->length + size + 1); - - new_value = jsonp_malloc(new_size); - if(!new_value) - return -1; - - memcpy(new_value, strbuff->value, strbuff->length); - - jsonp_free(strbuff->value); - strbuff->value = new_value; - strbuff->size = new_size; - } - - memcpy(strbuff->value + strbuff->length, data, size); - strbuff->length += size; - strbuff->value[strbuff->length] = '\0'; - - return 0; -} - -char strbuffer_pop(strbuffer_t *strbuff) -{ - if(strbuff->length > 0) { - char c = strbuff->value[--strbuff->length]; - strbuff->value[strbuff->length] = '\0'; - return c; - } - else - return '\0'; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/strbuffer.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/strbuffer.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/strbuffer.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/strbuffer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef STRBUFFER_H -#define STRBUFFER_H - -typedef struct { - char *value; - size_t length; /* bytes used */ - size_t size; /* bytes allocated */ -} strbuffer_t; - -int strbuffer_init(strbuffer_t *strbuff); -void strbuffer_close(strbuffer_t *strbuff); - -void strbuffer_clear(strbuffer_t *strbuff); - -const char *strbuffer_value(const strbuffer_t *strbuff); - -/* Steal the value and close the strbuffer */ -char *strbuffer_steal_value(strbuffer_t *strbuff); - -int strbuffer_append(strbuffer_t *strbuff, const char *string); -int strbuffer_append_byte(strbuffer_t *strbuff, char byte); -int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size); - -char strbuffer_pop(strbuffer_t *strbuff); - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/strconv.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/strconv.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/strconv.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/strconv.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -#include -#include -#include -#include -#include -#include "jansson_private.h" -#include "strbuffer.h" - -/* need jansson_private_config.h to get the correct snprintf */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#if JSON_HAVE_LOCALECONV -#include - -/* - - This code assumes that the decimal separator is exactly one - character. - - - If setlocale() is called by another thread between the call to - localeconv() and the call to sprintf() or strtod(), the result may - be wrong. setlocale() is not thread-safe and should not be used - this way. Multi-threaded programs should use uselocale() instead. -*/ - -static void to_locale(strbuffer_t *strbuffer) -{ - const char *point; - char *pos; - - point = localeconv()->decimal_point; - if(*point == '.') { - /* No conversion needed */ - return; - } - - pos = strchr(strbuffer->value, '.'); - if(pos) - *pos = *point; -} - -static void from_locale(char *buffer) -{ - const char *point; - char *pos; - - point = localeconv()->decimal_point; - if(*point == '.') { - /* No conversion needed */ - return; - } - - pos = strchr(buffer, *point); - if(pos) - *pos = '.'; -} -#endif - -int jsonp_strtod(strbuffer_t *strbuffer, double *out) -{ - double value; - char *end; - -#if JSON_HAVE_LOCALECONV - to_locale(strbuffer); -#endif - - errno = 0; - value = strtod(strbuffer->value, &end); - assert(end == strbuffer->value + strbuffer->length); - - if((value == HUGE_VAL || value == -HUGE_VAL) && errno == ERANGE) { - /* Overflow */ - return -1; - } - - *out = value; - return 0; -} - -int jsonp_dtostr(char *buffer, size_t size, double value, int precision) -{ - int ret; - char *start, *end; - size_t length; - - if (precision == 0) - precision = 17; - - ret = snprintf(buffer, size, "%.*g", precision, value); - if(ret < 0) - return -1; - - length = (size_t)ret; - if(length >= size) - return -1; - -#if JSON_HAVE_LOCALECONV - from_locale(buffer); -#endif - - /* Make sure there's a dot or 'e' in the output. Otherwise - a real is converted to an integer when decoding */ - if(strchr(buffer, '.') == NULL && - strchr(buffer, 'e') == NULL) - { - if(length + 3 >= size) { - /* No space to append ".0" */ - return -1; - } - buffer[length] = '.'; - buffer[length + 1] = '0'; - buffer[length + 2] = '\0'; - length += 2; - } - - /* Remove leading '+' from positive exponent. Also remove leading - zeros from exponents (added by some printf() implementations) */ - start = strchr(buffer, 'e'); - if(start) { - start++; - end = start + 1; - - if(*start == '-') - start++; - - while(*end == '0') - end++; - - if(end != start) { - memmove(start, end, length - (size_t)(end - buffer)); - length -= (size_t)(end - start); - } - } - - return (int)length; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/utf.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/utf.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/utf.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/utf.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include "utf.h" - -int utf8_encode(int32_t codepoint, char *buffer, size_t *size) -{ - if(codepoint < 0) - return -1; - else if(codepoint < 0x80) - { - buffer[0] = (char)codepoint; - *size = 1; - } - else if(codepoint < 0x800) - { - buffer[0] = 0xC0 + ((codepoint & 0x7C0) >> 6); - buffer[1] = 0x80 + ((codepoint & 0x03F)); - *size = 2; - } - else if(codepoint < 0x10000) - { - buffer[0] = 0xE0 + ((codepoint & 0xF000) >> 12); - buffer[1] = 0x80 + ((codepoint & 0x0FC0) >> 6); - buffer[2] = 0x80 + ((codepoint & 0x003F)); - *size = 3; - } - else if(codepoint <= 0x10FFFF) - { - buffer[0] = 0xF0 + ((codepoint & 0x1C0000) >> 18); - buffer[1] = 0x80 + ((codepoint & 0x03F000) >> 12); - buffer[2] = 0x80 + ((codepoint & 0x000FC0) >> 6); - buffer[3] = 0x80 + ((codepoint & 0x00003F)); - *size = 4; - } - else - return -1; - - return 0; -} - -size_t utf8_check_first(char byte) -{ - unsigned char u = (unsigned char)byte; - - if(u < 0x80) - return 1; - - if(0x80 <= u && u <= 0xBF) { - /* second, third or fourth byte of a multi-byte - sequence, i.e. a "continuation byte" */ - return 0; - } - else if(u == 0xC0 || u == 0xC1) { - /* overlong encoding of an ASCII byte */ - return 0; - } - else if(0xC2 <= u && u <= 0xDF) { - /* 2-byte sequence */ - return 2; - } - - else if(0xE0 <= u && u <= 0xEF) { - /* 3-byte sequence */ - return 3; - } - else if(0xF0 <= u && u <= 0xF4) { - /* 4-byte sequence */ - return 4; - } - else { /* u >= 0xF5 */ - /* Restricted (start of 4-, 5- or 6-byte sequence) or invalid - UTF-8 */ - return 0; - } -} - -size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint) -{ - size_t i; - int32_t value = 0; - unsigned char u = (unsigned char)buffer[0]; - - if(size == 2) - { - value = u & 0x1F; - } - else if(size == 3) - { - value = u & 0xF; - } - else if(size == 4) - { - value = u & 0x7; - } - else - return 0; - - for(i = 1; i < size; i++) - { - u = (unsigned char)buffer[i]; - - if(u < 0x80 || u > 0xBF) { - /* not a continuation byte */ - return 0; - } - - value = (value << 6) + (u & 0x3F); - } - - if(value > 0x10FFFF) { - /* not in Unicode range */ - return 0; - } - - else if(0xD800 <= value && value <= 0xDFFF) { - /* invalid code point (UTF-16 surrogate halves) */ - return 0; - } - - else if((size == 2 && value < 0x80) || - (size == 3 && value < 0x800) || - (size == 4 && value < 0x10000)) { - /* overlong encoding */ - return 0; - } - - if(codepoint) - *codepoint = value; - - return 1; -} - -const char *utf8_iterate(const char *buffer, size_t bufsize, int32_t *codepoint) -{ - size_t count; - int32_t value; - - if(!bufsize) - return buffer; - - count = utf8_check_first(buffer[0]); - if(count <= 0) - return NULL; - - if(count == 1) - value = (unsigned char)buffer[0]; - else - { - if(count > bufsize || !utf8_check_full(buffer, count, &value)) - return NULL; - } - - if(codepoint) - *codepoint = value; - - return buffer + count; -} - -int utf8_check_string(const char *string, size_t length) -{ - size_t i; - - for(i = 0; i < length; i++) - { - size_t count = utf8_check_first(string[i]); - if(count == 0) - return 0; - else if(count > 1) - { - if(count > length - i) - return 0; - - if(!utf8_check_full(&string[i], count, NULL)) - return 0; - - i += count - 1; - } - } - - return 1; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/utf.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/utf.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/utf.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/utf.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef UTF_H -#define UTF_H - -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifdef HAVE_STDINT_H -#include -#endif - -int utf8_encode(int32_t codepoint, char *buffer, size_t *size); - -size_t utf8_check_first(char byte); -size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint); -const char *utf8_iterate(const char *buffer, size_t size, int32_t *codepoint); - -int utf8_check_string(const char *string, size_t length); - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/value.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/value.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/src/value.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/src/value.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,1041 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#ifdef HAVE_STDINT_H -#include -#endif - -#include "jansson.h" -#include "hashtable.h" -#include "jansson_private.h" -#include "utf.h" - -/* Work around nonstandard isnan() and isinf() implementations */ -#ifndef isnan -#ifndef __sun -static JSON_INLINE int isnan(double x) { return x != x; } -#endif -#endif -#ifndef isinf -static JSON_INLINE int isinf(double x) { return !isnan(x) && isnan(x - x); } -#endif - -static JSON_INLINE void json_init(json_t *json, json_type type) -{ - json->type = type; - json->refcount = 1; -} - - -/*** object ***/ - -extern volatile uint32_t hashtable_seed; - -json_t *json_object(void) -{ - json_object_t *object = jsonp_malloc(sizeof(json_object_t)); - if(!object) - return NULL; - - if (!hashtable_seed) { - /* Autoseed */ - json_object_seed(0); - } - - json_init(&object->json, JSON_OBJECT); - - if(hashtable_init(&object->hashtable)) - { - jsonp_free(object); - return NULL; - } - - object->serial = 0; - object->visited = 0; - - return &object->json; -} - -static void json_delete_object(json_object_t *object) -{ - hashtable_close(&object->hashtable); - jsonp_free(object); -} - -size_t json_object_size(const json_t *json) -{ - json_object_t *object; - - if(!json_is_object(json)) - return 0; - - object = json_to_object(json); - return object->hashtable.size; -} - -json_t *json_object_get(const json_t *json, const char *key) -{ - json_object_t *object; - - if(!key || !json_is_object(json)) - return NULL; - - object = json_to_object(json); - return hashtable_get(&object->hashtable, key); -} - -int json_object_set_new_nocheck(json_t *json, const char *key, json_t *value) -{ - json_object_t *object; - - if(!value) - return -1; - - if(!key || !json_is_object(json) || json == value) - { - json_decref(value); - return -1; - } - object = json_to_object(json); - - if(hashtable_set(&object->hashtable, key, object->serial++, value)) - { - json_decref(value); - return -1; - } - - return 0; -} - -int json_object_set_new(json_t *json, const char *key, json_t *value) -{ - if(!key || !utf8_check_string(key, strlen(key))) - { - json_decref(value); - return -1; - } - - return json_object_set_new_nocheck(json, key, value); -} - -int json_object_del(json_t *json, const char *key) -{ - json_object_t *object; - - if(!key || !json_is_object(json)) - return -1; - - object = json_to_object(json); - return hashtable_del(&object->hashtable, key); -} - -int json_object_clear(json_t *json) -{ - json_object_t *object; - - if(!json_is_object(json)) - return -1; - - object = json_to_object(json); - - hashtable_clear(&object->hashtable); - object->serial = 0; - - return 0; -} - -int json_object_update(json_t *object, json_t *other) -{ - const char *key; - json_t *value; - - if(!json_is_object(object) || !json_is_object(other)) - return -1; - - json_object_foreach(other, key, value) { - if(json_object_set_nocheck(object, key, value)) - return -1; - } - - return 0; -} - -int json_object_update_existing(json_t *object, json_t *other) -{ - const char *key; - json_t *value; - - if(!json_is_object(object) || !json_is_object(other)) - return -1; - - json_object_foreach(other, key, value) { - if(json_object_get(object, key)) - json_object_set_nocheck(object, key, value); - } - - return 0; -} - -int json_object_update_missing(json_t *object, json_t *other) -{ - const char *key; - json_t *value; - - if(!json_is_object(object) || !json_is_object(other)) - return -1; - - json_object_foreach(other, key, value) { - if(!json_object_get(object, key)) - json_object_set_nocheck(object, key, value); - } - - return 0; -} - -void *json_object_iter(json_t *json) -{ - json_object_t *object; - - if(!json_is_object(json)) - return NULL; - - object = json_to_object(json); - return hashtable_iter(&object->hashtable); -} - -void *json_object_iter_at(json_t *json, const char *key) -{ - json_object_t *object; - - if(!key || !json_is_object(json)) - return NULL; - - object = json_to_object(json); - return hashtable_iter_at(&object->hashtable, key); -} - -void *json_object_iter_next(json_t *json, void *iter) -{ - json_object_t *object; - - if(!json_is_object(json) || iter == NULL) - return NULL; - - object = json_to_object(json); - return hashtable_iter_next(&object->hashtable, iter); -} - -const char *json_object_iter_key(void *iter) -{ - if(!iter) - return NULL; - - return hashtable_iter_key(iter); -} - -json_t *json_object_iter_value(void *iter) -{ - if(!iter) - return NULL; - - return (json_t *)hashtable_iter_value(iter); -} - -int json_object_iter_set_new(json_t *json, void *iter, json_t *value) -{ - if(!json_is_object(json) || !iter || !value) - return -1; - - hashtable_iter_set(iter, value); - return 0; -} - -void *json_object_key_to_iter(const char *key) -{ - if(!key) - return NULL; - - return hashtable_key_to_iter(key); -} - -static int json_object_equal(json_t *object1, json_t *object2) -{ - const char *key; - json_t *value1, *value2; - - if(json_object_size(object1) != json_object_size(object2)) - return 0; - - json_object_foreach(object1, key, value1) { - value2 = json_object_get(object2, key); - - if(!json_equal(value1, value2)) - return 0; - } - - return 1; -} - -static json_t *json_object_copy(json_t *object) -{ - json_t *result; - - const char *key; - json_t *value; - - result = json_object(); - if(!result) - return NULL; - - json_object_foreach(object, key, value) - json_object_set_nocheck(result, key, value); - - return result; -} - -static json_t *json_object_deep_copy(const json_t *object) -{ - json_t *result; - void *iter; - - result = json_object(); - if(!result) - return NULL; - - /* Cannot use json_object_foreach because object has to be cast - non-const */ - iter = json_object_iter((json_t *)object); - while(iter) { - const char *key; - const json_t *value; - key = json_object_iter_key(iter); - value = json_object_iter_value(iter); - - json_object_set_new_nocheck(result, key, json_deep_copy(value)); - iter = json_object_iter_next((json_t *)object, iter); - } - - return result; -} - - -/*** array ***/ - -json_t *json_array(void) -{ - json_array_t *array = jsonp_malloc(sizeof(json_array_t)); - if(!array) - return NULL; - json_init(&array->json, JSON_ARRAY); - - array->entries = 0; - array->size = 8; - - array->table = jsonp_malloc(array->size * sizeof(json_t *)); - if(!array->table) { - jsonp_free(array); - return NULL; - } - - array->visited = 0; - - return &array->json; -} - -static void json_delete_array(json_array_t *array) -{ - size_t i; - - for(i = 0; i < array->entries; i++) - json_decref(array->table[i]); - - jsonp_free(array->table); - jsonp_free(array); -} - -size_t json_array_size(const json_t *json) -{ - if(!json_is_array(json)) - return 0; - - return json_to_array(json)->entries; -} - -json_t *json_array_get(const json_t *json, size_t index) -{ - json_array_t *array; - if(!json_is_array(json)) - return NULL; - array = json_to_array(json); - - if(index >= array->entries) - return NULL; - - return array->table[index]; -} - -int json_array_set_new(json_t *json, size_t index, json_t *value) -{ - json_array_t *array; - - if(!value) - return -1; - - if(!json_is_array(json) || json == value) - { - json_decref(value); - return -1; - } - array = json_to_array(json); - - if(index >= array->entries) - { - json_decref(value); - return -1; - } - - json_decref(array->table[index]); - array->table[index] = value; - - return 0; -} - -static void array_move(json_array_t *array, size_t dest, - size_t src, size_t count) -{ - memmove(&array->table[dest], &array->table[src], count * sizeof(json_t *)); -} - -static void array_copy(json_t **dest, size_t dpos, - json_t **src, size_t spos, - size_t count) -{ - memcpy(&dest[dpos], &src[spos], count * sizeof(json_t *)); -} - -static json_t **json_array_grow(json_array_t *array, - size_t amount, - int copy) -{ - size_t new_size; - json_t **old_table, **new_table; - - if(array->entries + amount <= array->size) - return array->table; - - old_table = array->table; - - new_size = max(array->size + amount, array->size * 2); - new_table = jsonp_malloc(new_size * sizeof(json_t *)); - if(!new_table) - return NULL; - - array->size = new_size; - array->table = new_table; - - if(copy) { - array_copy(array->table, 0, old_table, 0, array->entries); - jsonp_free(old_table); - return array->table; - } - - return old_table; -} - -int json_array_append_new(json_t *json, json_t *value) -{ - json_array_t *array; - - if(!value) - return -1; - - if(!json_is_array(json) || json == value) - { - json_decref(value); - return -1; - } - array = json_to_array(json); - - if(!json_array_grow(array, 1, 1)) { - json_decref(value); - return -1; - } - - array->table[array->entries] = value; - array->entries++; - - return 0; -} - -int json_array_insert_new(json_t *json, size_t index, json_t *value) -{ - json_array_t *array; - json_t **old_table; - - if(!value) - return -1; - - if(!json_is_array(json) || json == value) { - json_decref(value); - return -1; - } - array = json_to_array(json); - - if(index > array->entries) { - json_decref(value); - return -1; - } - - old_table = json_array_grow(array, 1, 0); - if(!old_table) { - json_decref(value); - return -1; - } - - if(old_table != array->table) { - array_copy(array->table, 0, old_table, 0, index); - array_copy(array->table, index + 1, old_table, index, - array->entries - index); - jsonp_free(old_table); - } - else - array_move(array, index + 1, index, array->entries - index); - - array->table[index] = value; - array->entries++; - - return 0; -} - -int json_array_remove(json_t *json, size_t index) -{ - json_array_t *array; - - if(!json_is_array(json)) - return -1; - array = json_to_array(json); - - if(index >= array->entries) - return -1; - - json_decref(array->table[index]); - - /* If we're removing the last element, nothing has to be moved */ - if(index < array->entries - 1) - array_move(array, index, index + 1, array->entries - index - 1); - - array->entries--; - - return 0; -} - -int json_array_clear(json_t *json) -{ - json_array_t *array; - size_t i; - - if(!json_is_array(json)) - return -1; - array = json_to_array(json); - - for(i = 0; i < array->entries; i++) - json_decref(array->table[i]); - - array->entries = 0; - return 0; -} - -int json_array_extend(json_t *json, json_t *other_json) -{ - json_array_t *array, *other; - size_t i; - - if(!json_is_array(json) || !json_is_array(other_json)) - return -1; - array = json_to_array(json); - other = json_to_array(other_json); - - if(!json_array_grow(array, other->entries, 1)) - return -1; - - for(i = 0; i < other->entries; i++) - json_incref(other->table[i]); - - array_copy(array->table, array->entries, other->table, 0, other->entries); - - array->entries += other->entries; - return 0; -} - -static int json_array_equal(json_t *array1, json_t *array2) -{ - size_t i, size; - - size = json_array_size(array1); - if(size != json_array_size(array2)) - return 0; - - for(i = 0; i < size; i++) - { - json_t *value1, *value2; - - value1 = json_array_get(array1, i); - value2 = json_array_get(array2, i); - - if(!json_equal(value1, value2)) - return 0; - } - - return 1; -} - -static json_t *json_array_copy(json_t *array) -{ - json_t *result; - size_t i; - - result = json_array(); - if(!result) - return NULL; - - for(i = 0; i < json_array_size(array); i++) - json_array_append(result, json_array_get(array, i)); - - return result; -} - -static json_t *json_array_deep_copy(const json_t *array) -{ - json_t *result; - size_t i; - - result = json_array(); - if(!result) - return NULL; - - for(i = 0; i < json_array_size(array); i++) - json_array_append_new(result, json_deep_copy(json_array_get(array, i))); - - return result; -} - -/*** string ***/ - -static json_t *string_create(const char *value, size_t len, int own) -{ - char *v; - json_string_t *string; - - if(!value) - return NULL; - - if(own) - v = (char *)value; - else { - v = jsonp_strndup(value, len); - if(!v) - return NULL; - } - - string = jsonp_malloc(sizeof(json_string_t)); - if(!string) { - if(!own) - jsonp_free(v); - return NULL; - } - json_init(&string->json, JSON_STRING); - string->value = v; - string->length = len; - - return &string->json; -} - -json_t *json_string_nocheck(const char *value) -{ - if(!value) - return NULL; - - return string_create(value, strlen(value), 0); -} - -json_t *json_stringn_nocheck(const char *value, size_t len) -{ - return string_create(value, len, 0); -} - -/* this is private; "steal" is not a public API concept */ -json_t *jsonp_stringn_nocheck_own(const char *value, size_t len) -{ - return string_create(value, len, 1); -} - -json_t *json_string(const char *value) -{ - if(!value) - return NULL; - - return json_stringn(value, strlen(value)); -} - -json_t *json_stringn(const char *value, size_t len) -{ - if(!value || !utf8_check_string(value, len)) - return NULL; - - return json_stringn_nocheck(value, len); -} - -const char *json_string_value(const json_t *json) -{ - if(!json_is_string(json)) - return NULL; - - return json_to_string(json)->value; -} - -size_t json_string_length(const json_t *json) -{ - if(!json_is_string(json)) - return 0; - - return json_to_string(json)->length; -} - -int json_string_set_nocheck(json_t *json, const char *value) -{ - if(!value) - return -1; - - return json_string_setn_nocheck(json, value, strlen(value)); -} - -int json_string_setn_nocheck(json_t *json, const char *value, size_t len) -{ - char *dup; - json_string_t *string; - - if(!json_is_string(json) || !value) - return -1; - - dup = jsonp_strndup(value, len); - if(!dup) - return -1; - - string = json_to_string(json); - jsonp_free(string->value); - string->value = dup; - string->length = len; - - return 0; -} - -int json_string_set(json_t *json, const char *value) -{ - if(!value) - return -1; - - return json_string_setn(json, value, strlen(value)); -} - -int json_string_setn(json_t *json, const char *value, size_t len) -{ - if(!value || !utf8_check_string(value, len)) - return -1; - - return json_string_setn_nocheck(json, value, len); -} - -static void json_delete_string(json_string_t *string) -{ - jsonp_free(string->value); - jsonp_free(string); -} - -static int json_string_equal(json_t *string1, json_t *string2) -{ - json_string_t *s1, *s2; - - if(!json_is_string(string1) || !json_is_string(string2)) - return 0; - - s1 = json_to_string(string1); - s2 = json_to_string(string2); - return s1->length == s2->length && !memcmp(s1->value, s2->value, s1->length); -} - -static json_t *json_string_copy(const json_t *string) -{ - json_string_t *s; - - if(!json_is_string(string)) - return NULL; - - s = json_to_string(string); - return json_stringn_nocheck(s->value, s->length); -} - - -/*** integer ***/ - -json_t *json_integer(json_int_t value) -{ - json_integer_t *integer = jsonp_malloc(sizeof(json_integer_t)); - if(!integer) - return NULL; - json_init(&integer->json, JSON_INTEGER); - - integer->value = value; - return &integer->json; -} - -json_int_t json_integer_value(const json_t *json) -{ - if(!json_is_integer(json)) - return 0; - - return json_to_integer(json)->value; -} - -int json_integer_set(json_t *json, json_int_t value) -{ - if(!json_is_integer(json)) - return -1; - - json_to_integer(json)->value = value; - - return 0; -} - -static void json_delete_integer(json_integer_t *integer) -{ - jsonp_free(integer); -} - -static int json_integer_equal(json_t *integer1, json_t *integer2) -{ - return json_integer_value(integer1) == json_integer_value(integer2); -} - -static json_t *json_integer_copy(const json_t *integer) -{ - return json_integer(json_integer_value(integer)); -} - - -/*** real ***/ - -json_t *json_real(double value) -{ - json_real_t *real; - - if(isnan(value) || isinf(value)) - return NULL; - - real = jsonp_malloc(sizeof(json_real_t)); - if(!real) - return NULL; - json_init(&real->json, JSON_REAL); - - real->value = value; - return &real->json; -} - -double json_real_value(const json_t *json) -{ - if(!json_is_real(json)) - return 0; - - return json_to_real(json)->value; -} - -int json_real_set(json_t *json, double value) -{ - if(!json_is_real(json) || isnan(value) || isinf(value)) - return -1; - - json_to_real(json)->value = value; - - return 0; -} - -static void json_delete_real(json_real_t *real) -{ - jsonp_free(real); -} - -static int json_real_equal(json_t *real1, json_t *real2) -{ - return json_real_value(real1) == json_real_value(real2); -} - -static json_t *json_real_copy(const json_t *real) -{ - return json_real(json_real_value(real)); -} - - -/*** number ***/ - -double json_number_value(const json_t *json) -{ - if(json_is_integer(json)) - return (double)json_integer_value(json); - else if(json_is_real(json)) - return json_real_value(json); - else - return 0.0; -} - - -/*** simple values ***/ - -json_t *json_true(void) -{ - static json_t the_true = {JSON_TRUE, (size_t)-1}; - return &the_true; -} - - -json_t *json_false(void) -{ - static json_t the_false = {JSON_FALSE, (size_t)-1}; - return &the_false; -} - - -json_t *json_null(void) -{ - static json_t the_null = {JSON_NULL, (size_t)-1}; - return &the_null; -} - - -/*** deletion ***/ - -void json_delete(json_t *json) -{ - if(json_is_object(json)) - json_delete_object(json_to_object(json)); - - else if(json_is_array(json)) - json_delete_array(json_to_array(json)); - - else if(json_is_string(json)) - json_delete_string(json_to_string(json)); - - else if(json_is_integer(json)) - json_delete_integer(json_to_integer(json)); - - else if(json_is_real(json)) - json_delete_real(json_to_real(json)); - - /* json_delete is not called for true, false or null */ -} - - -/*** equality ***/ - -int json_equal(json_t *json1, json_t *json2) -{ - if(!json1 || !json2) - return 0; - - if(json_typeof(json1) != json_typeof(json2)) - return 0; - - /* this covers true, false and null as they are singletons */ - if(json1 == json2) - return 1; - - if(json_is_object(json1)) - return json_object_equal(json1, json2); - - if(json_is_array(json1)) - return json_array_equal(json1, json2); - - if(json_is_string(json1)) - return json_string_equal(json1, json2); - - if(json_is_integer(json1)) - return json_integer_equal(json1, json2); - - if(json_is_real(json1)) - return json_real_equal(json1, json2); - - return 0; -} - - -/*** copying ***/ - -json_t *json_copy(json_t *json) -{ - if(!json) - return NULL; - - if(json_is_object(json)) - return json_object_copy(json); - - if(json_is_array(json)) - return json_array_copy(json); - - if(json_is_string(json)) - return json_string_copy(json); - - if(json_is_integer(json)) - return json_integer_copy(json); - - if(json_is_real(json)) - return json_real_copy(json); - - if(json_is_true(json) || json_is_false(json) || json_is_null(json)) - return json; - - return NULL; -} - -json_t *json_deep_copy(const json_t *json) -{ - if(!json) - return NULL; - - if(json_is_object(json)) - return json_object_deep_copy(json); - - if(json_is_array(json)) - return json_array_deep_copy(json); - - /* for the rest of the types, deep copying doesn't differ from - shallow copying */ - - if(json_is_string(json)) - return json_string_copy(json); - - if(json_is_integer(json)) - return json_integer_copy(json); - - if(json_is_real(json)) - return json_real_copy(json); - - if(json_is_true(json) || json_is_false(json) || json_is_null(json)) - return (json_t *)json; - - return NULL; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/bin/json_process.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/bin/json_process.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/bin/json_process.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/bin/json_process.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,385 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include - -#ifdef HAVE_LOCALE_H -#include - #endif - -#if _WIN32 -#include /* for _setmode() */ -#include /* for _O_BINARY */ - -static const char dir_sep = '\\'; -#else -static const char dir_sep = '/'; -#endif - - -struct config { - int indent; - int compact; - int preserve_order; - int ensure_ascii; - int sort_keys; - int strip; - int use_env; - int have_hashseed; - int hashseed; - int precision; -} conf; - -#define l_isspace(c) ((c) == ' ' || (c) == '\n' || (c) == '\r' || (c) == '\t') - -/* Return a pointer to the first non-whitespace character of str. - Modifies str so that all trailing whitespace characters are - replaced by '\0'. */ -static const char *strip(char *str) -{ - size_t length; - char *result = str; - while (*result && l_isspace(*result)) - result++; - - length = strlen(result); - if (length == 0) - return result; - - while (l_isspace(result[length - 1])) - result[--length] = '\0'; - - return result; -} - - -static char *loadfile(FILE *file) -{ - long fsize, ret; - char *buf; - - fseek(file, 0, SEEK_END); - fsize = ftell(file); - fseek(file, 0, SEEK_SET); - - buf = malloc(fsize+1); - ret = fread(buf, 1, fsize, file); - if (ret != fsize) - exit(1); - buf[fsize] = '\0'; - - return buf; -} - - -static void read_conf(FILE *conffile) -{ - char *buffer, *line, *val; - - buffer = loadfile(conffile); - for (line = strtok(buffer, "\r\n"); line; line = strtok(NULL, "\r\n")) { - if (!strncmp(line, "export ", 7)) - continue; - val = strchr(line, '='); - if (!val) { - printf("invalid configuration line\n"); - break; - } - *val++ = '\0'; - - if (!strcmp(line, "JSON_INDENT")) - conf.indent = atoi(val); - if (!strcmp(line, "JSON_COMPACT")) - conf.compact = atoi(val); - if (!strcmp(line, "JSON_ENSURE_ASCII")) - conf.ensure_ascii = atoi(val); - if (!strcmp(line, "JSON_PRESERVE_ORDER")) - conf.preserve_order = atoi(val); - if (!strcmp(line, "JSON_SORT_KEYS")) - conf.sort_keys = atoi(val); - if (!strcmp(line, "JSON_REAL_PRECISION")) - conf.precision = atoi(val); - if (!strcmp(line, "STRIP")) - conf.strip = atoi(val); - if (!strcmp(line, "HASHSEED")) { - conf.have_hashseed = 1; - conf.hashseed = atoi(val); - } else { - conf.have_hashseed = 0; - } - } - - free(buffer); -} - - -static int cmpfile(const char *str, const char *path, const char *fname) -{ - char filename[1024], *buffer; - int ret; - FILE *file; - - sprintf(filename, "%s%c%s", path, dir_sep, fname); - file = fopen(filename, "rb"); - if (!file) { - if (conf.strip) - strcat(filename, ".strip"); - else - strcat(filename, ".normal"); - file = fopen(filename, "rb"); - } - if (!file) { - printf("Error: test result file could not be opened.\n"); - exit(1); - } - - buffer = loadfile(file); - if (strcmp(buffer, str) != 0) - ret = 1; - else - ret = 0; - free(buffer); - fclose(file); - - return ret; -} - -int use_conf(char *test_path) -{ - int ret; - size_t flags = 0; - char filename[1024], errstr[1024]; - char *buffer; - FILE *infile, *conffile; - json_t *json; - json_error_t error; - - sprintf(filename, "%s%cinput", test_path, dir_sep); - if (!(infile = fopen(filename, "rb"))) { - fprintf(stderr, "Could not open \"%s\"\n", filename); - return 2; - } - - sprintf(filename, "%s%cenv", test_path, dir_sep); - conffile = fopen(filename, "rb"); - if (conffile) { - read_conf(conffile); - fclose(conffile); - } - - if (conf.indent < 0 || conf.indent > 31) { - fprintf(stderr, "invalid value for JSON_INDENT: %d\n", conf.indent); - fclose(infile); - return 2; - } - if (conf.indent) - flags |= JSON_INDENT(conf.indent); - - if (conf.compact) - flags |= JSON_COMPACT; - - if (conf.ensure_ascii) - flags |= JSON_ENSURE_ASCII; - - if (conf.preserve_order) - flags |= JSON_PRESERVE_ORDER; - - if (conf.sort_keys) - flags |= JSON_SORT_KEYS; - - if (conf.precision < 0 || conf.precision > 31) { - fprintf(stderr, "invalid value for JSON_REAL_PRECISION: %d\n", - conf.precision); - fclose(infile); - return 2; - } - if (conf.precision) - flags |= JSON_REAL_PRECISION(conf.precision); - - if (conf.have_hashseed) - json_object_seed(conf.hashseed); - - if (conf.strip) { - /* Load to memory, strip leading and trailing whitespace */ - buffer = loadfile(infile); - json = json_loads(strip(buffer), 0, &error); - free(buffer); - } - else - json = json_loadf(infile, 0, &error); - - fclose(infile); - - if (!json) { - sprintf(errstr, "%d %d %d\n%s\n", - error.line, error.column, error.position, - error.text); - - ret = cmpfile(errstr, test_path, "error"); - return ret; - } - - buffer = json_dumps(json, flags); - ret = cmpfile(buffer, test_path, "output"); - free(buffer); - json_decref(json); - - return ret; -} - -static int getenv_int(const char *name) -{ - char *value, *end; - long result; - - value = getenv(name); - if(!value) - return 0; - - result = strtol(value, &end, 10); - if(*end != '\0') - return 0; - - return (int)result; -} - -int use_env() -{ - int indent, precision; - size_t flags = 0; - json_t *json; - json_error_t error; - - #ifdef _WIN32 - /* On Windows, set stdout and stderr to binary mode to avoid - outputting DOS line terminators */ - _setmode(_fileno(stdout), _O_BINARY); - _setmode(_fileno(stderr), _O_BINARY); - #endif - - indent = getenv_int("JSON_INDENT"); - if(indent < 0 || indent > 31) { - fprintf(stderr, "invalid value for JSON_INDENT: %d\n", indent); - return 2; - } - if(indent > 0) - flags |= JSON_INDENT(indent); - - if(getenv_int("JSON_COMPACT") > 0) - flags |= JSON_COMPACT; - - if(getenv_int("JSON_ENSURE_ASCII")) - flags |= JSON_ENSURE_ASCII; - - if(getenv_int("JSON_PRESERVE_ORDER")) - flags |= JSON_PRESERVE_ORDER; - - if(getenv_int("JSON_SORT_KEYS")) - flags |= JSON_SORT_KEYS; - - precision = getenv_int("JSON_REAL_PRECISION"); - if(precision < 0 || precision > 31) { - fprintf(stderr, "invalid value for JSON_REAL_PRECISION: %d\n", - precision); - return 2; - } - - if(getenv("HASHSEED")) - json_object_seed(getenv_int("HASHSEED")); - - if(precision > 0) - flags |= JSON_REAL_PRECISION(precision); - - if(getenv_int("STRIP")) { - /* Load to memory, strip leading and trailing whitespace */ - size_t size = 0, used = 0; - char *buffer = NULL, *buf_ck = NULL; - - while(1) { - size_t count; - - size = (size == 0 ? 128 : size * 2); - buf_ck = realloc(buffer, size); - if(!buf_ck) { - fprintf(stderr, "Unable to allocate %d bytes\n", (int)size); - free(buffer); - return 1; - } - buffer = buf_ck; - - count = fread(buffer + used, 1, size - used, stdin); - if(count < size - used) { - buffer[used + count] = '\0'; - break; - } - used += count; - } - - json = json_loads(strip(buffer), 0, &error); - free(buffer); - } - else - json = json_loadf(stdin, 0, &error); - - if(!json) { - fprintf(stderr, "%d %d %d\n%s\n", - error.line, error.column, - error.position, error.text); - return 1; - } - - json_dumpf(json, stdout, flags); - json_decref(json); - - return 0; -} - -int main(int argc, char *argv[]) -{ - int i; - char *test_path = NULL; - - #ifdef HAVE_SETLOCALE - setlocale(LC_ALL, ""); - #endif - - if (argc < 2) { - goto usage; - } - - for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "--strip")) - conf.strip = 1; - else if (!strcmp(argv[i], "--env")) - conf.use_env = 1; - else - test_path = argv[i]; - } - - if (conf.use_env) - return use_env(); - else - { - if (!test_path) - goto usage; - - return use_conf(test_path); - } - -usage: - fprintf(stderr, "argc =%d\n", argc); - fprintf(stderr, "usage: %s [--strip] [--env] test_dir\n", argv[0]); - return 2; -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/bin/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/bin/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/bin/Makefile.am 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/bin/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -check_PROGRAMS = json_process - -AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src -LDFLAGS = -static # for speed and Valgrind -LDADD = $(top_builddir)/src/libjansson.la diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/.gitignore kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/.gitignore --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/.gitignore 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -logs -bin/json_process -suites/api/test_array -suites/api/test_copy -suites/api/test_cpp -suites/api/test_dump -suites/api/test_dump_callback -suites/api/test_equal -suites/api/test_load -suites/api/test_loadb -suites/api/test_memory_funcs -suites/api/test_number -suites/api/test_object -suites/api/test_pack -suites/api/test_simple -suites/api/test_unpack -suites/api/test_load_callback diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/Makefile.am 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -SUBDIRS = bin suites -EXTRA_DIST = scripts run-suites - -TESTS = run-suites -TESTS_ENVIRONMENT = \ - top_srcdir=$(top_srcdir) \ - top_builddir=$(top_builddir) - -clean-local: - rm -rf logs diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/run-suites kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/run-suites --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/run-suites 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/run-suites 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -#!/bin/sh - -while [ -n "$1" ]; do - suite=$1 - if [ -x $top_srcdir/test/suites/$suite/run ]; then - SUITES="$SUITES $suite" - else - echo "No such suite: $suite" - exit 1 - fi - shift -done - -if [ -z "$SUITES" ]; then - suitedirs=$top_srcdir/test/suites/* - for suitedir in $suitedirs; do - if [ -d $suitedir ]; then - SUITES="$SUITES `basename $suitedir`" - fi - done -fi - -[ -z "$STOP" ] && STOP=0 - -suites_srcdir=$top_srcdir/test/suites -suites_builddir=suites -scriptdir=$top_srcdir/test/scripts -logdir=logs -bindir=bin -export suites_srcdir suites_builddir scriptdir logdir bindir - -passed=0 -failed=0 -for suite in $SUITES; do - echo "Suite: $suite" - if $suites_srcdir/$suite/run $suite; then - passed=`expr $passed + 1` - else - failed=`expr $failed + 1` - [ $STOP -eq 1 ] && break - fi -done - -if [ $failed -gt 0 ]; then - echo "$failed of `expr $passed + $failed` test suites failed" - exit 1 -else - echo "$passed test suites passed" - rm -rf $logdir -fi diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/scripts/run-tests.sh kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/scripts/run-tests.sh --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/scripts/run-tests.sh 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/scripts/run-tests.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -# Copyright (c) 2009-2014 Petri Lehtinen -# -# Jansson is free software; you can redistribute it and/or modify -# it under the terms of the MIT license. See LICENSE for details. - -die() { - echo "$1" >&2 - exit 1 -} - -[ -n "$1" ] || die "Usage: $0 suite-name" -[ -n "$bindir" ] || die "Set bindir" -[ -n "$logdir" ] || die "Set logdir" -[ -n "$scriptdir" ] || die "Set scriptdir" -[ -n "$suites_srcdir" ] || die "Set suites_srcdir" -[ -n "$suites_builddir" ] || die "Set suites_builddir" - -json_process=$bindir/json_process - -suite_name=$1 -suite_srcdir=$suites_srcdir/$suite_name -suite_builddir=$suites_builddir/$suite_name -suite_log=$logdir/$suite_name - -[ -z "$VERBOSE" ] && VERBOSE=0 -[ -z "$STOP" ] && STOP=0 - -. $scriptdir/valgrind.sh - -rm -rf $suite_log -mkdir -p $suite_log - -for test_path in $suite_srcdir/*; do - test_name=$(basename $test_path) - test_builddir=$suite_builddir/$test_name - test_log=$suite_log/$test_name - - [ "$test_name" = "run" ] && continue - is_test || continue - - rm -rf $test_log - mkdir -p $test_log - if [ $VERBOSE -eq 1 ]; then - printf '%s... ' "$test_name" - fi - - run_test - case $? in - 0) - # Success - if [ $VERBOSE -eq 1 ]; then - printf 'ok\n' - else - printf '.' - fi - rm -rf $test_log - ;; - - 77) - # Skip - if [ $VERBOSE -eq 1 ]; then - printf 'skipped\n' - else - printf 'S' - fi - rm -rf $test_log - ;; - - *) - # Failure - if [ $VERBOSE -eq 1 ]; then - printf 'FAILED\n' - else - printf 'F' - fi - - [ $STOP -eq 1 ] && break - ;; - esac -done - -if [ $VERBOSE -eq 0 ]; then - printf '\n' -fi - -if [ -n "$(ls -A $suite_log)" ]; then - for test_log in $suite_log/*; do - test_name=$(basename $test_log) - test_path=$suite_srcdir/$test_name - echo "=================================================================" - echo "$suite_name/$test_name" - echo "=================================================================" - show_error - echo - done - echo "=================================================================" - exit 1 -else - rm -rf $suite_log -fi diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/scripts/valgrind.sh kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/scripts/valgrind.sh --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/scripts/valgrind.sh 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/scripts/valgrind.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -# Copyright (c) 2009-2014 Petri Lehtinen -# -# Jansson is free software; you can redistribute it and/or modify -# it under the terms of the MIT license. See LICENSE for details. - -[ -z "$VALGRIND" ] && VALGRIND=0 - -VALGRIND_CMDLINE="valgrind --leak-check=full --show-reachable=yes --track-origins=yes -q" - -if [ $VALGRIND -eq 1 ]; then - test_runner="$VALGRIND_CMDLINE" - json_process="$VALGRIND_CMDLINE $json_process" -else - test_runner="" -fi - -valgrind_check() { - if [ $VALGRIND -eq 1 ]; then - # Check for Valgrind error output. The valgrind option - # --error-exitcode is not enough because Valgrind doesn't - # think unfreed allocs are errors. - if grep -E -q '^==[0-9]+== ' $1; then - touch $test_log/valgrind_error - return 1 - fi - fi -} - -valgrind_show_error() { - if [ $VALGRIND -eq 1 -a -f $test_log/valgrind_error ]; then - echo "valgrind detected an error" - return 0 - fi - return 1 -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/check-exports kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/check-exports --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/check-exports 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/check-exports 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -#!/bin/sh -# -# This test checks that libjansson.so exports the correct symbols. -# - -SOFILE="../src/.libs/libjansson.so" - -# The list of symbols, which the shared object should export, is read -# from the def file, which is used in Windows builds -grep 'json_' $top_srcdir/src/jansson.def \ - | sed -e 's/ //g' \ - | sort \ - >$test_log/exports - -nm -D $SOFILE >/dev/null >$test_log/symbols 2>/dev/null \ - || exit 77 # Skip if "nm -D" doesn't seem to work - -grep ' [DT] ' $test_log/symbols | cut -d' ' -f3 | grep -v '^_' | sort >$test_log/output - -if ! cmp -s $test_log/exports $test_log/output; then - diff -u $test_log/exports $test_log/output >&2 - exit 1 -fi diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/Makefile.am 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -EXTRA_DIST = run check-exports - -check_PROGRAMS = \ - test_array \ - test_copy \ - test_dump \ - test_dump_callback \ - test_equal \ - test_load \ - test_loadb \ - test_load_callback \ - test_memory_funcs \ - test_number \ - test_object \ - test_pack \ - test_simple \ - test_unpack - -test_array_SOURCES = test_array.c util.h -test_copy_SOURCES = test_copy.c util.h -test_dump_SOURCES = test_dump.c util.h -test_dump_callback_SOURCES = test_dump_callback.c util.h -test_load_SOURCES = test_load.c util.h -test_loadb_SOURCES = test_loadb.c util.h -test_memory_funcs_SOURCES = test_memory_funcs.c util.h -test_number_SOURCES = test_number.c util.h -test_object_SOURCES = test_object.c util.h -test_pack_SOURCES = test_pack.c util.h -test_simple_SOURCES = test_simple.c util.h -test_unpack_SOURCES = test_unpack.c util.h - -AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src -LDFLAGS = -static # for speed and Valgrind -LDADD = $(top_builddir)/src/libjansson.la diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/run kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/run --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/run 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/run 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2009-2014 Petri Lehtinen -# -# Jansson is free software; you can redistribute it and/or modify -# it under the terms of the MIT license. See LICENSE for details. - -is_test() { - case "$test_name" in - *.c|check-exports) - return 0 - ;; - *) - return 1 - ;; - esac -} - -run_test() { - if [ "$test_name" = "check-exports" ]; then - test_log=$test_log $test_path >$test_log/stdout 2>$test_log/stderr - else - $test_runner $suite_builddir/${test_name%.c} \ - >$test_log/stdout \ - 2>$test_log/stderr \ - || return 1 - valgrind_check $test_log/stderr || return 1 - fi -} - -show_error() { - valgrind_show_error && return - cat $test_log/stderr -} - -. $top_srcdir/test/scripts/run-tests.sh diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_array.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_array.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_array.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_array.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,432 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include "util.h" - -static void test_misc(void) -{ - json_t *array, *five, *seven, *value; - size_t i; - - array = json_array(); - five = json_integer(5); - seven = json_integer(7); - - if(!array) - fail("unable to create array"); - if(!five || !seven) - fail("unable to create integer"); - - if(json_array_size(array) != 0) - fail("empty array has nonzero size"); - - if(!json_array_append(array, NULL)) - fail("able to append NULL"); - - if(json_array_append(array, five)) - fail("unable to append"); - - if(json_array_size(array) != 1) - fail("wrong array size"); - - value = json_array_get(array, 0); - if(!value) - fail("unable to get item"); - if(value != five) - fail("got wrong value"); - - if(json_array_append(array, seven)) - fail("unable to append value"); - - if(json_array_size(array) != 2) - fail("wrong array size"); - - value = json_array_get(array, 1); - if(!value) - fail("unable to get item"); - if(value != seven) - fail("got wrong value"); - - if(json_array_set(array, 0, seven)) - fail("unable to set value"); - - if(!json_array_set(array, 0, NULL)) - fail("able to set NULL"); - - if(json_array_size(array) != 2) - fail("wrong array size"); - - value = json_array_get(array, 0); - if(!value) - fail("unable to get item"); - if(value != seven) - fail("got wrong value"); - - if(json_array_get(array, 2) != NULL) - fail("able to get value out of bounds"); - - if(!json_array_set(array, 2, seven)) - fail("able to set value out of bounds"); - - for(i = 2; i < 30; i++) { - if(json_array_append(array, seven)) - fail("unable to append value"); - - if(json_array_size(array) != i + 1) - fail("wrong array size"); - } - - for(i = 0; i < 30; i++) { - value = json_array_get(array, i); - if(!value) - fail("unable to get item"); - if(value != seven) - fail("got wrong value"); - } - - if(json_array_set_new(array, 15, json_integer(123))) - fail("unable to set new value"); - - value = json_array_get(array, 15); - if(!json_is_integer(value) || json_integer_value(value) != 123) - fail("json_array_set_new works incorrectly"); - - if(!json_array_set_new(array, 15, NULL)) - fail("able to set_new NULL value"); - - if(json_array_append_new(array, json_integer(321))) - fail("unable to append new value"); - - value = json_array_get(array, json_array_size(array) - 1); - if(!json_is_integer(value) || json_integer_value(value) != 321) - fail("json_array_append_new works incorrectly"); - - if(!json_array_append_new(array, NULL)) - fail("able to append_new NULL value"); - - json_decref(five); - json_decref(seven); - json_decref(array); -} - -static void test_insert(void) -{ - json_t *array, *five, *seven, *eleven, *value; - int i; - - array = json_array(); - five = json_integer(5); - seven = json_integer(7); - eleven = json_integer(11); - - if(!array) - fail("unable to create array"); - if(!five || !seven || !eleven) - fail("unable to create integer"); - - - if(!json_array_insert(array, 1, five)) - fail("able to insert value out of bounds"); - - - if(json_array_insert(array, 0, five)) - fail("unable to insert value in an empty array"); - - if(json_array_get(array, 0) != five) - fail("json_array_insert works incorrectly"); - - if(json_array_size(array) != 1) - fail("array size is invalid after insertion"); - - - if(json_array_insert(array, 1, seven)) - fail("unable to insert value at the end of an array"); - - if(json_array_get(array, 0) != five) - fail("json_array_insert works incorrectly"); - - if(json_array_get(array, 1) != seven) - fail("json_array_insert works incorrectly"); - - if(json_array_size(array) != 2) - fail("array size is invalid after insertion"); - - - if(json_array_insert(array, 1, eleven)) - fail("unable to insert value in the middle of an array"); - - if(json_array_get(array, 0) != five) - fail("json_array_insert works incorrectly"); - - if(json_array_get(array, 1) != eleven) - fail("json_array_insert works incorrectly"); - - if(json_array_get(array, 2) != seven) - fail("json_array_insert works incorrectly"); - - if(json_array_size(array) != 3) - fail("array size is invalid after insertion"); - - - if(json_array_insert_new(array, 2, json_integer(123))) - fail("unable to insert value in the middle of an array"); - - value = json_array_get(array, 2); - if(!json_is_integer(value) || json_integer_value(value) != 123) - fail("json_array_insert_new works incorrectly"); - - if(json_array_size(array) != 4) - fail("array size is invalid after insertion"); - - - for(i = 0; i < 20; i++) { - if(json_array_insert(array, 0, seven)) - fail("unable to insert value at the begining of an array"); - } - - for(i = 0; i < 20; i++) { - if(json_array_get(array, i) != seven) - fail("json_aray_insert works incorrectly"); - } - - if(json_array_size(array) != 24) - fail("array size is invalid after loop insertion"); - - json_decref(five); - json_decref(seven); - json_decref(eleven); - json_decref(array); -} - -static void test_remove(void) -{ - json_t *array, *five, *seven; - int i; - - array = json_array(); - five = json_integer(5); - seven = json_integer(7); - - if(!array) - fail("unable to create array"); - if(!five) - fail("unable to create integer"); - if(!seven) - fail("unable to create integer"); - - - if(!json_array_remove(array, 0)) - fail("able to remove an unexisting index"); - - - if(json_array_append(array, five)) - fail("unable to append"); - - if(!json_array_remove(array, 1)) - fail("able to remove an unexisting index"); - - if(json_array_remove(array, 0)) - fail("unable to remove"); - - if(json_array_size(array) != 0) - fail("array size is invalid after removing"); - - - if(json_array_append(array, five) || - json_array_append(array, seven) || - json_array_append(array, five) || - json_array_append(array, seven)) - fail("unable to append"); - - if(json_array_remove(array, 2)) - fail("unable to remove"); - - if(json_array_size(array) != 3) - fail("array size is invalid after removing"); - - if(json_array_get(array, 0) != five || - json_array_get(array, 1) != seven || - json_array_get(array, 2) != seven) - fail("remove works incorrectly"); - - json_decref(array); - - array = json_array(); - for(i = 0; i < 4; i++) { - json_array_append(array, five); - json_array_append(array, seven); - } - if(json_array_size(array) != 8) - fail("unable to append 8 items to array"); - - /* Remove an element from a "full" array. */ - json_array_remove(array, 5); - - json_decref(five); - json_decref(seven); - json_decref(array); -} - -static void test_clear(void) -{ - json_t *array, *five, *seven; - int i; - - array = json_array(); - five = json_integer(5); - seven = json_integer(7); - - if(!array) - fail("unable to create array"); - if(!five || !seven) - fail("unable to create integer"); - - for(i = 0; i < 10; i++) { - if(json_array_append(array, five)) - fail("unable to append"); - } - for(i = 0; i < 10; i++) { - if(json_array_append(array, seven)) - fail("unable to append"); - } - - if(json_array_size(array) != 20) - fail("array size is invalid after appending"); - - if(json_array_clear(array)) - fail("unable to clear"); - - if(json_array_size(array) != 0) - fail("array size is invalid after clearing"); - - json_decref(five); - json_decref(seven); - json_decref(array); -} - -static void test_extend(void) -{ - json_t *array1, *array2, *five, *seven; - int i; - - array1 = json_array(); - array2 = json_array(); - five = json_integer(5); - seven = json_integer(7); - - if(!array1 || !array2) - fail("unable to create array"); - if(!five || !seven) - fail("unable to create integer"); - - for(i = 0; i < 10; i++) { - if(json_array_append(array1, five)) - fail("unable to append"); - } - for(i = 0; i < 10; i++) { - if(json_array_append(array2, seven)) - fail("unable to append"); - } - - if(json_array_size(array1) != 10 || json_array_size(array2) != 10) - fail("array size is invalid after appending"); - - if(json_array_extend(array1, array2)) - fail("unable to extend"); - - for(i = 0; i < 10; i++) { - if(json_array_get(array1, i) != five) - fail("invalid array contents after extending"); - } - for(i = 10; i < 20; i++) { - if(json_array_get(array1, i) != seven) - fail("invalid array contents after extending"); - } - - json_decref(five); - json_decref(seven); - json_decref(array1); - json_decref(array2); -} - -static void test_circular() -{ - json_t *array1, *array2; - - /* the simple cases are checked */ - - array1 = json_array(); - if(!array1) - fail("unable to create array"); - - if(json_array_append(array1, array1) == 0) - fail("able to append self"); - - if(json_array_insert(array1, 0, array1) == 0) - fail("able to insert self"); - - if(json_array_append_new(array1, json_true())) - fail("failed to append true"); - - if(json_array_set(array1, 0, array1) == 0) - fail("able to set self"); - - json_decref(array1); - - - /* create circular references */ - - array1 = json_array(); - array2 = json_array(); - if(!array1 || !array2) - fail("unable to create array"); - - if(json_array_append(array1, array2) || - json_array_append(array2, array1)) - fail("unable to append"); - - /* circularity is detected when dumping */ - if(json_dumps(array1, 0) != NULL) - fail("able to dump circulars"); - - /* decref twice to deal with the circular references */ - json_decref(array1); - json_decref(array2); - json_decref(array1); -} - -static void test_array_foreach() -{ - size_t index; - json_t *array1, *array2, *value; - - array1 = json_pack("[sisisi]", "foo", 1, "bar", 2, "baz", 3); - array2 = json_array(); - - json_array_foreach(array1, index, value) { - json_array_append(array2, value); - } - - if(!json_equal(array1, array2)) - fail("json_array_foreach failed to iterate all elements"); - - json_decref(array1); - json_decref(array2); -} - - -static void run_tests() -{ - test_misc(); - test_insert(); - test_remove(); - test_clear(); - test_extend(); - test_circular(); - test_array_foreach(); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_copy.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_copy.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_copy.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_copy.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,318 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include "util.h" - -static void test_copy_simple(void) -{ - json_t *value, *copy; - - if(json_copy(NULL)) - fail("copying NULL doesn't return NULL"); - - /* true */ - value = json_true(); - copy = json_copy(value); - if(value != copy) - fail("copying true failed"); - json_decref(value); - json_decref(copy); - - /* false */ - value = json_false(); - copy = json_copy(value); - if(value != copy) - fail("copying false failed"); - json_decref(value); - json_decref(copy); - - /* null */ - value = json_null(); - copy = json_copy(value); - if(value != copy) - fail("copying null failed"); - json_decref(value); - json_decref(copy); - - /* string */ - value = json_string("foo"); - if(!value) - fail("unable to create a string"); - copy = json_copy(value); - if(!copy) - fail("unable to copy a string"); - if(copy == value) - fail("copying a string doesn't copy"); - if(!json_equal(copy, value)) - fail("copying a string produces an inequal copy"); - if(value->refcount != 1 || copy->refcount != 1) - fail("invalid refcounts"); - json_decref(value); - json_decref(copy); - - /* integer */ - value = json_integer(543); - if(!value) - fail("unable to create an integer"); - copy = json_copy(value); - if(!copy) - fail("unable to copy an integer"); - if(copy == value) - fail("copying an integer doesn't copy"); - if(!json_equal(copy, value)) - fail("copying an integer produces an inequal copy"); - if(value->refcount != 1 || copy->refcount != 1) - fail("invalid refcounts"); - json_decref(value); - json_decref(copy); - - /* real */ - value = json_real(123e9); - if(!value) - fail("unable to create a real"); - copy = json_copy(value); - if(!copy) - fail("unable to copy a real"); - if(copy == value) - fail("copying a real doesn't copy"); - if(!json_equal(copy, value)) - fail("copying a real produces an inequal copy"); - if(value->refcount != 1 || copy->refcount != 1) - fail("invalid refcounts"); - json_decref(value); - json_decref(copy); -} - -static void test_deep_copy_simple(void) -{ - json_t *value, *copy; - - if(json_deep_copy(NULL)) - fail("deep copying NULL doesn't return NULL"); - - /* true */ - value = json_true(); - copy = json_deep_copy(value); - if(value != copy) - fail("deep copying true failed"); - json_decref(value); - json_decref(copy); - - /* false */ - value = json_false(); - copy = json_deep_copy(value); - if(value != copy) - fail("deep copying false failed"); - json_decref(value); - json_decref(copy); - - /* null */ - value = json_null(); - copy = json_deep_copy(value); - if(value != copy) - fail("deep copying null failed"); - json_decref(value); - json_decref(copy); - - /* string */ - value = json_string("foo"); - if(!value) - fail("unable to create a string"); - copy = json_deep_copy(value); - if(!copy) - fail("unable to deep copy a string"); - if(copy == value) - fail("deep copying a string doesn't copy"); - if(!json_equal(copy, value)) - fail("deep copying a string produces an inequal copy"); - if(value->refcount != 1 || copy->refcount != 1) - fail("invalid refcounts"); - json_decref(value); - json_decref(copy); - - /* integer */ - value = json_integer(543); - if(!value) - fail("unable to create an integer"); - copy = json_deep_copy(value); - if(!copy) - fail("unable to deep copy an integer"); - if(copy == value) - fail("deep copying an integer doesn't copy"); - if(!json_equal(copy, value)) - fail("deep copying an integer produces an inequal copy"); - if(value->refcount != 1 || copy->refcount != 1) - fail("invalid refcounts"); - json_decref(value); - json_decref(copy); - - /* real */ - value = json_real(123e9); - if(!value) - fail("unable to create a real"); - copy = json_deep_copy(value); - if(!copy) - fail("unable to deep copy a real"); - if(copy == value) - fail("deep copying a real doesn't copy"); - if(!json_equal(copy, value)) - fail("deep copying a real produces an inequal copy"); - if(value->refcount != 1 || copy->refcount != 1) - fail("invalid refcounts"); - json_decref(value); - json_decref(copy); -} - -static void test_copy_array(void) -{ - const char *json_array_text = "[1, \"foo\", 3.141592, {\"foo\": \"bar\"}]"; - - json_t *array, *copy; - size_t i; - - array = json_loads(json_array_text, 0, NULL); - if(!array) - fail("unable to parse an array"); - - copy = json_copy(array); - if(!copy) - fail("unable to copy an array"); - if(copy == array) - fail("copying an array doesn't copy"); - if(!json_equal(copy, array)) - fail("copying an array produces an inequal copy"); - - for(i = 0; i < json_array_size(copy); i++) - { - if(json_array_get(array, i) != json_array_get(copy, i)) - fail("copying an array modifies its elements"); - } - - json_decref(array); - json_decref(copy); -} - -static void test_deep_copy_array(void) -{ - const char *json_array_text = "[1, \"foo\", 3.141592, {\"foo\": \"bar\"}]"; - - json_t *array, *copy; - size_t i; - - array = json_loads(json_array_text, 0, NULL); - if(!array) - fail("unable to parse an array"); - - copy = json_deep_copy(array); - if(!copy) - fail("unable to deep copy an array"); - if(copy == array) - fail("deep copying an array doesn't copy"); - if(!json_equal(copy, array)) - fail("deep copying an array produces an inequal copy"); - - for(i = 0; i < json_array_size(copy); i++) - { - if(json_array_get(array, i) == json_array_get(copy, i)) - fail("deep copying an array doesn't copy its elements"); - } - - json_decref(array); - json_decref(copy); -} - -static void test_copy_object(void) -{ - const char *json_object_text = - "{\"foo\": \"bar\", \"a\": 1, \"b\": 3.141592, \"c\": [1,2,3,4]}"; - - json_t *object, *copy; - void *iter; - - object = json_loads(json_object_text, 0, NULL); - if(!object) - fail("unable to parse an object"); - - copy = json_copy(object); - if(!copy) - fail("unable to copy an object"); - if(copy == object) - fail("copying an object doesn't copy"); - if(!json_equal(copy, object)) - fail("copying an object produces an inequal copy"); - - iter = json_object_iter(object); - while(iter) - { - const char *key; - json_t *value1, *value2; - - key = json_object_iter_key(iter); - value1 = json_object_iter_value(iter); - value2 = json_object_get(copy, key); - - if(value1 != value2) - fail("deep copying an object modifies its items"); - - iter = json_object_iter_next(object, iter); - } - - json_decref(object); - json_decref(copy); -} - -static void test_deep_copy_object(void) -{ - const char *json_object_text = - "{\"foo\": \"bar\", \"a\": 1, \"b\": 3.141592, \"c\": [1,2,3,4]}"; - - json_t *object, *copy; - void *iter; - - object = json_loads(json_object_text, 0, NULL); - if(!object) - fail("unable to parse an object"); - - copy = json_deep_copy(object); - if(!copy) - fail("unable to deep copy an object"); - if(copy == object) - fail("deep copying an object doesn't copy"); - if(!json_equal(copy, object)) - fail("deep copying an object produces an inequal copy"); - - iter = json_object_iter(object); - while(iter) - { - const char *key; - json_t *value1, *value2; - - key = json_object_iter_key(iter); - value1 = json_object_iter_value(iter); - value2 = json_object_get(copy, key); - - if(value1 == value2) - fail("deep copying an object doesn't copy its items"); - - iter = json_object_iter_next(object, iter); - } - - json_decref(object); - json_decref(copy); -} - -static void run_tests() -{ - test_copy_simple(); - test_deep_copy_simple(); - test_copy_array(); - test_deep_copy_array(); - test_copy_object(); - test_deep_copy_object(); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_dump.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_dump.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_dump.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_dump.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include "util.h" - -static int encode_null_callback(const char *buffer, size_t size, void *data) -{ - (void)buffer; - (void)size; - (void)data; - return 0; -} - -static void encode_null() -{ - if(json_dumps(NULL, JSON_ENCODE_ANY) != NULL) - fail("json_dumps didn't fail for NULL"); - - if(json_dumpf(NULL, stderr, JSON_ENCODE_ANY) != -1) - fail("json_dumpf didn't fail for NULL"); - - /* Don't test json_dump_file to avoid creating a file */ - - if(json_dump_callback(NULL, encode_null_callback, NULL, JSON_ENCODE_ANY) != -1) - fail("json_dump_callback didn't fail for NULL"); -} - - -static void encode_twice() -{ - /* Encode an empty object/array, add an item, encode again */ - - json_t *json; - char *result; - - json = json_object(); - result = json_dumps(json, 0); - if(!result || strcmp(result, "{}")) - fail("json_dumps failed"); - free(result); - - json_object_set_new(json, "foo", json_integer(5)); - result = json_dumps(json, 0); - if(!result || strcmp(result, "{\"foo\": 5}")) - fail("json_dumps failed"); - free(result); - - json_decref(json); - - json = json_array(); - result = json_dumps(json, 0); - if(!result || strcmp(result, "[]")) - fail("json_dumps failed"); - free(result); - - json_array_append_new(json, json_integer(5)); - result = json_dumps(json, 0); - if(!result || strcmp(result, "[5]")) - fail("json_dumps failed"); - free(result); - - json_decref(json); -} - -static void circular_references() -{ - /* Construct a JSON object/array with a circular reference: - - object: {"a": {"b": {"c": }}} - array: [[[]]] - - Encode it, remove the circular reference and encode again. - */ - - json_t *json; - char *result; - - json = json_object(); - json_object_set_new(json, "a", json_object()); - json_object_set_new(json_object_get(json, "a"), "b", json_object()); - json_object_set(json_object_get(json_object_get(json, "a"), "b"), "c", - json_object_get(json, "a")); - - if(json_dumps(json, 0)) - fail("json_dumps encoded a circular reference!"); - - json_object_del(json_object_get(json_object_get(json, "a"), "b"), "c"); - - result = json_dumps(json, 0); - if(!result || strcmp(result, "{\"a\": {\"b\": {}}}")) - fail("json_dumps failed!"); - free(result); - - json_decref(json); - - json = json_array(); - json_array_append_new(json, json_array()); - json_array_append_new(json_array_get(json, 0), json_array()); - json_array_append(json_array_get(json_array_get(json, 0), 0), - json_array_get(json, 0)); - - if(json_dumps(json, 0)) - fail("json_dumps encoded a circular reference!"); - - json_array_remove(json_array_get(json_array_get(json, 0), 0), 0); - - result = json_dumps(json, 0); - if(!result || strcmp(result, "[[[]]]")) - fail("json_dumps failed!"); - free(result); - - json_decref(json); -} - -static void encode_other_than_array_or_object() -{ - /* Encoding anything other than array or object should only - * succeed if the JSON_ENCODE_ANY flag is used */ - - json_t *json; - FILE *fp = NULL; - char *result; - - json = json_string("foo"); - if(json_dumps(json, 0) != NULL) - fail("json_dumps encoded a string!"); - if(json_dumpf(json, fp, 0) == 0) - fail("json_dumpf encoded a string!"); - - result = json_dumps(json, JSON_ENCODE_ANY); - if(!result || strcmp(result, "\"foo\"") != 0) - fail("json_dumps failed to encode a string with JSON_ENCODE_ANY"); - - free(result); - json_decref(json); - - json = json_integer(42); - if(json_dumps(json, 0) != NULL) - fail("json_dumps encoded an integer!"); - if(json_dumpf(json, fp, 0) == 0) - fail("json_dumpf encoded an integer!"); - - result = json_dumps(json, JSON_ENCODE_ANY); - if(!result || strcmp(result, "42") != 0) - fail("json_dumps failed to encode an integer with JSON_ENCODE_ANY"); - - free(result); - json_decref(json); - - -} - -static void escape_slashes() -{ - /* Test dump escaping slashes */ - - json_t *json; - char *result; - - json = json_object(); - json_object_set_new(json, "url", json_string("https://github.com/akheron/jansson")); - - result = json_dumps(json, 0); - if(!result || strcmp(result, "{\"url\": \"https://github.com/akheron/jansson\"}")) - fail("json_dumps failed to not escape slashes"); - - free(result); - - result = json_dumps(json, JSON_ESCAPE_SLASH); - if(!result || strcmp(result, "{\"url\": \"https:\\/\\/github.com\\/akheron\\/jansson\"}")) - fail("json_dumps failed to escape slashes"); - - free(result); - json_decref(json); -} - -static void encode_nul_byte() -{ - json_t *json; - char *result; - - json = json_stringn("nul byte \0 in string", 20); - result = json_dumps(json, JSON_ENCODE_ANY); - if(!result || memcmp(result, "\"nul byte \\u0000 in string\"", 27)) - fail("json_dumps failed to dump an embedded NUL byte"); - - free(result); - json_decref(json); -} - -static void run_tests() -{ - encode_null(); - encode_twice(); - circular_references(); - encode_other_than_array_or_object(); - escape_slashes(); - encode_nul_byte(); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_dump_callback.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_dump_callback.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_dump_callback.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_dump_callback.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include -#include "util.h" - -struct my_sink { - char *buf; - size_t off; - size_t cap; -}; - -static int my_writer(const char *buffer, size_t len, void *data) { - struct my_sink *s = data; - if (len > s->cap - s->off) { - return -1; - } - memcpy(s->buf + s->off, buffer, len); - s->off += len; - return 0; -} - -static void run_tests() -{ - struct my_sink s; - json_t *json; - const char str[] = "[\"A\", {\"B\": \"C\", \"e\": false}, 1, null, \"foo\"]"; - char *dumped_to_string; - - json = json_loads(str, 0, NULL); - if(!json) { - fail("json_loads failed"); - } - - dumped_to_string = json_dumps(json, 0); - if (!dumped_to_string) { - json_decref(json); - fail("json_dumps failed"); - } - - s.off = 0; - s.cap = strlen(dumped_to_string); - s.buf = malloc(s.cap); - if (!s.buf) { - json_decref(json); - free(dumped_to_string); - fail("malloc failed"); - } - - if (json_dump_callback(json, my_writer, &s, 0) == -1) { - json_decref(json); - free(dumped_to_string); - free(s.buf); - fail("json_dump_callback failed on an exact-length sink buffer"); - } - - if (strncmp(dumped_to_string, s.buf, s.off) != 0) { - json_decref(json); - free(dumped_to_string); - free(s.buf); - fail("json_dump_callback and json_dumps did not produce identical output"); - } - - s.off = 1; - if (json_dump_callback(json, my_writer, &s, 0) != -1) { - json_decref(json); - free(dumped_to_string); - free(s.buf); - fail("json_dump_callback succeeded on a short buffer when it should have failed"); - } - - json_decref(json); - free(dumped_to_string); - free(s.buf); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_equal.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_equal.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_equal.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_equal.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,189 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include "util.h" - -static void test_equal_simple() -{ - json_t *value1, *value2; - - if(json_equal(NULL, NULL)) - fail("json_equal fails for two NULLs"); - - value1 = json_true(); - if(json_equal(value1, NULL) || json_equal(NULL, value1)) - fail("json_equal fails for NULL"); - - /* this covers true, false and null as they are singletons */ - if(!json_equal(value1, value1)) - fail("identical objects are not equal"); - json_decref(value1); - - /* integer */ - value1 = json_integer(1); - value2 = json_integer(1); - if(!value1 || !value2) - fail("unable to create integers"); - if(!json_equal(value1, value2)) - fail("json_equal fails for two equal integers"); - json_decref(value2); - - value2 = json_integer(2); - if(!value2) - fail("unable to create an integer"); - if(json_equal(value1, value2)) - fail("json_equal fails for two inequal integers"); - - json_decref(value1); - json_decref(value2); - - /* real */ - value1 = json_real(1.2); - value2 = json_real(1.2); - if(!value1 || !value2) - fail("unable to create reals"); - if(!json_equal(value1, value2)) - fail("json_equal fails for two equal reals"); - json_decref(value2); - - value2 = json_real(3.141592); - if(!value2) - fail("unable to create an real"); - if(json_equal(value1, value2)) - fail("json_equal fails for two inequal reals"); - - json_decref(value1); - json_decref(value2); - - /* string */ - value1 = json_string("foo"); - value2 = json_string("foo"); - if(!value1 || !value2) - fail("unable to create strings"); - if(!json_equal(value1, value2)) - fail("json_equal fails for two equal strings"); - json_decref(value2); - - value2 = json_string("bar"); - if(!value2) - fail("unable to create an string"); - if(json_equal(value1, value2)) - fail("json_equal fails for two inequal strings"); - - json_decref(value1); - json_decref(value2); -} - -static void test_equal_array() -{ - json_t *array1, *array2; - - array1 = json_array(); - array2 = json_array(); - if(!array1 || !array2) - fail("unable to create arrays"); - - if(!json_equal(array1, array2)) - fail("json_equal fails for two empty arrays"); - - json_array_append_new(array1, json_integer(1)); - json_array_append_new(array2, json_integer(1)); - json_array_append_new(array1, json_string("foo")); - json_array_append_new(array2, json_string("foo")); - json_array_append_new(array1, json_integer(2)); - json_array_append_new(array2, json_integer(2)); - if(!json_equal(array1, array2)) - fail("json_equal fails for two equal arrays"); - - json_array_remove(array2, 2); - if(json_equal(array1, array2)) - fail("json_equal fails for two inequal arrays"); - - json_array_append_new(array2, json_integer(3)); - if(json_equal(array1, array2)) - fail("json_equal fails for two inequal arrays"); - - json_decref(array1); - json_decref(array2); -} - -static void test_equal_object() -{ - json_t *object1, *object2; - - object1 = json_object(); - object2 = json_object(); - if(!object1 || !object2) - fail("unable to create objects"); - - if(!json_equal(object1, object2)) - fail("json_equal fails for two empty objects"); - - json_object_set_new(object1, "a", json_integer(1)); - json_object_set_new(object2, "a", json_integer(1)); - json_object_set_new(object1, "b", json_string("foo")); - json_object_set_new(object2, "b", json_string("foo")); - json_object_set_new(object1, "c", json_integer(2)); - json_object_set_new(object2, "c", json_integer(2)); - if(!json_equal(object1, object2)) - fail("json_equal fails for two equal objects"); - - json_object_del(object2, "c"); - if(json_equal(object1, object2)) - fail("json_equal fails for two inequal objects"); - - json_object_set_new(object2, "c", json_integer(3)); - if(json_equal(object1, object2)) - fail("json_equal fails for two inequal objects"); - - json_object_del(object2, "c"); - json_object_set_new(object2, "d", json_integer(2)); - if(json_equal(object1, object2)) - fail("json_equal fails for two inequal objects"); - - json_decref(object1); - json_decref(object2); -} - -static void test_equal_complex() -{ - json_t *value1, *value2; - - const char *complex_json = -"{" -" \"integer\": 1, " -" \"real\": 3.141592, " -" \"string\": \"foobar\", " -" \"true\": true, " -" \"object\": {" -" \"array-in-object\": [1,true,\"foo\",{}]," -" \"object-in-object\": {\"foo\": \"bar\"}" -" }," -" \"array\": [\"foo\", false, null, 1.234]" -"}"; - - value1 = json_loads(complex_json, 0, NULL); - value2 = json_loads(complex_json, 0, NULL); - if(!value1 || !value2) - fail("unable to parse JSON"); - if(!json_equal(value1, value2)) - fail("json_equal fails for two inequal strings"); - - json_decref(value1); - json_decref(value2); - - /* TODO: There's no negative test case here */ -} - -static void run_tests() -{ - test_equal_simple(); - test_equal_array(); - test_equal_object(); - test_equal_complex(); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_loadb.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_loadb.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_loadb.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_loadb.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include "util.h" - -static void run_tests() -{ - json_t *json; - json_error_t error; - const char str[] = "[\"A\", {\"B\": \"C\"}, 1, 2, 3]garbage"; - size_t len = strlen(str) - strlen("garbage"); - - json = json_loadb(str, len, 0, &error); - if(!json) { - fail("json_loadb failed on a valid JSON buffer"); - } - json_decref(json); - - json = json_loadb(str, len - 1, 0, &error); - if (json) { - json_decref(json); - fail("json_loadb should have failed on an incomplete buffer, but it didn't"); - } - if(error.line != 1) { - fail("json_loadb returned an invalid line number on fail"); - } - if(strcmp(error.text, "']' expected near end of file") != 0) { - fail("json_loadb returned an invalid error message for an unclosed top-level array"); - } -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_load.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_load.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_load.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_load.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include "util.h" - -static void file_not_found() -{ - json_t *json; - json_error_t error; - char *pos; - - json = json_load_file("/path/to/nonexistent/file.json", 0, &error); - if(json) - fail("json_load_file returned non-NULL for a nonexistent file"); - if(error.line != -1) - fail("json_load_file returned an invalid line number"); - - /* The error message is locale specific, only check the beginning - of the error message. */ - - pos = strchr(error.text, ':'); - if(!pos) - fail("json_load_file returne an invalid error message"); - - *pos = '\0'; - - if(strcmp(error.text, "unable to open /path/to/nonexistent/file.json") != 0) - fail("json_load_file returned an invalid error message"); -} - -static void reject_duplicates() -{ - json_error_t error; - - if(json_loads("{\"foo\": 1, \"foo\": 2}", JSON_REJECT_DUPLICATES, &error)) - fail("json_loads did not detect a duplicate key"); - check_error("duplicate object key near '\"foo\"'", "", 1, 16, 16); -} - -static void disable_eof_check() -{ - json_error_t error; - json_t *json; - - const char *text = "{\"foo\": 1} garbage"; - - if(json_loads(text, 0, &error)) - fail("json_loads did not detect garbage after JSON text"); - check_error("end of file expected near 'garbage'", "", 1, 18, 18); - - json = json_loads(text, JSON_DISABLE_EOF_CHECK, &error); - if(!json) - fail("json_loads failed with JSON_DISABLE_EOF_CHECK"); - - json_decref(json); -} - -static void decode_any() -{ - json_t *json; - json_error_t error; - - json = json_loads("\"foo\"", JSON_DECODE_ANY, &error); - if (!json || !json_is_string(json)) - fail("json_load decoded any failed - string"); - json_decref(json); - - json = json_loads("42", JSON_DECODE_ANY, &error); - if (!json || !json_is_integer(json)) - fail("json_load decoded any failed - integer"); - json_decref(json); - - json = json_loads("true", JSON_DECODE_ANY, &error); - if (!json || !json_is_true(json)) - fail("json_load decoded any failed - boolean"); - json_decref(json); - - json = json_loads("null", JSON_DECODE_ANY, &error); - if (!json || !json_is_null(json)) - fail("json_load decoded any failed - null"); - json_decref(json); -} - -static void decode_int_as_real() -{ - json_t *json; - json_error_t error; - -#if JSON_INTEGER_IS_LONG_LONG - const char *imprecise; - json_int_t expected; -#endif - - json = json_loads("42", JSON_DECODE_INT_AS_REAL | JSON_DECODE_ANY, &error); - if (!json || !json_is_real(json) || json_real_value(json) != 42.0) - fail("json_load decode int as real failed - int"); - json_decref(json); - -#if JSON_INTEGER_IS_LONG_LONG - /* This number cannot be represented exactly by a double */ - imprecise = "9007199254740993"; - expected = 9007199254740992ll; - - json = json_loads(imprecise, JSON_DECODE_INT_AS_REAL | JSON_DECODE_ANY, - &error); - if (!json || !json_is_real(json) || expected != (json_int_t)json_real_value(json)) - fail("json_load decode int as real failed - expected imprecision"); - json_decref(json); -#endif -} - -static void allow_nul() -{ - const char *text = "\"nul byte \\u0000 in string\""; - const char *expected = "nul byte \0 in string"; - size_t len = 20; - json_t *json; - - json = json_loads(text, JSON_ALLOW_NUL | JSON_DECODE_ANY, NULL); - if(!json || !json_is_string(json)) - fail("unable to decode embedded NUL byte"); - - if(json_string_length(json) != len) - fail("decoder returned wrong string length"); - - if(memcmp(json_string_value(json), expected, len + 1)) - fail("decoder returned wrong string content"); - - json_decref(json); -} - -static void load_wrong_args() -{ - json_t *json; - json_error_t error; - - json = json_loads(NULL, 0, &error); - if (json) - fail("json_loads should return NULL if the first argument is NULL"); - - json = json_loadb(NULL, 0, 0, &error); - if (json) - fail("json_loadb should return NULL if the first argument is NULL"); - - json = json_loadf(NULL, 0, &error); - if (json) - fail("json_loadf should return NULL if the first argument is NULL"); - - json = json_load_file(NULL, 0, &error); - if (json) - fail("json_loadf should return NULL if the first argument is NULL"); -} - -static void position() -{ - json_t *json; - size_t flags = JSON_DISABLE_EOF_CHECK; - json_error_t error; - - json = json_loads("{\"foo\": \"bar\"}", 0, &error); - if(error.position != 14) - fail("json_loads returned a wrong position"); - json_decref(json); - - json = json_loads("{\"foo\": \"bar\"} baz quux", flags, &error); - if(error.position != 14) - fail("json_loads returned a wrong position"); - json_decref(json); -} - -static void run_tests() -{ - file_not_found(); - reject_duplicates(); - disable_eof_check(); - decode_any(); - decode_int_as_real(); - allow_nul(); - load_wrong_args(); - position(); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_load_callback.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_load_callback.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_load_callback.c 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_load_callback.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2009-2011 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include -#include "util.h" - -struct my_source { - const char *buf; - size_t off; - size_t cap; -}; - -static const char my_str[] = "[\"A\", {\"B\": \"C\", \"e\": false}, 1, null, \"foo\"]"; - -static size_t greedy_reader(void *buf, size_t buflen, void *arg) -{ - struct my_source *s = arg; - if (buflen > s->cap - s->off) - buflen = s->cap - s->off; - if (buflen > 0) { - memcpy(buf, s->buf + s->off, buflen); - s->off += buflen; - return buflen; - } else { - return 0; - } -} - -static void run_tests() -{ - struct my_source s; - json_t *json; - json_error_t error; - - s.off = 0; - s.cap = strlen(my_str); - s.buf = my_str; - - json = json_load_callback(greedy_reader, &s, 0, &error); - - if (!json) - fail("json_load_callback failed on a valid callback"); - json_decref(json); - - s.off = 0; - s.cap = strlen(my_str) - 1; - s.buf = my_str; - - json = json_load_callback(greedy_reader, &s, 0, &error); - if (json) { - json_decref(json); - fail("json_load_callback should have failed on an incomplete stream, but it didn't"); - } - if (strcmp(error.source, "") != 0) { - fail("json_load_callback returned an invalid error source"); - } - if (strcmp(error.text, "']' expected near end of file") != 0) { - fail("json_load_callback returned an invalid error message for an unclosed top-level array"); - } - - json = json_load_callback(NULL, NULL, 0, &error); - if (json) { - json_decref(json); - fail("json_load_callback should have failed on NULL load callback, but it didn't"); - } - if (strcmp(error.text, "wrong arguments") != 0) { - fail("json_load_callback returned an invalid error message for a NULL load callback"); - } -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_memory_funcs.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_memory_funcs.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_memory_funcs.c 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_memory_funcs.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,82 +0,0 @@ -#include -#include - -#include "util.h" - -static int malloc_called = 0; -static int free_called = 0; - -/* helper */ -static void create_and_free_complex_object() -{ - json_t *obj; - - obj = json_pack("{s:i,s:n,s:b,s:b,s:{s:s},s:[i,i,i]", - "foo", 42, - "bar", - "baz", 1, - "qux", 0, - "alice", "bar", "baz", - "bob", 9, 8, 7); - - json_decref(obj); -} - -static void *my_malloc(size_t size) -{ - malloc_called = 1; - return malloc(size); -} - -static void my_free(void *ptr) -{ - free_called = 1; - free(ptr); -} - -static void test_simple() -{ - json_set_alloc_funcs(my_malloc, my_free); - create_and_free_complex_object(); - - if(malloc_called != 1 || free_called != 1) - fail("Custom allocation failed"); -} - - -/* - Test the secure memory functions code given in the API reference - documentation, but by using plain memset instead of - guaranteed_memset(). -*/ - -static void *secure_malloc(size_t size) -{ - /* Store the memory area size in the beginning of the block */ - void *ptr = malloc(size + 8); - *((size_t *)ptr) = size; - return (char *)ptr + 8; -} - -static void secure_free(void *ptr) -{ - size_t size; - - ptr = (char *)ptr - 8; - size = *((size_t *)ptr); - - /*guaranteed_*/memset(ptr, 0, size + 8); - free(ptr); -} - -static void test_secure_funcs(void) -{ - json_set_alloc_funcs(secure_malloc, secure_free); - create_and_free_complex_object(); -} - -static void run_tests() -{ - test_simple(); - test_secure_funcs(); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_number.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_number.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_number.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_number.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include "util.h" - -static void run_tests() -{ - json_t *integer, *real; - json_int_t i; - double d; - - integer = json_integer(5); - real = json_real(100.1); - - if(!integer) - fail("unable to create integer"); - if(!real) - fail("unable to create real"); - - i = json_integer_value(integer); - if(i != 5) - fail("wrong integer value"); - - d = json_real_value(real); - if(d != 100.1) - fail("wrong real value"); - - d = json_number_value(integer); - if(d != 5.0) - fail("wrong number value"); - d = json_number_value(real); - if(d != 100.1) - fail("wrong number value"); - - json_decref(integer); - json_decref(real); - -#ifdef NAN - real = json_real(NAN); - if(real != NULL) - fail("could construct a real from NaN"); - - real = json_real(1.0); - if(json_real_set(real, NAN) != -1) - fail("could set a real to NaN"); - - if(json_real_value(real) != 1.0) - fail("real value changed unexpectedly"); - - json_decref(real); -#endif - -#ifdef INFINITY - real = json_real(INFINITY); - if(real != NULL) - fail("could construct a real from Inf"); - - real = json_real(1.0); - if(json_real_set(real, INFINITY) != -1) - fail("could set a real to Inf"); - - if(json_real_value(real) != 1.0) - fail("real value changed unexpectedly"); - - json_decref(real); -#endif -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_object.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_object.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_object.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_object.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,527 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include "util.h" - -static void test_clear() -{ - json_t *object, *ten; - - object = json_object(); - ten = json_integer(10); - - if(!object) - fail("unable to create object"); - if(!ten) - fail("unable to create integer"); - - if(json_object_set(object, "a", ten) || - json_object_set(object, "b", ten) || - json_object_set(object, "c", ten) || - json_object_set(object, "d", ten) || - json_object_set(object, "e", ten)) - fail("unable to set value"); - - if(json_object_size(object) != 5) - fail("invalid size"); - - json_object_clear(object); - - if(json_object_size(object) != 0) - fail("invalid size after clear"); - - json_decref(ten); - json_decref(object); -} - -static void test_update() -{ - json_t *object, *other, *nine, *ten; - - object = json_object(); - other = json_object(); - - nine = json_integer(9); - ten = json_integer(10); - - if(!object || !other) - fail("unable to create object"); - if(!nine || !ten) - fail("unable to create integer"); - - - /* update an empty object with an empty object */ - - if(json_object_update(object, other)) - fail("unable to update an emtpy object with an empty object"); - - if(json_object_size(object) != 0) - fail("invalid size after update"); - - if(json_object_size(other) != 0) - fail("invalid size for updater after update"); - - - /* update an empty object with a nonempty object */ - - if(json_object_set(other, "a", ten) || - json_object_set(other, "b", ten) || - json_object_set(other, "c", ten) || - json_object_set(other, "d", ten) || - json_object_set(other, "e", ten)) - fail("unable to set value"); - - if(json_object_update(object, other)) - fail("unable to update an empty object"); - - if(json_object_size(object) != 5) - fail("invalid size after update"); - - if(json_object_get(object, "a") != ten || - json_object_get(object, "b") != ten || - json_object_get(object, "c") != ten || - json_object_get(object, "d") != ten || - json_object_get(object, "e") != ten) - fail("update works incorrectly"); - - - /* perform the same update again */ - - if(json_object_update(object, other)) - fail("unable to update a non-empty object"); - - if(json_object_size(object) != 5) - fail("invalid size after update"); - - if(json_object_get(object, "a") != ten || - json_object_get(object, "b") != ten || - json_object_get(object, "c") != ten || - json_object_get(object, "d") != ten || - json_object_get(object, "e") != ten) - fail("update works incorrectly"); - - - /* update a nonempty object with a nonempty object with both old - and new keys */ - - if(json_object_clear(other)) - fail("clear failed"); - - if(json_object_set(other, "a", nine) || - json_object_set(other, "b", nine) || - json_object_set(other, "f", nine) || - json_object_set(other, "g", nine) || - json_object_set(other, "h", nine)) - fail("unable to set value"); - - if(json_object_update(object, other)) - fail("unable to update a nonempty object"); - - if(json_object_size(object) != 8) - fail("invalid size after update"); - - if(json_object_get(object, "a") != nine || - json_object_get(object, "b") != nine || - json_object_get(object, "f") != nine || - json_object_get(object, "g") != nine || - json_object_get(object, "h") != nine) - fail("update works incorrectly"); - - json_decref(nine); - json_decref(ten); - json_decref(other); - json_decref(object); -} - -static void test_conditional_updates() -{ - json_t *object, *other; - - object = json_pack("{sisi}", "foo", 1, "bar", 2); - other = json_pack("{sisi}", "foo", 3, "baz", 4); - - if(json_object_update_existing(object, other)) - fail("json_object_update_existing failed"); - - if(json_object_size(object) != 2) - fail("json_object_update_existing added new items"); - - if(json_integer_value(json_object_get(object, "foo")) != 3) - fail("json_object_update_existing failed to update existing key"); - - if(json_integer_value(json_object_get(object, "bar")) != 2) - fail("json_object_update_existing updated wrong key"); - - json_decref(object); - - object = json_pack("{sisi}", "foo", 1, "bar", 2); - - if(json_object_update_missing(object, other)) - fail("json_object_update_missing failed"); - - if(json_object_size(object) != 3) - fail("json_object_update_missing didn't add new items"); - - if(json_integer_value(json_object_get(object, "foo")) != 1) - fail("json_object_update_missing updated existing key"); - - if(json_integer_value(json_object_get(object, "bar")) != 2) - fail("json_object_update_missing updated wrong key"); - - if(json_integer_value(json_object_get(object, "baz")) != 4) - fail("json_object_update_missing didn't add new items"); - - json_decref(object); - json_decref(other); -} - -static void test_circular() -{ - json_t *object1, *object2; - - object1 = json_object(); - object2 = json_object(); - if(!object1 || !object2) - fail("unable to create object"); - - /* the simple case is checked */ - if(json_object_set(object1, "a", object1) == 0) - fail("able to set self"); - - /* create circular references */ - if(json_object_set(object1, "a", object2) || - json_object_set(object2, "a", object1)) - fail("unable to set value"); - - /* circularity is detected when dumping */ - if(json_dumps(object1, 0) != NULL) - fail("able to dump circulars"); - - /* decref twice to deal with the circular references */ - json_decref(object1); - json_decref(object2); - json_decref(object1); -} - -static void test_set_nocheck() -{ - json_t *object, *string; - - object = json_object(); - string = json_string("bar"); - - if(!object) - fail("unable to create object"); - if(!string) - fail("unable to create string"); - - if(json_object_set_nocheck(object, "foo", string)) - fail("json_object_set_nocheck failed"); - if(json_object_get(object, "foo") != string) - fail("json_object_get after json_object_set_nocheck failed"); - - /* invalid UTF-8 in key */ - if(json_object_set_nocheck(object, "a\xefz", string)) - fail("json_object_set_nocheck failed for invalid UTF-8"); - if(json_object_get(object, "a\xefz") != string) - fail("json_object_get after json_object_set_nocheck failed"); - - if(json_object_set_new_nocheck(object, "bax", json_integer(123))) - fail("json_object_set_new_nocheck failed"); - if(json_integer_value(json_object_get(object, "bax")) != 123) - fail("json_object_get after json_object_set_new_nocheck failed"); - - /* invalid UTF-8 in key */ - if(json_object_set_new_nocheck(object, "asdf\xfe", json_integer(321))) - fail("json_object_set_new_nocheck failed for invalid UTF-8"); - if(json_integer_value(json_object_get(object, "asdf\xfe")) != 321) - fail("json_object_get after json_object_set_new_nocheck failed"); - - json_decref(string); - json_decref(object); -} - -static void test_iterators() -{ - int i; - json_t *object, *foo, *bar, *baz; - const char *iter_keys[3]; - int have_key[3] = { 0, 0, 0 }; - json_t *iter_values[3]; - void *iter; - - if(json_object_iter(NULL)) - fail("able to iterate over NULL"); - - if(json_object_iter_next(NULL, NULL)) - fail("able to increment an iterator on a NULL object"); - - object = json_object(); - foo = json_string("foo"); - bar = json_string("bar"); - baz = json_string("baz"); - if(!object || !foo || !bar || !bar) - fail("unable to create values"); - - if(json_object_iter_next(object, NULL)) - fail("able to increment a NULL iterator"); - - if(json_object_set(object, "a", foo) || - json_object_set(object, "b", bar) || - json_object_set(object, "c", baz)) - fail("unable to populate object"); - - iter = json_object_iter(object); - if(!iter) - fail("unable to get iterator"); - iter_keys[0] = json_object_iter_key(iter); - iter_values[0] = json_object_iter_value(iter); - - iter = json_object_iter_next(object, iter); - if(!iter) - fail("unable to increment iterator"); - iter_keys[1] = json_object_iter_key(iter); - iter_values[1] = json_object_iter_value(iter); - - iter = json_object_iter_next(object, iter); - if(!iter) - fail("unable to increment iterator"); - iter_keys[2] = json_object_iter_key(iter); - iter_values[2] = json_object_iter_value(iter); - - if(json_object_iter_next(object, iter) != NULL) - fail("able to iterate over the end"); - - /* Check that keys have correct values */ - for (i = 0; i < 3; i++) { - if (strcmp(iter_keys[i], "a") == 0) { - if (iter_values[i] != foo) - fail("wrong value for iter key a"); - else - have_key[0] = 1; - } else if (strcmp(iter_keys[i], "b") == 0) { - if (iter_values[i] != bar) - fail("wrong value for iter key b"); - else - have_key[1] = 1; - } else if (strcmp(iter_keys[i], "c") == 0) { - if (iter_values[i] != baz) - fail("wrong value for iter key c"); - else - have_key[2] = 1; - } - } - - /* Check that we got all keys */ - for(i = 0; i < 3; i++) { - if(!have_key[i]) - fail("a key wasn't iterated over"); - } - - if(json_object_iter_at(object, "foo")) - fail("json_object_iter_at() succeeds for non-existent key"); - - iter = json_object_iter_at(object, "b"); - if(!iter) - fail("json_object_iter_at() fails for an existing key"); - - if(strcmp(json_object_iter_key(iter), "b")) - fail("iterating failed: wrong key"); - if(json_object_iter_value(iter) != bar) - fail("iterating failed: wrong value"); - - if(json_object_iter_set(object, iter, baz)) - fail("unable to set value at iterator"); - - if(strcmp(json_object_iter_key(iter), "b")) - fail("json_object_iter_key() fails after json_object_iter_set()"); - if(json_object_iter_value(iter) != baz) - fail("json_object_iter_value() fails after json_object_iter_set()"); - if(json_object_get(object, "b") != baz) - fail("json_object_get() fails after json_object_iter_set()"); - - json_decref(object); - json_decref(foo); - json_decref(bar); - json_decref(baz); -} - -static void test_misc() -{ - json_t *object, *string, *other_string, *value; - - object = json_object(); - string = json_string("test"); - other_string = json_string("other"); - - if(!object) - fail("unable to create object"); - if(!string || !other_string) - fail("unable to create string"); - - if(json_object_get(object, "a")) - fail("value for nonexisting key"); - - if(json_object_set(object, "a", string)) - fail("unable to set value"); - - if(!json_object_set(object, NULL, string)) - fail("able to set NULL key"); - - if(!json_object_set(object, "a", NULL)) - fail("able to set NULL value"); - - /* invalid UTF-8 in key */ - if(!json_object_set(object, "a\xefz", string)) - fail("able to set invalid unicode key"); - - value = json_object_get(object, "a"); - if(!value) - fail("no value for existing key"); - if(value != string) - fail("got different value than what was added"); - - /* "a", "lp" and "px" collide in a five-bucket hashtable */ - if(json_object_set(object, "b", string) || - json_object_set(object, "lp", string) || - json_object_set(object, "px", string)) - fail("unable to set value"); - - value = json_object_get(object, "a"); - if(!value) - fail("no value for existing key"); - if(value != string) - fail("got different value than what was added"); - - if(json_object_set(object, "a", other_string)) - fail("unable to replace an existing key"); - - value = json_object_get(object, "a"); - if(!value) - fail("no value for existing key"); - if(value != other_string) - fail("got different value than what was set"); - - if(!json_object_del(object, "nonexisting")) - fail("able to delete a nonexisting key"); - - if(json_object_del(object, "px")) - fail("unable to delete an existing key"); - - if(json_object_del(object, "a")) - fail("unable to delete an existing key"); - - if(json_object_del(object, "lp")) - fail("unable to delete an existing key"); - - - /* add many keys to initiate rehashing */ - - if(json_object_set(object, "a", string)) - fail("unable to set value"); - - if(json_object_set(object, "lp", string)) - fail("unable to set value"); - - if(json_object_set(object, "px", string)) - fail("unable to set value"); - - if(json_object_set(object, "c", string)) - fail("unable to set value"); - - if(json_object_set(object, "d", string)) - fail("unable to set value"); - - if(json_object_set(object, "e", string)) - fail("unable to set value"); - - - if(json_object_set_new(object, "foo", json_integer(123))) - fail("unable to set new value"); - - value = json_object_get(object, "foo"); - if(!json_is_integer(value) || json_integer_value(value) != 123) - fail("json_object_set_new works incorrectly"); - - if(!json_object_set_new(object, NULL, json_integer(432))) - fail("able to set_new NULL key"); - - if(!json_object_set_new(object, "foo", NULL)) - fail("able to set_new NULL value"); - - json_decref(string); - json_decref(other_string); - json_decref(object); -} - -static void test_preserve_order() -{ - json_t *object; - char *result; - - const char *expected = "{\"foobar\": 1, \"bazquux\": 6, \"lorem ipsum\": 3, \"sit amet\": 5, \"helicopter\": 7}"; - - object = json_object(); - - json_object_set_new(object, "foobar", json_integer(1)); - json_object_set_new(object, "bazquux", json_integer(2)); - json_object_set_new(object, "lorem ipsum", json_integer(3)); - json_object_set_new(object, "dolor", json_integer(4)); - json_object_set_new(object, "sit amet", json_integer(5)); - - /* changing a value should preserve the order */ - json_object_set_new(object, "bazquux", json_integer(6)); - - /* deletion shouldn't change the order of others */ - json_object_del(object, "dolor"); - - /* add a new item just to make sure */ - json_object_set_new(object, "helicopter", json_integer(7)); - - result = json_dumps(object, JSON_PRESERVE_ORDER); - - if(strcmp(expected, result) != 0) { - fprintf(stderr, "%s != %s", expected, result); - fail("JSON_PRESERVE_ORDER doesn't work"); - } - - free(result); - json_decref(object); -} - -static void test_object_foreach() -{ - const char *key; - json_t *object1, *object2, *value; - - object1 = json_pack("{sisisi}", "foo", 1, "bar", 2, "baz", 3); - object2 = json_object(); - - json_object_foreach(object1, key, value) - json_object_set(object2, key, value); - - if(!json_equal(object1, object2)) - fail("json_object_foreach failed to iterate all key-value pairs"); - - json_decref(object1); - json_decref(object2); -} - -static void run_tests() -{ - test_misc(); - test_clear(); - test_update(); - test_conditional_updates(); - test_circular(); - test_set_nocheck(); - test_iterators(); - test_preserve_order(); - test_object_foreach(); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_pack.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_pack.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_pack.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_pack.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,307 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * Copyright (c) 2010-2012 Graeme Smecher - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include -#include -#include -#include "util.h" - -static void run_tests() -{ - json_t *value; - int i; - char buffer[4] = {'t', 'e', 's', 't'}; - json_error_t error; - - /* - * Simple, valid json_pack cases - */ - /* true */ - value = json_pack("b", 1); - if(!json_is_true(value)) - fail("json_pack boolean failed"); - if(value->refcount != (size_t)-1) - fail("json_pack boolean refcount failed"); - json_decref(value); - - /* false */ - value = json_pack("b", 0); - if(!json_is_false(value)) - fail("json_pack boolean failed"); - if(value->refcount != (size_t)-1) - fail("json_pack boolean refcount failed"); - json_decref(value); - - /* null */ - value = json_pack("n"); - if(!json_is_null(value)) - fail("json_pack null failed"); - if(value->refcount != (size_t)-1) - fail("json_pack null refcount failed"); - json_decref(value); - - /* integer */ - value = json_pack("i", 1); - if(!json_is_integer(value) || json_integer_value(value) != 1) - fail("json_pack integer failed"); - if(value->refcount != (size_t)1) - fail("json_pack integer refcount failed"); - json_decref(value); - - /* integer from json_int_t */ - value = json_pack("I", (json_int_t)555555); - if(!json_is_integer(value) || json_integer_value(value) != 555555) - fail("json_pack json_int_t failed"); - if(value->refcount != (size_t)1) - fail("json_pack integer refcount failed"); - json_decref(value); - - /* real */ - value = json_pack("f", 1.0); - if(!json_is_real(value) || json_real_value(value) != 1.0) - fail("json_pack real failed"); - if(value->refcount != (size_t)1) - fail("json_pack real refcount failed"); - json_decref(value); - - /* string */ - value = json_pack("s", "test"); - if(!json_is_string(value) || strcmp("test", json_string_value(value))) - fail("json_pack string failed"); - if(value->refcount != (size_t)1) - fail("json_pack string refcount failed"); - json_decref(value); - - /* string and length (int) */ - value = json_pack("s#", "test asdf", 4); - if(!json_is_string(value) || strcmp("test", json_string_value(value))) - fail("json_pack string and length failed"); - if(value->refcount != (size_t)1) - fail("json_pack string and length refcount failed"); - json_decref(value); - - /* string and length (size_t) */ - value = json_pack("s%", "test asdf", (size_t)4); - if(!json_is_string(value) || strcmp("test", json_string_value(value))) - fail("json_pack string and length failed"); - if(value->refcount != (size_t)1) - fail("json_pack string and length refcount failed"); - json_decref(value); - - /* string and length (int), non-NUL terminated string */ - value = json_pack("s#", buffer, 4); - if(!json_is_string(value) || strcmp("test", json_string_value(value))) - fail("json_pack string and length (int) failed"); - if(value->refcount != (size_t)1) - fail("json_pack string and length (int) refcount failed"); - json_decref(value); - - /* string and length (size_t), non-NUL terminated string */ - value = json_pack("s%", buffer, (size_t)4); - if(!json_is_string(value) || strcmp("test", json_string_value(value))) - fail("json_pack string and length (size_t) failed"); - if(value->refcount != (size_t)1) - fail("json_pack string and length (size_t) refcount failed"); - json_decref(value); - - /* string concatenation */ - value = json_pack("s++", "te", "st", "ing"); - if(!json_is_string(value) || strcmp("testing", json_string_value(value))) - fail("json_pack string concatenation failed"); - if(value->refcount != (size_t)1) - fail("json_pack string concatenation refcount failed"); - json_decref(value); - - /* string concatenation and length (int) */ - value = json_pack("s#+#+", "test", 1, "test", 2, "test"); - if(!json_is_string(value) || strcmp("ttetest", json_string_value(value))) - fail("json_pack string concatenation and length (int) failed"); - if(value->refcount != (size_t)1) - fail("json_pack string concatenation and length (int) refcount failed"); - json_decref(value); - - /* string concatenation and length (size_t) */ - value = json_pack("s%+%+", "test", (size_t)1, "test", (size_t)2, "test"); - if(!json_is_string(value) || strcmp("ttetest", json_string_value(value))) - fail("json_pack string concatenation and length (size_t) failed"); - if(value->refcount != (size_t)1) - fail("json_pack string concatenation and length (size_t) refcount failed"); - json_decref(value); - - /* empty object */ - value = json_pack("{}", 1.0); - if(!json_is_object(value) || json_object_size(value) != 0) - fail("json_pack empty object failed"); - if(value->refcount != (size_t)1) - fail("json_pack empty object refcount failed"); - json_decref(value); - - /* empty list */ - value = json_pack("[]", 1.0); - if(!json_is_array(value) || json_array_size(value) != 0) - fail("json_pack empty list failed"); - if(value->refcount != (size_t)1) - fail("json_pack empty list failed"); - json_decref(value); - - /* non-incref'd object */ - value = json_pack("o", json_integer(1)); - if(!json_is_integer(value) || json_integer_value(value) != 1) - fail("json_pack object failed"); - if(value->refcount != (size_t)1) - fail("json_pack integer refcount failed"); - json_decref(value); - - /* incref'd object */ - value = json_pack("O", json_integer(1)); - if(!json_is_integer(value) || json_integer_value(value) != 1) - fail("json_pack object failed"); - if(value->refcount != (size_t)2) - fail("json_pack integer refcount failed"); - json_decref(value); - json_decref(value); - - /* simple object */ - value = json_pack("{s:[]}", "foo"); - if(!json_is_object(value) || json_object_size(value) != 1) - fail("json_pack array failed"); - if(!json_is_array(json_object_get(value, "foo"))) - fail("json_pack array failed"); - if(json_object_get(value, "foo")->refcount != (size_t)1) - fail("json_pack object refcount failed"); - json_decref(value); - - /* object with complex key */ - value = json_pack("{s+#+: []}", "foo", "barbar", 3, "baz"); - if(!json_is_object(value) || json_object_size(value) != 1) - fail("json_pack array failed"); - if(!json_is_array(json_object_get(value, "foobarbaz"))) - fail("json_pack array failed"); - if(json_object_get(value, "foobarbaz")->refcount != (size_t)1) - fail("json_pack object refcount failed"); - json_decref(value); - - /* simple array */ - value = json_pack("[i,i,i]", 0, 1, 2); - if(!json_is_array(value) || json_array_size(value) != 3) - fail("json_pack object failed"); - for(i=0; i<3; i++) - { - if(!json_is_integer(json_array_get(value, i)) || - json_integer_value(json_array_get(value, i)) != i) - - fail("json_pack integer array failed"); - } - json_decref(value); - - /* Whitespace; regular string */ - value = json_pack(" s ", "test"); - if(!json_is_string(value) || strcmp("test", json_string_value(value))) - fail("json_pack string (with whitespace) failed"); - json_decref(value); - - /* Whitespace; empty array */ - value = json_pack("[ ]"); - if(!json_is_array(value) || json_array_size(value) != 0) - fail("json_pack empty array (with whitespace) failed"); - json_decref(value); - - /* Whitespace; array */ - value = json_pack("[ i , i, i ] ", 1, 2, 3); - if(!json_is_array(value) || json_array_size(value) != 3) - fail("json_pack array (with whitespace) failed"); - json_decref(value); - - /* - * Invalid cases - */ - - /* newline in format string */ - if(json_pack_ex(&error, 0, "{\n\n1")) - fail("json_pack failed to catch invalid format '1'"); - check_error("Expected format 's', got '1'", "", 3, 1, 4); - - /* mismatched open/close array/object */ - if(json_pack_ex(&error, 0, "[}")) - fail("json_pack failed to catch mismatched '}'"); - check_error("Unexpected format character '}'", "", 1, 2, 2); - - if(json_pack_ex(&error, 0, "{]")) - fail("json_pack failed to catch mismatched ']'"); - check_error("Expected format 's', got ']'", "", 1, 2, 2); - - /* missing close array */ - if(json_pack_ex(&error, 0, "[")) - fail("json_pack failed to catch missing ']'"); - check_error("Unexpected end of format string", "", 1, 2, 2); - - /* missing close object */ - if(json_pack_ex(&error, 0, "{")) - fail("json_pack failed to catch missing '}'"); - check_error("Unexpected end of format string", "", 1, 2, 2); - - /* garbage after format string */ - if(json_pack_ex(&error, 0, "[i]a", 42)) - fail("json_pack failed to catch garbage after format string"); - check_error("Garbage after format string", "", 1, 4, 4); - - if(json_pack_ex(&error, 0, "ia", 42)) - fail("json_pack failed to catch garbage after format string"); - check_error("Garbage after format string", "", 1, 2, 2); - - /* NULL string */ - if(json_pack_ex(&error, 0, "s", NULL)) - fail("json_pack failed to catch null argument string"); - check_error("NULL string argument", "", 1, 1, 1); - - /* + on its own */ - if(json_pack_ex(&error, 0, "+", NULL)) - fail("json_pack failed to a lone +"); - check_error("Unexpected format character '+'", "", 1, 1, 1); - - /* NULL format */ - if(json_pack_ex(&error, 0, NULL)) - fail("json_pack failed to catch NULL format string"); - check_error("NULL or empty format string", "", -1, -1, 0); - - /* NULL key */ - if(json_pack_ex(&error, 0, "{s:i}", NULL, 1)) - fail("json_pack failed to catch NULL key"); - check_error("NULL string argument", "", 1, 2, 2); - - /* More complicated checks for row/columns */ - if(json_pack_ex(&error, 0, "{ {}: s }", "foo")) - fail("json_pack failed to catch object as key"); - check_error("Expected format 's', got '{'", "", 1, 3, 3); - - /* Complex object */ - if(json_pack_ex(&error, 0, "{ s: {}, s:[ii{} }", "foo", "bar", 12, 13)) - fail("json_pack failed to catch missing ]"); - check_error("Unexpected format character '}'", "", 1, 19, 19); - - /* Complex array */ - if(json_pack_ex(&error, 0, "[[[[[ [[[[[ [[[[ }]]]] ]]]] ]]]]]")) - fail("json_pack failed to catch extra }"); - check_error("Unexpected format character '}'", "", 1, 21, 21); - - /* Invalid UTF-8 in object key */ - if(json_pack_ex(&error, 0, "{s:i}", "\xff\xff", 42)) - fail("json_pack failed to catch invalid UTF-8 in an object key"); - check_error("Invalid UTF-8 object key", "", 1, 2, 2); - - /* Invalid UTF-8 in a string */ - if(json_pack_ex(&error, 0, "{s:s}", "foo", "\xff\xff")) - fail("json_pack failed to catch invalid UTF-8 in a string"); - check_error("Invalid UTF-8 string", "", 1, 4, 4); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_simple.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_simple.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_simple.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_simple.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,227 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include "util.h" - -/* Call the simple functions not covered by other tests of the public API */ -static void run_tests() -{ - json_t *value; - - value = json_boolean(1); - if(!json_is_true(value)) - fail("json_boolean(1) failed"); - json_decref(value); - - value = json_boolean(-123); - if(!json_is_true(value)) - fail("json_boolean(-123) failed"); - json_decref(value); - - value = json_boolean(0); - if(!json_is_false(value)) - fail("json_boolean(0) failed"); - if(json_boolean_value(value) != 0) - fail("json_boolean_value failed"); - json_decref(value); - - - value = json_integer(1); - if(json_typeof(value) != JSON_INTEGER) - fail("json_typeof failed"); - - if(json_is_object(value)) - fail("json_is_object failed"); - - if(json_is_array(value)) - fail("json_is_array failed"); - - if(json_is_string(value)) - fail("json_is_string failed"); - - if(!json_is_integer(value)) - fail("json_is_integer failed"); - - if(json_is_real(value)) - fail("json_is_real failed"); - - if(!json_is_number(value)) - fail("json_is_number failed"); - - if(json_is_true(value)) - fail("json_is_true failed"); - - if(json_is_false(value)) - fail("json_is_false failed"); - - if(json_is_boolean(value)) - fail("json_is_boolean failed"); - - if(json_is_null(value)) - fail("json_is_null failed"); - - json_decref(value); - - - value = json_string("foo"); - if(!value) - fail("json_string failed"); - if(strcmp(json_string_value(value), "foo")) - fail("invalid string value"); - if (json_string_length(value) != 3) - fail("invalid string length"); - - if(json_string_set(value, "barr")) - fail("json_string_set failed"); - if(strcmp(json_string_value(value), "barr")) - fail("invalid string value"); - if (json_string_length(value) != 4) - fail("invalid string length"); - - if(json_string_setn(value, "hi\0ho", 5)) - fail("json_string_set failed"); - if(memcmp(json_string_value(value), "hi\0ho\0", 6)) - fail("invalid string value"); - if (json_string_length(value) != 5) - fail("invalid string length"); - - json_decref(value); - - value = json_string(NULL); - if(value) - fail("json_string(NULL) failed"); - - /* invalid UTF-8 */ - value = json_string("a\xefz"); - if(value) - fail("json_string() failed"); - - value = json_string_nocheck("foo"); - if(!value) - fail("json_string_nocheck failed"); - if(strcmp(json_string_value(value), "foo")) - fail("invalid string value"); - if (json_string_length(value) != 3) - fail("invalid string length"); - - if(json_string_set_nocheck(value, "barr")) - fail("json_string_set_nocheck failed"); - if(strcmp(json_string_value(value), "barr")) - fail("invalid string value"); - if (json_string_length(value) != 4) - fail("invalid string length"); - - if(json_string_setn_nocheck(value, "hi\0ho", 5)) - fail("json_string_set failed"); - if(memcmp(json_string_value(value), "hi\0ho\0", 6)) - fail("invalid string value"); - if (json_string_length(value) != 5) - fail("invalid string length"); - - json_decref(value); - - /* invalid UTF-8 */ - value = json_string_nocheck("qu\xff"); - if(!value) - fail("json_string_nocheck failed"); - if(strcmp(json_string_value(value), "qu\xff")) - fail("invalid string value"); - if (json_string_length(value) != 3) - fail("invalid string length"); - - if(json_string_set_nocheck(value, "\xfd\xfe\xff")) - fail("json_string_set_nocheck failed"); - if(strcmp(json_string_value(value), "\xfd\xfe\xff")) - fail("invalid string value"); - if (json_string_length(value) != 3) - fail("invalid string length"); - - json_decref(value); - - - value = json_integer(123); - if(!value) - fail("json_integer failed"); - if(json_integer_value(value) != 123) - fail("invalid integer value"); - if(json_number_value(value) != 123.0) - fail("invalid number value"); - - if(json_integer_set(value, 321)) - fail("json_integer_set failed"); - if(json_integer_value(value) != 321) - fail("invalid integer value"); - if(json_number_value(value) != 321.0) - fail("invalid number value"); - - json_decref(value); - - value = json_real(123.123); - if(!value) - fail("json_real failed"); - if(json_real_value(value) != 123.123) - fail("invalid integer value"); - if(json_number_value(value) != 123.123) - fail("invalid number value"); - - if(json_real_set(value, 321.321)) - fail("json_real_set failed"); - if(json_real_value(value) != 321.321) - fail("invalid real value"); - if(json_number_value(value) != 321.321) - fail("invalid number value"); - - json_decref(value); - - value = json_true(); - if(!value) - fail("json_true failed"); - json_decref(value); - - value = json_false(); - if(!value) - fail("json_false failed"); - json_decref(value); - - value = json_null(); - if(!value) - fail("json_null failed"); - json_decref(value); - - /* Test reference counting on singletons (true, false, null) */ - value = json_true(); - if(value->refcount != (size_t)-1) - fail("refcounting true works incorrectly"); - json_decref(value); - if(value->refcount != (size_t)-1) - fail("refcounting true works incorrectly"); - json_incref(value); - if(value->refcount != (size_t)-1) - fail("refcounting true works incorrectly"); - - value = json_false(); - if(value->refcount != (size_t)-1) - fail("refcounting false works incorrectly"); - json_decref(value); - if(value->refcount != (size_t)-1) - fail("refcounting false works incorrectly"); - json_incref(value); - if(value->refcount != (size_t)-1) - fail("refcounting false works incorrectly"); - - value = json_null(); - if(value->refcount != (size_t)-1) - fail("refcounting null works incorrectly"); - json_decref(value); - if(value->refcount != (size_t)-1) - fail("refcounting null works incorrectly"); - json_incref(value); - if(value->refcount != (size_t)-1) - fail("refcounting null works incorrectly"); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_unpack.c kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_unpack.c --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/test_unpack.c 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/test_unpack.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,400 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * Copyright (c) 2010-2012 Graeme Smecher - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#include -#include -#include -#include "util.h" - -static void run_tests() -{ - json_t *j, *j2; - int i1, i2, i3; - json_int_t I1; - int rv; - size_t z; - double f; - char *s; - - json_error_t error; - - /* - * Simple, valid json_pack cases - */ - - /* true */ - rv = json_unpack(json_true(), "b", &i1); - if(rv || !i1) - fail("json_unpack boolean failed"); - - /* false */ - rv = json_unpack(json_false(), "b", &i1); - if(rv || i1) - fail("json_unpack boolean failed"); - - /* null */ - if(json_unpack(json_null(), "n")) - fail("json_unpack null failed"); - - /* integer */ - j = json_integer(42); - rv = json_unpack(j, "i", &i1); - if(rv || i1 != 42) - fail("json_unpack integer failed"); - json_decref(j); - - /* json_int_t */ - j = json_integer(5555555); - rv = json_unpack(j, "I", &I1); - if(rv || I1 != 5555555) - fail("json_unpack json_int_t failed"); - json_decref(j); - - /* real */ - j = json_real(1.7); - rv = json_unpack(j, "f", &f); - if(rv || f != 1.7) - fail("json_unpack real failed"); - json_decref(j); - - /* number */ - j = json_integer(12345); - rv = json_unpack(j, "F", &f); - if(rv || f != 12345.0) - fail("json_unpack (real or) integer failed"); - json_decref(j); - - j = json_real(1.7); - rv = json_unpack(j, "F", &f); - if(rv || f != 1.7) - fail("json_unpack real (or integer) failed"); - json_decref(j); - - /* string */ - j = json_string("foo"); - rv = json_unpack(j, "s", &s); - if(rv || strcmp(s, "foo")) - fail("json_unpack string failed"); - json_decref(j); - - /* string with length (size_t) */ - j = json_string("foo"); - rv = json_unpack(j, "s%", &s, &z); - if(rv || strcmp(s, "foo") || z != 3) - fail("json_unpack string with length (size_t) failed"); - json_decref(j); - - /* empty object */ - j = json_object(); - if(json_unpack(j, "{}")) - fail("json_unpack empty object failed"); - json_decref(j); - - /* empty list */ - j = json_array(); - if(json_unpack(j, "[]")) - fail("json_unpack empty list failed"); - json_decref(j); - - /* non-incref'd object */ - j = json_object(); - rv = json_unpack(j, "o", &j2); - if(rv || j2 != j || j->refcount != 1) - fail("json_unpack object failed"); - json_decref(j); - - /* incref'd object */ - j = json_object(); - rv = json_unpack(j, "O", &j2); - if(rv || j2 != j || j->refcount != 2) - fail("json_unpack object failed"); - json_decref(j); - json_decref(j); - - /* simple object */ - j = json_pack("{s:i}", "foo", 42); - rv = json_unpack(j, "{s:i}", "foo", &i1); - if(rv || i1 != 42) - fail("json_unpack simple object failed"); - json_decref(j); - - /* simple array */ - j = json_pack("[iii]", 1, 2, 3); - rv = json_unpack(j, "[i,i,i]", &i1, &i2, &i3); - if(rv || i1 != 1 || i2 != 2 || i3 != 3) - fail("json_unpack simple array failed"); - json_decref(j); - - /* object with many items & strict checking */ - j = json_pack("{s:i, s:i, s:i}", "a", 1, "b", 2, "c", 3); - rv = json_unpack(j, "{s:i, s:i, s:i}", "a", &i1, "b", &i2, "c", &i3); - if(rv || i1 != 1 || i2 != 2 || i3 != 3) - fail("json_unpack object with many items failed"); - json_decref(j); - - /* - * Invalid cases - */ - - j = json_integer(42); - if(!json_unpack_ex(j, &error, 0, "z")) - fail("json_unpack succeeded with invalid format character"); - check_error("Unexpected format character 'z'", "", 1, 1, 1); - - if(!json_unpack_ex(NULL, &error, 0, "[i]")) - fail("json_unpack succeeded with NULL root"); - check_error("NULL root value", "", -1, -1, 0); - json_decref(j); - - /* mismatched open/close array/object */ - j = json_pack("[]"); - if(!json_unpack_ex(j, &error, 0, "[}")) - fail("json_unpack failed to catch mismatched ']'"); - check_error("Unexpected format character '}'", "", 1, 2, 2); - json_decref(j); - - j = json_pack("{}"); - if(!json_unpack_ex(j, &error, 0, "{]")) - fail("json_unpack failed to catch mismatched '}'"); - check_error("Expected format 's', got ']'", "", 1, 2, 2); - json_decref(j); - - /* missing close array */ - j = json_pack("[]"); - if(!json_unpack_ex(j, &error, 0, "[")) - fail("json_unpack failed to catch missing ']'"); - check_error("Unexpected end of format string", "", 1, 2, 2); - json_decref(j); - - /* missing close object */ - j = json_pack("{}"); - if(!json_unpack_ex(j, &error, 0, "{")) - fail("json_unpack failed to catch missing '}'"); - check_error("Unexpected end of format string", "", 1, 2, 2); - json_decref(j); - - /* garbage after format string */ - j = json_pack("[i]", 42); - if(!json_unpack_ex(j, &error, 0, "[i]a", &i1)) - fail("json_unpack failed to catch garbage after format string"); - check_error("Garbage after format string", "", 1, 4, 4); - json_decref(j); - - j = json_integer(12345); - if(!json_unpack_ex(j, &error, 0, "ia", &i1)) - fail("json_unpack failed to catch garbage after format string"); - check_error("Garbage after format string", "", 1, 2, 2); - json_decref(j); - - /* NULL format string */ - j = json_pack("[]"); - if(!json_unpack_ex(j, &error, 0, NULL)) - fail("json_unpack failed to catch null format string"); - check_error("NULL or empty format string", "", -1, -1, 0); - json_decref(j); - - /* NULL string pointer */ - j = json_string("foobie"); - if(!json_unpack_ex(j, &error, 0, "s", NULL)) - fail("json_unpack failed to catch null string pointer"); - check_error("NULL string argument", "", 1, 1, 1); - json_decref(j); - - /* invalid types */ - j = json_integer(42); - j2 = json_string("foo"); - if(!json_unpack_ex(j, &error, 0, "s")) - fail("json_unpack failed to catch invalid type"); - check_error("Expected string, got integer", "", 1, 1, 1); - - if(!json_unpack_ex(j, &error, 0, "n")) - fail("json_unpack failed to catch invalid type"); - check_error("Expected null, got integer", "", 1, 1, 1); - - if(!json_unpack_ex(j, &error, 0, "b")) - fail("json_unpack failed to catch invalid type"); - check_error("Expected true or false, got integer", "", 1, 1, 1); - - if(!json_unpack_ex(j2, &error, 0, "i")) - fail("json_unpack failed to catch invalid type"); - check_error("Expected integer, got string", "", 1, 1, 1); - - if(!json_unpack_ex(j2, &error, 0, "I")) - fail("json_unpack failed to catch invalid type"); - check_error("Expected integer, got string", "", 1, 1, 1); - - if(!json_unpack_ex(j, &error, 0, "f")) - fail("json_unpack failed to catch invalid type"); - check_error("Expected real, got integer", "", 1, 1, 1); - - if(!json_unpack_ex(j2, &error, 0, "F")) - fail("json_unpack failed to catch invalid type"); - check_error("Expected real or integer, got string", "", 1, 1, 1); - - if(!json_unpack_ex(j, &error, 0, "[i]")) - fail("json_unpack failed to catch invalid type"); - check_error("Expected array, got integer", "", 1, 1, 1); - - if(!json_unpack_ex(j, &error, 0, "{si}", "foo")) - fail("json_unpack failed to catch invalid type"); - check_error("Expected object, got integer", "", 1, 1, 1); - - json_decref(j); - json_decref(j2); - - /* Array index out of range */ - j = json_pack("[i]", 1); - if(!json_unpack_ex(j, &error, 0, "[ii]", &i1, &i2)) - fail("json_unpack failed to catch index out of array bounds"); - check_error("Array index 1 out of range", "", 1, 3, 3); - json_decref(j); - - /* NULL object key */ - j = json_pack("{si}", "foo", 42); - if(!json_unpack_ex(j, &error, 0, "{si}", NULL, &i1)) - fail("json_unpack failed to catch null string pointer"); - check_error("NULL object key", "", 1, 2, 2); - json_decref(j); - - /* Object key not found */ - j = json_pack("{si}", "foo", 42); - if(!json_unpack_ex(j, &error, 0, "{si}", "baz", &i1)) - fail("json_unpack failed to catch null string pointer"); - check_error("Object item not found: baz", "", 1, 3, 3); - json_decref(j); - - /* - * Strict validation - */ - - j = json_pack("[iii]", 1, 2, 3); - rv = json_unpack(j, "[iii!]", &i1, &i2, &i3); - if(rv || i1 != 1 || i2 != 2 || i3 != 3) - fail("json_unpack array with strict validation failed"); - json_decref(j); - - j = json_pack("[iii]", 1, 2, 3); - if(!json_unpack_ex(j, &error, 0, "[ii!]", &i1, &i2)) - fail("json_unpack array with strict validation failed"); - check_error("1 array item(s) left unpacked", "", 1, 5, 5); - json_decref(j); - - /* Like above, but with JSON_STRICT instead of '!' format */ - j = json_pack("[iii]", 1, 2, 3); - if(!json_unpack_ex(j, &error, JSON_STRICT, "[ii]", &i1, &i2)) - fail("json_unpack array with strict validation failed"); - check_error("1 array item(s) left unpacked", "", 1, 4, 4); - json_decref(j); - - j = json_pack("{s:s, s:i}", "foo", "bar", "baz", 42); - rv = json_unpack(j, "{sssi!}", "foo", &s, "baz", &i1); - if(rv || strcmp(s, "bar") != 0 || i1 != 42) - fail("json_unpack object with strict validation failed"); - json_decref(j); - - /* Unpack the same item twice */ - j = json_pack("{s:s, s:i}", "foo", "bar", "baz", 42); - if(!json_unpack_ex(j, &error, 0, "{s:s,s:s!}", "foo", &s, "foo", &s)) - fail("json_unpack object with strict validation failed"); - check_error("1 object item(s) left unpacked", "", 1, 10, 10); - json_decref(j); - - j = json_pack("[i,{s:i,s:n},[i,i]]", 1, "foo", 2, "bar", 3, 4); - if(json_unpack_ex(j, NULL, JSON_STRICT | JSON_VALIDATE_ONLY, - "[i{sisn}[ii]]", "foo", "bar")) - fail("json_unpack complex value with strict validation failed"); - json_decref(j); - - /* ! and * must be last */ - j = json_pack("[ii]", 1, 2); - if(!json_unpack_ex(j, &error, 0, "[i!i]", &i1, &i2)) - fail("json_unpack failed to catch ! in the middle of an array"); - check_error("Expected ']' after '!', got 'i'", "", 1, 4, 4); - - if(!json_unpack_ex(j, &error, 0, "[i*i]", &i1, &i2)) - fail("json_unpack failed to catch * in the middle of an array"); - check_error("Expected ']' after '*', got 'i'", "", 1, 4, 4); - json_decref(j); - - j = json_pack("{sssi}", "foo", "bar", "baz", 42); - if(!json_unpack_ex(j, &error, 0, "{ss!si}", "foo", &s, "baz", &i1)) - fail("json_unpack failed to catch ! in the middle of an object"); - check_error("Expected '}' after '!', got 's'", "", 1, 5, 5); - - if(!json_unpack_ex(j, &error, 0, "{ss*si}", "foo", &s, "baz", &i1)) - fail("json_unpack failed to catch ! in the middle of an object"); - check_error("Expected '}' after '*', got 's'", "", 1, 5, 5); - json_decref(j); - - /* Error in nested object */ - j = json_pack("{s{snsn}}", "foo", "bar", "baz"); - if(!json_unpack_ex(j, &error, 0, "{s{sn!}}", "foo", "bar")) - fail("json_unpack nested object with strict validation failed"); - check_error("1 object item(s) left unpacked", "", 1, 7, 7); - json_decref(j); - - /* Error in nested array */ - j = json_pack("[[ii]]", 1, 2); - if(!json_unpack_ex(j, &error, 0, "[[i!]]", &i1)) - fail("json_unpack nested array with strict validation failed"); - check_error("1 array item(s) left unpacked", "", 1, 5, 5); - json_decref(j); - - /* Optional values */ - j = json_object(); - i1 = 0; - if(json_unpack(j, "{s?i}", "foo", &i1)) - fail("json_unpack failed for optional key"); - if(i1 != 0) - fail("json_unpack unpacked an optional key"); - json_decref(j); - - i1 = 0; - j = json_pack("{si}", "foo", 42); - if(json_unpack(j, "{s?i}", "foo", &i1)) - fail("json_unpack failed for an optional value"); - if(i1 != 42) - fail("json_unpack failed to unpack an optional value"); - json_decref(j); - - j = json_object(); - i1 = i2 = i3 = 0; - if(json_unpack(j, "{s?[ii]s?{s{si}}}", - "foo", &i1, &i2, - "bar", "baz", "quux", &i3)) - fail("json_unpack failed for complex optional values"); - if(i1 != 0 || i2 != 0 || i3 != 0) - fail("json_unpack unexpectedly unpacked something"); - json_decref(j); - - j = json_pack("{s{si}}", "foo", "bar", 42); - if(json_unpack(j, "{s?{s?i}}", "foo", "bar", &i1)) - fail("json_unpack failed for complex optional values"); - if(i1 != 42) - fail("json_unpack failed to unpack"); - json_decref(j); - - /* Combine ? and ! */ - j = json_pack("{si}", "foo", 42); - i1 = i2 = 0; - if(json_unpack(j, "{sis?i!}", "foo", &i1, "bar", &i2)) - fail("json_unpack failed for optional values with strict mode"); - if(i1 != 42) - fail("json_unpack failed to unpack"); - if(i2 != 0) - fail("json_unpack failed to unpack"); - json_decref(j); - - /* But don't compensate a missing key with an optional one. */ - j = json_pack("{sisi}", "foo", 42, "baz", 43); - i1 = i2 = i3 = 0; - if(!json_unpack_ex(j, &error, 0, "{sis?i!}", "foo", &i1, "bar", &i2)) - fail("json_unpack failed for optional values with strict mode and compensation"); - check_error("1 object item(s) left unpacked", "", 1, 8, 8); - json_decref(j); -} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/util.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/util.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/api/util.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/api/util.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2009-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - */ - -#ifndef UTIL_H -#define UTIL_H - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#if HAVE_LOCALE_H -#include -#endif - -#include - -#define failhdr fprintf(stderr, "%s:%d: ", __FILE__, __LINE__) - -#define fail(msg) \ - do { \ - failhdr; \ - fprintf(stderr, "%s\n", msg); \ - exit(1); \ - } while(0) - -/* Assumes json_error_t error */ -#define check_error(text_, source_, line_, column_, position_) \ - do { \ - if(strcmp(error.text, text_) != 0) { \ - failhdr; \ - fprintf(stderr, "text: \"%s\" != \"%s\"\n", error.text, text_); \ - exit(1); \ - } \ - if(strcmp(error.source, source_) != 0) { \ - failhdr; \ - \ - fprintf(stderr, "source: \"%s\" != \"%s\"\n", error.source, source_); \ - exit(1); \ - } \ - if(error.line != line_) { \ - failhdr; \ - fprintf(stderr, "line: %d != %d\n", error.line, line_); \ - exit(1); \ - } \ - if(error.column != column_) { \ - failhdr; \ - fprintf(stderr, "column: %d != %d\n", error.column, column_); \ - exit(1); \ - } \ - if(error.position != position_) { \ - failhdr; \ - fprintf(stderr, "position: %d != %d\n", error.position, position_); \ - exit(1); \ - } \ - } while(0) - - -static void run_tests(); - -int main() { -#ifdef HAVE_SETLOCALE - setlocale(LC_ALL, ""); -#endif - run_tests(); - return 0; -} - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1, 2] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/array/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/array/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/array/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/array/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1, 2] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -JSON_COMPACT=1 -export JSON_COMPACT diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1, 2] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-array/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1,2] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -JSON_COMPACT=1 -HASHSEED=1 -export JSON_COMPACT HASHSEED diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a": 1, "b": 2} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/compact-object/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a":1,"b":2} \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -JSON_ENSURE_ASCII=1 -export JSON_ENSURE_ASCII diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/input 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -[ - "foo", - "å ä ö", - "foo åä", - "åä foo", - "å foo ä", - "clef g: 𝄞" -] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/output 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/ensure-ascii/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["foo", "\u00E5 \u00E4 \u00F6", "foo \u00E5\u00E4", "\u00E5\u00E4 foo", "\u00E5 foo \u00E4", "clef g: \uD834\uDD1E"] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -JSON_INDENT=4 -export JSON_INDENT diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1, 2] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-array/output 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -[ - 1, - 2 -] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -JSON_INDENT=4 -JSON_COMPACT=1 -export JSON_INDENT JSON_COMPACT diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1, 2] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-array/output 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -[ - 1, - 2 -] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -JSON_INDENT=4 -JSON_COMPACT=1 -HASHSEED=1 -export JSON_INDENT JSON_COMPACT HASHSEED diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a": 1, "b": 2} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-compact-object/output 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -{ - "a":1, - "b":2 -} \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -JSON_INDENT=4 -HASHSEED=1 -export JSON_INDENT HASHSEED diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a": 1, "b": 2} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/indent-object/output 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -{ - "a": 1, - "b": 2 -} \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/object/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/object/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/object/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/object/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -HASHSEED=1 -export HASHSEED diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/object/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/object/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/object/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/object/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a": 1, "b": 2} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/object/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/object/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/object/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/object/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a": 1, "b": 2} \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -JSON_PRESERVE_ORDER=1 -export JSON_PRESERVE_ORDER diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"foo": 1, "bar": 2, "asdf": 3, "deadbeef": 4, "badc0ffee": 5, "qwerty": 6} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/preserve-order/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"foo": 1, "bar": 2, "asdf": 3, "deadbeef": 4, "badc0ffee": 5, "qwerty": 6} \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/env 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -JSON_REAL_PRECISION=4 -export JSON_REAL_PRECISION diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/input 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1.23456789, 1.0, 1.0000000000000002] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/output 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/real-precision/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1.235, 1.0, 1.0] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/run kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/run --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/run 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/run 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2009-2014 Petri Lehtinen -# -# Jansson is free software; you can redistribute it and/or modify -# it under the terms of the MIT license. See LICENSE for details. - -is_test() { - test -d $test_path -} - -run_test() { - ( - if [ -f $test_path/env ]; then - . $test_path/env - fi - $json_process --env <$test_path/input >$test_log/stdout 2>$test_log/stderr - ) - valgrind_check $test_log/stderr || return 1 - cmp -s $test_path/output $test_log/stdout -} - -show_error() { - valgrind_show_error && return - - echo "EXPECTED OUTPUT:" - nl -bn $test_path/output - echo "ACTUAL OUTPUT:" - nl -bn $test_log/stdout -} - -. $top_srcdir/test/scripts/run-tests.sh diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/env 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -JSON_SORT_KEYS=1 -export JSON_SORT_KEYS diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"foo": 1, "bar": 2, "baz": 3, "quux": 4} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/encoding-flags/sort-keys/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"bar": 2, "baz": 3, "foo": 1, "quux": 4} \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/.gitattributes kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/.gitattributes --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/.gitattributes 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/.gitattributes 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -api/ text=auto -* text eol=lf \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/apostrophe/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/apostrophe/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/apostrophe/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/apostrophe/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -invalid token near ''' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/apostrophe/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/apostrophe/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/apostrophe/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/apostrophe/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/ascii-unicode-identifier/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/ascii-unicode-identifier/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/ascii-unicode-identifier/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/ascii-unicode-identifier/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 1 1 -'[' or '{' expected near 'a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/ascii-unicode-identifier/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/ascii-unicode-identifier/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/ascii-unicode-identifier/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/ascii-unicode-identifier/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -aå diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/brace-comma/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/brace-comma/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/brace-comma/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/brace-comma/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -string or '}' expected near ',' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/brace-comma/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/brace-comma/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/brace-comma/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/brace-comma/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{, diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-comma/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-comma/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-comma/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-comma/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unexpected token near ',' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-comma/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-comma/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-comma/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-comma/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[, diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2 0 4 -']' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -']' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/bracket-one-comma/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1, diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/empty/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/empty/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/empty/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/empty/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 0 0 -'[' or '{' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-array/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-array/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-array/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-array/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 4 4 -unexpected token near ']' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1,] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-multiline-array/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-multiline-array/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-multiline-array/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-multiline-array/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -6 1 17 -unexpected token near ']' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-multiline-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-multiline-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-multiline-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/extra-comma-in-multiline-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -[1, -2, -3, -4, -5, -] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/garbage-after-newline/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/garbage-after-newline/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/garbage-after-newline/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/garbage-after-newline/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2 3 11 -end of file expected near 'foo' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/garbage-after-newline/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/garbage-after-newline/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/garbage-after-newline/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/garbage-after-newline/input 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -[1,2,3] -foo diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/garbage-at-the-end/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/garbage-at-the-end/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/garbage-at-the-end/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/garbage-at-the-end/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 10 10 -end of file expected near 'foo' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/garbage-at-the-end/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/garbage-at-the-end/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/garbage-at-the-end/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/garbage-at-the-end/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1,2,3]foo diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/integer-starting-with-zero/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/integer-starting-with-zero/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/integer-starting-with-zero/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/integer-starting-with-zero/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -invalid token near '0' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/integer-starting-with-zero/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/integer-starting-with-zero/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/integer-starting-with-zero/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/integer-starting-with-zero/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[012] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-escape/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-escape/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-escape/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-escape/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 4 4 -invalid escape near '"\a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-escape/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-escape/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-escape/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-escape/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\a <-- invalid escape"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-identifier/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-identifier/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-identifier/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-identifier/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 5 5 -invalid token near 'troo' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-identifier/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-identifier/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-identifier/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-identifier/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[troo diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-integer/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-integer/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-integer/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-integer/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 8 8 -']' expected near 'foo' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-integer/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-integer/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-integer/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-integer/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-123foo] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-real/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-real/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-real/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-real/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 12 12 -']' expected near 'foo' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-real/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-real/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-real/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-negative-real/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-123.123foo] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-second-surrogate/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-second-surrogate/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-second-surrogate/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-second-surrogate/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 62 62 -invalid Unicode '\uD888\u3210' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-second-surrogate/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-second-surrogate/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/invalid-second-surrogate/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/invalid-second-surrogate/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\uD888\u3210 (first surrogate and invalid second surrogate)"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2 0 2 -string or '}' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 1 1 -string or '}' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-brace/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2 0 2 -']' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 1 1 -']' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-open-bracket/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-second-surrogate/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-second-surrogate/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-second-surrogate/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-second-surrogate/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 40 40 -invalid Unicode '\uDFAA' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-second-surrogate/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-second-surrogate/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/lone-second-surrogate/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/lone-second-surrogate/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\uDFAA (second surrogate on it's own)"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/minus-sign-without-number/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/minus-sign-without-number/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/minus-sign-without-number/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/minus-sign-without-number/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -invalid token near '-' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/minus-sign-without-number/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/minus-sign-without-number/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/minus-sign-without-number/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/minus-sign-without-number/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-foo] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/negative-integer-starting-with-zero/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/negative-integer-starting-with-zero/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/negative-integer-starting-with-zero/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/negative-integer-starting-with-zero/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -invalid token near '-0' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/negative-integer-starting-with-zero/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/negative-integer-starting-with-zero/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/negative-integer-starting-with-zero/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/negative-integer-starting-with-zero/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-012] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 4 4 -'[' or '{' expected near 'null' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -null diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-object-key/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-object-key/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-object-key/error 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-object-key/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 15 15 -NUL byte in object key not supported near '"foo\u0000bar"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-object-key/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-object-key/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-object-key/input 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-object-key/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"foo\u0000bar": 42} \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 12 12 -control character 0x0 near '"null byte ' Binary files /tmp/TMxy8hWn7B/kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/input and /tmp/FbBd8Zjrdx/kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/input differ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/nostrip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/nostrip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/nostrip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-in-string/nostrip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -The embedded NULL byte breaks json_loads(), which is used instead of -json_loadf() in the stripped tests. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -invalid token near end of file Binary files /tmp/TMxy8hWn7B/kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/input and /tmp/FbBd8Zjrdx/kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/input differ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/nostrip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/nostrip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/nostrip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/null-byte-outside-string/nostrip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -The embedded NULL byte breaks json_loads(), which is used instead of -json_loadf() in the stripped tests. diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-apostrophes/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-apostrophes/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-apostrophes/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-apostrophes/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -string or '}' expected near ''' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-apostrophes/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-apostrophes/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-apostrophes/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-apostrophes/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{'a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-garbage-at-end/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-garbage-at-end/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-garbage-at-end/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-garbage-at-end/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 12 12 -'}' expected near '123' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-garbage-at-end/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-garbage-at-end/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-garbage-at-end/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-garbage-at-end/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a":"a" 123} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2 0 4 -']' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -']' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-in-unterminated-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[{} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2 0 5 -':' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 4 4 -':' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-colon/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-value/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-value/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-value/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-value/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2 0 6 -unexpected token near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-value/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-value/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-value/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-value/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 5 5 -unexpected token near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-value/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-value/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-no-value/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-no-value/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a": diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 7 7 -unexpected newline near '"a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 7 7 -premature end of input near '"a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/object-unterminated-value/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a":"a diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-garbage-after-e/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-garbage-after-e/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-garbage-after-e/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-garbage-after-e/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -invalid token near '1e' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-garbage-after-e/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-garbage-after-e/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-garbage-after-e/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-garbage-after-e/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1ea] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-negative-overflow/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-negative-overflow/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-negative-overflow/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-negative-overflow/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 15 15 -real number overflow near '-123123e100000' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-negative-overflow/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-negative-overflow/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-negative-overflow/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-negative-overflow/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-123123e100000] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-positive-overflow/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-positive-overflow/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-positive-overflow/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-positive-overflow/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 14 14 -real number overflow near '123123e100000' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-positive-overflow/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-positive-overflow/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-positive-overflow/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-positive-overflow/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123123e100000] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-e/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-e/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-e/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-e/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -invalid token near '1e' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-e/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-e/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-e/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-e/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1e] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-point/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-point/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-point/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-point/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -invalid token near '1.' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-point/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-point/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-point/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/real-truncated-at-point/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1.] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/run kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/run --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/run 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/run 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2009-2014 Petri Lehtinen -# -# Jansson is free software; you can redistribute it and/or modify -# it under the terms of the MIT license. See LICENSE for details. - -is_test() { - test -d $test_path -} - -do_run() { - variant=$1 - s=".$1" - - strip=0 - if [ "$variant" = "strip" ]; then - # This test should not be stripped - [ -f $test_path/nostrip ] && return - strip=1 - fi - - STRIP=$strip $json_process --env \ - <$test_path/input >$test_log/stdout$s 2>$test_log/stderr$s - valgrind_check $test_log/stderr$s || return 1 - - ref=error - [ -f $test_path/error$s ] && ref=error$s - - if ! cmp -s $test_path/$ref $test_log/stderr$s; then - echo $variant > $test_log/variant - return 1 - fi -} - -run_test() { - do_run normal && do_run strip -} - -show_error() { - valgrind_show_error && return - - read variant < $test_log/variant - s=".$variant" - - echo "VARIANT: $variant" - - echo "EXPECTED ERROR:" - ref=error - [ -f $test_path/error$s ] && ref=error$s - nl -bn $test_path/$ref - - echo "ACTUAL ERROR:" - nl -bn $test_log/stderr$s -} - -. $top_srcdir/test/scripts/run-tests.sh diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/tab-character-in-string/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/tab-character-in-string/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/tab-character-in-string/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/tab-character-in-string/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -control character 0x9 near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/tab-character-in-string/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/tab-character-in-string/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/tab-character-in-string/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/tab-character-in-string/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[" <-- tab character"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/too-big-negative-integer/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/too-big-negative-integer/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/too-big-negative-integer/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/too-big-negative-integer/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 32 32 -too big negative integer diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/too-big-negative-integer/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/too-big-negative-integer/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/too-big-negative-integer/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/too-big-negative-integer/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-123123123123123123123123123123] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/too-big-positive-integer/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/too-big-positive-integer/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/too-big-positive-integer/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/too-big-positive-integer/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 31 31 -too big integer diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/too-big-positive-integer/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/too-big-positive-integer/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/too-big-positive-integer/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/too-big-positive-integer/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123123123123123123123123123123] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/truncated-unicode-surrogate/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/truncated-unicode-surrogate/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/truncated-unicode-surrogate/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/truncated-unicode-surrogate/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 46 46 -invalid Unicode '\uDADA' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/truncated-unicode-surrogate/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/truncated-unicode-surrogate/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/truncated-unicode-surrogate/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/truncated-unicode-surrogate/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\uDADA (first surrogate without the second)"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unicode-identifier/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unicode-identifier/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unicode-identifier/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unicode-identifier/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 1 2 -'[' or '{' expected near 'å' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unicode-identifier/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unicode-identifier/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unicode-identifier/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unicode-identifier/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -å diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2 0 5 -']' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 4 4 -']' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["a" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -2 0 3 -string or '}' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -string or '}' expected near end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-array-and-object/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[{ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unexpected newline near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -premature end of input near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-empty-key/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{" diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -unexpected newline near '"a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -premature end of input near '"a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-key/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-object-and-array/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-object-and-array/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-object-and-array/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-object-and-array/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -string or '}' expected near '[' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-object-and-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-object-and-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-object-and-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-object-and-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{[ diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/error.normal kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/error.normal --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/error.normal 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/error.normal 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -unexpected newline near '"a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/error.strip kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/error.strip --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/error.strip 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/error.strip 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -premature end of input near '"a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid/unterminated-string/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["a diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/encoded-surrogate-half/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/encoded-surrogate-half/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/encoded-surrogate-half/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/encoded-surrogate-half/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xed near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/encoded-surrogate-half/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/encoded-surrogate-half/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/encoded-surrogate-half/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/encoded-surrogate-half/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[" <-- encoded surrogate half"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -unable to decode byte 0xe5 near '"\' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 1 1 -unable to decode byte 0xe5 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 4 4 -unable to decode byte 0xe5 near '123' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 4 4 -unable to decode byte 0xe5 near '"\u' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\u"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 4 4 -unable to decode byte 0xe5 near '1e1' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1e1] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xe5 near 'a' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[a] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xe5 near '0' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[0] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 3 3 -unable to decode byte 0xe5 near '1e' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1e] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xe5 near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[" <-- invalid UTF-8"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 0 0 -unable to decode byte 0xe5 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ - diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0x81 near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[""] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/not-in-unicode-range/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/not-in-unicode-range/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/not-in-unicode-range/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/not-in-unicode-range/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xf4 near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/not-in-unicode-range/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/not-in-unicode-range/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/not-in-unicode-range/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/not-in-unicode-range/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[""] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xe0 near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[" <-- overlong encoding"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xf0 near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[" <-- overlong encoding"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xc1 near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[""] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/restricted-utf-8/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/restricted-utf-8/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/restricted-utf-8/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/restricted-utf-8/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xfd near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/restricted-utf-8/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/restricted-utf-8/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/restricted-utf-8/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/restricted-utf-8/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[""] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/run kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/run --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/run 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/run 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2009-2014 Petri Lehtinen -# -# Jansson is free software; you can redistribute it and/or modify -# it under the terms of the MIT license. See LICENSE for details. - -is_test() { - test -d $test_path -} - -run_test() { - $json_process --env <$test_path/input >$test_log/stdout 2>$test_log/stderr - valgrind_check $test_log/stderr || return 1 - cmp -s $test_path/error $test_log/stderr -} - -show_error() { - valgrind_show_error && return - - echo "EXPECTED ERROR:" - nl -bn $test_path/error - echo "ACTUAL ERROR:" - nl -bn $test_log/stderr -} - -. $top_srcdir/test/scripts/run-tests.sh diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/truncated-utf-8/error kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/truncated-utf-8/error --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/truncated-utf-8/error 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/truncated-utf-8/error 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -1 2 2 -unable to decode byte 0xe0 near '"' diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/truncated-utf-8/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/truncated-utf-8/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/invalid-unicode/truncated-utf-8/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/invalid-unicode/truncated-utf-8/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[" <-- truncated UTF-8"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/Makefile.am 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/Makefile.am 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ -SUBDIRS = api -EXTRA_DIST = invalid invalid-unicode valid diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/complex-array/env kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/complex-array/env --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/complex-array/env 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/complex-array/env 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -JSON_SORT_KEYS=1 \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/complex-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/complex-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/complex-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/complex-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -[1,2,3,4, -"a", "b", "c", -{"foo": "bar", "core": "dump"}, -true, false, true, true, null, false -] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/complex-array/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/complex-array/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/complex-array/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/complex-array/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1, 2, 3, 4, "a", "b", "c", {"core": "dump", "foo": "bar"}, true, false, true, true, null, false] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-array/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-array/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-array/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-array/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-object/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-object/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-object/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-object/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-object/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-object/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-object/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-object/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{} \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-object-in-array/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-object-in-array/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-object-in-array/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-object-in-array/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[{}] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-object-in-array/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-object-in-array/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-object-in-array/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-object-in-array/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[{}] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-string/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-string/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-string/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-string/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[""] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-string/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-string/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/empty-string/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/empty-string/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[""] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/escaped-utf-control-char/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/escaped-utf-control-char/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/escaped-utf-control-char/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/escaped-utf-control-char/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\u0012 escaped control character"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/escaped-utf-control-char/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/escaped-utf-control-char/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/escaped-utf-control-char/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/escaped-utf-control-char/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\u0012 escaped control character"] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/false/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/false/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/false/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/false/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[false] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/false/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/false/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/false/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/false/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[false] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-int/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-int/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-int/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-int/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-123] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-int/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-int/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-int/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-int/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-123] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-one/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-one/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-one/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-one/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-1] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-one/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-one/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-one/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-one/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-1] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-zero/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-zero/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-zero/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-zero/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[-0] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-zero/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-zero/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/negative-zero/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/negative-zero/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[0] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/null/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/null/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/null/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/null/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[null] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/null/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/null/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/null/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/null/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[null] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/one-byte-utf-8/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/one-byte-utf-8/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/one-byte-utf-8/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/one-byte-utf-8/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\u002c one-byte UTF-8"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/one-byte-utf-8/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/one-byte-utf-8/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/one-byte-utf-8/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/one-byte-utf-8/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[", one-byte UTF-8"] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1E22] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1e22] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e-negative-exponent/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e-negative-exponent/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e-negative-exponent/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e-negative-exponent/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1E-2] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e-negative-exponent/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e-negative-exponent/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e-negative-exponent/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e-negative-exponent/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[0.01] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e-positive-exponent/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e-positive-exponent/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e-positive-exponent/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e-positive-exponent/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1E+2] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e-positive-exponent/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e-positive-exponent/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-capital-e-positive-exponent/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-capital-e-positive-exponent/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[100.0] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-exponent/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-exponent/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-exponent/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-exponent/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123e45] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-exponent/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-exponent/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-exponent/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-exponent/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1.2299999999999999e47] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-fraction-exponent/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-fraction-exponent/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-fraction-exponent/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-fraction-exponent/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123.456e78] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-fraction-exponent/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-fraction-exponent/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-fraction-exponent/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-fraction-exponent/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1.23456e80] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-negative-exponent/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-negative-exponent/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-negative-exponent/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-negative-exponent/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1e-2] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-negative-exponent/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-negative-exponent/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-negative-exponent/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-negative-exponent/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[0.01] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-positive-exponent/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-positive-exponent/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-positive-exponent/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-positive-exponent/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1e+2] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-positive-exponent/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-positive-exponent/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-positive-exponent/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-positive-exponent/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[100.0] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-subnormal-number/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-subnormal-number/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-subnormal-number/input 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-subnormal-number/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1.8011670033376514e-308] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-subnormal-number/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-subnormal-number/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-subnormal-number/output 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-subnormal-number/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1.8011670033376514e-308] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-underflow/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-underflow/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-underflow/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-underflow/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123e-10000000] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-underflow/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-underflow/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/real-underflow/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/real-underflow/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[0.0] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/run kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/run --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/run 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/run 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -#!/bin/sh -# -# Copyright (c) 2009-2014 Petri Lehtinen -# -# Jansson is free software; you can redistribute it and/or modify -# it under the terms of the MIT license. See LICENSE for details. - -JSON_SORT_KEYS=1 -export JSON_SORT_KEYS - -is_test() { - test -d $test_path -} - -do_run() { - variant=$1 - s=".$1" - - strip=0 - [ "$variant" = "strip" ] && strip=1 - - STRIP=$strip $json_process --env \ - <$test_path/input >$test_log/stdout$s 2>$test_log/stderr$s - valgrind_check $test_log/stderr$s || return 1 - - ref=output - [ -f $test_path/output$s ] && ref=output$s - - if ! cmp -s $test_path/$ref $test_log/stdout$s; then - echo $variant > $test_log/variant - return 1 - fi -} - -run_test() { - do_run normal && do_run strip -} - -show_error() { - valgrind_show_error && return - - read variant < $test_log/variant - s=".$variant" - - echo "VARIANT: $variant" - - echo "EXPECTED OUTPUT:" - ref=output - [ -f $test_path/output$s ] && ref=output$s - nl -bn $test_path/$ref - - echo "ACTUAL OUTPUT:" - nl -bn $test_log/stdout$s -} - -. $top_srcdir/test/scripts/run-tests.sh diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/short-string/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/short-string/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/short-string/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/short-string/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["a"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/short-string/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/short-string/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/short-string/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/short-string/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["a"] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-ascii-string/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-ascii-string/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-ascii-string/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-ascii-string/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["abcdefghijklmnopqrstuvwxyz1234567890 "] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-ascii-string/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-ascii-string/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-ascii-string/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-ascii-string/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["abcdefghijklmnopqrstuvwxyz1234567890 "] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-0/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-0/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-0/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-0/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[0] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-0/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-0/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-0/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-0/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[0] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-1/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-1/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-1/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-1/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-1/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-1/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-1/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-1/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[1] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-123/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-123/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-123/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-123/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-123/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-123/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-int-123/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-int-123/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-object/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-object/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-object/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-object/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a":[]} diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-object/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-object/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-object/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-object/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"a": []} \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-real/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-real/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-real/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-real/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123.456789] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-real/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-real/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/simple-real/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/simple-real/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[123.456789] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/string-escapes/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/string-escapes/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/string-escapes/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/string-escapes/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\"\\\/\b\f\n\r\t"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/string-escapes/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/string-escapes/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/string-escapes/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/string-escapes/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\"\\/\b\f\n\r\t"] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/three-byte-utf-8/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/three-byte-utf-8/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/three-byte-utf-8/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/three-byte-utf-8/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\u0821 three-byte UTF-8"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/three-byte-utf-8/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/three-byte-utf-8/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/three-byte-utf-8/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/three-byte-utf-8/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["ࠡ three-byte UTF-8"] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/true/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/true/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/true/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/true/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[true] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/true/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/true/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/true/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/true/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -[true] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/two-byte-utf-8/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/two-byte-utf-8/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/two-byte-utf-8/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/two-byte-utf-8/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\u0123 two-byte UTF-8"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/two-byte-utf-8/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/two-byte-utf-8/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/two-byte-utf-8/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/two-byte-utf-8/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["ģ two-byte UTF-8"] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/utf-8-string/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/utf-8-string/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/utf-8-string/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/utf-8-string/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["€þıœəßð some utf-8 ĸʒ×ŋµåäö𝄞"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/utf-8-string/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/utf-8-string/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/utf-8-string/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/utf-8-string/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["€þıœəßð some utf-8 ĸʒ×ŋµåäö𝄞"] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/input kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/input --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/input 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/input 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["\uD834\uDD1E surrogate, four-byte UTF-8"] diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/output kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/output --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/output 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/output 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -["𝄞 surrogate, four-byte UTF-8"] \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/.travis.yml kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/.travis.yml --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/jansson/.travis.yml 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/jansson/.travis.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -env: - matrix: - - JANSSON_BUILD_METHOD=cmake JANSSON_CMAKE_OPTIONS="-DJANSSON_TEST_WITH_VALGRIND=ON" JANSSON_EXTRA_INSTALL="valgrind" - - JANSSON_BUILD_METHOD=autotools -language: c -compiler: - - gcc - - clang -install: - - sudo apt-get update -qq - - sudo apt-get install -y -qq cmake $JANSSON_EXTRA_INSTALL -script: - - if [ "$JANSSON_BUILD_METHOD" = "autotools" ]; then autoreconf -f -i && CFLAGS=-Werror ./configure && make check; fi - - if [ "$JANSSON_BUILD_METHOD" = "cmake" ]; then mkdir build && cd build && cmake .. $JANSSON_CMAKE_OPTIONS && cmake --build . && ctest --output-on-failure; fi diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/Makefile.am kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/Makefile.am --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/Makefile.am 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/Makefile.am 2015-02-20 11:24:58.000000000 +0000 @@ -1,2 +1,2 @@ -SUBDIRS = jansson cppmyth +SUBDIRS = cppmyth diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/cppmyth/libcppmyth.vcxproj kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/cppmyth/libcppmyth.vcxproj --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/cppmyth/libcppmyth.vcxproj 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/cppmyth/libcppmyth.vcxproj 2015-02-20 11:24:58.000000000 +0000 @@ -77,7 +77,7 @@ - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\..\..\jansson\src;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) Debug/ EnableFastChecks CompileAsCpp @@ -96,10 +96,10 @@ WIN32;_WINDOWS;_DEBUG;_USE_32BIT_TIME_T;_CRT_SECURE_NO_WARNINGS;CMAKE_INTDIR=\"Debug\";%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\jansson\include;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\jansson\include;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) $(IntDir) %(Filename).h %(Filename).tlb @@ -109,7 +109,7 @@ - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\..\..\jansson\src;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) Release/ CompileAsCpp 4005;4996 @@ -128,10 +128,10 @@ WIN32;_WINDOWS;NDEBUG;_USE_32BIT_TIME_T;_CRT_SECURE_NO_WARNINGS;CMAKE_INTDIR=\"Release\";%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\jansson\include;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\jansson\include;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) $(IntDir) %(Filename).h %(Filename).tlb @@ -141,7 +141,7 @@ - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\..\..\jansson\src;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) MinSizeRel/ CompileAsCpp 4005;4996 @@ -160,10 +160,10 @@ WIN32;_WINDOWS;NDEBUG;_USE_32BIT_TIME_T;_CRT_SECURE_NO_WARNINGS;CMAKE_INTDIR=\"MinSizeRel\";%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)..\jansson\include;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\jansson\include;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) $(IntDir) %(Filename).h %(Filename).tlb @@ -173,7 +173,7 @@ - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\..\..\jansson\src;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) RelWithDebInfo/ CompileAsCpp ProgramDatabase @@ -191,10 +191,10 @@ WIN32;_WINDOWS;NDEBUG;_USE_32BIT_TIME_T;_CRT_SECURE_NO_WARNINGS;CMAKE_INTDIR=\"RelWithDebInfo\";%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)..\jansson\include;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) - $(ProjectDir)include;$(ProjectDir)..\jansson\include;$(ProjectDir)..\..\..\jansson\src;%(AdditionalIncludeDirectories) + $(ProjectDir)include;%(AdditionalIncludeDirectories) $(IntDir) %(Filename).h %(Filename).tlb diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/cppmyth.sln kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/cppmyth.sln --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/cppmyth.sln 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/cppmyth.sln 2015-02-20 11:24:58.000000000 +0000 @@ -3,12 +3,7 @@ # Visual Studio Express 2013 for Windows Desktop VisualStudioVersion = 12.0.21005.1 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjansson", "jansson\libjansson.vcxproj", "{E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcppmyth", "cppmyth\libcppmyth.vcxproj", "{086B2F32-C84B-481C-BB7E-ACCB4B2A0671}" - ProjectSection(ProjectDependencies) = postProject - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3} = {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3} - EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -18,14 +13,6 @@ RelWithDebInfo|Win32 = RelWithDebInfo|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Debug|Win32.ActiveCfg = Debug|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Debug|Win32.Build.0 = Debug|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Release|Win32.ActiveCfg = Release|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Release|Win32.Build.0 = Release|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32 {086B2F32-C84B-481C-BB7E-ACCB4B2A0671}.Debug|Win32.ActiveCfg = Debug|Win32 {086B2F32-C84B-481C-BB7E-ACCB4B2A0671}.Debug|Win32.Build.0 = Debug|Win32 {086B2F32-C84B-481C-BB7E-ACCB4B2A0671}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/jansson/include/jansson_config.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/jansson/include/jansson_config.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/jansson/include/jansson_config.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/jansson/include/jansson_config.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2010-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - * - * - * This file specifies a part of the site-specific configuration for - * Jansson, namely those things that affect the public API in - * jansson.h. - * - * The CMake system will generate the jansson_config.h file and - * copy it to the build and install directories. - */ - -#ifndef JANSSON_CONFIG_H -#define JANSSON_CONFIG_H - -/* Define this so that we can disable scattered automake configuration in source files */ -#ifndef JANSSON_USING_CMAKE -#define JANSSON_USING_CMAKE -#endif - -/* Note: when using cmake, JSON_INTEGER_IS_LONG_LONG is not defined nor used, - * as we will also check for __int64 etc types. - * (the definition was used in the automake system) */ - -/* Bring in the cmake-detected defines */ -#define HAVE_STDINT_H 1 -/* #undef HAVE_INTTYPES_H */ -/* #undef HAVE_SYS_TYPES_H */ - -/* Include our standard type header for the integer typedef */ - -#if defined(HAVE_STDINT_H) -# include -#elif defined(HAVE_INTTYPES_H) -# include -#elif defined(HAVE_SYS_TYPES_H) -# include -#endif - - -/* If your compiler supports the inline keyword in C, JSON_INLINE is - defined to `inline', otherwise empty. In C++, the inline is always - supported. */ -#ifdef __cplusplus -#define JSON_INLINE inline -#else -#define JSON_INLINE __inline -#endif - - -#define json_int_t long long -#define json_strtoint strtoll -#define JSON_INTEGER_FORMAT "I64d" - - -/* If locale.h and localeconv() are available, define to 1, otherwise to 0. */ -#define JSON_HAVE_LOCALECONV 1 - - - -#endif diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/jansson/libjansson.vcxproj kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/jansson/libjansson.vcxproj --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/jansson/libjansson.vcxproj 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/jansson/libjansson.vcxproj 1970-01-01 00:00:00.000000000 +0000 @@ -1,221 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - MinSizeRel - Win32 - - - RelWithDebInfo - Win32 - - - - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3} - Win32Proj - Win32 - libjansson - - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - MultiByte - v120 - - - StaticLibrary - false - MultiByte - v120 - - - - - - - - - - <_ProjectFileVersion>10.0.20506.1 - $(SolutionDir)libs\$(TargetName)\$(Configuration)\ - $(SolutionDir)objs\$(TargetName)\$(Configuration)\ - jansson - .lib - $(SolutionDir)libs\$(TargetName)\$(Configuration)\ - $(SolutionDir)objs\$(TargetName)\$(Configuration)\ - jansson - .lib - $(SolutionDir)libs\$(TargetName)\$(Configuration)\ - $(SolutionDir)objs\$(TargetName)\$(Configuration)\ - jansson - .lib - $(SolutionDir)libs\$(TargetName)\$(Configuration)\ - $(SolutionDir)objs\$(TargetName)\$(Configuration)\ - jansson - .lib - - - - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - Debug/ - EnableFastChecks - CompileAsC - ProgramDatabase - 4005;4996 - - - Disabled - Disabled - NotUsing - MultiThreadedDebug - true - Level3 - WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) - $(IntDir) - - - WIN32;_WINDOWS;_DEBUG;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - - - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - $(IntDir) - %(Filename).h - %(Filename).tlb - %(Filename)_i.c - %(Filename)_p.c - - - - - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - Release/ - CompileAsC - 4005;4996 - - - AnySuitable - MaxSpeed - NotUsing - MultiThreaded - true - Level3 - - - WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) - $(IntDir) - - - WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - - - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - $(IntDir) - %(Filename).h - %(Filename).tlb - %(Filename)_i.c - %(Filename)_p.c - - - - - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - MinSizeRel/ - CompileAsC - 4005;4996 - - - OnlyExplicitInline - MinSpace - NotUsing - MultiThreaded - true - Level3 - - - WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) - $(IntDir) - - - WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - - - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - $(IntDir) - %(Filename).h - %(Filename).tlb - %(Filename)_i.c - %(Filename)_p.c - - - - - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - RelWithDebInfo/ - CompileAsC - ProgramDatabase - 4005;4996 - - - OnlyExplicitInline - MaxSpeed - NotUsing - MultiThreaded - true - Level3 - WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) - $(IntDir) - - - WIN32;_WINDOWS;NDEBUG;_CRT_SECURE_NO_WARNINGS;HAVE_CONFIG_H;%(PreprocessorDefinitions) - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - - - $(ProjectDir)include;$(ProjectDir)private_include;%(AdditionalIncludeDirectories) - $(IntDir) - %(Filename).h - %(Filename).tlb - %(Filename)_i.c - %(Filename)_p.c - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/jansson/libjansson.vcxproj.filters kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/jansson/libjansson.vcxproj.filters --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/jansson/libjansson.vcxproj.filters 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/jansson/libjansson.vcxproj.filters 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - {F75349EF-D9CD-4429-B526-FF181881A161} - - - \ No newline at end of file diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/jansson/private_include/jansson_private_config.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/jansson/private_include/jansson_private_config.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/project/VS2010Express/jansson/private_include/jansson_private_config.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/project/VS2010Express/jansson/private_include/jansson_private_config.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -/* #undef HAVE_ENDIAN_H */ -#define HAVE_FCNTL_H 1 -/* #undef HAVE_SCHED_H */ -/* #undef HAVE_UNISTD_H */ -/* #undef HAVE_SYS_PARAM_H */ -#define HAVE_SYS_STAT_H 1 -/* #undef HAVE_SYS_TIME_H */ -/* #undef HAVE_SYS_TYPES_H */ -#define HAVE_STDINT_H 1 - -#define HAVE_CLOSE 1 -#define HAVE_GETPID 1 -/* #undef HAVE_GETTIMEOFDAY */ -#define HAVE_OPEN 1 -#define HAVE_READ 1 -/* #undef HAVE_SCHED_YIELD */ - -/* #undef HAVE_SYNC_BUILTINS */ -/* #undef HAVE_ATOMIC_BUILTINS */ - -#define HAVE_LOCALE_H 1 -#define HAVE_SETLOCALE 1 - -#define HAVE_INT32_T 1 -#ifndef HAVE_INT32_T -# define int32_t int32_t -#endif - -#define HAVE_UINT32_T 1 -#ifndef HAVE_UINT32_T -# define uint32_t uint32_t -#endif - -#define HAVE_UINT16_T 1 -#ifndef HAVE_UINT16_T -# define uint16_t uint16_t -#endif - -#define HAVE_UINT8_T 1 -#ifndef HAVE_UINT8_T -# define uint8_t uint8_t -#endif - -/* #undef HAVE_SSIZE_T */ - -#ifndef HAVE_SSIZE_T -# define ssize_t int -#endif - -/* #undef HAVE_SNPRINTF */ - -#ifndef HAVE_SNPRINTF -# define snprintf _snprintf -#endif - -/* #undef HAVE_VSNPRINTF */ - -/*#define USE_URANDOM 1*/ -#define USE_WINDOWS_CRYPTOAPI 1 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/README kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/README --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/cppmyth/README 2014-09-12 07:43:46.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/cppmyth/README 2015-02-20 11:24:58.000000000 +0000 @@ -15,10 +15,19 @@ cd build cmake -Then build the lib: +Then build the lib and demo: make +Running liveTV demo: +-------------------- + +Choose a server and a channel to spawn, here 1001 from localhost, and pipe the +stream to mplayer: + +./demo/livetvdemo 127.0.0.1 1001 | mplayer - + +Sources of demo are in /demo/src/ Generate the documentation: --------------------------- diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/platform/posix/os-threads.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/platform/posix/os-threads.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/platform/posix/os-threads.h 2014-09-12 07:43:39.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/platform/posix/os-threads.h 2015-02-20 11:24:58.000000000 +0000 @@ -72,7 +72,20 @@ typedef pthread_t thread_t; - #define ThreadsCreate(thread, func, arg) (pthread_create(&thread, NULL, (void *(*) (void *))func, (void *)arg) == 0) + inline pthread_attr_t *GetDetachedThreadAttribute(void) + { + static pthread_attr_t g_threadAttr; + static bool bAttributeInitialised = false; + if (!bAttributeInitialised) + { + pthread_attr_init(&g_threadAttr); + pthread_attr_setdetachstate(&g_threadAttr, PTHREAD_CREATE_DETACHED); + bAttributeInitialised = true; + } + return &g_threadAttr; + } + + #define ThreadsCreate(thread, func, arg) (pthread_create(&thread, GetDetachedThreadAttribute(), (void *(*) (void *))func, (void *)arg) == 0) #define ThreadsWait(thread, retval) (pthread_join(thread, retval) == 0) typedef pthread_mutex_t mutex_t; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/platform/sockets/tcp.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/platform/sockets/tcp.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/lib/platform/sockets/tcp.h 2015-01-30 18:35:38.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/lib/platform/sockets/tcp.h 2015-02-20 11:24:58.000000000 +0000 @@ -67,6 +67,7 @@ { TcpSocketClose(m_socket); m_strError = strerror(m_iError); + m_socket = INVALID_SOCKET_VALUE; } else { diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/project/VS2010Express/xbmc-pvr-addons.sln kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/project/VS2010Express/xbmc-pvr-addons.sln --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/project/VS2010Express/xbmc-pvr-addons.sln 2014-11-24 13:23:34.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/project/VS2010Express/xbmc-pvr-addons.sln 2015-02-20 11:24:58.000000000 +0000 @@ -51,8 +51,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pvr.mythtv", "..\..\addons\pvr.mythtv\project\VS2010Express\pvr.mythtv.vcxproj", "{A7F105B4-D41C-4BAE-B9A5-8E322C97A6D5}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libjansson", "..\..\lib\cppmyth\project\VS2010Express\jansson\libjansson.vcxproj", "{E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcppmyth", "..\..\lib\cppmyth\project\VS2010Express\cppmyth\libcppmyth.vcxproj", "{086B2F32-C84B-481C-BB7E-ACCB4B2A0671}" EndProject Global @@ -295,18 +293,6 @@ {A7F105B4-D41C-4BAE-B9A5-8E322C97A6D5}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32 {A7F105B4-D41C-4BAE-B9A5-8E322C97A6D5}.RelWithDebInfo|Win32.Build.0 = Release|Win32 {A7F105B4-D41C-4BAE-B9A5-8E322C97A6D5}.RelWithDebInfo|x64.ActiveCfg = Release|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Debug|Win32.ActiveCfg = Debug|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Debug|Win32.Build.0 = Debug|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Debug|x64.ActiveCfg = Debug|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.MinSizeRel|Win32.ActiveCfg = MinSizeRel|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.MinSizeRel|Win32.Build.0 = MinSizeRel|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.MinSizeRel|x64.ActiveCfg = MinSizeRel|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Release|Win32.ActiveCfg = Release|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Release|Win32.Build.0 = Release|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.Release|x64.ActiveCfg = Release|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.RelWithDebInfo|Win32.ActiveCfg = RelWithDebInfo|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.RelWithDebInfo|Win32.Build.0 = RelWithDebInfo|Win32 - {E95631F0-9035-4BE4-B8E1-E2C6B0E3F0C3}.RelWithDebInfo|x64.ActiveCfg = RelWithDebInfo|Win32 {086B2F32-C84B-481C-BB7E-ACCB4B2A0671}.Debug|Win32.ActiveCfg = Debug|Win32 {086B2F32-C84B-481C-BB7E-ACCB4B2A0671}.Debug|Win32.Build.0 = Debug|Win32 {086B2F32-C84B-481C-BB7E-ACCB4B2A0671}.Debug|x64.ActiveCfg = Debug|Win32 diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/xbmc/libXBMC_gui.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/xbmc/libXBMC_gui.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/xbmc/libXBMC_gui.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/xbmc/libXBMC_gui.h 2015-02-20 11:24:58.000000000 +0000 @@ -36,13 +36,14 @@ #endif /* current ADDONGUI API version */ -#define XBMC_GUI_API_VERSION "5.6.0" +#define XBMC_GUI_API_VERSION "5.8.0" /* min. ADDONGUI API version */ -#define XBMC_GUI_MIN_API_VERSION "5.3.0" +#define XBMC_GUI_MIN_API_VERSION "5.8.0" #define ADDON_ACTION_PREVIOUS_MENU 10 #define ADDON_ACTION_CLOSE_DIALOG 51 +#define ADDON_ACTION_NAV_BACK 92 class CAddonGUIWindow; class CAddonGUISpinControl; @@ -50,6 +51,8 @@ class CAddonGUIProgressControl; class CAddonListItem; class CAddonGUIRenderingControl; +class CAddonGUISliderControl; +class CAddonGUISettingsSliderControl; class CHelper_libXBMC_gui { @@ -169,6 +172,125 @@ dlsym(m_libXBMC_gui, "GUI_control_release_rendering"); if (GUI_control_release_rendering == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + GUI_control_get_slider = (CAddonGUISliderControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) + dlsym(m_libXBMC_gui, "GUI_control_get_slider"); + if (GUI_control_get_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_control_release_slider = (void (*)(CAddonGUISliderControl* p)) + dlsym(m_libXBMC_gui, "GUI_control_release_slider"); + if (GUI_control_release_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_control_get_settings_slider = (CAddonGUISettingsSliderControl* (*)(void *HANDLE, void *CB, CAddonGUIWindow *window, int controlId)) + dlsym(m_libXBMC_gui, "GUI_control_get_settings_slider"); + if (GUI_control_get_settings_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_control_release_settings_slider = (void (*)(CAddonGUISettingsSliderControl* p)) + dlsym(m_libXBMC_gui, "GUI_control_release_settings_slider"); + if (GUI_control_release_settings_slider == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_show_and_get_input_with_head = (bool (*)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_show_and_get_input_with_head"); + if (GUI_dialog_keyboard_show_and_get_input_with_head == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_show_and_get_input = (bool (*)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_show_and_get_input"); + if (GUI_dialog_keyboard_show_and_get_input == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_show_and_get_new_password_with_head = (bool (*)(void *HANDLE, void *CB, char &newPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_show_and_get_new_password_with_head"); + if (GUI_dialog_keyboard_show_and_get_new_password_with_head == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_show_and_get_new_password = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_show_and_get_new_password"); + if (GUI_dialog_keyboard_show_and_get_new_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_show_and_verify_new_password_with_head = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_show_and_verify_new_password_with_head"); + if (GUI_dialog_keyboard_show_and_verify_new_password_with_head == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_show_and_verify_new_password = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_show_and_verify_new_password"); + if (GUI_dialog_keyboard_show_and_verify_new_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_show_and_verify_password = (int (*)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_show_and_verify_password"); + if (GUI_dialog_keyboard_show_and_verify_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_show_and_get_filter = (bool (*)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_show_and_get_filter"); + if (GUI_dialog_keyboard_show_and_get_filter == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_send_text_to_active_keyboard = (bool (*)(void *HANDLE, void *CB, const char *aTextString, bool closeKeyboard)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_send_text_to_active_keyboard"); + if (GUI_dialog_keyboard_send_text_to_active_keyboard == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_keyboard_is_activated = (bool (*)(void *HANDLE, void *CB)) + dlsym(m_libXBMC_gui, "GUI_dialog_keyboard_is_activated"); + if (GUI_dialog_keyboard_is_activated == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_numeric_show_and_verify_new_password = (bool (*)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize)) + dlsym(m_libXBMC_gui, "GUI_dialog_numeric_show_and_verify_new_password"); + if (GUI_dialog_numeric_show_and_verify_new_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_numeric_show_and_verify_password = (int (*)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries)) + dlsym(m_libXBMC_gui, "GUI_dialog_numeric_show_and_verify_password"); + if (GUI_dialog_numeric_show_and_verify_password == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_numeric_show_and_verify_input = (bool (*)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput)) + dlsym(m_libXBMC_gui, "GUI_dialog_numeric_show_and_verify_input"); + if (GUI_dialog_numeric_show_and_verify_input == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_numeric_show_and_get_time = (bool (*)(void *HANDLE, void *CB, tm &time, const char *strHeading)) + dlsym(m_libXBMC_gui, "GUI_dialog_numeric_show_and_get_time"); + if (GUI_dialog_numeric_show_and_get_time == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_numeric_show_and_get_date = (bool (*)(void *HANDLE, void *CB, tm &date, const char *strHeading)) + dlsym(m_libXBMC_gui, "GUI_dialog_numeric_show_and_get_date"); + if (GUI_dialog_numeric_show_and_get_date == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_numeric_show_and_get_ipaddress = (bool (*)(void *HANDLE, void *CB, char &IPAddress, unsigned int iMaxStringSize, const char *strHeading)) + dlsym(m_libXBMC_gui, "GUI_dialog_numeric_show_and_get_ipaddress"); + if (GUI_dialog_numeric_show_and_get_ipaddress == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_numeric_show_and_get_number = (bool (*)(void *HANDLE, void *CB, char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs)) + dlsym(m_libXBMC_gui, "GUI_dialog_numeric_show_and_get_number"); + if (GUI_dialog_numeric_show_and_get_number == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_numeric_show_and_get_seconds = (bool (*)(void *HANDLE, void *CB, char &strTime, unsigned int iMaxStringSize, const char *strHeading)) + dlsym(m_libXBMC_gui, "GUI_dialog_numeric_show_and_get_seconds"); + if (GUI_dialog_numeric_show_and_get_seconds == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_filebrowser_show_and_get_file = (bool (*)(void *HANDLE, void *CB, const char *directory, const char *mask, const char *heading, char &path, unsigned int iMaxStringSize, bool useThumbs, bool useFileDirectories, bool singleList)) + dlsym(m_libXBMC_gui, "GUI_dialog_filebrowser_show_and_get_file"); + if (GUI_dialog_filebrowser_show_and_get_file == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_ok_show_and_get_input_single_text = (void (*)(void *HANDLE, void *CB, const char *heading, const char *text)) + dlsym(m_libXBMC_gui, "GUI_dialog_ok_show_and_get_input_single_text"); + if (GUI_dialog_ok_show_and_get_input_single_text == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_ok_show_and_get_input_line_text = (void (*)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2)) + dlsym(m_libXBMC_gui, "GUI_dialog_ok_show_and_get_input_line_text"); + if (GUI_dialog_ok_show_and_get_input_line_text == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_yesno_show_and_get_input_singletext = (bool (*)(void *HANDLE, void *CB, const char *heading, const char *text, bool& bCanceled, const char *noLabel, const char *yesLabel)) + dlsym(m_libXBMC_gui, "GUI_dialog_yesno_show_and_get_input_singletext"); + if (GUI_dialog_yesno_show_and_get_input_singletext == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_yesno_show_and_get_input_linetext = (bool (*)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel)) + dlsym(m_libXBMC_gui, "GUI_dialog_yesno_show_and_get_input_linetext"); + if (GUI_dialog_yesno_show_and_get_input_linetext == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_yesno_show_and_get_input_linebuttontext = (bool (*)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel, const char *yesLabel)) + dlsym(m_libXBMC_gui, "GUI_dialog_yesno_show_and_get_input_linebuttontext"); + if (GUI_dialog_yesno_show_and_get_input_linebuttontext == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_text_viewer = (void (*)(void *hdl, void *cb, const char *heading, const char *text)) + dlsym(m_libXBMC_gui, "GUI_dialog_text_viewer"); + if (GUI_dialog_text_viewer == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } + + GUI_dialog_select = (int (*)(void *hdl, void *cb, const char *heading, const char *entries[], unsigned int size, int selected)) + dlsym(m_libXBMC_gui, "GUI_dialog_select"); + if (GUI_dialog_select == NULL) { fprintf(stderr, "Unable to assign function %s\n", dlerror()); return false; } m_Callbacks = GUI_register_me(m_Handle); return m_Callbacks != NULL; @@ -259,6 +381,177 @@ return GUI_control_release_rendering(p); } + CAddonGUISliderControl* Control_getSlider(CAddonGUIWindow *window, int controlId) + { + return GUI_control_get_slider(m_Handle, m_Callbacks, window, controlId); + } + + void Control_releaseSlider(CAddonGUISliderControl* p) + { + return GUI_control_release_slider(p); + } + + CAddonGUISettingsSliderControl* Control_getSettingsSlider(CAddonGUIWindow *window, int controlId) + { + return GUI_control_get_settings_slider(m_Handle, m_Callbacks, window, controlId); + } + + void Control_releaseSettingsSlider(CAddonGUISettingsSliderControl* p) + { + return GUI_control_release_settings_slider(p); + } + + /*! @name GUI Keyboard functions */ + //@{ + bool Dialog_Keyboard_ShowAndGetInput(char &strText, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs = 0) + { + return GUI_dialog_keyboard_show_and_get_input_with_head(m_Handle, m_Callbacks, strText, iMaxStringSize, strHeading, allowEmptyResult, hiddenInput, autoCloseMs); + } + + bool Dialog_Keyboard_ShowAndGetInput(char &strText, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs = 0) + { + return GUI_dialog_keyboard_show_and_get_input(m_Handle, m_Callbacks, strText, iMaxStringSize, allowEmptyResult, autoCloseMs); + } + + bool Dialog_Keyboard_ShowAndGetNewPassword(char &strNewPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, unsigned int autoCloseMs = 0) + { + return GUI_dialog_keyboard_show_and_get_new_password_with_head(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, strHeading, allowEmptyResult, autoCloseMs); + } + + bool Dialog_Keyboard_ShowAndGetNewPassword(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs = 0) + { + return GUI_dialog_keyboard_show_and_get_new_password(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, autoCloseMs); + } + + bool Dialog_Keyboard_ShowAndVerifyNewPassword(char &strNewPassword, unsigned int iMaxStringSize, const char *strHeading, bool allowEmptyResult, unsigned int autoCloseMs = 0) + { + return GUI_dialog_keyboard_show_and_verify_new_password_with_head(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, strHeading, allowEmptyResult, autoCloseMs); + } + + bool Dialog_Keyboard_ShowAndVerifyNewPassword(char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs = 0) + { + return GUI_dialog_keyboard_show_and_verify_new_password(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize, autoCloseMs); + } + + int Dialog_Keyboard_ShowAndVerifyPassword(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs = 0) + { + return GUI_dialog_keyboard_show_and_verify_password(m_Handle, m_Callbacks, strPassword, iMaxStringSize, strHeading, iRetries, autoCloseMs); + } + + bool Dialog_Keyboard_ShowAndGetFilter(char &strText, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs = 0) + { + return GUI_dialog_keyboard_show_and_get_filter(m_Handle, m_Callbacks, strText, iMaxStringSize, searching, autoCloseMs); + } + + bool Dialog_Keyboard_SendTextToActiveKeyboard(const char *aTextString, bool closeKeyboard = false) + { + return GUI_dialog_keyboard_send_text_to_active_keyboard(m_Handle, m_Callbacks, aTextString, closeKeyboard); + } + + bool Dialog_Keyboard_isKeyboardActivated() + { + return GUI_dialog_keyboard_is_activated(m_Handle, m_Callbacks); + } + //@} + + /*! @name GUI Numeric functions */ + //@{ + bool Dialog_Numeric_ShowAndVerifyNewPassword(char &strNewPassword, unsigned int iMaxStringSize) + { + return GUI_dialog_numeric_show_and_verify_new_password(m_Handle, m_Callbacks, strNewPassword, iMaxStringSize); + } + + int Dialog_Numeric_ShowAndVerifyPassword(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries) + { + return GUI_dialog_numeric_show_and_verify_password(m_Handle, m_Callbacks, strPassword, iMaxStringSize, strHeading, iRetries); + } + + bool Dialog_Numeric_ShowAndVerifyInput(char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput) + { + return GUI_dialog_numeric_show_and_verify_input(m_Handle, m_Callbacks, strPassword, iMaxStringSize, strHeading, bGetUserInput); + } + + bool Dialog_Numeric_ShowAndGetTime(tm &time, const char *strHeading) + { + return GUI_dialog_numeric_show_and_get_time(m_Handle, m_Callbacks, time, strHeading); + } + + bool Dialog_Numeric_ShowAndGetDate(tm &date, const char *strHeading) + { + return GUI_dialog_numeric_show_and_get_date(m_Handle, m_Callbacks, date, strHeading); + } + + bool Dialog_Numeric_ShowAndGetIPAddress(char &strIPAddress, unsigned int iMaxStringSize, const char *strHeading) + { + return GUI_dialog_numeric_show_and_get_ipaddress(m_Handle, m_Callbacks, strIPAddress, iMaxStringSize, strHeading); + } + + bool Dialog_Numeric_ShowAndGetNumber(char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs = 0) + { + return GUI_dialog_numeric_show_and_get_number(m_Handle, m_Callbacks, strInput, iMaxStringSize, strHeading, iAutoCloseTimeoutMs = 0); + } + + bool Dialog_Numeric_ShowAndGetSeconds(char &strTime, unsigned int iMaxStringSize, const char *strHeading) + { + return GUI_dialog_numeric_show_and_get_seconds(m_Handle, m_Callbacks, strTime, iMaxStringSize, strHeading); + } + //@} + + /*! @name GUI File browser functions */ + //@{ + bool Dialog_FileBrowser_ShowAndGetFile(const char *directory, const char *mask, const char *heading, char &strPath, unsigned int iMaxStringSize, bool useThumbs = false, bool useFileDirectories = false, bool singleList = false) + { + return GUI_dialog_filebrowser_show_and_get_file(m_Handle, m_Callbacks, directory, mask, heading, strPath, iMaxStringSize, useThumbs, useFileDirectories, singleList); + } + //@} + + /*! @name GUI OK Dialog functions */ + //@{ + void Dialog_OK_ShowAndGetInput(const char *heading, const char *text) + { + GUI_dialog_ok_show_and_get_input_single_text(m_Handle, m_Callbacks, heading, text); + } + + void Dialog_OK_ShowAndGetInput(const char *heading, const char *line0, const char *line1, const char *line2) + { + GUI_dialog_ok_show_and_get_input_line_text(m_Handle, m_Callbacks, heading, line0, line1, line2); + } + //@} + + /*! @name GUI Yes No Dialog functions */ + //@{ + bool Dialog_YesNo_ShowAndGetInput(const char *heading, const char *text, bool& bCanceled, const char *noLabel = "", const char *yesLabel = "") + { + return GUI_dialog_yesno_show_and_get_input_singletext(m_Handle, m_Callbacks, heading, text, bCanceled, noLabel, yesLabel); + } + + bool Dialog_YesNo_ShowAndGetInput(const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel = "", const char *yesLabel = "") + { + return GUI_dialog_yesno_show_and_get_input_linetext(m_Handle, m_Callbacks, heading, line0, line1, line2, noLabel, yesLabel); + } + + bool Dialog_YesNo_ShowAndGetInput(const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel = "", const char *yesLabel = "") + { + return GUI_dialog_yesno_show_and_get_input_linebuttontext(m_Handle, m_Callbacks, heading, line0, line1, line2, bCanceled, noLabel, yesLabel); + } + //@} + + /*! @name GUI Text viewer Dialog */ + //@{ + void Dialog_TextViewer(const char *heading, const char *text) + { + return GUI_dialog_text_viewer(m_Handle, m_Callbacks, heading, text); + } + //@} + + /*! @name GUI select Dialog */ + //@{ + int Dialog_Select(const char *heading, const char *entries[], unsigned int size, int selected = -1) + { + return GUI_dialog_select(m_Handle, m_Callbacks, heading, entries, size, selected); + } + //@} + protected: void* (*GUI_register_me)(void *HANDLE); void (*GUI_unregister_me)(void *HANDLE, void* CB); @@ -279,6 +572,36 @@ void (*GUI_ListItem_destroy)(CAddonListItem* p); CAddonGUIRenderingControl* (*GUI_control_get_rendering)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); void (*GUI_control_release_rendering)(CAddonGUIRenderingControl* p); + CAddonGUISliderControl* (*GUI_control_get_slider)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); + void (*GUI_control_release_slider)(CAddonGUISliderControl* p); + CAddonGUISettingsSliderControl* (*GUI_control_get_settings_slider)(void *HANDLE, void* CB, CAddonGUIWindow *window, int controlId); + void (*GUI_control_release_settings_slider)(CAddonGUISettingsSliderControl* p); + bool (*GUI_dialog_keyboard_show_and_get_input_with_head)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, bool hiddenInput, unsigned int autoCloseMs); + bool (*GUI_dialog_keyboard_show_and_get_input)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool allowEmptyResult, unsigned int autoCloseMs); + bool (*GUI_dialog_keyboard_show_and_get_new_password_with_head)(void *HANDLE, void *CB, char &newPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs); + bool (*GUI_dialog_keyboard_show_and_get_new_password)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); + bool (*GUI_dialog_keyboard_show_and_verify_new_password_with_head)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, const char *heading, bool allowEmptyResult, unsigned int autoCloseMs); + bool (*GUI_dialog_keyboard_show_and_verify_new_password)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize, unsigned int autoCloseMs); + int (*GUI_dialog_keyboard_show_and_verify_password)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries, unsigned int autoCloseMs); + bool (*GUI_dialog_keyboard_show_and_get_filter)(void *HANDLE, void *CB, char &aTextString, unsigned int iMaxStringSize, bool searching, unsigned int autoCloseMs); + bool (*GUI_dialog_keyboard_send_text_to_active_keyboard)(void *HANDLE, void *CB, const char *aTextString, bool closeKeyboard); + bool (*GUI_dialog_keyboard_is_activated)(void *HANDLE, void *CB); + bool (*GUI_dialog_numeric_show_and_verify_new_password)(void *HANDLE, void *CB, char &strNewPassword, unsigned int iMaxStringSize); + int (*GUI_dialog_numeric_show_and_verify_password)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, int iRetries); + bool (*GUI_dialog_numeric_show_and_verify_input)(void *HANDLE, void *CB, char &strPassword, unsigned int iMaxStringSize, const char *strHeading, bool bGetUserInput); + bool (*GUI_dialog_numeric_show_and_get_time)(void *HANDLE, void *CB, tm &time, const char *strHeading); + bool (*GUI_dialog_numeric_show_and_get_date)(void *HANDLE, void *CB, tm &date, const char *strHeading); + bool (*GUI_dialog_numeric_show_and_get_ipaddress)(void *HANDLE, void *CB, char &IPAddress, unsigned int iMaxStringSize, const char *strHeading); + bool (*GUI_dialog_numeric_show_and_get_number)(void *HANDLE, void *CB, char &strInput, unsigned int iMaxStringSize, const char *strHeading, unsigned int iAutoCloseTimeoutMs); + bool (*GUI_dialog_numeric_show_and_get_seconds)(void *HANDLE, void *CB, char &strTime, unsigned int iMaxStringSize, const char *strHeading); + bool (*GUI_dialog_filebrowser_show_and_get_file)(void *HANDLE, void *CB, const char *directory, const char *mask, const char *heading, char &path, unsigned int iMaxStringSize, bool useThumbs, bool useFileDirectories, bool singleList); + void (*GUI_dialog_ok_show_and_get_input_single_text)(void *HANDLE, void *CB, const char *heading, const char *text); + void (*GUI_dialog_ok_show_and_get_input_line_text)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2); + bool (*GUI_dialog_yesno_show_and_get_input_singletext)(void *HANDLE, void *CB, const char *heading, const char *text, bool& bCanceled, const char *noLabel, const char *yesLabel); + bool (*GUI_dialog_yesno_show_and_get_input_linetext)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, const char *noLabel, const char *yesLabel); + bool (*GUI_dialog_yesno_show_and_get_input_linebuttontext)(void *HANDLE, void *CB, const char *heading, const char *line0, const char *line1, const char *line2, bool &bCanceled, const char *noLabel, const char *yesLabel); + void (*GUI_dialog_text_viewer)(void *hdl, void *cb, const char *heading, const char *text); + int (*GUI_dialog_select)(void *hdl, void *cb, const char *heading, const char *entries[], unsigned int size, int selected); private: void *m_libXBMC_gui; @@ -350,6 +673,67 @@ void *m_cb; }; +class CAddonGUISliderControl +{ +public: + CAddonGUISliderControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); + virtual ~CAddonGUISliderControl(void) {} + + virtual void SetVisible(bool yesNo); + virtual std::string GetDescription() const; + + virtual void SetIntRange(int iStart, int iEnd); + virtual void SetIntValue(int iValue); + virtual int GetIntValue() const; + virtual void SetIntInterval(int iInterval); + + virtual void SetPercentage(float fPercent); + virtual float GetPercentage() const; + + virtual void SetFloatRange(float fStart, float fEnd); + virtual void SetFloatValue(float fValue); + virtual float GetFloatValue() const; + virtual void SetFloatInterval(float fInterval); + +private: + CAddonGUIWindow *m_Window; + int m_ControlId; + GUIHANDLE m_SliderHandle; + void *m_Handle; + void *m_cb; +}; + +class CAddonGUISettingsSliderControl +{ +public: + CAddonGUISettingsSliderControl(void *hdl, void *cb, CAddonGUIWindow *window, int controlId); + virtual ~CAddonGUISettingsSliderControl(void) {} + + virtual void SetVisible(bool yesNo); + virtual void SetText(const char *label); + virtual std::string GetDescription() const; + + virtual void SetIntRange(int iStart, int iEnd); + virtual void SetIntValue(int iValue); + virtual int GetIntValue() const; + virtual void SetIntInterval(int iInterval); + + virtual void SetPercentage(float fPercent); + virtual float GetPercentage() const; + + virtual void SetFloatRange(float fStart, float fEnd); + virtual void SetFloatValue(float fValue); + virtual float GetFloatValue() const; + virtual void SetFloatInterval(float fInterval); + +private: + CAddonGUIWindow *m_Window; + int m_ControlId; + GUIHANDLE m_SettingsSliderHandle; + void *m_Handle; + void *m_cb; +}; + class CAddonListItem { friend class CAddonGUIWindow; @@ -383,6 +767,8 @@ friend class CAddonGUIRadioButton; friend class CAddonGUIProgressControl; friend class CAddonGUIRenderingControl; +friend class CAddonGUISliderControl; +friend class CAddonGUISettingsSliderControl; public: CAddonGUIWindow(void *hdl, void *cb, const char *xmlFilename, const char *defaultSkin, bool forceFallback, bool asDialog); diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/xbmc/xbmc_codec_types.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/xbmc/xbmc_codec_types.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/xbmc/xbmc_codec_types.h 2014-01-04 10:28:12.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/xbmc/xbmc_codec_types.h 2015-02-20 11:24:58.000000000 +0000 @@ -34,6 +34,7 @@ XBMC_CODEC_TYPE_AUDIO, XBMC_CODEC_TYPE_DATA, XBMC_CODEC_TYPE_SUBTITLE, + XBMC_CODEC_TYPE_RDS, XBMC_CODEC_TYPE_NB } xbmc_codec_type_t; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/xbmc/xbmc_pvr_dll.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/xbmc/xbmc_pvr_dll.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/xbmc/xbmc_pvr_dll.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/xbmc/xbmc_pvr_dll.h 2015-02-20 11:24:58.000000000 +0000 @@ -176,8 +176,9 @@ * Show the channel scan dialog if this backend supports it. * @return PVR_ERROR_NO_ERROR if the dialog was displayed successfully. * @remarks Required if bSupportsChannelScan is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. + * @note see libXBMC_gui.h about related parts */ - PVR_ERROR DialogChannelScan(void); + PVR_ERROR OpenDialogChannelScan(void); /*! * @return The total amount of channels on the backend, or -1 on error. @@ -201,7 +202,7 @@ * Delete a channel from the backend. * @param channel The channel to delete. * @return PVR_ERROR_NO_ERROR if the channel has been deleted successfully. - * @remarks Optional. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. + * @remarks Required if bSupportsChannelSettings is set to true. */ PVR_ERROR DeleteChannel(const PVR_CHANNEL& channel); @@ -209,7 +210,7 @@ * Rename a channel on the backend. * @param channel The channel to rename, containing the new channel name. * @return PVR_ERROR_NO_ERROR if the channel has been renamed successfully. - * @remarks Optional. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. + * @remarks Optional, and only used if bSupportsChannelSettings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. */ PVR_ERROR RenameChannel(const PVR_CHANNEL& channel); @@ -217,7 +218,7 @@ * Move a channel to another channel number on the backend. * @param channel The channel to move, containing the new channel number. * @return PVR_ERROR_NO_ERROR if the channel has been moved successfully. - * @remarks Optional. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. + * @remarks Optional, and only used if bSupportsChannelSettings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. */ PVR_ERROR MoveChannel(const PVR_CHANNEL& channel); @@ -225,17 +226,19 @@ * Show the channel settings dialog, if supported by the backend. * @param channel The channel to show the dialog for. * @return PVR_ERROR_NO_ERROR if the dialog has been displayed successfully. - * @remarks Optional. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. + * @remarks Required if bSupportsChannelSettings is set to true. + * @note see libXBMC_gui.h about related parts */ - PVR_ERROR DialogChannelSettings(const PVR_CHANNEL& channel); + PVR_ERROR OpenDialogChannelSettings(const PVR_CHANNEL& channel); /*! * Show the dialog to add a channel on the backend, if supported by the backend. * @param channel The channel to add. * @return PVR_ERROR_NO_ERROR if the channel has been added successfully. - * @remarks Optional. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. + * @remarks Required if bSupportsChannelSettings is set to true. + * @note see libXBMC_gui.h about related parts */ - PVR_ERROR DialogAddChannel(const PVR_CHANNEL& channel); + PVR_ERROR OpenDialogChannelAdd(const PVR_CHANNEL& channel); //@} /** @name PVR recording methods @@ -245,19 +248,21 @@ */ //@{ /*! - * @return The total amount of channels on the backend or -1 on error. + * @return The total amount of recordings on the backend or -1 on error. + * @param deleted if set return deleted recording (called if bSupportsRecordingsUndelete set to true) * @remarks Required if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. */ - int GetRecordingsAmount(void); + int GetRecordingsAmount(bool deleted); /*! * Request the list of all recordings from the backend, if supported. * Recording entries are added to XBMC by calling TransferRecordingEntry() on the callback. * @param handle Handle to pass to the callback method. + * @param deleted if set return deleted recording (called if bSupportsRecordingsUndelete set to true) * @return PVR_ERROR_NO_ERROR if the recordings have been fetched successfully. * @remarks Required if bSupportsRecordings is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. */ - PVR_ERROR GetRecordings(ADDON_HANDLE handle); + PVR_ERROR GetRecordings(ADDON_HANDLE handle, bool deleted); /*! * Delete a recording on the backend. @@ -268,6 +273,20 @@ PVR_ERROR DeleteRecording(const PVR_RECORDING& recording); /*! + * Undelete a recording on the backend. + * @param recording The recording to undelete. + * @return PVR_ERROR_NO_ERROR if the recording has been undeleted successfully. + * @remarks Optional, and only used if bSupportsRecordingsUndelete is set to true. Return PVR_ERROR_NOT_IMPLEMENTED if this add-on won't provide this function. + */ + PVR_ERROR UndeleteRecording(const PVR_RECORDING& recording); + + /*! + * @brief Delete all recordings permanent which in the deleted folder on the backend. + * @return PVR_ERROR_NO_ERROR if the recordings has been deleted successfully. + */ + PVR_ERROR DeleteAllRecordingsFromTrash(); + + /*! * Rename a recording on the backend. * @param recording The recording to rename, containing the new name. * @return PVR_ERROR_NO_ERROR if the recording has been renamed successfully. @@ -617,7 +636,7 @@ pClient->GetBackendName = GetBackendName; pClient->GetBackendVersion = GetBackendVersion; pClient->GetDriveSpace = GetDriveSpace; - pClient->DialogChannelScan = DialogChannelScan; + pClient->OpenDialogChannelScan = OpenDialogChannelScan; pClient->MenuHook = CallMenuHook; pClient->GetEpg = GetEPGForChannel; @@ -631,12 +650,14 @@ pClient->DeleteChannel = DeleteChannel; pClient->RenameChannel = RenameChannel; pClient->MoveChannel = MoveChannel; - pClient->DialogChannelSettings = DialogChannelSettings; - pClient->DialogAddChannel = DialogAddChannel; + pClient->OpenDialogChannelSettings = OpenDialogChannelSettings; + pClient->OpenDialogChannelAdd = OpenDialogChannelAdd; pClient->GetRecordingsAmount = GetRecordingsAmount; pClient->GetRecordings = GetRecordings; pClient->DeleteRecording = DeleteRecording; + pClient->UndeleteRecording = UndeleteRecording; + pClient->DeleteAllRecordingsFromTrash = DeleteAllRecordingsFromTrash; pClient->RenameRecording = RenameRecording; pClient->SetRecordingPlayCount = SetRecordingPlayCount; pClient->SetRecordingLastPlayedPosition = SetRecordingLastPlayedPosition; diff -Nru kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/xbmc/xbmc_pvr_types.h kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/xbmc/xbmc_pvr_types.h --- kodi-pvr-addons-1.0.0~git20150130.1935-b2dc035/xbmc/xbmc_pvr_types.h 2015-01-19 19:21:07.000000000 +0000 +++ kodi-pvr-addons-1.0.0~git20150220.1227-4657d8b/xbmc/xbmc_pvr_types.h 2015-02-20 11:24:58.000000000 +0000 @@ -75,10 +75,10 @@ #define PVR_STREAM_MAX_STREAMS 20 /* current PVR API version */ -#define XBMC_PVR_API_VERSION "1.9.3" +#define XBMC_PVR_API_VERSION "1.9.4" /* min. PVR API version */ -#define XBMC_PVR_MIN_API_VERSION "1.9.3" +#define XBMC_PVR_MIN_API_VERSION "1.9.4" #ifdef __cplusplus extern "C" { @@ -122,13 +122,14 @@ */ typedef enum { - PVR_MENUHOOK_UNKNOWN =-1, /*!< @brief unknown menu hook */ - PVR_MENUHOOK_ALL = 0, /*!< @brief all categories */ - PVR_MENUHOOK_CHANNEL = 1, /*!< @brief for channels */ - PVR_MENUHOOK_TIMER = 2, /*!< @brief for timers */ - PVR_MENUHOOK_EPG = 3, /*!< @brief for EPG */ - PVR_MENUHOOK_RECORDING = 4, /*!< @brief for recordings */ - PVR_MENUHOOK_SETTING = 5, /*!< @brief for settings */ + PVR_MENUHOOK_UNKNOWN =-1, /*!< @brief unknown menu hook */ + PVR_MENUHOOK_ALL = 0, /*!< @brief all categories */ + PVR_MENUHOOK_CHANNEL = 1, /*!< @brief for channels */ + PVR_MENUHOOK_TIMER = 2, /*!< @brief for timers */ + PVR_MENUHOOK_EPG = 3, /*!< @brief for EPG */ + PVR_MENUHOOK_RECORDING = 4, /*!< @brief for recordings */ + PVR_MENUHOOK_DELETED_RECORDING = 5, /*!< @brief for deleted recordings */ + PVR_MENUHOOK_SETTING = 6, /*!< @brief for settings */ } PVR_MENUHOOK_CAT; /*! @@ -150,9 +151,11 @@ bool bSupportsTV; /*!< @brief true if this add-on provides TV channels */ bool bSupportsRadio; /*!< @brief true if this add-on supports radio channels */ bool bSupportsRecordings; /*!< @brief true if this add-on supports playback of recordings stored on the backend */ + bool bSupportsRecordingsUndelete; /*!< @brief true if this add-on supports undelete of recordings stored on the backend */ bool bSupportsTimers; /*!< @brief true if this add-on supports the creation and editing of timers */ bool bSupportsChannelGroups; /*!< @brief true if this add-on supports channel groups */ bool bSupportsChannelScan; /*!< @brief true if this add-on support scanning for new channels on the backend */ + bool bSupportsChannelSettings; /*!< @brief true if this add-on supports the following functions: DeleteChannel, RenameChannel, MoveChannel, DialogChannelSettings and DialogAddChannel */ bool bHandlesInputStream; /*!< @brief true if this add-on provides an input stream. false if XBMC handles the stream. */ bool bHandlesDemuxing; /*!< @brief true if this add-on demultiplexes packets. */ bool bSupportsRecordingFolders; /*!< @brief true if the backend supports timers / recordings in folders. */ @@ -295,6 +298,7 @@ int iGenreSubType; /*!< @brief (optional) genre sub type */ int iPlayCount; /*!< @brief (optional) play count of this recording on the client */ int iLastPlayedPosition; /*!< @brief (optional) last played position of this recording on the client */ + bool bIsDeleted; /*!< @brief (optional) shows this recording is deleted and can be undelete */ } ATTRIBUTE_PACKED PVR_RECORDING; /*! @@ -349,17 +353,19 @@ int (__cdecl* GetChannelGroupsAmount)(void); PVR_ERROR (__cdecl* GetChannelGroups)(ADDON_HANDLE, bool); PVR_ERROR (__cdecl* GetChannelGroupMembers)(ADDON_HANDLE, const PVR_CHANNEL_GROUP&); - PVR_ERROR (__cdecl* DialogChannelScan)(void); + PVR_ERROR (__cdecl* OpenDialogChannelScan)(void); int (__cdecl* GetChannelsAmount)(void); PVR_ERROR (__cdecl* GetChannels)(ADDON_HANDLE, bool); PVR_ERROR (__cdecl* DeleteChannel)(const PVR_CHANNEL&); PVR_ERROR (__cdecl* RenameChannel)(const PVR_CHANNEL&); PVR_ERROR (__cdecl* MoveChannel)(const PVR_CHANNEL&); - PVR_ERROR (__cdecl* DialogChannelSettings)(const PVR_CHANNEL&); - PVR_ERROR (__cdecl* DialogAddChannel)(const PVR_CHANNEL&); - int (__cdecl* GetRecordingsAmount)(void); - PVR_ERROR (__cdecl* GetRecordings)(ADDON_HANDLE); + PVR_ERROR (__cdecl* OpenDialogChannelSettings)(const PVR_CHANNEL&); + PVR_ERROR (__cdecl* OpenDialogChannelAdd)(const PVR_CHANNEL&); + int (__cdecl* GetRecordingsAmount)(bool); + PVR_ERROR (__cdecl* GetRecordings)(ADDON_HANDLE, bool); PVR_ERROR (__cdecl* DeleteRecording)(const PVR_RECORDING&); + PVR_ERROR (__cdecl* UndeleteRecording)(const PVR_RECORDING&); + PVR_ERROR (__cdecl* DeleteAllRecordingsFromTrash)(void); PVR_ERROR (__cdecl* RenameRecording)(const PVR_RECORDING&); PVR_ERROR (__cdecl* SetRecordingPlayCount)(const PVR_RECORDING&, int); PVR_ERROR (__cdecl* SetRecordingLastPlayedPosition)(const PVR_RECORDING&, int);