Exemplo n.º 1
0
int main(int argc, char** argv)
{
	SC_LanguageClient * client = createLanguageClient("sclang");
	if (!client)
		return 1;
	int returnCode = client->run(argc, argv);
	destroyLanguageClient(client);
	return returnCode;
}
Exemplo n.º 2
0
int vpost(const char *fmt, va_list ap)
{
	char buf[512];
	int n = vsnprintf(buf, sizeof(buf), fmt, ap);
	if (n > 0) {
		SC_LanguageClient *client = SC_LanguageClient::lockedInstance();
		if (client) client->postText(buf, sc_min(n, sizeof(buf) - 1));
		SC_LanguageClient::unlockInstance();
	}
	return 0;
}
void error(const char *fmt, ...)
{
	char buf[512];
	va_list ap;
	va_start(ap, fmt);
	int n = vsnprintf(buf, sizeof(buf), fmt, ap);
	if (n > 0) {
		SC_LanguageClient *client = SC_LanguageClient::lockedInstance();
		if (client) client->postError(buf, sc_min(n, sizeof(buf) - 1));
		SC_LanguageClient::unlockInstance();
	}
}
Exemplo n.º 4
0
void postChar(char c)
{
	SC_LanguageClient *client = SC_LanguageClient::lockedInstance();
	if (client) client->postFlush(&c, sizeof(char));
	SC_LanguageClient::unlockInstance();
}
Exemplo n.º 5
0
void postText(const char *str, long len)
{
	SC_LanguageClient *client = SC_LanguageClient::lockedInstance();
	if (client) client->postFlush(str, len);
	SC_LanguageClient::unlockInstance();
}