size_t get_unitex_version_revision_xml_string(char* string, size_t buflen)
{
#ifdef SVN_REVISION
	const char* xmlStringRevision = "\0<UnitexRevision>" STRINGIZE(SVN_REVISION) "</UnitexRevision>\0";
#else
	const char* xmlStringRevision = "\0<UnitexVersionInfo>xxxx</UnitexVersionInfo>\0";
#endif

#if defined(UNITEX_MAJOR_VERSION_NUMBER) && defined(UNITEX_MINOR_VERSION_NUMBER)
	const char* xmlStringVersion = "\0<UnitexMajorVersion>"  STRINGIZE(UNITEX_MAJOR_VERSION_NUMBER) "</UnitexMajorVersion>" \
		"<UnitexMinorVersion>"  STRINGIZE(UNITEX_MINOR_VERSION_NUMBER) "</UnitexMinorVersion>" \
		"\0";
#else
	const char* xmlStringVersion = "\0<UnitexMajorVersion>x</UnitexMajorVersion>"
		"<UnitexMinorVersion>x</UnitexMinorVersion>\0";
#endif

	const char* xmlStringSemVer = "\0<UnitexSemVer>" UNITEX_SEMVER_STRING "</UnitexSemVer>";

	const char* usableXmlStringRevision = xmlStringRevision + 1;
	const char* usableXmlStringVersion = xmlStringVersion + 1;
	const char* usableXmlStringSemVer = xmlStringSemVer + 1;
	size_t len = strlen(usableXmlStringRevision)+strlen(usableXmlStringVersion)+strlen(usableXmlStringSemVer)+(3*strlen("\n"));
	if (buflen > len) {
		strcpy(string, usableXmlStringVersion);
		strcat(string, "\n");
		strcat(string, usableXmlStringRevision);
		strcat(string, "\n");
		strcat(string, usableXmlStringSemVer);
		strcat(string, "\n");
	}

	return len + 1;
}
Exemplo n.º 2
0
int main(int argc, char* argv[])
{
    arg_SetArgs((size_t)argc, (char**)argv);

    LE_DEBUG("== Starting Executable '%s' ==", STRINGIZE(LE_EXECUTABLE_NAME));

    LE_LOG_SESSION = log_RegComponent( STRINGIZE(LE_COMPONENT_NAME), &LE_LOG_LEVEL_FILTER_PTR);

    // Connect to the Log Control Daemon.
    // The sooner we can connect to the Log Control Daemon, the better, because that is when
    // we obtain any non-default log settings that have been set using the interactive log
    // control tool.  However, we can't do that until we have a working IPC messaging system.
    // However, the Log Control Daemon shouldn't try to connect to itself.
    // Also, the Service Directory shouldn't try to use the messaging system, so it can't
    // connect to the Log Control Daemon either.  Besides, the Service Directory starts before
    // the Log Control Daemon starts.
    #ifndef NO_LOG_CONTROL
        log_ConnectToControlDaemon();
    #endif

    //@todo: Block all signals that the user intends to handle with signal events.

    // Queue up all the component initialization functions to be called by the Event Loop after
    // it processes any messages that were received from the Log Control Daemon.
    event_QueueComponentInit(_le_event_InitializeComponent);


    LE_DEBUG("== Starting Event Processing Loop ==");

    le_event_RunLoop();

    LE_FATAL("SHOULDN'T GET HERE!");
}
Exemplo n.º 3
0
void initQSettings() {
    QCoreApplication::setOrganizationName(Constants::ORGANIZATION_NAME);
    QCoreApplication::setOrganizationDomain(Constants::ORGANIZATION_DOMAIN);
    QCoreApplication::setApplicationName(Constants::APPLICATION_NAME);
    QString appVersion(STRINGIZE(BUILDNUMBER));
    QCoreApplication::setApplicationVersion(XPIKS_VERSION_STRING " " STRINGIZE(XPIKS_VERSION_SUFFIX) " - " +
                                            appVersion.left(10));
}
Exemplo n.º 4
0
void SeafileTrayIcon::about()
{
    QMessageBox::about(seafApplet->mainWindow(), tr("About %1").arg(getBrand()),
                       tr("<h2>%1 Client %2</h2>").arg(getBrand()).arg(
                           STRINGIZE(SEAFILE_CLIENT_VERSION))
#if defined(SEAFILE_CLIENT_REVISION)
                       .append("<h4> REV %1 </h4>")
                       .arg(STRINGIZE(SEAFILE_CLIENT_REVISION))
#endif
                       );
}
Exemplo n.º 5
0
OIIO_EXPORT const char*
jpeg_imageio_library_version()
{
#define STRINGIZE2(a) #a
#define STRINGIZE(a) STRINGIZE2(a)
#ifdef LIBJPEG_TURBO_VERSION
    return "jpeg-turbo " STRINGIZE(LIBJPEG_TURBO_VERSION) "/jp" STRINGIZE(
        JPEG_LIB_VERSION);
#else
    return "jpeglib " STRINGIZE(JPEG_LIB_VERSION_MAJOR) "." STRINGIZE(
        JPEG_LIB_VERSION_MINOR);
#endif
}
Exemplo n.º 6
0
lh_class *LH_MonitoringBar::classInfo()
{
    static lh_class classInfo =
    {
        sizeof(lh_class),
        STRINGIZE(MONITORING_FOLDER),
        STRINGIZE(COMMON_OBJECT_NAME)"Bar",
        STRINGIZE(COMMON_OBJECT_NAME)" (Bar)",
        48,48
        
    };

    return &classInfo;
}
Exemplo n.º 7
0
lh_class *LH_MonitoringDial::classInfo()
{
    static lh_class classInfo =
    {
        sizeof(lh_class),
        STRINGIZE(MONITORING_FOLDER),
        STRINGIZE(COMMON_OBJECT_NAME)"Dial",
        STRINGIZE(COMMON_OBJECT_NAME)" (Dial)",
        48,48,
        lh_object_calltable_NULL,
        lh_instance_calltable_NULL
    };

    return &classInfo;
}
Exemplo n.º 8
0
//--------------------------------------------------------------------------------------------------
void comp1_Foo(void)
{
    LE_DEBUG("comp1 %d msg", LE_LOG_DEBUG);
    LE_INFO("comp1 %d msg", LE_LOG_INFO);
    LE_WARN("comp1 %d msg", LE_LOG_WARN);
    LE_ERROR("comp1 %d msg", LE_LOG_ERR);
    LE_CRIT("comp1 %d msg", LE_LOG_CRIT);
    LE_EMERG("comp1 %d msg", LE_LOG_EMERG);

    le_log_TraceRef_t trace1 = le_log_GetTraceRef("key 1");
    le_log_TraceRef_t trace2 = le_log_GetTraceRef("key 2");

    LE_TRACE(trace1, "Trace msg in %s", STRINGIZE(LE_COMPONENT_NAME));
    LE_TRACE(trace2, "Trace msg in %s", STRINGIZE(LE_COMPONENT_NAME));
}
Exemplo n.º 9
0
int POLL_FUNC_NAME(POLL_FUNC_SIG) {
	if (pollmethod_orig == NULL) {
		pollmethod_orig = dlsym(RTLD_NEXT, STRINGIZE(POLL_FUNC_NAME));
		MIN_POLL_C = getenv("MIN_POLL");
		SET_POLL_C = getenv("SET_POLL");
		if (MIN_POLL_C && is_only_digits(MIN_POLL_C)) {
			MIN_POLL = atoi(MIN_POLL_C);
		}
		if (SET_POLL_C && is_only_digits(SET_POLL_C)) {
			SET_POLL = atoi(SET_POLL_C);
		}
	}
#ifdef linux
	if (timeout>=0 && timeout < MIN_POLL) {
		timeout = SET_POLL;
	}
	return pollmethod_orig(fds, nfds, timeout);
#endif
#ifdef __APPLE__
	struct timespec new_timeout;

	if (timeout->tv_nsec < MIN_POLL * 1000000) {
		new_timeout.tv_nsec = SET_POLL * 1000000;
	}
	else {
		new_timeout = *timeout;
	}
	return pollmethod_orig(kq, changelist, nchanges, eventlist, nevents, &new_timeout);
#endif
}
Exemplo n.º 10
0
void SeafileApplet::onGetLatestVersionInfoSuccess(const QString& latest_version)
{
    QString current_version = STRINGIZE(SEAFILE_CLIENT_VERSION);

    int ret;
    if (compareVersions(current_version, latest_version, &ret) < 0) {
        return;
    }

    if (ret >= 0) {
        return;
    }

    QString msg = tr("A new version of %1 client (%2) is available.\n"
                     "Do you want to visit the download page?").arg(getBrand()).arg(latest_version);

    if (!yesOrNoBox(msg, NULL, true)) {
        return;
    }

    QString url;
    if (QLocale::system().name() == "zh_CN") {
        url = kSeafileClientDownloadUrlChinese;
    } else {
        url = kSeafileClientDownloadUrl;
    }

    QDesktopServices::openUrl(url);
}
Exemplo n.º 11
0
static struct rotation decode_rotation(const struct http_vars *vars,
				       unsigned int num_seats)
{
	struct rotation rot;
	unsigned int i;

	rot.size = num_seats;
	for (i = 0; i < rot.size; i++) {
		char varname[strlen("rotation")
			    + sizeof(STRINGIZE(MAX_ELECTORATE_SEATS))];
		const char *val;

		sprintf(varname, "rotation%u", i);
		val = http_string(vars, varname);
		rot.rotations[i] = atoi(val);
	}

	/* Do sanity checks on input: must be all numbers up to rot.size */
	for (i = 0; i < rot.size; i++) {
		unsigned int j;

		if (rot.rotations[i] >= rot.size)
			bailout("Bad rotation #%u: %u\n", i, rot.rotations[i]);

		for (j = 0; j < rot.size; j++) {
			if (j != i && rot.rotations[j] == rot.rotations[i])
				bailout("Rotations %u & %u == %u\n",
					j, i, rot.rotations[i]);
		}
	}
	return rot;
}
std::string construct_start_string()
{
	std::string start;
	LLSLURL start_slurl = LLStartUp::getStartSLURL();
	switch(start_slurl.getType())
	{
		case LLSLURL::LOCATION:
		{
			// a startup URL was specified
			LLVector3 position = start_slurl.getPosition();
			std::string unescaped_start = 
			STRINGIZE(  "uri:" 
					  << start_slurl.getRegion() << "&" 
						<< position[VX] << "&" 
						<< position[VY] << "&" 
						<< position[VZ]);
			start = xml_escape_string(unescaped_start);
			break;
		}
		case LLSLURL::HOME_LOCATION:
		{
			start = "home";
			break;
		}
		default:
		{
			start = "last";
		}
	}
	return start;
}
Exemplo n.º 13
0
/*static*/ OsPath Paths::RootData(const OsPath& argv0)
{

#ifdef INSTALLED_DATADIR
	UNUSED2(argv0);
	return OsPath(STRINGIZE(INSTALLED_DATADIR))/"";
#else

# if OS_MACOSX
	if (osx_IsAppBundleValid())
	{
		debug_printf(L"Valid app bundle detected\n");

		std::string resourcesPath = osx_GetBundleResourcesPath();
		// Ensure we have a valid resources path
		ENSURE(!resourcesPath.empty());

		return OsPath(resourcesPath)/"data"/"";
	}
# endif // OS_MACOSX

	return Root(argv0)/"data"/"";

#endif // INSTALLED_DATADIR
}
Exemplo n.º 14
0
/* DDS3.2.6: Get Rotation */
void get_rotation(const struct electorate *elec)
{
	struct http_vars *reply;
	unsigned int i;
	char ecodestr[INT_CHARS];
	struct http_vars request[]
		= { { (char*)"ecode", ecodestr }, { NULL, NULL } };

	sprintf(ecodestr, "%u", elec->code);

	reply = http_exchange(SERVER_ADDRESS, SERVER_PORT, ROBSON_CGI,request);
	if (!reply)
		display_error(ERR_SERVER_UNREACHABLE);

	/* Some error occurred? */
	if (http_error(reply))
		display_error(http_error(reply));

	for (i = 0; i < elec->num_seats; i++) {
		char varname[strlen("rotation")
			    + sizeof(STRINGIZE(MAX_ELECTORATE_SEATS))];
		const char *val;

		sprintf(varname, "rotation%u", i);
		val = http_string(reply, varname);
		current_rotation.rotations[i] = atoi(val);
		assert(current_rotation.rotations[i] < elec->num_seats);
	}
	/* DDS3.2.6: Save Rotation */
	current_rotation.size = elec->num_seats;
	http_free(reply);
}
Exemplo n.º 15
0
// called when an exception is detected (see below); provides detailed
// debugging information and exits.
//
// note: keep memory allocs and locking to an absolute minimum, because
// they may deadlock the process!
long __stdcall wseh_ExceptionFilter(struct _EXCEPTION_POINTERS* ep)
{
	// OutputDebugString raises an exception, which OUGHT to be swallowed
	// by WaitForDebugEvent but sometimes isn't. if we see it, ignore it.
	if(ep->ExceptionRecord->ExceptionCode == 0x40010006)	// DBG_PRINTEXCEPTION_C
		return EXCEPTION_CONTINUE_EXECUTION;

	// if run in a debugger, let it handle exceptions (tends to be more
	// convenient since it can bring up the crash location)
	if(IsDebuggerPresent())
		return EXCEPTION_CONTINUE_SEARCH;

	// make sure we don't recurse infinitely if this function raises an
	// SEH exception. (we may only have the guard page's 4 KB worth of
	// stack space if the exception is EXCEPTION_STACK_OVERFLOW)
	static intptr_t nestingLevel = 0;
	cpu_AtomicAdd(&nestingLevel, 1);
	if(nestingLevel >= 3)
		return EXCEPTION_CONTINUE_SEARCH;

	// someone is already holding the dbghelp lock - this is bad.
	// we'll report this problem first and then try to display the
	// exception info regardless (maybe dbghelp won't blow up).
	if(wutil_IsLocked(WDBG_SYM_CS) == 1)
		DEBUG_DISPLAY_ERROR(L"Exception raised while critical section is held - may deadlock..");

	// a dump file is essential for debugging, so write it before
	// anything else goes wrong (especially before showing the error
	// dialog because the user could choose to exit immediately)
	wdbg_sym_WriteMinidump(ep);

	// extract details from ExceptionRecord.
	wchar_t descriptionBuf[150];
	const wchar_t* description = GetExceptionDescription(ep, descriptionBuf, ARRAY_SIZE(descriptionBuf));
	wchar_t file[DEBUG_FILE_CHARS] = {0};
	int line = 0;
	wchar_t func[DEBUG_SYMBOL_CHARS] = {0};
	GetExceptionLocus(ep, file, &line, func);

	wchar_t message[500];
	const wchar_t* messageFormat =
		L"Much to our regret we must report the program has encountered an error.\r\n"
		L"\r\n"
		L"Please let us know at http://trac.wildfiregames.com/ and attach the crashlog.txt and crashlog.dmp files.\r\n"
		L"\r\n"
		L"Details: unhandled exception (%ls)\r\n";
	swprintf_s(message, ARRAY_SIZE(message), messageFormat, description);

	size_t flags = 0;
	if(ep->ExceptionRecord->ExceptionFlags & EXCEPTION_NONCONTINUABLE)
		flags = DE_NO_CONTINUE;
	const wchar_t* const lastFuncToSkip = WIDEN(STRINGIZE(DECORATED_NAME(wseh_ExceptionFilter)));
	ErrorReaction er = debug_DisplayError(message, flags, ep->ContextRecord, lastFuncToSkip, file,line,utf8_from_wstring(func).c_str(), 0);
	ENSURE(er == ER_CONTINUE);	// nothing else possible

	// invoke the Win32 default handler - it calls ExitProcess for
	// most exception types.
	return EXCEPTION_CONTINUE_SEARCH;
}
 std::string lookup(LLSD::Type type) const
 {
     MapType::const_iterator found = mMap.find(type);
     if (found != mMap.end())
     {
         return found->second;
     }
     return STRINGIZE("<unknown LLSD type " << type << ">");
 }
