2010-06-24 15:54:01 +00:00
|
|
|
/*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
2014-04-02 11:43:54 +02:00
|
|
|
#pragma once
|
2010-06-24 15:54:01 +00:00
|
|
|
|
2016-08-16 14:57:56 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2019-08-27 08:13:23 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup bli
|
2011-02-18 13:58:08 +00:00
|
|
|
*/
|
|
|
|
|
|
2010-06-24 15:54:01 +00: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 15:54:01 +00:00
|
|
|
|
2018-11-27 17:28:36 +01:00
|
|
|
/* Get CPU brand, result is to be MEM_freeN()-ed. */
|
|
|
|
|
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 12:55:20 +11: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);
|
|
|
|
|
|
2019-05-17 15:02:12 +02:00
|
|
|
/* Get maximum addressable memory in megabytes. */
|
|
|
|
|
size_t BLI_system_memory_max_in_megabytes(void);
|
|
|
|
|
int BLI_system_memory_max_in_megabytes_int(void);
|
|
|
|
|
|
2021-02-05 16:23:34 +11:00
|
|
|
/* For `getpid`. */
|
2014-04-02 11:43:54 +02:00
|
|
|
#ifdef WIN32
|
|
|
|
|
# define BLI_SYSTEM_PID_H <process.h>
|
2020-05-01 07:37:48 -06:00
|
|
|
|
|
|
|
|
/* void* since we really do not want to drag Windows.h in to get the proper typedef. */
|
|
|
|
|
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 15:54:01 +00:00
|
|
|
#endif
|
|
|
|
|
|
2019-08-27 08:13:23 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|