Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/utility/program"

From cppreference.com
< cpp‎ | utility
m (Text replace - "/sidebar" to "/navbar")
m (removed debugging support section (already moved to general utilities))
 
(11 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 
{{title|Program support utilities}}
 
{{title|Program support utilities}}
 
{{cpp/utility/program/navbar}}
 
{{cpp/utility/program/navbar}}
===Program termination===
 
  
 +
===Program termination===
 
The following functions manage program termination and resource cleanup.
 
The following functions manage program termination and resource cleanup.
  
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list header | cstdlib}}
+
{{dsc header|cstdlib}}
{{dcl list template | cpp/utility/program/dcl list abort}}
+
{{dsc inc|cpp/utility/program/dsc abort}}
{{dcl list template | cpp/utility/program/dcl list exit}}
+
{{dsc inc|cpp/utility/program/dsc exit}}
{{dcl list template | cpp/utility/program/dcl list quick_exit}}
+
{{dsc inc|cpp/utility/program/dsc quick_exit}}
{{dcl list template | cpp/utility/program/dcl list _Exit}}
+
{{dsc inc|cpp/utility/program/dsc _Exit}}
{{dcl list template | cpp/utility/program/dcl list atexit}}
+
{{dsc inc|cpp/utility/program/dsc atexit}}
{{dcl list template | cpp/utility/program/dcl list at_quick_exit}}
+
{{dsc inc|cpp/utility/program/dsc at_quick_exit}}
{{dcl list template | cpp/utility/program/dcl list EXIT_status}}
+
{{dsc inc|cpp/utility/program/dsc EXIT_status}}
{{dcl list end}}
+
{{dsc end}}
 +
 
 +
{{rrev|since=c++23|
 +
===Unreachable control flow===
 +
{{dsc begin}}
 +
{{dsc header|utility}}
 +
{{dsc inc|cpp/utility/dsc unreachable}}
 +
{{dsc end}}
 +
}}
  
 
===Communicating with the environment===
 
===Communicating with the environment===
 
+
{{dsc begin}}
{{dcl list begin}}
+
{{dsc header|cstdlib}}
{{dcl list template | cpp/utility/program/dcl list system}}
+
{{dsc inc|cpp/utility/program/dsc system}}
{{dcl list template | cpp/utility/program/dcl list getenv}}
+
{{dsc inc|cpp/utility/program/dsc getenv}}
{{dcl list end}}
+
{{dsc end}}
  
 
===Signals===
 
===Signals===
 
 
Several functions and macro constants for signal management are provided.
 
Several functions and macro constants for signal management are provided.
  
{{dcl list begin}}
+
{{dsc begin}}
{{dcl list header | csignal}}
+
{{dsc header|csignal}}
{{dcl list template | cpp/utility/program/dcl list signal}}
+
{{dsc inc|cpp/utility/program/dsc signal}}
{{dcl list template | cpp/utility/program/dcl list raise}}
+
{{dsc inc|cpp/utility/program/dsc raise}}
{{dcl list typedef | cpp/utility/program/sig_atomic_t | the integer type that can be accessed as an atomic entity from an asynchronous signal handler}}
+
{{dsc typedef|cpp/utility/program/sig_atomic_t|the integer type that can be accessed as an atomic entity from an asynchronous signal handler}}
{{dcl list template | cpp/utility/program/dcl list SIG_strategies}}
+
{{dsc inc|cpp/utility/program/dsc SIG_strategies}}
{{dcl list template | cpp/utility/program/dcl list SIG_ERR}}
+
{{dsc inc|cpp/utility/program/dsc SIG_ERR}}
  
{{dcl list h2 | Signal types}}
+
{{dsc h2|Signal types}}
{{dcl list template | cpp/utility/program/dcl list SIG_types}}
+
{{dsc inc|cpp/utility/program/dsc SIG_types}}
{{dcl list end}}
+
{{dsc end}}
  
 
===Non-local jumps===
 
===Non-local jumps===
 +
{{dsc begin}}
 +
{{dsc header|csetjmp}}
 +
{{dsc inc|cpp/utility/program/dsc setjmp}}
 +
{{dsc inc|cpp/utility/program/dsc longjmp}}
 +
 +
{{dsc h2|Types}}
 +
{{dsc inc|cpp/utility/program/dsc jmp_buf}}
 +
{{dsc end}}
  
{{dcl list begin}}
+
===See also===
{{dcl list header | csetjmp}}
+
{{dsc begin}}
{{dcl list template | cpp/utility/program/dcl list setjmp}}
+
{{dsc see c|c/program|Program support utilities|nomono=true}}
{{dcl list template | cpp/utility/program/dcl list longjmp}}
+
{{dsc end}}
  
{{dcl list h2 | Types}}
+
{{langlinks|de|es|fr|it|ja|pt|ru|zh}}
{{dcl list template | cpp/utility/program/dcl list jmp_buf}}
+
{{dcl list end}}
+

Latest revision as of 06:12, 16 December 2023

 
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
 

Contents

[edit] Program termination

The following functions manage program termination and resource cleanup.

Defined in header <cstdlib>
causes abnormal program termination (without cleaning up)
(function) [edit]
causes normal program termination with cleaning up
(function) [edit]
causes quick program termination without completely cleaning up
(function) [edit]
(C++11)
causes normal program termination without cleaning up
(function) [edit]
registers a function to be called on std::exit() invocation
(function) [edit]
registers a function to be called on std::quick_exit invocation
(function) [edit]
indicates program execution status
(macro constant) [edit]

Unreachable control flow

Defined in header <utility>
marks unreachable point of execution
(function) [edit]
(since C++23)

[edit] Communicating with the environment

Defined in header <cstdlib>
calls the host environment's command processor
(function) [edit]
access to the list of environment variables
(function) [edit]

[edit] Signals

Several functions and macro constants for signal management are provided.

Defined in header <csignal>
sets a signal handler for particular signal
(function) [edit]
runs the signal handler for particular signal
(function) [edit]
the integer type that can be accessed as an atomic entity from an asynchronous signal handler
(typedef)
defines signal handling strategies
(macro constant) [edit]
return value of signal specifying that an error was encountered
(macro constant) [edit]
Signal types
defines signal types
(macro constant) [edit]

[edit] Non-local jumps

Defined in header <csetjmp>
saves the context
(function macro) [edit]
jumps to specified location
(function) [edit]
Types
execution context type
(typedef) [edit]

[edit] See also

C documentation for Program support utilities