Exemplo n.º 17
0
bool OyunApp::OnInit()
{
	// Play like a nice Linux application
	for (int i = 1 ; i < argc ; i++)
	{
		if (!wxStrcmp(argv[i], wxT("--version")))
		{
			const wchar_t *version = wxT(STRINGIZE( OYUN_VERSION ));
			const wxString verstring =
				_("Oyun %ls\n"
				  "Copyright (C) 2004-2011 Charles Pence\n"
				  "License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\n"
				  "This is free software: you are free to change and redistribute it.\n"
				  "There is NO WARRANTY, to the extent permitted by law.\n");
			wxPrintf(verstring, version);
			
			return false;
		}
		else if (!wxStrcmp(argv[i], wxT("--help")))
		{
			const wxString helpstring =
				_("Usage: oyun [OPTION]...\n"
				  "Run an evolutionary game theory tournament.\n"
				  "\n"
				  "  --test       run the Oyun testing suite\n"
				  "  --help       display this help and exit\n"
				  "  --version    output version information and exit\n"
				  "\n"
				  "Report bugs to: <*****@*****.**>.\n"
				  "Oyun home page: <http://charlespence.net/oyun/>.\n");
			wxPrintf(wxT("%s"), helpstring);
			
			return false;
		}
    else
		{
			// Invalid command-line parameter
			wxPrintf(_("oyun: unrecognized option `%ls'\n"
			           "Try `oyun --help' for more information.\n"), argv[i]);
			
			return false;
		}
	}
	
	// Seed the RNG
	Random::Seed(time(NULL));
	
#ifdef __WXMAC__
	// Create the common OS X menu bar if we need it
	CreateMacMenuBar();
#endif
	
	// Make the first wizard
	CreateWizard();
	
	return true;
}
size_t get_unitex_version_revision_json_string(char* string, size_t buflen)
{
#if defined(UNITEX_MAJOR_VERSION_NUMBER) && defined(UNITEX_MINOR_VERSION_NUMBER) && defined (SVN_REVISION)
	const char* jsonString = "\0{\"UnitexMajorVersion\":" STRINGIZE(UNITEX_MAJOR_VERSION_NUMBER)
		", \"UnitexMinorVersion\":" STRINGIZE(UNITEX_MINOR_VERSION_NUMBER) ", \"UnitexRevision\":" STRINGIZE(SVN_REVISION) \
		", \"UnitexSemVer\":\"" UNITEX_SEMVER_STRING "\"}";
#else
	const char* jsonString = "\0{\"UnitexMajorVersion\":-1, \"UnitexMinorVersion\":-1, \"UnitexRevision\":-1, \"UnitexSemVer\":\"" UNITEX_SEMVER_STRING "\"}";
#endif

	const char* usableStringRevision = jsonString + 1;

	size_t len = strlen(usableStringRevision);
	if (buflen > len) {
		strcpy(string, usableStringRevision);
	}

	return len + 1;
}
Exemplo n.º 19
0
    namespace version
    {
      /// \brief the major version of yaggler
      extern constexpr size_t major = _PROJ_VERSION_MAJOR;

      /// \brief the minor version of yaggler
      extern constexpr size_t minor = _PROJ_VERSION_MINOR;

      /// \brief the "superminor" (fix number) version of yaggler
      extern constexpr size_t superminor = _PROJ_VERSION_SUPERMINOR;

      /// \brief string representing the yaggler version in the form \e major.minor.superminor
      extern constexpr string_t short_string = STRINGIZE(_PROJ_VERSION_MAJOR) "." STRINGIZE(_PROJ_VERSION_MINOR) "." STRINGIZE(_PROJ_VERSION_SUPERMINOR);

#define YAGGLER_BUILD_TIMESTAMP __TIMESTAMP__
      /// \brief a more exhaustive string adding the build timestamp of yaggler
      /// \see short_string
      extern constexpr string_t string = STRINGIZE(_PROJ_VERSION_MAJOR) "." STRINGIZE(_PROJ_VERSION_MINOR) "." STRINGIZE(_PROJ_VERSION_SUPERMINOR) " (" YAGGLER_BUILD_TIMESTAMP ")";
    } // namespace version
