Luanti 5.16.0-dev
Loading...
Searching...
No Matches
porting.h File Reference
#include <csignal>
#include <string>
#include "config.h"
#include "irrlichttypes.h"
#include "debug.h"
#include "util/timetaker.h"
#include <unistd.h>
#include <cstdlib>
#include <sys/time.h>
#include <ctime>
Include dependency graph for porting.h:

Go to the source code of this file.

Namespaces

namespace  porting

Macros

#define SWPRINTF_CHARSTRING   L"%s"
#define SLEEP_ACCURACY_US   200
#define sleep_ms(x)
#define sleep_us(x)
#define strlcpy(d, s, n)

Functions

void porting::signal_handler_init (void)
volatile std::sig_atomic_t * porting::signal_handler_killstatus ()
bool porting::getCurrentExecPath (char *buf, size_t len)
std::string porting::getDataPath (const char *subpath)
void porting::initializePaths ()
const std::string & porting::get_sysinfo ()
u32 porting::getMemorySizeMB ()
void porting::os_get_clock (struct timespec *ts)
u64 porting::getTimeS ()
u64 porting::getTimeMs ()
u64 porting::getTimeUs ()
u64 porting::getTimeNs ()
u64 porting::getTime (TimePrecision prec)
u64 porting::getDeltaMs (u64 old_time_ms, u64 new_time_ms)
 Delta calculation function arguments.
void porting::preciseSleepUs (u64 sleep_time)
const char * porting::getPlatformName ()
bool porting::secure_rand_fill_buf (void *buf, size_t len)
void porting::osSpecificInit ()
void porting::attachOrCreateConsole ()
static void porting::TrackFreedMemory (size_t amount)
static void porting::TriggerMemoryTrim ()
int porting::mt_snprintf (char *buf, const size_t buf_size, const char *fmt,...)
bool porting::open_url (const std::string &url)
 Opens URL in default web browser.
bool porting::open_directory (const std::string &path)
 Opens a directory in the default file manager.

Macro Definition Documentation

◆ SLEEP_ACCURACY_US

#define SLEEP_ACCURACY_US   200

Referenced by porting::preciseSleepUs().

◆ sleep_ms

◆ sleep_us

#define sleep_us ( x)
Value:
usleep(x)

Referenced by porting::preciseSleepUs().

◆ strlcpy

#define strlcpy ( d,
s,
n )
Value:
mystrlcpy(d, s, n)
size_t mystrlcpy(char *dst, const char *src, size_t size) noexcept
Definition string.cpp:282

Referenced by read_flags_table().

◆ SWPRINTF_CHARSTRING

#define SWPRINTF_CHARSTRING   L"%s"