Carp/core/System.carp

32 lines
1.3 KiB
Plaintext
Raw Normal View History

2018-01-24 18:08:18 +03:00
(system-include "carp_system.h")
2018-01-24 17:53:18 +03:00
2017-06-26 12:15:03 +03:00
(defmodule System
(doc free "Frees an object. Should not be called except in direst circumstances.")
2017-06-26 12:15:03 +03:00
(register free (Fn [t] ()))
(doc time "Gets the current system time as an integer.")
2017-06-26 12:15:03 +03:00
(register time (Fn [] Int))
(doc nanotime "Gets the current system time in nanoseconds as a long.")
(register nanotime (Fn [] Long))
(doc sleep-seconds "Sleeps for a specified number of seconds.")
2017-12-25 18:51:23 +03:00
(register sleep-seconds (Fn [Int] ()))
(doc sleep-seconds "Sleeps for a specified number of microseconds.")
(register sleep-micros (Fn [Int] ()))
(doc system "Performs a system command.")
2018-03-11 16:53:50 +03:00
(register system (Fn [&String] ()))
(doc get-arg "Gets the command line argument at a specified index.")
2018-04-04 10:00:20 +03:00
(register get-arg (Fn [Int] (Ref String)))
(doc get-args-len "Gets the number of command line arguments.")
2018-04-04 10:00:20 +03:00
(register get-args-len (Fn [] Int))
(register fork (Fn [] Int) "fork")
(register wait (Fn [(Ptr Int)] Int) "wait")
(register get-exit-status (Fn [Int] Int) "WEXITSTATUS")
2018-05-23 16:13:13 +03:00
(register signal (Fn [Int (Fn [Int] ())] ()) "signal")
(register signal-abort Int "SIGABRT")
(register signal-fpe Int "SIGFPE")
(register signal-ill Int "SIGILL")
(register signal-int Int "SIGINT")
(register signal-segv Int "SIGSEGV")
(register signal-term Int "SIGTERM")
)