diff --git a/DESCRIPTION b/DESCRIPTION index a46c7716b..465b08af9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: nanonext Type: Package Title: NNG (Nanomsg Next Gen) Lightweight Messaging Library -Version: 1.3.2.9008 +Version: 1.3.2.9009 Description: R binding for NNG (Nanomsg Next Gen), a successor to ZeroMQ. NNG is a socket library implementing 'Scalability Protocols', a reliable, high-performance standard for common communications patterns including diff --git a/NEWS.md b/NEWS.md index 79ca43fc6..d77bf7ca8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# nanonext 1.3.2.9008 (development) +# nanonext 1.3.2.9009 (development) #### New Features diff --git a/R/utils.R b/R/utils.R index 6882e1081..7016a028c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -316,18 +316,20 @@ serial_config <- function(class, sfunc, ufunc, vec = FALSE) #' Set Serialization Marker #' -#' Toggles the serialization marker on or off. Internal package function. +#' Internal package function. #' -#' @return NULL. +#' @param x logical value. +#' +#' @return The logical value 'x' supplied. #' #' @examples #' .mark() -#' .mark() +#' .mark(FALSE) #' #' @keywords internal #' @export #' -.mark <- function() .Call(rnng_set_marker) +.mark <- function(x = TRUE) .Call(rnng_set_marker, x) #' Advances the RNG State #' diff --git a/man/dot-mark.Rd b/man/dot-mark.Rd index f02e94b45..28392a614 100644 --- a/man/dot-mark.Rd +++ b/man/dot-mark.Rd @@ -4,17 +4,20 @@ \alias{.mark} \title{Set Serialization Marker} \usage{ -.mark() +.mark(x = TRUE) +} +\arguments{ +\item{x}{logical value.} } \value{ -NULL. +The logical value 'x' supplied. } \description{ -Toggles the serialization marker on or off. Internal package function. +Internal package function. } \examples{ .mark() -.mark() +.mark(FALSE) } \keyword{internal} diff --git a/src/init.c b/src/init.c index 7ebbef14f..95ab48fa3 100644 --- a/src/init.c +++ b/src/init.c @@ -178,7 +178,7 @@ static const R_CallMethodDef callMethods[] = { {"rnng_send", (DL_FUNC) &rnng_send, 5}, {"rnng_send_aio", (DL_FUNC) &rnng_send_aio, 6}, {"rnng_serial_config", (DL_FUNC) &rnng_serial_config, 4}, - {"rnng_set_marker", (DL_FUNC) &rnng_set_marker, 0}, + {"rnng_set_marker", (DL_FUNC) &rnng_set_marker, 1}, {"rnng_set_opt", (DL_FUNC) &rnng_set_opt, 3}, {"rnng_set_promise_context", (DL_FUNC) &rnng_set_promise_context, 2}, {"rnng_signal_thread_create", (DL_FUNC) &rnng_signal_thread_create, 2}, diff --git a/src/nanonext.h b/src/nanonext.h index 896f87f1c..7dbf7d416 100644 --- a/src/nanonext.h +++ b/src/nanonext.h @@ -362,7 +362,7 @@ SEXP rnng_request(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); SEXP rnng_send(SEXP, SEXP, SEXP, SEXP, SEXP); SEXP rnng_send_aio(SEXP, SEXP, SEXP, SEXP, SEXP, SEXP); SEXP rnng_serial_config(SEXP, SEXP, SEXP, SEXP); -SEXP rnng_set_marker(void); +SEXP rnng_set_marker(SEXP); SEXP rnng_set_opt(SEXP, SEXP, SEXP); SEXP rnng_set_promise_context(SEXP, SEXP); SEXP rnng_signal_thread_create(SEXP, SEXP); diff --git a/src/utils.c b/src/utils.c index ff04c0710..817908836 100644 --- a/src/utils.c +++ b/src/utils.c @@ -589,10 +589,10 @@ SEXP rnng_serial_config(SEXP klass, SEXP sfunc, SEXP ufunc, SEXP vec) { } -SEXP rnng_set_marker(void) { +SEXP rnng_set_marker(SEXP x) { - special_bit = special_bit ? (uint8_t) 0 : (uint8_t) 1; - return R_NilValue; + special_bit = (uint8_t) NANO_INTEGER(x); + return x; } diff --git a/tests/tests.R b/tests/tests.R index 3500191a8..c6f97141e 100644 --- a/tests/tests.R +++ b/tests/tests.R @@ -553,9 +553,9 @@ test_zero(dial(s, url = "inproc://disp/1")) test_true(wait(cv)) test_zero(send(disp, TRUE, block = 500L)) test_true(recv(s, block = 500L)) -test_null(.mark()) +test_true(.mark()) test_zero(send(s, NULL, block = 500L)) -test_null(.mark()) +test_true(!.mark(FALSE)) test_null(recv(disp, block = 500L)) test_zero(reap(s)) rm(disp)