1#  File src/library/tools/R/zzz.R
2#  Part of the R package, https://www.R-project.org
3#
4#  Copyright (C) 1995-2013 The R Core Team
5#
6#  This program is free software; you can redistribute it and/or modify
7#  it under the terms of the GNU General Public License as published by
8#  the Free Software Foundation; either version 2 of the License, or
9#  (at your option) any later version.
10#
11#  This program is distributed in the hope that it will be useful,
12#  but WITHOUT ANY WARRANTY; without even the implied warranty of
13#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14#  GNU General Public License for more details.
15#
16#  A copy of the GNU General Public License is available at
17#  https://www.R-project.org/Licenses/
18
19.noGenerics <- TRUE
20
21.onUnload <-
22function(libpath)
23    library.dynam.unload("tools", libpath)
24
25library.dynam("tools", "tools", .Library)
26PS_sigs <- getDLLRegisteredRoutines("tools")[[c(".Call", "ps_sigs")]]
27
28## These are created at install time: the numbers are hard-coded in signals.c
29## They happen to be the BSD ones as this started in multicore
30SIGHUP <- .Call(PS_sigs, 1L)
31SIGINT <- .Call(PS_sigs, 2L)
32SIGQUIT <- .Call(PS_sigs, 3L)
33SIGKILL <- .Call(PS_sigs, 9L)
34SIGTERM <- .Call(PS_sigs, 15L)
35SIGSTOP <- .Call(PS_sigs, 17L)
36SIGTSTP <- .Call(PS_sigs, 18L)
37SIGCONT <- .Call(PS_sigs, 19L)
38SIGCHLD <- .Call(PS_sigs, 20L)
39SIGUSR1 <- .Call(PS_sigs, 30L)
40SIGUSR2 <- .Call(PS_sigs, 31L)
41
42## This calls C code in the package too
43latexArgCount <- integer()              # The next line modifies this
44latexTable <- makeLatexTable(utf8table)  # FIXME: Should latexTable be hardcoded instead?
45rm(PS_sigs)
46
47.onLoad <- function(libname, pkgname) {
48    ## see if we can render Unicode bullet: not C locales, nor CJK on Windows.
49    if (.Platform$OS.type == "windows") {
50	cp <- l10n_info()$codepage
51	if (cp > 0 && (cp == 874L || (cp >= 1250L && cp <= 1258L)))
52	    Rd2txt_options(itemBullet = "\u2022 ")
53    } else if (!is.na(iconv("\u2022", "UTF-8", "")))
54	Rd2txt_options(itemBullet = "\u2022 ")
55}
56