2022-02-10 23:07:11 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2010-06-24 17:54:01 +02:00
|
|
|
|
2014-04-02 11:43:54 +02:00
|
|
|
#pragma once
|
2010-06-24 17:54:01 +02:00
|
|
|
|
2016-08-16 14:57:56 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2019-08-27 16:13:23 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup bli
|
2011-02-18 14:58:08 +01:00
|
|
|
*/
|
|
|
|
|
2010-06-24 17:54:01 +02:00
|
|
|
int BLI_cpu_support_sse2(void);
|
2019-08-27 14:03:49 +02:00
|
|
|
int BLI_cpu_support_sse41(void);
|
2016-08-16 14:57:56 +02:00
|
|
|
void BLI_system_backtrace(FILE *fp);
|
2010-06-24 17:54:01 +02:00
|
|
|
|
2021-12-20 09:01:14 +01:00
|
|
|
/** Get CPU brand, result is to be MEM_freeN()-ed. */
|
2018-11-27 17:28:36 +01:00
|
|
|
char *BLI_cpu_brand_string(void);
|
|
|
|
|
2018-12-07 17:36:40 +01:00
|
|
|
/**
|
|
|
|
* Obtain the hostname from the system.
|
|
|
|
*
|
|
|
|
* This simply determines the host's name, and doesn't do any DNS lookup of any
|
|
|
|
* IP address of the machine. As such, it's only usable for identification
|
|
|
|
* purposes, and not for reachability over a network.
|
|
|
|
*
|
2018-12-12 02:55:20 +01:00
|
|
|
* \param buffer: Character buffer to write the hostname into.
|
|
|
|
* \param bufsize: Size of the character buffer, including trailing '\0'.
|
2018-12-07 17:36:40 +01:00
|
|
|
*/
|
|
|
|
void BLI_hostname_get(char *buffer, size_t bufsize);
|
|
|
|
|
2021-12-20 09:01:14 +01:00
|
|
|
/** Get maximum addressable memory in megabytes. */
|
2019-05-17 15:02:12 +02:00
|
|
|
size_t BLI_system_memory_max_in_megabytes(void);
|
2021-12-20 09:01:14 +01:00
|
|
|
/** Get maximum addressable memory in megabytes (clamped to #INT_MAX). */
|
2019-05-17 15:02:12 +02:00
|
|
|
int BLI_system_memory_max_in_megabytes_int(void);
|
|
|
|
|
2021-02-05 06:23:34 +01:00
|
|
|
/* For `getpid`. */
|
2014-04-02 11:43:54 +02:00
|
|
|
#ifdef WIN32
|
|
|
|
# define BLI_SYSTEM_PID_H <process.h>
|
2020-05-01 15:37:48 +02:00
|
|
|
|
2021-12-20 09:01:14 +01:00
|
|
|
/**
|
|
|
|
* \note Use `void *` for `exception` since we really do not want to drag Windows.h
|
|
|
|
* in to get the proper `typedef`.
|
|
|
|
*/
|
2020-05-01 15:37:48 +02:00
|
|
|
void BLI_windows_handle_exception(void *exception);
|
|
|
|
|
2014-04-02 11:43:54 +02:00
|
|
|
#else
|
|
|
|
# define BLI_SYSTEM_PID_H <unistd.h>
|
2010-06-24 17:54:01 +02:00
|
|
|
#endif
|
|
|
|
|
2019-08-27 16:13:23 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|