Skip to content

Commit

Permalink
Mark zp_time_since_epoch and zp_get_time_since_epoch as internal (#717)
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc authored Oct 8, 2024
1 parent 5d5596b commit d25a5e1
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions include/zenoh-pico/system/platform_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ unsigned long z_time_elapsed_s(z_time_t *time);
typedef struct {
uint32_t secs;
uint32_t nanos;
} zp_time_since_epoch;
} _z_time_since_epoch;

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t);
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t);
#ifdef __cplusplus
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/api/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ z_result_t z_bytes_writer_append(z_loaned_bytes_writer_t *writer, z_moved_bytes_

z_result_t z_timestamp_new(z_timestamp_t *ts, const z_loaned_session_t *zs) {
*ts = _z_timestamp_null();
zp_time_since_epoch t;
_Z_RETURN_IF_ERR(zp_get_time_since_epoch(&t));
_z_time_since_epoch t;
_Z_RETURN_IF_ERR(_z_get_time_since_epoch(&t));
ts->time = _z_timestamp_ntp64_from_time(t.secs, t.nanos);
ts->id = _Z_RC_IN_VAL(zs)->_local_zid;
return _Z_RES_OK;
Expand Down
2 changes: 1 addition & 1 deletion src/system/arduino/esp32/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) {
return elapsed;
}

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) {
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) {
z_time_t now;
gettimeofday(&now, NULL);
t->secs = now.tv_sec;
Expand Down
2 changes: 1 addition & 1 deletion src/system/arduino/opencr/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) {
return elapsed;
}

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) {
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) {
z_time_t now;
gettimeofday(&now, NULL);
t->secs = now.tv_sec;
Expand Down
2 changes: 1 addition & 1 deletion src/system/emscripten/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ unsigned long z_time_elapsed_ms(z_time_t *time) {

unsigned long z_time_elapsed_s(z_time_t *time) { return z_time_elapsed_ms(time) * 1000; }

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) {
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) {
double date = emscripten_date_now();
t->secs = (uint32_t)(date / 1000);
t->nanos = (uint32_t)((date - t->secs * 1000) * 1000000);
Expand Down
2 changes: 1 addition & 1 deletion src/system/espidf/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) {
return elapsed;
}

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) {
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) {
z_time_t now;
gettimeofday(&now, NULL);
t->secs = now.tv_sec;
Expand Down
2 changes: 1 addition & 1 deletion src/system/flipper/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,4 @@ struct tm* localtime(const time_t* timep) {
return &t;
}

z_result_t zp_get_time_since_epoch(zp_time_since_epoch* t) { return -1; }
z_result_t _z_get_time_since_epoch(_z_time_since_epoch* t) { return -1; }
2 changes: 1 addition & 1 deletion src/system/freertos_plus_tcp/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@ unsigned long z_time_elapsed_ms(z_time_t *time) {

unsigned long z_time_elapsed_s(z_time_t *time) { return z_time_elapsed_ms(time) / 1000; }

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) { return -1; }
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) { return -1; }
2 changes: 1 addition & 1 deletion src/system/mbed/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) {
return elapsed;
}

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) {
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) {
z_time_t now;
gettimeofday(&now, NULL);
t->secs = now.tv_sec;
Expand Down
2 changes: 1 addition & 1 deletion src/system/unix/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) {
return elapsed;
}

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) {
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) {
z_time_t now;
gettimeofday(&now, NULL);
t->secs = (uint32_t)now.tv_sec;
Expand Down
2 changes: 1 addition & 1 deletion src/system/windows/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) {
return elapsed;
}

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) {
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) {
z_time_t now;
ftime(&now);
t->secs = (uint32_t)now.time;
Expand Down
2 changes: 1 addition & 1 deletion src/system/zephyr/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ unsigned long z_time_elapsed_s(z_time_t *time) {
return elapsed;
}

z_result_t zp_get_time_since_epoch(zp_time_since_epoch *t) {
z_result_t _z_get_time_since_epoch(_z_time_since_epoch *t) {
z_time_t now;
gettimeofday(&now, NULL);
t->secs = now.tv_sec;
Expand Down

0 comments on commit d25a5e1

Please sign in to comment.