From 7b56134f730888e773114acdf2185ac02e59e656 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 28 Jun 2011 14:26:18 +0200 Subject: [PATCH] Rename uv_get_hrtime, uv_get_exepath to uv_hrtime, uv_exepath --- test/test-get-currentexe.c | 8 ++++---- test/test-hrtime.c | 4 ++-- uv-darwin.c | 4 ++-- uv-freebsd.c | 2 +- uv-linux.c | 4 ++-- uv-sunos.c | 4 ++-- uv-win.c | 4 ++-- uv.h | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/test/test-get-currentexe.c b/test/test-get-currentexe.c index 880d9cd6..da2c160e 100644 --- a/test/test-get-currentexe.c +++ b/test/test-get-currentexe.c @@ -33,20 +33,20 @@ TEST_IMPL(get_currentexe) { int r; size = sizeof(buffer) / sizeof(buffer[0]); - r = uv_get_exepath(buffer, &size); + r = uv_exepath(buffer, &size); ASSERT(!r); match = strstr(buffer, executable_path); - /* Verify that the path returned from uv_get_exepath is a subdirectory of executable_path */ + /* Verify that the path returned from uv_exepath is a subdirectory of executable_path */ ASSERT(match && !strcmp(match, executable_path)); ASSERT(size == strlen(buffer)); /* Negative tests */ size = sizeof(buffer) / sizeof(buffer[0]); - r = uv_get_exepath(NULL, &size); + r = uv_exepath(NULL, &size); ASSERT(r == -1); - r = uv_get_exepath(buffer, NULL); + r = uv_exepath(buffer, NULL); ASSERT(r == -1); return 0; diff --git a/test/test-hrtime.c b/test/test-hrtime.c index 41f9f1c9..03cb429d 100644 --- a/test/test-hrtime.c +++ b/test/test-hrtime.c @@ -30,9 +30,9 @@ TEST_IMPL(hrtime) { uint64_t a, b, diff; - a = uv_get_hrtime(); + a = uv_hrtime(); uv_sleep(1); - b = uv_get_hrtime(); + b = uv_hrtime(); diff = b - a; diff --git a/uv-darwin.c b/uv-darwin.c index 6670a34a..fa2948cd 100644 --- a/uv-darwin.c +++ b/uv-darwin.c @@ -26,7 +26,7 @@ #include -uint64_t uv_get_hrtime() { +uint64_t uv_hrtime() { uint64_t time; Nanoseconds enano; time = mach_absolute_time(); @@ -35,7 +35,7 @@ uint64_t uv_get_hrtime() { } -int uv_get_exepath(char* buffer, size_t* size) { +int uv_exepath(char* buffer, size_t* size) { uint32_t usize; int result; char* path; diff --git a/uv-freebsd.c b/uv-freebsd.c index 8c68e24e..108455d8 100644 --- a/uv-freebsd.c +++ b/uv-freebsd.c @@ -21,7 +21,7 @@ #include "uv.h" -int uv_get_exepath(char* buffer, size_t* size) { +int uv_exepath(char* buffer, size_t* size) { uint32_t usize; int result; char* path; diff --git a/uv-linux.c b/uv-linux.c index 8eae6c17..2d26c9bc 100644 --- a/uv-linux.c +++ b/uv-linux.c @@ -28,14 +28,14 @@ * There's probably some way to get time from Linux than gettimeofday(). What * it is, I don't know. */ -uint64_t uv_get_hrtime() { +uint64_t uv_hrtime() { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return (ts.tv_sec * NANOSEC + ts.tv_nsec); } -int uv_get_exepath(char* buffer, size_t* size) { +int uv_exepath(char* buffer, size_t* size) { uint32_t usize; int result; char* path; diff --git a/uv-sunos.c b/uv-sunos.c index 8e068822..879956f4 100644 --- a/uv-sunos.c +++ b/uv-sunos.c @@ -27,7 +27,7 @@ #include -uint64_t uv_get_hrtime() { +uint64_t uv_hrtime() { return (gethrtime()); } @@ -37,7 +37,7 @@ uint64_t uv_get_hrtime() { * of the function, but this function could be called by multiple consumers and * we don't want to potentially create a race condition in the use of snprintf. */ -int uv_get_exepath(char* buffer, size_t* size) { +int uv_exepath(char* buffer, size_t* size) { size_t res; pid_t pid; char buf[PATH_MAX]; diff --git a/uv-win.c b/uv-win.c index 7eddb8ad..adeab4bf 100644 --- a/uv-win.c +++ b/uv-win.c @@ -1746,7 +1746,7 @@ int uv_utf8_to_utf16(const char* utf8Buffer, wchar_t* utf16Buffer, size_t utf16S } -int uv_get_exepath(char* buffer, size_t* size) { +int uv_exepath(char* buffer, size_t* size) { int retVal; size_t utf16Size; wchar_t* utf16Buffer; @@ -1791,7 +1791,7 @@ done: } -uint64_t uv_get_hrtime(void) { +uint64_t uv_hrtime(void) { assert(0 && "implement me"); } diff --git a/uv.h b/uv.h index 37956b44..a013c8d2 100644 --- a/uv.h +++ b/uv.h @@ -457,7 +457,7 @@ struct sockaddr_in uv_ip4_addr(const char* ip, int port); struct sockaddr_in6 uv_ip6_addr(const char* ip, int port); /* Gets the executable path */ -int uv_get_exepath(char* buffer, size_t* size); +int uv_exepath(char* buffer, size_t* size); /* the presence of this union forces similar struct layout */ union uv_any_handle { @@ -513,7 +513,7 @@ uv_counters_t* uv_counters(); * Note not every platform can support nanosecond resolution; however, this * value will always be in nanoseconds. */ -extern uint64_t uv_get_hrtime(void); +extern uint64_t uv_hrtime(void); #ifdef __cplusplus }