File: R_zmq_utility.r

package info (click to toggle)
r-cran-pbdzmq 0.3.13%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 856 kB
  • sloc: ansic: 737; sh: 93; pascal: 30; cpp: 6; makefile: 4
file content (57 lines) | stat: -rw-r--r-- 1,259 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#' Utility Functions
#' 
#' Utility functions
#' 
#' \code{zmq.strerror()} gets ZeroMQ error message string.
#'
#' \code{zmq.version()} print current ZeroMQ version.
#' 
#' @param errno 
#' an integer for the error number
#' 
#' @return 
#' \code{zmq.strerror()} returns an R string containing ZeroMQ error
#' message.
#' 
#' @author Wei-Chen Chen \email{wccsnow@@gmail.com}.
#' 
#' @references ZeroMQ/4.1.0 API Reference:
#' \url{http://api.zeromq.org/4-1:_start}
#' 
#' Programming with Big Data in R Website: \url{https://pbdr.org/}
#' 
#' @examples
#' \dontrun{
#' library(pbdZMQ, quietly = TRUE)
#' 
#' context <- zmq.ctx.new()
#' zmq.ctx.destroy(context)
#' zmq.strerror(0)
#' 
#' zmq.ctx.destroy(context) # Error since context is free.
#' zmq.strerror(14)
#' }
#' 
#' @keywords internal
#' @seealso \code{\link{zmq.ctx.new}()}, \code{\link{zmq.ctx.destroy}()},
#' \code{\link{zmq.socket}()}, \code{\link{zmq.close}()}.
#' @rdname xx_utility
#' @name Utility Functions
NULL



#' @rdname xx_utility
#' @export
zmq.strerror <- function(errno){
  .Call("R_zmq_strerror", as.integer(errno[1]), PACKAGE = "pbdZMQ")
}


#' @rdname xx_utility
#' @export
zmq.version <- function(){
  ret <- .Call("R_zmq_version", PACKAGE = "pbdZMQ")
  package_version(ret)
}