Alien-uv
view release on metacpan or search on metacpan
libuv/src/unix/udp.c view on Meta::CPAN
}
uv__udp_run_completed(handle);
assert(handle->send_queue_size == 0);
assert(handle->send_queue_count == 0);
/* Now tear down the handle. */
handle->recv_cb = NULL;
handle->alloc_cb = NULL;
/* but _do not_ touch close_cb */
}
static void uv__udp_run_completed(uv_udp_t* handle) {
uv_udp_send_t* req;
QUEUE* q;
assert(!(handle->flags & UV_HANDLE_UDP_PROCESSING));
handle->flags |= UV_HANDLE_UDP_PROCESSING;
libuv/src/win/fs.c view on Meta::CPAN
sizeof buffer,
FileDirectoryInformation,
FALSE,
NULL,
TRUE);
/* If the handle is not a directory, we'll get STATUS_INVALID_PARAMETER.
* This should be reported back as UV_ENOTDIR.
*/
if (status == STATUS_INVALID_PARAMETER)
goto not_a_directory_error;
while (NT_SUCCESS(status)) {
char* position = buffer;
size_t next_entry_offset = 0;
do {
FILE_DIRECTORY_INFORMATION* info;
uv__dirent_t* dirent;
size_t wchar_len;
libuv/src/win/fs.c view on Meta::CPAN
return;
nt_error:
SET_REQ_WIN32_ERROR(req, pRtlNtStatusToDosError(status));
goto cleanup;
win32_error:
SET_REQ_WIN32_ERROR(req, GetLastError());
goto cleanup;
not_a_directory_error:
SET_REQ_UV_ERROR(req, UV_ENOTDIR, ERROR_DIRECTORY);
goto cleanup;
out_of_memory_error:
SET_REQ_UV_ERROR(req, UV_ENOMEM, ERROR_OUTOFMEMORY);
goto cleanup;
cleanup:
if (dir_handle != INVALID_HANDLE_VALUE)
CloseHandle(dir_handle);
libuv/src/win/tty.c view on Meta::CPAN
for (j = 0; j < buf.len; j++) {
unsigned char c = buf.base[j];
/* Run the character through the utf8 decoder We happily accept non
* shortest form encodings and invalid code points - there's no real harm
* that can be done. */
if (utf8_bytes_left == 0) {
/* Read utf-8 start byte */
DWORD first_zero_bit;
unsigned char not_c = ~c;
#ifdef _MSC_VER /* msvc */
if (_BitScanReverse(&first_zero_bit, not_c)) {
#else /* assume gcc */
if (c != 0) {
first_zero_bit = (sizeof(int) * 8) - 1 - __builtin_clz(not_c);
#endif
if (first_zero_bit == 7) {
/* Ascii - pass right through */
utf8_codepoint = (unsigned int) c;
} else if (first_zero_bit <= 5) {
/* Multibyte sequence */
utf8_codepoint = (0xff >> (8 - first_zero_bit)) & c;
utf8_bytes_left = (char) (6 - first_zero_bit);
libuv/test/test-fs.c view on Meta::CPAN
uv_fs_req_cleanup(req);
}
TEST_IMPL(fs_file_noent) {
uv_fs_t req;
int r;
loop = uv_default_loop();
r = uv_fs_open(NULL, &req, "does_not_exist", O_RDONLY, 0, NULL);
ASSERT(r == UV_ENOENT);
ASSERT(req.result == UV_ENOENT);
uv_fs_req_cleanup(&req);
r = uv_fs_open(loop, &req, "does_not_exist", O_RDONLY, 0, open_noent_cb);
ASSERT(r == 0);
ASSERT(open_cb_count == 0);
uv_run(loop, UV_RUN_DEFAULT);
ASSERT(open_cb_count == 1);
/* TODO add EACCES test */
MAKE_VALGRIND_HAPPY();
return 0;
libuv/test/test-spawn.c view on Meta::CPAN
MAKE_VALGRIND_HAPPY();
return 0;
}
TEST_IMPL(spawn_quoted_path) {
#ifndef _WIN32
RETURN_SKIP("Test for Windows");
#else
char* quoted_path_env[2];
args[0] = "not_existing";
args[1] = NULL;
options.file = args[0];
options.args = args;
options.exit_cb = exit_cb;
options.flags = 0;
/* We test if search_path works correctly with semicolons in quoted path. We
* will use an invalid drive, so we are sure no executable is spawned. */
quoted_path_env[0] = "PATH=\"xyz:\\test;\";xyz:\\other";
quoted_path_env[1] = NULL;
options.env = quoted_path_env;
( run in 0.865 second using v1.01-cache-2.11-cpan-cc502c75498 )