18 #include <CoreFoundation/CoreFoundation.h>
20 #define DLL_EXTENSION ".dylib"
21 #define FIRMWARE_FOLDER "Firmware/"
22 #elif defined(AJALinux)
24 #define DLL_EXTENSION ".so"
25 #define FIRMWARE_FOLDER "firmware/"
26 #elif defined(MSWindows)
27 #define DLL_EXTENSION ".dll"
28 #define FIRMWARE_FOLDER "Firmware\\"
29 #elif defined(AJABareMetal)
30 #define DLL_EXTENSION ".dll"
31 #define FIRMWARE_FOLDER "Firmware\\"
36 #define INSTP(_p_) xHEX0N(uint64_t(_p_),16)
37 #define NBFAIL(__x__) AJA_sERROR (AJA_DebugUnit_RPCClient, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
38 #define NBWARN(__x__) AJA_sWARNING(AJA_DebugUnit_RPCClient, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
39 #define NBNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_RPCClient, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
40 #define NBINFO(__x__) AJA_sINFO (AJA_DebugUnit_RPCClient, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
41 #define NBDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_RPCClient, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
42 #define NBCFAIL(__x__) AJA_sERROR (AJA_DebugUnit_RPCClient, AJAFUNC << ": " << __x__)
43 #define NBCWARN(__x__) AJA_sWARNING(AJA_DebugUnit_RPCClient, AJAFUNC << ": " << __x__)
44 #define NBCNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_RPCClient, AJAFUNC << ": " << __x__)
45 #define NBCINFO(__x__) AJA_sINFO (AJA_DebugUnit_RPCClient, AJAFUNC << ": " << __x__)
46 #define NBCDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_RPCClient, AJAFUNC << ": " << __x__)
47 #define NBSFAIL(__x__) AJA_sERROR (AJA_DebugUnit_RPCServer, AJAFUNC << ": " << __x__)
48 #define NBSWARN(__x__) AJA_sWARNING(AJA_DebugUnit_RPCServer, AJAFUNC << ": " << __x__)
49 #define NBSNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_RPCServer, AJAFUNC << ": " << __x__)
50 #define NBSINFO(__x__) AJA_sINFO (AJA_DebugUnit_RPCServer, AJAFUNC << ": " << __x__)
51 #define NBSDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_RPCServer, AJAFUNC << ": " << __x__)
57 if (it == mDict.end())
64 string str(valueForKey(inKey));
67 if (str.find(
"0x") == 0 || str.find(
"0X") == 0)
74 if (str.find(
"x") == 0 || str.find(
"X") == 0)
81 if (str.find(
"o") == 0 || str.find(
"O") == 0)
88 if (str.find(
"b") == 0 || str.find(
"B") == 0)
103 const string & key(it->first), val(it->second), quote(val.find(
' ') != string::npos ?
"'" :
"");
104 oss << key <<
"=" << quote << val << quote;
105 if (++it != mDict.end())
112 const int kyWdth(
int(largestKeySize()+0)), valWdth(
int(largestValueSize()+0));
113 oss << string(
size_t(kyWdth),
'-') <<
" " << string(
size_t(valWdth),
'-') << endl;
116 const string & key(it->first), val(it->second);
117 oss << std::setw(kyWdth) << key <<
" : " << val;
118 if (++it != mDict.end())
128 for (
DictConstIter it(mDict.begin()); it != mDict.end(); ++it)
129 result.insert(it->first);
136 for (
DictConstIter it(mDict.begin()); it != mDict.end(); ++it)
137 if (it->first.length() > result)
138 result = it->first.length();
145 for (
DictConstIter it(mDict.begin()); it != mDict.end(); ++it)
146 if (it->second.length() > result)
147 result = it->second.length();
153 size_t numUpdated(0);
154 for (
DictConstIter it(inDict.mDict.begin()); it != inDict.mDict.end(); ++it)
155 if (hasKey(it->first))
156 {mDict[it->first] = it->second; numUpdated++;}
163 for (
DictConstIter it(inDict.mDict.begin()); it != inDict.mDict.end(); ++it)
164 if (!hasKey(it->first))
165 {mDict[it->first] = it->second; numAdded++;}
179 mQueryParams.clear();
191 if (!inStripLeadSlash)
193 if (rsrc.at(0) ==
'/')
198 void NTV2DeviceSpecParser::Parse (
void)
207 string tokDevID, tokIndexNum, tokScheme, tokSerial, tokModelName;
208 size_t posDevID(0), posIndexNum(0), posScheme(0), posSerial(0), posModelName(0);
209 bool isSerial(ParseSerialNum(posSerial, tokSerial)), isScheme(ParseScheme(posScheme, tokScheme));
210 bool isIndexNum(ParseDecNumber(posIndexNum, tokIndexNum)), isDeviceID(ParseDeviceID(posDevID, tokDevID));
211 bool isModelName(ParseModelName(posModelName, tokModelName));
214 posDevID = posIndexNum = posSerial = posModelName = posScheme;
215 isSerial = ParseSerialNum(posSerial, tokSerial);
216 isIndexNum = ParseDecNumber(posIndexNum, tokIndexNum);
217 isDeviceID = ParseDeviceID(posDevID, tokDevID);
218 isModelName = ParseModelName(posModelName, tokModelName);
231 bool converted(
false);
233 if (tokSerial.length() == 18)
236 const bool hasLeading0X (tokSerial.find(
"0X") == 0 || tokSerial.find(
"0x") == 0);
237 const string hex64(tokSerial.substr(hasLeading0X ? 2 : 0, 16));
240 for (
size_t ndx(0); ndx < 8; ndx++)
241 serTxt +=
char(serNum64 >> ((7-ndx)*8));
247 for (
size_t ndx(0); ndx < tokSerial.length(); ndx++)
248 {
char ch(tokSerial.at(ndx));
249 if ( ! ( ( (ch >=
'0') && (ch <=
'9') ) ||
250 ( (ch >=
'A') && (ch <=
'Z') ) ||
251 ( (ch >=
'a') && (ch <=
'z') ) ||
252 (ch ==
' ') || (ch ==
'-') ) )
254 err <<
"Illegal serial number character '" << (ch ? ch :
'?') <<
"' (" <<
xHEX0N(
UWord(ch),2) <<
")";
256 mPos -= converted ? 16 : 8; mPos += ndx * (converted ? 2 : 1) + (converted ? 1 : 0);
280 err <<
"Invalid local device specification";
282 mPos += isScheme ? 12 : 0;
288 if (!IsSupportedScheme(tokScheme))
289 {err <<
"Unsupported scheme '" << tokScheme <<
"'"; AddError(err.str()); mPos -= 3;
break;}
295 size_t posURL(posScheme), posRsrc(0);
296 string host, port, rsrcPath;
297 if (!ParseHostAddressAndPortNumber(posURL, host, port))
298 {mPos = posURL; AddError(
"Bad host address or port number");
break;}
307 if (ParseResourcePath(posRsrc, rsrcPath))
310 size_t posQuery(mPos);
312 if (ParseQuery(posQuery, params))
315 mQueryParams = params;
318 if (mPos < SpecLength())
319 {err <<
"Extra character(s) at " <<
DEC(mPos); AddError(err.str());
break;}
328 #endif // defined(_DEBUG)
333 oss << (IsLocalDevice() ?
"local " :
"") <<
"device";
335 oss <<
" serial '" << DeviceSerial() <<
"'";
337 oss <<
" model '" << DeviceModel() <<
"'";
339 oss <<
" ID '" << DeviceID() <<
"'";
341 oss <<
" " << DeviceIndex();
351 {oss << endl; Results().Print(oss,
false);}
372 if (devIDStr.find(
"0X") != string::npos)
387 oss <<
DEC(ErrorCount()) << (ErrorCount() == 1 ?
" error" :
" errors") << (HasErrors() ?
":" :
"");
391 << DeviceSpec() << endl
392 << string(mPos ? mPos : 0,
' ') <<
"^" << endl;
393 for (
size_t num(0); num < ErrorCount(); )
396 if (++num < ErrorCount())
403 bool NTV2DeviceSpecParser::ParseHexNumber (
size_t & pos,
string & outToken)
407 while (pos < SpecLength())
409 const char ch(CharAt(pos));
410 if (tokHexNum.length() == 0)
414 ++pos; tokHexNum = ch;
416 else if (tokHexNum.length() == 1)
418 if (ch !=
'x' && ch !=
'X')
420 ++pos; tokHexNum += ch;
426 ++pos; tokHexNum += ch;
429 if (tokHexNum.length() > 2)
430 {
aja::upper(tokHexNum); outToken = tokHexNum;}
431 return !outToken.empty();
434 bool NTV2DeviceSpecParser::ParseDecNumber (
size_t & pos,
string & outToken)
438 while (pos < SpecLength())
440 const char ch(CharAt(pos));
441 if (!IsDecimalDigit(ch))
444 if (ch !=
'0' || tokDecNum !=
"0")
447 if (tokDecNum.length() > 0)
448 outToken = tokDecNum;
449 return !outToken.empty();
452 bool NTV2DeviceSpecParser::ParseAlphaNumeric (
size_t & pos,
string & outToken,
const std::string & inOtherChars)
456 while (pos < SpecLength())
458 const char ch(CharAt(pos));
459 if (!IsLetter(ch) && !IsDecimalDigit(ch) && inOtherChars.find(ch) == string::npos)
461 ++pos; tokAlphaNum += ch;
463 if (tokAlphaNum.length() > 1)
464 outToken = tokAlphaNum;
465 return !outToken.empty();
468 bool NTV2DeviceSpecParser::ParseScheme (
size_t & pos,
string & outToken)
471 string rawScheme, tokScheme;
472 while (ParseAlphaNumeric(pos, rawScheme))
474 tokScheme = rawScheme;
475 char ch(CharAt(pos));
478 ++pos; tokScheme += ch;
483 ++pos; tokScheme += ch;
488 ++pos; tokScheme += ch;
491 if (tokScheme.find(
"://") != string::npos)
492 {
aja::lower(rawScheme); outToken = rawScheme;}
493 return !outToken.empty();
496 bool NTV2DeviceSpecParser::ParseSerialNum (
size_t & pos,
string & outToken)
499 string tokAlphaNum, tokHexNum;
500 size_t posAlphaNum(pos), posHexNum(pos);
503 while (posAlphaNum < SpecLength())
505 const char ch(CharAt(posAlphaNum));
506 if (!IsUpperLetter(ch) && !IsDecimalDigit(ch) && ch !=
'-' && ch !=
' ')
508 ++posAlphaNum; tokAlphaNum += ch;
510 if (tokAlphaNum.length() < 2)
512 else if (tokAlphaNum.length() == 8 || tokAlphaNum.length() == 9)
513 {pos = posAlphaNum; outToken = tokAlphaNum;
break;}
515 if (ParseHexNumber(posHexNum, tokHexNum))
516 if (tokHexNum.length() == 18)
517 {pos = posHexNum; outToken = tokHexNum;}
519 return !outToken.empty();
522 bool NTV2DeviceSpecParser::ParseDeviceID (
size_t & pos,
string & outToken)
526 if (!ParseHexNumber(pos, tokHexNum))
528 if (tokHexNum.length() != 10)
537 ostringstream devID; devID <<
xHEX0N(*it,8);
538 string devIDStr(devID.str());
540 devIDStrs.insert(devIDStr);
542 if (devIDStrs.find(tokHexNum) != devIDStrs.end())
543 outToken = tokHexNum;
544 return !outToken.empty();
547 bool NTV2DeviceSpecParser::ParseModelName (
size_t & pos,
string & outToken)
551 if (!ParseAlphaNumeric(pos, tokName))
562 modelNames.insert(modelName);
564 if (modelNames.find(tokName) != modelNames.end())
566 return !outToken.empty();
569 bool NTV2DeviceSpecParser::ParseDNSName (
size_t & pos,
string & outDNSName)
572 string dnsName, name;
575 while (ParseAlphaNumeric(dnsPos, name,
"_-"))
577 if (!dnsName.empty())
585 if (!dnsName.empty())
587 outDNSName = dnsName;
588 return !outDNSName.empty();
591 bool NTV2DeviceSpecParser::ParseIPv4Address (
size_t & pos,
string & outIPv4)
594 string ipv4Name, num;
597 while (ParseDecNumber(ipv4Pos, num))
599 if (!ipv4Name.empty())
602 ch = CharAt(ipv4Pos);
607 if (!ipv4Name.empty())
610 return !outIPv4.empty();
613 bool NTV2DeviceSpecParser::ParseHostAddressAndPortNumber (
size_t & pos,
string & outAddr,
string & outPort)
615 outAddr.clear(); outPort.clear();
617 string dnsName, ipv4, port;
618 size_t dnsPos(pos), ipv4Pos(pos), portPos(0);
619 bool isDNS(ParseDNSName(dnsPos, dnsName)), isIPv4(ParseIPv4Address(ipv4Pos, ipv4));
620 if (!isDNS && !isIPv4)
621 {pos = dnsPos < ipv4Pos ? ipv4Pos : dnsPos;
return false;}
624 {outAddr = ipv4; pos = portPos = ipv4Pos;}
626 {outAddr = dnsName; pos = portPos = dnsPos;}
629 char ch (CharAt(portPos));
633 if (!ParseDecNumber(portPos, port))
634 {pos = portPos;
return false;}
640 bool NTV2DeviceSpecParser::ParseResourcePath (
size_t & pos,
string & outRsrc)
645 char ch(CharAt(rsrcPos));
650 if (!ParseAlphaNumeric(rsrcPos, name))
653 ch = CharAt(rsrcPos);
658 return !outRsrc.empty();
661 bool NTV2DeviceSpecParser::ParseParamAssignment (
size_t & pos,
string & outKey,
string & outValue)
663 outKey.clear(); outValue.clear();
665 size_t paramPos(pos);
666 char ch(CharAt(paramPos));
668 ch = CharAt(++paramPos);
671 if (!ParseAlphaNumeric(paramPos, key))
673 ch = CharAt(paramPos);
676 ch = CharAt(++paramPos);
677 while (ch != 0 && ch !=
'&')
680 ch = CharAt(++paramPos);
684 {pos = paramPos; outKey = key; outValue = value;}
688 bool NTV2DeviceSpecParser::ParseQuery (
size_t & pos,
NTV2Dictionary & outParams)
692 size_t queryPos(pos);
693 char ch(CharAt(queryPos));
698 while (ParseParamAssignment(queryPos, key, value))
700 outParams.insert(key, value);
701 ch = CharAt(queryPos);
705 if (!outParams.empty())
707 return !outParams.empty();
712 return inScheme.find(
"ntv2") == 0;
715 bool NTV2DeviceSpecParser::IsUpperLetter (
const char inChar)
716 {
static const string sHexDigits(
"_ABCDEFGHIJKLMNOPQRSTUVWXYZ");
717 return sHexDigits.find(inChar) != string::npos;
720 bool NTV2DeviceSpecParser::IsLowerLetter (
const char inChar)
721 {
static const string sHexDigits(
"abcdefghijklmnopqrstuvwxyz");
722 return sHexDigits.find(inChar) != string::npos;
725 bool NTV2DeviceSpecParser::IsLetter (
const char inChar,
const bool inIncludeUnderscore)
726 {
return (inIncludeUnderscore && inChar ==
'_') || IsUpperLetter(inChar) || IsLowerLetter(inChar);
729 bool NTV2DeviceSpecParser::IsDecimalDigit (
const char inChar)
730 {
static const string sDecDigits(
"0123456789");
731 return sDecDigits.find(inChar) != string::npos;
734 bool NTV2DeviceSpecParser::IsHexDigit (
const char inChar)
735 {
static const string sHexDigits(
"0123456789ABCDEFabcdef");
736 return sHexDigits.find(inChar) != string::npos;
739 bool NTV2DeviceSpecParser::IsLegalSerialNumChar (
const char inChar)
740 {
return IsLetter(inChar) || IsDecimalDigit(inChar);
744 void NTV2DeviceSpecParser::test (
void)
747 specParser.
Reset(
"1");
748 specParser.
Reset(
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000001");
749 specParser.
Reset(
"corvid24");
750 specParser.
Reset(
"corvid88");
751 specParser.
Reset(
"konalhi");
752 specParser.
Reset(
"alpha");
753 specParser.
Reset(
"00T64450");
754 specParser.
Reset(
"00t6-450");
755 specParser.
Reset(
"BLATZBE0");
756 specParser.
Reset(
"0x424C41545A424530");
757 specParser.
Reset(
"0x424C415425424530");
759 specParser.
Reset(
"badscheme://1");
761 specParser.
Reset(
"ntv2local://1");
762 specParser.
Reset(
"NtV2lOcAl://00000000000000000000000000000000000000000000000000000000000000000000000000000000000001");
763 specParser.
Reset(
"NTV2Local://corvid24");
764 specParser.
Reset(
"ntv2local://corvid88");
765 specParser.
Reset(
"ntv2local://konalhi");
766 specParser.
Reset(
"ntv2local://alpha");
767 specParser.
Reset(
"ntv2local://00T64450");
768 specParser.
Reset(
"ntv2local://00t6-450");
769 specParser.
Reset(
"ntv2local://BLATZBE0");
771 specParser.
Reset(
"ntv2nub://1.2.3.4");
772 specParser.
Reset(
"ntv2nub://1.2.3.4/doc");
773 specParser.
Reset(
"ntv2nub://1.2.3.4/doc/");
774 specParser.
Reset(
"ntv2nub://1.2.3.4/doc/alpha?one&two=2&three=&four=4");
775 specParser.
Reset(
"ntv2nub://1.2.3.4/doc/?one&two=2&three=&four=4");
776 specParser.
Reset(
"ntv2nub://1.2.3.4:badport/doc?one&two=2&three=&four=4");
777 specParser.
Reset(
"ntv2nub://1.2.3.4:200/doc?one&two=2&three=&four=4");
778 specParser.
Reset(
"ntv2nub://1.2.3.4:200/doc/?one&two=2&three=&four=4");
779 specParser.
Reset(
"ntv2nub://1.2.3.4:12345");
780 specParser.
Reset(
"ntv2nub://1.2.3.4:65000/doc");
781 specParser.
Reset(
"ntv2nub://1.2.3.4:32767/doc/");
782 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc/");
783 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc/?");
784 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc?");
785 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc/?one");
786 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc?one");
787 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc/?one=");
788 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc?one=");
789 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc/?one=1");
790 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc?one=1");
791 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc/?one=1&two");
792 specParser.
Reset(
"ntv2nub://1.2.3.4/path/to/doc?one=1&two");
793 specParser.
Reset(
"ntv2nub://50.200.250.300");
794 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.com/path/to/doc/?one=1&two");
795 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.edu:badport/path/to/doc/?one=1&two");
796 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.info:5544/path/to/doc/?one=1&two");
797 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.org/path/to/doc/?one=1&two");
798 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.nz:badport/path/to/doc/?one=1&two");
799 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.au:000004/path/to/doc/?one=1&two");
800 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.ch:4/corvid88");
801 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.cn:4/00T64450");
802 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.ru:4/2");
803 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.co.uk:4/00000000000000000000000000000001");
804 specParser.
Reset(
"ntv2nub://fully.qualified.domain.name.com:4/0000000000000000000000000000000001");
805 specParser.
Reset(
"ntv2://swdevice/?"
807 "&supportlog=file%3A%2F%2F%2FUsers%2Fdemo%2FDesktop%2FAJAWatcherSupport.log"
808 "&sdram=file%3A%2F%2F%2FUsers%2Fdemo%2FDesktop%2FSDRAMsnapshot.dat");
810 #endif // defined(_DEBUG)
812 #if defined(MSWindows)
813 static string WinErrStr (
const DWORD inErr)
815 string result(
"foo");
817 const DWORD res(FormatMessage ( FORMAT_MESSAGE_ALLOCATE_BUFFER
818 | FORMAT_MESSAGE_FROM_SYSTEM
819 | FORMAT_MESSAGE_IGNORE_INSERTS,
822 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
828 result =
reinterpret_cast<const char *
>(lpMsgBuf);
840 : mConnectParams (inParams)
854 {
NBFAIL(
"Cannot set connect params while connected");
return false;}
865 NBDBG(
DEC(oldCount) <<
" connect param(s) removed, replaced with " << inNewParams);
868 NBWARN(
"No connect params");
874 oss << (IsConnected() ?
"Connected" :
"Disconnected");
875 if (IsConnected() && !Name().empty())
876 oss <<
" to '" << Name() <<
"'";
898 { (void) regNum; (void) outRegValue; (void) regMask; (void) regShift;
903 { (void) regNum; (void) regValue; (void) regMask; (void) regShift;
908 { (void) autoCircData;
913 { (void) eInterrupt; (void) timeOutMs;
917 #if !defined(NTV2_DEPRECATE_16_3)
919 { (void) bitFileType;
920 ::memset(&bitFileInfo, 0,
sizeof(bitFileInfo));
926 ::memset(&buildInfo, 0,
sizeof(buildInfo));
931 const UWord signalMask,
const bool testPatDMAEnb,
const ULWord testPatNum)
932 { (void) channel; (void) testPatternFBF; (void) signalMask; (void) testPatDMAEnb; (void) testPatNum;
937 { (void) numRegs; (void) outFailedRegNum; (void) outRegs;
943 outDriverVersion = 0xFFFFFFFF;
946 #endif // !defined(NTV2_DEPRECATE_16_3)
950 const ULWord inNumSegments,
const ULWord inSegmentHostPitch,
951 const ULWord inSegmentCardPitch,
const bool inSynchronous)
952 { (void) inDMAEngine; (void) inIsRead; (void) inFrameNumber; (void) inOutFrameBuffer;
953 (void) inCardOffsetBytes; (void) inNumSegments; (void) inSegmentHostPitch;
954 (void) inSegmentCardPitch; (void) inSynchronous;
977 outSupported.clear();
1000 if (scheme.find(
"ntv2"))
1005 string pluginName(scheme), pluginPath, dllsFolder, errStr;
1009 NBCDBG(
"AJA firmware path is '" << pluginPath <<
"', seeking '" << pluginName <<
DLL_EXTENSION "'");
1014 dllsFolder = pluginPath;
1015 dllsFolder.erase(dllsFolder.length()-1,1);
1019 #if defined(MSWindows)
1021 std::wstring dllsFolderW;
1023 if (!AddDllDirectory(dllsFolderW.c_str()))
1024 {
NBCFAIL(
"AddDllDirectory '" << pluginPath <<
"' failed: " << WinErrStr(::GetLastError()));
1027 HMODULE pHandle = ::LoadLibraryExA(LPCSTR(pluginPath.c_str()),
AJA_NULL, LOAD_LIBRARY_SEARCH_USER_DIRS);
1029 err <<
"Unable to open '" << pluginPath <<
"' in '" << dllsFolder <<
"': " << WinErrStr(::GetLastError());
1030 #elif defined(AJABareMetal)
1034 #else // MacOS or Linux
1036 void* pHandle = ::dlopen(pluginPath.c_str(), RTLD_LAZY);
1038 {
const char * pErrorStr(::dlerror());
1039 errStr = pErrorStr ? pErrorStr :
"";
1040 err <<
"Unable to open '" << pluginPath <<
"': " << errStr;
1042 #endif // MacOS or Linux
1045 NBCDBG(
"'" << pluginPath <<
"' opened");
1048 #if defined(MSWindows)
1049 uint64_t * pFunc =
reinterpret_cast<uint64_t*
>(::GetProcAddress(pHandle, inFuncName.c_str()));
1051 err <<
"'GetProcAddress' failed for '" << inFuncName <<
"' in '" << pluginPath <<
"': " << WinErrStr(::GetLastError());
1052 #elif defined(AJABareMetal)
1054 #else // MacOS or Linux
1055 uint64_t * pFunc =
reinterpret_cast<uint64_t*
>(::dlsym(pHandle, inFuncName.c_str()));
1057 {
const char * pErrorStr(::dlerror());
1058 errStr = pErrorStr ? pErrorStr :
"";
1059 err <<
"'dlsym' failed for '" << inFuncName <<
"' in '" << pluginPath <<
"': " << errStr;
1061 #endif // MacOS or Linux
1065 #if defined(AJABareMetal)
1067 #elif !defined(MSWindows)
1070 ::FreeLibrary(pHandle);
1073 else NBCDBG(
"Calling '" << inFuncName <<
"' in '" << pluginPath <<
"'");
1089 NBCFAIL(
"'" << funcName <<
"' failed to return NTV2RPCClientAPI instance using: " << inParams);
1091 NBCINFO(
"'" << funcName <<
"' created instance " <<
xHEX0N(uint64_t(pRPCObject),16));
1111 NBSFAIL(
"'" << funcName <<
"' failed to return NTV2RPCServerAPI instance using: " << inParams);
1113 NBSINFO(
"'" << funcName <<
"' created instance " <<
xHEX0N(uint64_t(pRPCObject),16));
1121 if (parser.HasErrors())
1127 : mConfigParams (inParams)
1154 size_t oldCount(
mConfigParams.size()), updated(0), added(0);
1164 NBSDBG(
DEC(oldCount) <<
" config param(s) removed, replaced with " << inNewParams);