package opam-core
Install
Dune Dependency
Authors
-
David Allsopp
-
VVincent Bernardoff <vb@luminar.eu.org>
-
RRaja Boujbel <raja.boujbel@ocamlpro.com>
-
KKate Deplaix <kit-ty-kate@outlook.com>
-
RRoberto Di Cosmo <roberto@dicosmo.org>
-
TThomas Gazagnaire <thomas@gazagnaire.org>
-
LLouis Gesbert <louis.gesbert@ocamlpro.com>
-
FFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
-
AAnil Madhavapeddy <anil@recoil.org>
-
GGuillem Rieu <guillem.rieu@ocamlpro.com>
-
RRalf Treinen <ralf.treinen@pps.jussieu.fr>
-
FFrederic Tuong <tuong@users.gforge.inria.fr>
Maintainers
Sources
md5=3a99d6d8c0394185f168fa0f085f6bb9
sha512=596d7b28f0cf9613dc7637aaeac45cc45f411a13286fea1cc81aeb0630c4f8a6dc2095d50db73229a255a3da3d9a08fe0993355a7fc64d3b16fd712789ff5f6e
doc/opam-core/OpamStubs/index.html
Module OpamStubs
Source
OS-specific functions requiring C code on at least one platform.
Most functions are Windows-specific and raise an exception on other platforms.
include module type of struct include OpamStubsTypes end
type console_screen_buffer_info = OpamStubsTypes.console_screen_buffer_info = {
size : int * int;
(*Width and height of the screen buffer
*)cursorPosition : int * int;
(*Current position of the console cursor (caret)
*)attributes : int;
(*Screen attributes; see https://docs.microsoft.com/en-us/windows/console/console-screen-buffers#_win32_character_attributes
*)window : int * int * int * int;
(*Coordinates of the upper-left and lower-right corners of the display window within the screen buffer
*)maximumWindowSize : int * int;
(*Maximum displayable size of the console for this screen buffer
*)
}
CONSOLE_SCREEN_BUFFER_INFO struct (see https://docs.microsoft.com/en-us/windows/console/console-screen-buffer-info-str)
type console_font_infoex = OpamStubsTypes.console_font_infoex = {
font : int;
(*Index in the system's console font table
*)fontSize : int * int;
(*Size, in logical units, of the font
*)fontFamily : int;
(*Font pitch and family (low 8 bits only). See tmPitchAndFamily in https://msdn.microsoft.com/library/windows/desktop/dd145132
*)fontWeight : int;
(*Font weight. Normal = 400; Bold = 700
*)faceName : string;
(*Name of the typeface
*)
}
CONSOLE_FONT_INFOEX struct (see https://docs.microsoft.com/en-us/windows/console/console-font-infoex)
Win32 API handles
Standard handle constants (see https://docs.microsoft.com/en-us/windows/console/getstdhandle)
Win32 Root Registry Hives (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724836.aspx)
Win32 Registry Value Types (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724884.aspx
type ('a, 'b, 'c) winmessage = ('a, 'b, 'c) OpamStubsTypes.winmessage =
| WM_SETTINGCHANGE : (int, string, int) winmessage
(*See https://msdn.microsoft.com/en-us/library/windows/desktop/ms725497.aspx
*)
Windows Messages (at least, one of them!)
Windows CPU Architectures (SYSTEM_INFO.wProcessArchitecture / sysinfoapi.h)
type win32_non_fixed_version_info = OpamStubsTypes.win32_non_fixed_version_info =
{
comments : string option;
companyName : string option;
fileDescription : string option;
fileVersionString : string option;
internalName : string option;
legalCopyright : string option;
legalTrademarks : string option;
originalFilename : string option;
productName : string option;
productVersionString : string option;
privateBuild : string option;
specialBuild : string option;
}
Predefined version information strings (see VerQueryValueW)
type win32_version_info = OpamStubsTypes.win32_version_info = {
signature : int;
(*
*)0xFEEF04BD
version : int * int;
(*Structure version number
*)fileVersion : int * int * int * int;
(*File version
*)productVersion : int * int * int * int;
(*Product version
*)fileFlagsMask : int;
fileFlags : int;
(*File attributes (see VS_FIXEDFILEINFO)
*)fileOS : int;
(*File OS (see VS_FIXEDFILEINFO)
*)fileType : int;
(*File Type (see VS_FIXEDFILEINFO)
*)fileSubtype : int;
(*File Sub-type (see VS_FIXEDFILEINFO)
*)fileDate : int64;
(*File creation time stamp
*)strings : ((int * int) * win32_non_fixed_version_info) list;
(*Non-fixed string table. First field is a pair of Language and Codepage ID.
*)
}
VS_FIXEDFILEINFO
faccessat on Unix; _waccess on Windows. Checks whether a path is executable for the current process. On Unix, unlike Unix.access, this is checked using the EUID/EGID rather than RUID/RGID.
On Windows, this returns the actual process ID, rather than the non-unique faked process ID returned by the Microsoft C Runtime (see https://caml.inria.fr/mantis/view.php?id=4034).
On all other platforms, this is just an alias for Unix.getpid
.
Windows only. As getpid
, but without the possibility of truncating the ID on 32-bit platforms.
Windows only. Return current Console screen buffer information.
Windows only. Set the console's text attribute setting.
Windows only. fillConsoleOutputCharacter buffer c n (x, y)
writes c
n
times starting at the given coordinate (and wrapping if required).
Windows only. Returns the input/output mode of the console screen buffer referred to by the handle.
Windows only. Sets the input/output mode of the console screen buffer referred to by the handle, returning true
if the operation isr successful.
Windows only. Returns the Windows version as (major, minor, build, revision)
. This function only works if opam is compiled OCaml 4.06.0 or later, it returns (0, 0, 0, 0)
otherwise.
Windows only. Equivalent of uname -m
.
Windows only. Given a list pids
with length
elements, waitpids pids length
behaves like Unix.wait
, returning the pid and exit status of the first process to terminate.
Windows only. readRegistry root key name value_type
reads the value name
from registry key key
of root
. As per Windows Registry convention, the default value can be read by passing ""
for name
.
Windows only. enumRegistry root key value_type
reads all the values from registry key key
of root
which have type value_type
.
Returns []
if the key is not found.
Windows only. writeRegistry root key name value_type value
sets the value name
of type value_type
in registry key key
of root
to value
.
Windows only. Retrieves the current Console Output Code Page.
Windows only. Gets information on the current console output font.
Windows only. Given a font name, returns a pair consisting of a screen DC and a font object, which will have been selected into the DC.
Windows only. Given (dc, font)
, deletes the font object and releases the DC.
Windows only. has_glyph (dc, font) scalar
returns true
if font
contains a glyph for scalar
.
Windows only. Returns the CPU architecture of the given process ID (or the current process).
Windows only. process_putenv pid name value
sets the environment variable name
to value
in given process ID (Unix.putenv
must also be called to update the value in the current process). This function must not be called if the target process is 32-bit and the current process is 64-bit or vice versa (outcomes vary from a no-op to a segfault).
Windows only. retrieves the location of the wanted directory
val sendMessageTimeout :
nativeint ->
int ->
int ->
('a, 'b, 'c) winmessage ->
'a ->
'b ->
int * 'c
Windows only. sendMessageTimeout hwnd timeout flags message wParam lParam
sends a message to the given handle, but is guaranteed to return within timeout
milliseconds. The result consists of two parts, fst
is the return value from SendMessageTimeout, snd
depends on both the message and fst
. See https://msdn.microsoft.com/en-us/library/windows/desktop/ms644952.aspx
Windows only. Returns the pid and full path to the image for each entry in the ancestry list for this process, starting with the process itself. If an image name can't be determined, then ""
is returned; on failure, returns []
.
Windows only. getConsoleAlias alias exeName
retrieves the value for a given executable or ""
if the alias is not defined. See https://docs.microsoft.com/en-us/windows/console/getconsolealias
val win_create_process :
string ->
string ->
string option ->
Unix.file_descr ->
Unix.file_descr ->
Unix.file_descr ->
int
Windows only. Provided by OCaml's win32unix library.
Windows only. Returns the name of the class for the Console window or None
if there is no console.
Windows only. Directly wraps SetErrorMode.
Windows only. Directly wraps GetErrorMode.
Windows only. Directly wraps SetConsoleOutputCP(CP_UTF8).
Windows only. Returns the version info block for a file or None
if the file either doesn't exist or doesn't have one.
Windows only. Returns the environment which new processes would receive.
Unix only. Returns the number of columns of the current terminal window linked with stdout. If stdout isn't linked to any terminal (e.g. redirection), then this function will return 0. A valid number of columns should be strictly above 0.