Exemplo n.º 20
0
void InitSearchPaths (void)
/* Initialize the path search list */
{
    /* Create the search path lists */
    LibSearchPath = NewSearchPath ();
    ObjSearchPath = NewSearchPath ();
    CfgSearchPath = NewSearchPath ();

    LibDefaultPath = NewSearchPath ();
    ObjDefaultPath = NewSearchPath ();
    CfgDefaultPath = NewSearchPath ();

    /* Always search all stuff in the current directory */
    AddSearchPath (LibSearchPath, "");
    AddSearchPath (ObjSearchPath, "");
    AddSearchPath (CfgSearchPath, "");

    /* Add specific paths from the environment. */
    AddSearchPathFromEnv (LibDefaultPath, "LD65_LIB");
    AddSearchPathFromEnv (ObjDefaultPath, "LD65_OBJ");
    AddSearchPathFromEnv (CfgDefaultPath, "LD65_CFG");

    /* Add paths relative to a main directory defined in an env. var. */
    AddSubSearchPathFromEnv (LibDefaultPath, "CC65_HOME", "lib");
    AddSubSearchPathFromEnv (ObjDefaultPath, "CC65_HOME", "lib");
    AddSubSearchPathFromEnv (CfgDefaultPath, "CC65_HOME", "cfg");

    /* Add some compiled-in search paths if defined at compile time. */
#if defined(LD65_LIB) && !defined(_WIN32)
    AddSearchPath (LibDefaultPath, STRINGIZE (LD65_LIB));
#endif
#if defined(LD65_OBJ) && !defined(_WIN32)
    AddSearchPath (ObjDefaultPath, STRINGIZE (LD65_OBJ));
#endif
#if defined(LD65_CFG) && !defined(_WIN32)
    AddSearchPath (CfgDefaultPath, STRINGIZE (LD65_CFG));
#endif

    /* Add paths relative to the parent directory of the Windows binary. */
    AddSubSearchPathFromWinBin (LibDefaultPath, "lib");
    AddSubSearchPathFromWinBin (ObjDefaultPath, "lib");
    AddSubSearchPathFromWinBin (CfgDefaultPath, "cfg");
}
Exemplo n.º 21
0
/*************************************************************************
    Load all windowrendererset modules specified.and register factories.
*************************************************************************/
void Scheme::loadWindowRendererFactories()
{
    // check factories
    std::vector<WRModule>::iterator cmod = d_windowRendererModules.begin();
    for (;cmod != d_windowRendererModules.end(); ++cmod)
    {
        if (!(*cmod).wrModule)
        {
#if !defined(CEGUI_STATIC)
            // load dynamic module as required
            if (!(*cmod).dynamicModule)
			{
				String name = (*cmod).name;
				name += STRINGIZE(CEGUI_VERSION_POSTFIX);
                (*cmod).dynamicModule = new DynamicModule(name);
			}

            WindowRendererModule& (*getWRModuleFunc)() =
                reinterpret_cast<WindowRendererModule&(*)()>(
                    (*cmod).dynamicModule->
                        getSymbolAddress("getWindowRendererModule"));

            if (!getWRModuleFunc)
                throw InvalidRequestException(
                    "Scheme::loadWindowRendererFactories: Required function "
                    "export 'WindowRendererModule& getWindowRendererModule()' "
                    "was not found in module '" + (*cmod).name + "'.");

            // get the WindowRendererModule object for this module.
            (*cmod).wrModule = &getWRModuleFunc();
#else
            (*cmod).wrModule = &getWindowRendererModule();
#endif
        }

        // see if we should just register all factories available in the module
        // (i.e. No factories explicitly specified)
        if ((*cmod).wrTypes.size() == 0)
        {
            Logger::getSingleton().logEvent("No window renderer factories "
                                            "specified for module '" +
                                            (*cmod).name + "' - adding all "
                                            "available factories...");
            (*cmod).wrModule->registerAllFactories();
        }
        // some names were explicitly given, so only register those.
        else
        {
            std::vector<String>::const_iterator elem = (*cmod).wrTypes.begin();
            for (; elem != (*cmod).wrTypes.end(); ++elem)
                (*cmod).wrModule->registerFactory(*elem);
        }
    }
}
Exemplo n.º 22
0
void SeafileApplet::checkLatestVersionInfo()
{
    QString id = rpc_client_->getCcnetPeerId();
    QString version = STRINGIZE(SEAFILE_CLIENT_VERSION);

    GetLatestVersionRequest *req = new GetLatestVersionRequest(id, version);
    req->send();

    connect(req, SIGNAL(success(const QString&)),
            this, SLOT(onGetLatestVersionInfoSuccess(const QString&)));
}
Exemplo n.º 23
0
	Info(const LLSD& request):
		response(LLSD(), request),
		groupname(request["group"]),
		group(LLControlGroup::getInstance(groupname)),
		key(request["key"]),
		control(NULL)
	{
		if (! group)
		{
			response.error(STRINGIZE("Unrecognized group '" << groupname << "'"));
			return;
		}

		control = group->getControl(key);
		if (! control)
		{
			response.error(STRINGIZE("In group '" << groupname
									 << "', unrecognized control key '" << key << "'"));
		}
	}
