Пример #1
0
// xchat.nickcmp(lhs, rhs)
static int xclua_nickcmp(lua_State * L) {
	const char * lhs = luaL_checkstring(L, 1);
	const char * rhs = luaL_checkstring(L, 2);
	int R = xchat_nickcmp(ph, lhs, rhs);
	lua_pushinteger(L, R);
	return 1;
}
Пример #2
0
/*
 * lua:  xchat.nickcmp(name1, name2)
 * desc: Performs a nick name comparision, based on the current server 
 *       connection. This might be a RFC1459 compliant string compare, or 
 *       plain ascii (in the case of DALNet). Use this to compare channels 
 *       and nicknames. The function works the same way as strcasecmp. 
 * ret:  number ess than, equal to, or greater than zero if name1 is found, 
 *       respectively, to be less than, to match, or be greater than name2. 
 * args:
 *       * name1 (string): nick or channel name
 *       * name2 (string): nick or channel name
 */
static int lxc_nickcmp(lua_State *L)
{
	const char *n1 = luaL_checkstring(L, 1);
	const char *n2 = luaL_checkstring(L, 2);
	lua_pushnumber(L, (double)xchat_nickcmp(ph, n1, n2));
	return 1;
}
Пример #3
0
static
XS (XS_Xchat_nickcmp)
{
	dXSARGS;
	if (items != 2) {
		xchat_print (ph, "Usage: Xchat::nickcmp(s1, s2)");
	} else {
		XSRETURN_IV ((IV) xchat_nickcmp (ph, SvPV_nolen (ST (0)),
													SvPV_nolen (ST (1))));
	}
}
Пример #4
0
static VALUE static_ruby_xchat_nickcmp( VALUE klass,
                                        VALUE s1,
                                        VALUE s2 )
{
  char *s_s1;
  char *s_s2;

  s_s1 = StringValueCStr( s1 );
  s_s2 = StringValueCStr( s2 );

  return INT2FIX( xchat_nickcmp( static_plugin_handle, s_s1, s_s2 ) );
}