Exemple #1
0
static TACommandVerdict wcscmp_cmd(TAThread thread, TAInputStream stream)
{
    wchar_t* ws1;
    wchar_t* ws2;
    int res;

    // Prepare
    ws1 = (wchar_t*)readPointer(&stream);
    ws2 = (wchar_t*)readPointer(&stream);


    START_TARGET_OPERATION(thread);
	print_wstring(ws1);
	print_wstring(ws2);

    // Execute
    res = wcscmp(ws1, ws2);
	ta_debug_printf("res %d\n", res);

    END_TARGET_OPERATION(thread);

    // Response
    writeInt(thread, res);
    sendResponse(thread);

    return taDefaultVerdict;
}
Exemple #2
0
int				convert_wstring(t_tag *tag, va_list *args)
{
	wchar_t		*output_arg;

	output_arg = va_arg(*args, wchar_t *);
	if (output_arg != NULL)
		return (print_wstring(tag, output_arg));
	else if (tag->has_precision == 2)
	{
		print_width_pad(0, tag->width, '0');
		return (tag->width);
	}
	else
	{
		ft_putstr(NULL);
		return (6);
	}
}