Exemplo n.º 24
0
static void TimeoutHandler
(
    le_timer_Ref_t timerRef
)
{
    if (WaitingForConnection)
    {
        LE_ERROR("Couldn't establish connection after " STRINGIZE(TIMEOUT_SECS) " seconds");
        exit(EXIT_FAILURE);
    }
}
static std::string lookup(LLCommandHandler::EUntrustedAccess value)
{
    for (symbol_info *sii(symbols), *siend(symbols + (sizeof(symbols)/sizeof(symbols[0])));
            sii != siend; ++sii)
    {
        if (sii->value == value)
        {
            return sii->name;
        }
    }
    return STRINGIZE("UNTRUSTED_" << value);
}
Exemplo n.º 26
0
lh_class *LH_MonitoringText::classInfo()
{
    static lh_class classInfo =
    {
        sizeof(lh_class),
        STRINGIZE(MONITORING_FOLDER),
        STRINGIZE(COMMON_OBJECT_NAME)"Text",
        STRINGIZE(COMMON_OBJECT_NAME)" (Text)",
        -1, -1,

    };

    if( classInfo.width == -1 )
    {
        QFont font;
        QFontMetrics fm( font );
        classInfo.height = fm.height();
        classInfo.width = fm.width("100%");
    }

    return &classInfo;
}
Exemplo n.º 27
0
static BOOL add_hooks()
{
    wchar_t curFile[512];
    GetModuleFileNameW(NULL, curFile, 512);

    wstring f = strlower(wstring(curFile));

    // bail immediately if we're in a system process. We don't want to hook, log, anything -
    // this instance is being used for a shell extension.
    if(f.find(L"dllhost.exe") != wstring::npos || f.find(L"explorer.exe") != wstring::npos)
    {
#ifndef _RELEASE
        OutputDebugStringA("Hosting " STRINGIZE(RDOC_DLL_FILE) ".dll in shell process\n");
#endif
        return TRUE;
    }

    if(f.find(CONCAT(L, STRINGIZE(RDOC_DLL_FILE)) L"cmd.exe") != wstring::npos ||
            f.find(CONCAT(L, STRINGIZE(RDOC_DLL_FILE)) L"ui.vshost.exe") != wstring::npos ||
            f.find(L"q" CONCAT(L, STRINGIZE(RDOC_DLL_FILE)) L".exe") != wstring::npos ||
            f.find(CONCAT(L, STRINGIZE(RDOC_DLL_FILE)) L"ui.exe") != wstring::npos)
    {
        RDCDEBUG("Not creating hooks - in replay app");

        RenderDoc::Inst().SetReplayApp(true);

        RenderDoc::Inst().Initialise();

        return true;
    }

    RenderDoc::Inst().Initialise();

    RDCLOG("Loading into %ls", curFile);

    LibraryHooks::GetInstance().CreateHooks();

    return TRUE;
}
Exemplo n.º 28
0
static BOOL add_hooks()
{
  wchar_t curFile[512];
  GetModuleFileNameW(NULL, curFile, 512);

  wstring f = strlower(wstring(curFile));

  // bail immediately if we're in a system process. We don't want to hook, log, anything -
  // this instance is being used for a shell extension.
  if(f.find(L"dllhost.exe") != wstring::npos || f.find(L"explorer.exe") != wstring::npos)
  {
#ifndef _RELEASE
    OutputDebugStringA("Hosting " STRINGIZE(RDOC_DLL_FILE) ".dll in shell process\n");
#endif
    return TRUE;
  }

  // search for an exported symbol with this name, typically renderdoc__replay__marker
  if(HOOKS_IDENTIFY(STRINGIZE(RDOC_DLL_FILE) "__replay__marker"))
  {
    RDCDEBUG("Not creating hooks - in replay app");

    RenderDoc::Inst().SetReplayApp(true);

    RenderDoc::Inst().Initialise();

    return true;
  }

  RenderDoc::Inst().Initialise();

  RDCLOG("Loading into %ls", curFile);

  LibraryHooks::GetInstance().CreateHooks();

  return TRUE;
}
Exemplo n.º 29
0
    QString SpellCheckService::getDictsRoot() const {
        QString resourcesPath;
#if defined(INTEGRATION_TESTS) || defined(UI_TESTS)
        resourcesPath = STRINGIZE(DEPS_DIR);
#else
        resourcesPath = QCoreApplication::applicationDirPath();
#if defined(Q_OS_MAC)
        resourcesPath += "/../Resources/";
#endif
#endif

        resourcesPath += "/dict/";

        return QDir::cleanPath(resourcesPath);
    }
Exemplo n.º 30
0
void LLViewerControlListener::vars(LLSD const & request)
{
	// This method doesn't use Info, because we're not looking up a specific
	// control name.
	Response response(LLSD(), request);
	std::string groupname(request["group"]);
	LLControlGroup* group(LLControlGroup::getInstance(groupname));
	if (! group)
	{
		return response.error(STRINGIZE("Unrecognized group '" << groupname << "'"));
	}

	CollectVars collector(group);
	group->applyToAll(&collector);
	response["vars"] = collector.vars;
}