LiVES  3.2.0
Data Structures | Macros | Typedefs | Enumerations | Functions
machinestate.h File Reference
#include <sys/time.h>
#include <time.h>
#include "rpmalloc.h"
#include <inttypes.h>
#include "lsd.h"

Go to the source code of this file.

Data Structures

struct  lives_file_dets_t
 
struct  lives_threadvars_t
 
struct  lives_thread_data_t
 
struct  thrd_work_t
 
union  allfunc_t
 

Macros

#define EXTRA_BYTES   DEF_ALIGN
 TODO - split into: memory, files, sysops, threads. More...
 
#define USE_RPMALLOC
 
#define lives_malloc   malloc
 
#define lives_realloc   realloc
 
#define lives_free   free
 
#define lives_memcpy   memcpy
 
#define lives_memcmp   memcmp
 
#define lives_memset   memset
 
#define lives_memmove   memmove
 
#define lives_calloc   calloc
 
#define __STDC_FORMAT_MACROS
 
#define LONGSIZE   32
 
#define __PRI64_PREFIX   "ll"
 
#define PRId64   __PRI64_PREFIX "d"
 
#define PRIu64   __PRI64_PREFIX "u"
 
#define WEED_LEAF_MD5SUM   "md5sum"
 
#define WEED_PLANT_LIVES   31337
 
#define WEED_LEAF_LIVES_SUBTYPE   "subtype"
 
#define WEED_LEAF_LIVES_MESSAGE_STRING   "message_string"
 
#define LIVES_WEED_SUBTYPE_MESSAGE   1
 
#define LIVES_WEED_SUBTYPE_WIDGET   2
 
#define LIVES_WEED_SUBTYPE_TUNABLE   3
 
#define LIVES_WEED_SUBTYPE_PROC_THREAD   4
 
#define OVERRIDE_MEMFUNCS
 
#define OVERRIDE_CALLOC_ALIGNED
 
#define LSD_RANDFUNC(ptr, size)   (lives_get_randbytes((ptr), (size)))
 
#define lives_nanosleep(nanosec)
 
#define lives_nanosleep_until_nonzero(condition)   {while (!(condition)) lives_nanosleep(1000);}
 
#define EXTRA_DETAILS_CHECK_MISSING   (1ul << 0)
 extras we can check for, may consume more time More...
 
#define EXTRA_DETAILS_DIRSIZE   (1ul << 1)
 
#define EXTRA_DETAILS_EMPTY_DIRS   (1ul << 2)
 
#define EXTRA_DETAILS_SYMLINK   (1ul << 3)
 
#define EXTRA_DETAILS_ACCESSIBLE   (1ul << 4)
 
#define EXTRA_DETAILS_WRITEABLE   (1ul << 5)
 
#define EXTRA_DETAILS_EXECUTABLE   (1ul << 6)
 
#define EXTRA_DETAILS_CLIPHDR   (1ul << 7)
 
#define EXTRA_DETAILS_MD5SUM   (1ul << 33)
 derived values More...
 
#define WEED_LEAF_NOTIFY   "notify"
 
#define WEED_LEAF_DONE   "done"
 
#define WEED_LEAF_THREADFUNC   "tfunction"
 
#define WEED_LEAF_THREAD_PROCESSING   "t_processing"
 
#define WEED_LEAF_THREAD_CANCELLABLE   "t_can_cancel"
 
#define WEED_LEAF_THREAD_CANCELLED   "t_cancelled"
 
#define WEED_LEAF_RETURN_VALUE   "return_value"
 
#define WEED_LEAF_DONTCARE   "dontcare"
 tell proc_thread with return value that we n o longer need return val. More...
 
#define WEED_LEAF_DONTCARE_MUTEX   "dontcare_mutex"
 ensures we can set dontcare without it finishing while doing so More...
 
#define WEED_LEAF_SIGNALLED   "signalled"
 
#define WEED_LEAF_SIGNAL_DATA   "signal_data"
 
#define WEED_LEAF_THREAD_PARAM   "thrd_param"
 
#define _WEED_LEAF_THREAD_PARAM(n)   WEED_LEAF_THREAD_PARAM n
 
#define WEED_LEAF_THREAD_PARAM0   _WEED_LEAF_THREAD_PARAM("0")
 
#define WEED_LEAF_THREAD_PARAM1   _WEED_LEAF_THREAD_PARAM("1")
 
#define WEED_LEAF_THREAD_PARAM2   _WEED_LEAF_THREAD_PARAM("2")
 
#define LIVES_THRDFLAG_AUTODELETE   (1 << 0)
 
#define LIVES_THRDFLAG_TUNING   (1 << 1)
 
#define LIVES_THRDFLAG_WAIT_SYNC   (1 << 2)
 
#define LIVES_THRDATTR_NONE   0
 
#define LIVES_THRDATTR_AUTODELETE   (1 << 0)
 
#define LIVES_THRDATTR_PRIORITY   (1 << 1)
 
#define LIVES_THRDATTR_WAIT_SYNC   (1 << 2)
 
#define LIVES_THRDATTR_FG_THREAD   (1 << 3)
 
#define LIVES_THRDATTR_NO_GUI   (1 << 4)
 
#define _RV_   WEED_LEAF_RETURN_VALUE
 
#define GETARG(type, n)   WEED_LEAF_GET(info, _WEED_LEAF_THREAD_PARAM(n), type)
 
#define ARGS1(t1)   GETARG(t1, "0")
 
#define ARGS2(t1, t2)   ARGS1(t1), GETARG(t2, "1")
 
#define ARGS3(t1, t2, t3)   ARGS2(t1, t2), GETARG(t3, "2")
 
#define ARGS4(t1, t2, t3, t4)   ARGS3(t1, t2, t3), GETARG(t4, "3")
 
#define ARGS5(t1, t2, t3, t4, t5)   ARGS4(t1, t2, t3, t4), GETARG(t5, "4")
 
#define ARGS6(t1, t2, t3, t4, t5, t6)   ARGS5(t1, t2, t3, t4, t5), GETARG(t6, "5")
 
#define ARGS7(t1, t2, t3, t4, t5, t6, t7)   ARGS6(t1, t2, t3, t4, t5, t6), GETARG(t7, "6")
 
#define ARGS8(t1, t2, t3, t4, t5, t6, t7, t8)   ARGS7(t1, t2, t3, t4, t5, t6, t7), GETARG(t8, "7")
 
#define ARGS9(t1, t2, t3, t4, t5, t6, t7, t8, t9)   ARGS8(t1, t2, t3, t4, t5, t6, t7. t8), GETARG(t9, "8")
 
#define ARGS10(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)   ARGS9(t1, t2, t3, t4, t5, t6, t7, t8, t9), GETARG(t10, "9")
 
#define CALL_VOID_10(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)   (*thefunc->func)(ARGS10(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10))
 
#define CALL_VOID_9(t1, t2, t3, t4, t5, t6, t7, t8, t9)   (*thefunc->func)(ARGS9(t1, t2, t3, t4, t5, t6, t7, t8, t9))
 
#define CALL_VOID_8(t1, t2, t3, t4, t5, t6, t7, t8)   (*thefunc->func)(ARGS8(t1, t2, t3, t4, t5, t6, t7, t8))
 
#define CALL_VOID_7(t1, t2, t3, t4, t5, t6, t7)   (*thefunc->func)(ARGS7(t1, t2, t3, t4, t5, t6, t7))
 
#define CALL_VOID_6(t1, t2, t3, t4, t5, t6)   (*thefunc->func)(ARGS6(t1, t2, t3, t4, t5, t6))
 
#define CALL_VOID_5(t1, t2, t3, t4, t5)   (*thefunc->func)(ARGS5(t1, t2, t3, t4, t5))
 
#define CALL_VOID_4(t1, t2, t3, t4)   (*thefunc->func)(ARGS4(t1, t2, t3, t4))
 
#define CALL_VOID_3(t1, t2, t3)   (*thefunc->func)(ARGS3(t1, t2, t3))
 
#define CALL_VOID_2(t1, t2)   (*thefunc->func)(ARGS2(t1, t2))
 
#define CALL_VOID_1(t1)   (*thefunc->func)(ARGS1(t1))
 
#define CALL_VOID_0()   (*thefunc->func)()
 
#define CALL_10(ret, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)
 
#define CALL_9(ret, t1, t2, t3, t4, t5, t6, t7, t8, t9)
 
#define CALL_8(ret, t1, t2, t3, t4, t5, t6, t7, t8)
 
#define CALL_7(ret, t1, t2, t3, t4, t5, t6, t7)
 
#define CALL_6(ret, t1, t2, t3, t4, t5, t6)   weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS6(t1, t2, t3, t4, t5, t6)))
 
#define CALL_5(ret, t1, t2, t3, t4, t5)   weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS5(t1, t2, t3, t4, t5)))
 
#define CALL_4(ret, t1, t2, t3, t4)   weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS4(t1, t2, t3, t4)))
 
#define CALL_3(ret, t1, t2, t3)   weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS3(t1, t2, t3)))
 
#define CALL_2(ret, t1, t2)   weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS2(t1, t2)))
 
#define CALL_1(ret, t1)   weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS1(t1)))
 
#define CALL_0(ret)   weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)())
 
#define THREADVAR(var)   (get_threadvars()->var_##var)
 
#define WM_XFWM4   "Xfwm4"
 
#define WM_XFCE4_PANEL   "xfce4-panel"
 
#define WM_XFCE4_SSAVE   "xfce4-ssave"
 
#define WM_XFCE4_COLOR   "xfce4-color-settings"
 
#define WM_XFCE4_DISP   "xfce4-display-settings"
 
#define WM_XFCE4_POW   "xfce4-power-manager-settings"
 
#define WM_XFCE4_SETTINGS   "xfce4-settings-manager"
 
#define WM_XFCE4_TERMINAL   "xfce4-terminal"
 
#define WM_XFCE4_TASKMGR   "xfce4-taskmanager"
 
#define WM_XFCE4_SSHOT   "xfce4-screenshooter"
 
#define WM_KWIN   "KWin"
 
#define WM_KWIN_PANEL   ""
 
#define WM_KWIN_SSAVE   ""
 
#define WM_KWIN_COLOR   ""
 
#define WM_KWIN_DISP   ""
 
#define WM_KWIN_POW   ""
 
#define WM_KWIN_SETTINGS   "systemseettings5"
 
#define WM_KWIN_TERMINAL   "Konsole"
 
#define WM_KWIN_TASKMGR   "systemmonitor"
 
#define WM_KWIN_SSHOT   ""
 
#define XDG_CURRENT_DESKTOP   "XDG_CURRENT_DESKTOP"
 
#define XDG_SESSION_TYPE   "XDG_SESSION_TYPE"
 

Typedefs

typedef void *(* malloc_f) (size_t)
 
typedef void(* free_f) (void *)
 
typedef void *(* free_and_return_f) (void *)
 
typedef void *(* memcpy_f) (void *, const void *, size_t)
 
typedef int(* memcmp_f) (const void *, const void *, size_t)
 
typedef void *(* memset_f) (void *, int, size_t)
 
typedef void *(* memmove_f) (void *, const void *, size_t)
 
typedef void *(* realloc_f) (void *, size_t)
 
typedef void *(* calloc_f) (size_t, size_t)
 
typedef void *(* malloc_and_copy_f) (size_t, const void *)
 
typedef void(* unmalloc_and_copy_f) (size_t, void *)
 
typedef weed_plantptr_t lives_proc_thread_t
 
typedef void *(* lives_funcptr_t) (void *)
 
typedef LiVESList lives_thread_t
 
typedef uint64_t lives_thread_attr_t
 
typedef uint64_t funcsig_t
 
typedef int(* funcptr_int_t) ()
 
typedef double(* funcptr_dbl_t) ()
 
typedef int(* funcptr_bool_t) ()
 
typedef char *(* funcptr_string_t) ()
 
typedef int64_t(* funcptr_int64_t) ()
 
typedef weed_funcptr_t(* funcptr_funcptr_t) ()
 
typedef void *(* funcptr_voidptr_t) ()
 
typedef weed_plant_t(* funcptr_plantptr_t) ()
 

Enumerations

enum  lives_storage_status_t {
  LIVES_STORAGE_STATUS_UNKNOWN = 0, LIVES_STORAGE_STATUS_NORMAL, LIVES_STORAGE_STATUS_WARNING, LIVES_STORAGE_STATUS_CRITICAL,
  LIVES_STORAGE_STATUS_OVERFLOW, LIVES_STORAGE_STATUS_OVER_QUOTA, LIVES_STORAGE_STATUS_OFFLINE
}
 disk/storage status values More...
 

Functions

boolean init_memfuncs (void)
 
void lives_free_check (void *p)
 
void * quick_calloc (size_t n, size_t s)
 
void quick_free (void *p)
 
void * lives_free_and_return (void *p)
 TODO: this file should be split into at least: memory functions, thread functions, file utils. More...
 
void * lives_calloc_safety (size_t nmemb, size_t xsize) GNU_ALIGNED(DEF_ALIGN)
 
void * lives_recalloc (void *p, size_t nmemb, size_t omemb, size_t xsize) GNU_ALIGNED(DEF_ALIGN)
 
size_t get_max_align (size_t req_size, size_t align_max)
 
weed_plant_t * lives_plant_new (int subtype)
 
weed_plant_t * lives_plant_new_with_index (int subtype, int64_t index)
 
void * _ext_malloc (size_t n) GNU_MALLOC
 
void * _ext_malloc_and_copy (size_t, const void *) GNU_MALLOC_SIZE(1)
 
void _ext_unmalloc_and_copy (size_t, void *)
 
void _ext_free (void *)
 
void * _ext_free_and_return (void *)
 
void * _ext_memcpy (void *, const void *, size_t)
 
void * _ext_memset (void *, int, size_t)
 
void * _ext_memmove (void *, const void *, size_t)
 
void * _ext_realloc (void *, size_t) GNU_MALLOC_SIZE(2)
 
void * _ext_calloc (size_t, size_t) GNU_MALLOC_SIZE2(1
 
void GNU_ALIGN (2)
 
void lives_get_randbytes (void *ptr, size_t size)
 
size_t lives_strlen (const char *) GNU_HOT GNU_PURE
 
boolean lives_strcmp (const char *, const char *) GNU_HOT GNU_PURE
 returns FALSE if strings match More...
 
boolean lives_strncmp (const char *, const char *, size_t) GNU_HOT GNU_PURE
 returns FALSE if strings match More...
 
char * lives_strdup_quick (const char *s)
 
int lives_strcmp_ordered (const char *, const char *) GNU_HOT GNU_PURE
 
char * lives_concat (char *, char *) GNU_HOT
 
char * lives_concat_sep (char *st, const char *sep, char *x)
 
char * lives_strstop (char *, const char term) GNU_HOT
 
int lives_strappend (const char *string, int len, const char *xnew)
 
const char * lives_strappendf (const char *string, int len, const char *fmt,...)
 
void swab2 (const void *from, const void *to, size_t granularity) GNU_HOT
 
void swab4 (const void *from, const void *to, size_t granularity) GNU_HOT
 
void swab8 (const void *from, const void *to, size_t granularity) GNU_HOT
 
void reverse_bytes (char *buff, size_t count, size_t granularity) GNU_HOT GNU_FLATTEN
 
boolean reverse_buffer (uint8_t *buff, size_t count, size_t chunk) GNU_HOT
 
uint64_t nxtval (uint64_t val, uint64_t lim, boolean less)
 
uint64_t autotune_u64_end (weed_plant_t **tuner, uint64_t val)
 
void autotune_u64 (weed_plant_t *tuner, uint64_t min, uint64_t max, int ntrials, double cost)
 
void init_random (void)
 
void lives_srandom (unsigned int seed)
 
uint64_t lives_random (void)
 
uint64_t fastrand (void) GNU_HOT
 
void fastrand_add (uint64_t entropy)
 
double fastrand_dbl (double range)
 
uint32_t fastrand_int (uint32_t range)
 pick a pseudo random uint between 0 and range (inclusive) More...
 
uint64_t gen_unique_id (void)
 
void * proxy_realloc (void *ptr, size_t new_size)
 
char * get_md5sum (const char *filename)
 
char * lives_format_storage_space_string (uint64_t space)
 
lives_storage_status_t get_storage_status (const char *dir, uint64_t warn_level, int64_t *dsval, int64_t resvd)
 
uint64_t get_ds_free (const char *dir)
 
lives_proc_thread_t disk_monitor_start (const char *dir)
 
boolean disk_monitor_running (const char *dir)
 
int64_t disk_monitor_check_result (const char *dir)
 
int64_t disk_monitor_wait_result (const char *dir, ticks_t timeout)
 
void disk_monitor_forget (void)
 
char * get_mountpoint_for (const char *dir)
 
ticks_t lives_get_relative_ticks (ticks_t origsecs, ticks_t orignsecs)
 
ticks_t lives_get_current_ticks (void)
 
char * lives_datetime (uint64_t secs, boolean use_local)
 
char * lives_datetime_rel (const char *datetime)
 
int check_dev_busy (char *devstr)
 
off_t get_file_size (int fd)
 
off_t sget_file_size (const char *name)
 
void reget_afilesize (int fileno)
 
off_t reget_afilesize_inner (int fileno)
 
off_t get_dir_size (const char *dirname)
 
boolean compress_files_in_dir (const char *dir, int method, void *data)
 
LiVESResponseType send_to_trash (const char *item)
 
uint32_t lives_string_hash (const char *string) GNU_PURE GNU_HOT
 
uint32_t fast_hash (const char *key) GNU_PURE GNU_HOT
 
char * lives_chomp (char *string)
 
char * lives_strtrim (const char *buff)
 
int check_for_bad_ffmpeg (void)
 
void update_effort (int nthings, boolean badthings)
 
void reset_effort (void)
 
void lives_threadpool_init (void)
 
void lives_threadpool_finish (void)
 
int lives_thread_create (lives_thread_t *thread, lives_thread_attr_t attr, lives_funcptr_t func, void *arg)
 
uint64_t lives_thread_join (lives_thread_t work, void **retval)
 
lives_proc_thread_t lives_proc_thread_create (lives_thread_attr_t, lives_funcptr_t, int return_type, const char *args_fmt,...)
 create the specific plant which defines a background task to be run More...
 
void lives_proc_thread_free (lives_proc_thread_t lpt)
 
boolean lives_proc_thread_check (lives_proc_thread_t)
 returns FALSE while the thread is running, TRUE once it has finished More...
 
int lives_proc_thread_signalled (lives_proc_thread_t tinfo)
 
int64_t lives_proc_thread_signalled_idx (lives_proc_thread_t tinfo)
 
lives_thread_data_t * get_thread_data (void)
 
lives_threadvars_tget_threadvars (void)
 
lives_thread_data_t * lives_thread_data_create (uint64_t idx)
 
void lives_proc_thread_set_cancellable (lives_proc_thread_t)
 only threads with no return value can possibly be cancellable. For threads with a value, use lives_proc_thread_dontcare() More...
 
boolean lives_proc_thread_get_cancellable (lives_proc_thread_t)
 
boolean lives_proc_thread_cancel (lives_proc_thread_t)
 
boolean lives_proc_thread_cancelled (lives_proc_thread_t)
 
boolean lives_proc_thread_dontcare (lives_proc_thread_t)
 tell a threead with return value that we no longer need the value so it can free itself More...
 
void lives_proc_thread_sync_ready (lives_proc_thread_t)
 
void lives_proc_thread_join (lives_proc_thread_t)
 
int lives_proc_thread_join_int (lives_proc_thread_t)
 
double lives_proc_thread_join_double (lives_proc_thread_t)
 
int lives_proc_thread_join_boolean (lives_proc_thread_t)
 
char * lives_proc_thread_join_string (lives_proc_thread_t)
 
weed_funcptr_t lives_proc_thread_join_funcptr (lives_proc_thread_t)
 
void * lives_proc_thread_join_voidptr (lives_proc_thread_t)
 
weed_plantptr_t lives_proc_thread_join_plantptr (lives_proc_thread_t)
 
int64_t lives_proc_thread_join_int64 (lives_proc_thread_t)
 
void resubmit_proc_thread (lives_proc_thread_t, lives_thread_attr_t)
 (re)submission point, the function call is added to the threadpool tasklist if we have sufficient threads the task will be run at once, if all threads are busy then MINPOOLTHREADS new threads will be created and added to the pool More...
 
void * fg_run_func (lives_proc_thread_t lpt, void *retval)
 
void * main_thread_execute (lives_funcptr_t func, int return_type, void *retval, const char *args_fmt,...)
 
void free_fdets_list (LiVESList **)
 
lives_proc_thread_t dir_to_file_details (LiVESList **, const char *dir, const char *orig_loc, uint64_t extra)
 create a list from a (sub)directory '. More...
 
lives_proc_thread_t ordfile_to_file_details (LiVESList **listp, const char *ofname, const char *orig_loc, uint64_t extra)
 
char * grep_in_cmd (const char *cmd, int mstart, int npieces, const char *mphrase, int ridx, int rlen)
 
char * get_wid_for_name (const char *wname)
 x11 More...
 
boolean hide_x11_window (const char *wid)
 
boolean unhide_x11_window (const char *wid)
 
boolean activate_x11_window (const char *wid)
 
boolean show_desktop_panel (void)
 
boolean hide_desktop_panel (void)
 
boolean get_x11_visible (const char *wname)
 
int get_window_stack_level (LiVESXWindow *, int *nwins)
 
boolean get_wm_caps (void)
 
boolean get_distro_dets (void)
 
boolean get_machine_dets (void)
 
int get_num_cpus (void)
 
double get_disk_load (const char *mp)
 
int64_t get_cpu_load (int cpun)
 percent * 1 million More...
 
char * get_systmp (const char *suff, boolean is_dir)
 
char * get_worktmp (const char *prefix)
 
char * get_worktmpfile (const char *prefix)
 
boolean check_snap (const char *prog)
 

Macro Definition Documentation

◆ __PRI64_PREFIX

#define __PRI64_PREFIX   "ll"

Definition at line 163 of file machinestate.h.

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS

Definition at line 132 of file machinestate.h.

◆ _RV_

#define _RV_   WEED_LEAF_RETURN_VALUE

Definition at line 451 of file machinestate.h.

◆ _WEED_LEAF_THREAD_PARAM

#define _WEED_LEAF_THREAD_PARAM (   n)    WEED_LEAF_THREAD_PARAM n

Definition at line 425 of file machinestate.h.

◆ ARGS1

#define ARGS1 (   t1)    GETARG(t1, "0")

Definition at line 466 of file machinestate.h.

◆ ARGS10

#define ARGS10 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7,
  t8,
  t9,
  t10 
)    ARGS9(t1, t2, t3, t4, t5, t6, t7, t8, t9), GETARG(t10, "9")

Definition at line 475 of file machinestate.h.

◆ ARGS2

#define ARGS2 (   t1,
  t2 
)    ARGS1(t1), GETARG(t2, "1")

Definition at line 467 of file machinestate.h.

◆ ARGS3

#define ARGS3 (   t1,
  t2,
  t3 
)    ARGS2(t1, t2), GETARG(t3, "2")

Definition at line 468 of file machinestate.h.

◆ ARGS4

#define ARGS4 (   t1,
  t2,
  t3,
  t4 
)    ARGS3(t1, t2, t3), GETARG(t4, "3")

Definition at line 469 of file machinestate.h.

◆ ARGS5

#define ARGS5 (   t1,
  t2,
  t3,
  t4,
  t5 
)    ARGS4(t1, t2, t3, t4), GETARG(t5, "4")

Definition at line 470 of file machinestate.h.

◆ ARGS6

#define ARGS6 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6 
)    ARGS5(t1, t2, t3, t4, t5), GETARG(t6, "5")

Definition at line 471 of file machinestate.h.

◆ ARGS7

#define ARGS7 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7 
)    ARGS6(t1, t2, t3, t4, t5, t6), GETARG(t7, "6")

Definition at line 472 of file machinestate.h.

◆ ARGS8

#define ARGS8 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7,
  t8 
)    ARGS7(t1, t2, t3, t4, t5, t6, t7), GETARG(t8, "7")

Definition at line 473 of file machinestate.h.

◆ ARGS9

#define ARGS9 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7,
  t8,
  t9 
)    ARGS8(t1, t2, t3, t4, t5, t6, t7. t8), GETARG(t9, "8")

Definition at line 474 of file machinestate.h.

◆ CALL_0

#define CALL_0 (   ret)    weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)())

Definition at line 503 of file machinestate.h.

◆ CALL_1

#define CALL_1 (   ret,
  t1 
)    weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS1(t1)))

Definition at line 502 of file machinestate.h.

◆ CALL_10

#define CALL_10 (   ret,
  t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7,
  t8,
  t9,
  t10 
)
Value:
weed_set_##ret##_value(info, _RV_, \
(*thefunc->func##ret)(ARGS10(t1, t2, t3, t4, t5, t6, t7, t8, t9, t19)))

Definition at line 489 of file machinestate.h.

◆ CALL_2

#define CALL_2 (   ret,
  t1,
  t2 
)    weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS2(t1, t2)))

Definition at line 501 of file machinestate.h.

◆ CALL_3

#define CALL_3 (   ret,
  t1,
  t2,
  t3 
)    weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS3(t1, t2, t3)))

Definition at line 500 of file machinestate.h.

◆ CALL_4

#define CALL_4 (   ret,
  t1,
  t2,
  t3,
  t4 
)    weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS4(t1, t2, t3, t4)))

Definition at line 499 of file machinestate.h.

◆ CALL_5

#define CALL_5 (   ret,
  t1,
  t2,
  t3,
  t4,
  t5 
)    weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS5(t1, t2, t3, t4, t5)))

Definition at line 498 of file machinestate.h.

◆ CALL_6

#define CALL_6 (   ret,
  t1,
  t2,
  t3,
  t4,
  t5,
  t6 
)    weed_set_##ret##_value(info, _RV_, (*thefunc->func##ret)(ARGS6(t1, t2, t3, t4, t5, t6)))

Definition at line 497 of file machinestate.h.

◆ CALL_7

#define CALL_7 (   ret,
  t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7 
)
Value:
weed_set_##ret##_value(info, _RV_, \
(*thefunc->func##ret)(ARGS7(t1, t2, t3, t4, t5, t6, t7)))

Definition at line 495 of file machinestate.h.

◆ CALL_8

#define CALL_8 (   ret,
  t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7,
  t8 
)
Value:
weed_set_##ret##_value(info, _RV_, \
(*thefunc->func##ret)(ARGS8(t1, t2, t3, t4, t5, t6, t7, t7)))

Definition at line 493 of file machinestate.h.

◆ CALL_9

#define CALL_9 (   ret,
  t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7,
  t8,
  t9 
)
Value:
weed_set_##ret##_value(info, _RV_, \
(*thefunc->func##ret)(ARGS9(t1, t2, t3, t4, t5, t6, t7, t8, t9)))

Definition at line 491 of file machinestate.h.

◆ CALL_VOID_0

#define CALL_VOID_0 ( )    (*thefunc->func)()

Definition at line 487 of file machinestate.h.

◆ CALL_VOID_1

#define CALL_VOID_1 (   t1)    (*thefunc->func)(ARGS1(t1))

Definition at line 486 of file machinestate.h.

◆ CALL_VOID_10

#define CALL_VOID_10 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7,
  t8,
  t9,
  t10 
)    (*thefunc->func)(ARGS10(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10))

Definition at line 477 of file machinestate.h.

◆ CALL_VOID_2

#define CALL_VOID_2 (   t1,
  t2 
)    (*thefunc->func)(ARGS2(t1, t2))

Definition at line 485 of file machinestate.h.

◆ CALL_VOID_3

#define CALL_VOID_3 (   t1,
  t2,
  t3 
)    (*thefunc->func)(ARGS3(t1, t2, t3))

Definition at line 484 of file machinestate.h.

◆ CALL_VOID_4

#define CALL_VOID_4 (   t1,
  t2,
  t3,
  t4 
)    (*thefunc->func)(ARGS4(t1, t2, t3, t4))

Definition at line 483 of file machinestate.h.

◆ CALL_VOID_5

#define CALL_VOID_5 (   t1,
  t2,
  t3,
  t4,
  t5 
)    (*thefunc->func)(ARGS5(t1, t2, t3, t4, t5))

Definition at line 482 of file machinestate.h.

◆ CALL_VOID_6

#define CALL_VOID_6 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6 
)    (*thefunc->func)(ARGS6(t1, t2, t3, t4, t5, t6))

Definition at line 481 of file machinestate.h.

◆ CALL_VOID_7

#define CALL_VOID_7 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7 
)    (*thefunc->func)(ARGS7(t1, t2, t3, t4, t5, t6, t7))

Definition at line 480 of file machinestate.h.

◆ CALL_VOID_8

#define CALL_VOID_8 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7,
  t8 
)    (*thefunc->func)(ARGS8(t1, t2, t3, t4, t5, t6, t7, t8))

Definition at line 479 of file machinestate.h.

◆ CALL_VOID_9

#define CALL_VOID_9 (   t1,
  t2,
  t3,
  t4,
  t5,
  t6,
  t7,
  t8,
  t9 
)    (*thefunc->func)(ARGS9(t1, t2, t3, t4, t5, t6, t7, t8, t9))

Definition at line 478 of file machinestate.h.

◆ EXTRA_BYTES

#define EXTRA_BYTES   DEF_ALIGN

TODO - split into: memory, files, sysops, threads.

Definition at line 16 of file machinestate.h.

◆ EXTRA_DETAILS_ACCESSIBLE

#define EXTRA_DETAILS_ACCESSIBLE   (1ul << 4)

Definition at line 330 of file machinestate.h.

◆ EXTRA_DETAILS_CHECK_MISSING

#define EXTRA_DETAILS_CHECK_MISSING   (1ul << 0)

extras we can check for, may consume more time

Definition at line 326 of file machinestate.h.

◆ EXTRA_DETAILS_CLIPHDR

#define EXTRA_DETAILS_CLIPHDR   (1ul << 7)

Definition at line 333 of file machinestate.h.

◆ EXTRA_DETAILS_DIRSIZE

#define EXTRA_DETAILS_DIRSIZE   (1ul << 1)

Definition at line 327 of file machinestate.h.

◆ EXTRA_DETAILS_EMPTY_DIRS

#define EXTRA_DETAILS_EMPTY_DIRS   (1ul << 2)

Definition at line 328 of file machinestate.h.

◆ EXTRA_DETAILS_EXECUTABLE

#define EXTRA_DETAILS_EXECUTABLE   (1ul << 6)

Definition at line 332 of file machinestate.h.

◆ EXTRA_DETAILS_MD5SUM

#define EXTRA_DETAILS_MD5SUM   (1ul << 33)

derived values

Definition at line 336 of file machinestate.h.

◆ EXTRA_DETAILS_SYMLINK

#define EXTRA_DETAILS_SYMLINK   (1ul << 3)

Definition at line 329 of file machinestate.h.

◆ EXTRA_DETAILS_WRITEABLE

#define EXTRA_DETAILS_WRITEABLE   (1ul << 5)

Definition at line 331 of file machinestate.h.

◆ GETARG

#define GETARG (   type,
 
)    WEED_LEAF_GET(info, _WEED_LEAF_THREAD_PARAM(n), type)

Definition at line 464 of file machinestate.h.

◆ lives_calloc

#define lives_calloc   calloc

Definition at line 67 of file machinestate.h.

◆ lives_free

#define lives_free   free

Definition at line 52 of file machinestate.h.

◆ lives_malloc

#define lives_malloc   malloc

Definition at line 46 of file machinestate.h.

◆ lives_memcmp

#define lives_memcmp   memcmp

Definition at line 58 of file machinestate.h.

◆ lives_memcpy

#define lives_memcpy   memcpy

Definition at line 55 of file machinestate.h.

◆ lives_memmove

#define lives_memmove   memmove

Definition at line 64 of file machinestate.h.

◆ lives_memset

#define lives_memset   memset

Definition at line 61 of file machinestate.h.

◆ lives_nanosleep

#define lives_nanosleep (   nanosec)
Value:
{struct timespec ts; ts.tv_sec = (uint64_t)nanosec / ONE_BILLION; \
ts.tv_nsec = (uint64_t)nanosec - ts.tv_sec * ONE_BILLION; while (nanosleep(&ts, &ts) == -1 && \
errno != ETIMEDOUT);}

Definition at line 307 of file machinestate.h.

◆ lives_nanosleep_until_nonzero

#define lives_nanosleep_until_nonzero (   condition)    {while (!(condition)) lives_nanosleep(1000);}

Definition at line 310 of file machinestate.h.

◆ lives_realloc

#define lives_realloc   realloc

Definition at line 49 of file machinestate.h.

◆ LIVES_THRDATTR_AUTODELETE

#define LIVES_THRDATTR_AUTODELETE   (1 << 0)

Definition at line 438 of file machinestate.h.

◆ LIVES_THRDATTR_FG_THREAD

#define LIVES_THRDATTR_FG_THREAD   (1 << 3)

Definition at line 441 of file machinestate.h.

◆ LIVES_THRDATTR_NO_GUI

#define LIVES_THRDATTR_NO_GUI   (1 << 4)

Definition at line 442 of file machinestate.h.

◆ LIVES_THRDATTR_NONE

#define LIVES_THRDATTR_NONE   0

Definition at line 437 of file machinestate.h.

◆ LIVES_THRDATTR_PRIORITY

#define LIVES_THRDATTR_PRIORITY   (1 << 1)

Definition at line 439 of file machinestate.h.

◆ LIVES_THRDATTR_WAIT_SYNC

#define LIVES_THRDATTR_WAIT_SYNC   (1 << 2)

Definition at line 440 of file machinestate.h.

◆ LIVES_THRDFLAG_AUTODELETE

#define LIVES_THRDFLAG_AUTODELETE   (1 << 0)

Definition at line 430 of file machinestate.h.

◆ LIVES_THRDFLAG_TUNING

#define LIVES_THRDFLAG_TUNING   (1 << 1)

Definition at line 431 of file machinestate.h.

◆ LIVES_THRDFLAG_WAIT_SYNC

#define LIVES_THRDFLAG_WAIT_SYNC   (1 << 2)

Definition at line 432 of file machinestate.h.

◆ LIVES_WEED_SUBTYPE_MESSAGE

#define LIVES_WEED_SUBTYPE_MESSAGE   1

Definition at line 201 of file machinestate.h.

◆ LIVES_WEED_SUBTYPE_PROC_THREAD

#define LIVES_WEED_SUBTYPE_PROC_THREAD   4

Definition at line 204 of file machinestate.h.

◆ LIVES_WEED_SUBTYPE_TUNABLE

#define LIVES_WEED_SUBTYPE_TUNABLE   3

Definition at line 203 of file machinestate.h.

◆ LIVES_WEED_SUBTYPE_WIDGET

#define LIVES_WEED_SUBTYPE_WIDGET   2

Definition at line 202 of file machinestate.h.

◆ LONGSIZE

#define LONGSIZE   32

Definition at line 151 of file machinestate.h.

◆ LSD_RANDFUNC

#define LSD_RANDFUNC (   ptr,
  size 
)    (lives_get_randbytes((ptr), (size)))

Definition at line 234 of file machinestate.h.

◆ OVERRIDE_CALLOC_ALIGNED

#define OVERRIDE_CALLOC_ALIGNED

Definition at line 226 of file machinestate.h.

◆ OVERRIDE_MEMFUNCS

#define OVERRIDE_MEMFUNCS

Definition at line 222 of file machinestate.h.

◆ PRId64

#define PRId64   __PRI64_PREFIX "d"

Definition at line 169 of file machinestate.h.

◆ PRIu64

#define PRIu64   __PRI64_PREFIX "u"

Definition at line 170 of file machinestate.h.

◆ THREADVAR

#define THREADVAR (   var)    (get_threadvars()->var_##var)

Definition at line 531 of file machinestate.h.

◆ USE_RPMALLOC

#define USE_RPMALLOC

Definition at line 30 of file machinestate.h.

◆ WEED_LEAF_DONE

#define WEED_LEAF_DONE   "done"

Definition at line 412 of file machinestate.h.

◆ WEED_LEAF_DONTCARE

#define WEED_LEAF_DONTCARE   "dontcare"

tell proc_thread with return value that we n o longer need return val.

Definition at line 418 of file machinestate.h.

◆ WEED_LEAF_DONTCARE_MUTEX

#define WEED_LEAF_DONTCARE_MUTEX   "dontcare_mutex"

ensures we can set dontcare without it finishing while doing so

Definition at line 419 of file machinestate.h.

◆ WEED_LEAF_LIVES_MESSAGE_STRING

#define WEED_LEAF_LIVES_MESSAGE_STRING   "message_string"

Definition at line 199 of file machinestate.h.

◆ WEED_LEAF_LIVES_SUBTYPE

#define WEED_LEAF_LIVES_SUBTYPE   "subtype"

Definition at line 198 of file machinestate.h.

◆ WEED_LEAF_MD5SUM

#define WEED_LEAF_MD5SUM   "md5sum"

Definition at line 193 of file machinestate.h.

◆ WEED_LEAF_NOTIFY

#define WEED_LEAF_NOTIFY   "notify"

Definition at line 411 of file machinestate.h.

◆ WEED_LEAF_RETURN_VALUE

#define WEED_LEAF_RETURN_VALUE   "return_value"

Definition at line 417 of file machinestate.h.

◆ WEED_LEAF_SIGNAL_DATA

#define WEED_LEAF_SIGNAL_DATA   "signal_data"

Definition at line 422 of file machinestate.h.

◆ WEED_LEAF_SIGNALLED

#define WEED_LEAF_SIGNALLED   "signalled"

Definition at line 421 of file machinestate.h.

◆ WEED_LEAF_THREAD_CANCELLABLE

#define WEED_LEAF_THREAD_CANCELLABLE   "t_can_cancel"

Definition at line 415 of file machinestate.h.

◆ WEED_LEAF_THREAD_CANCELLED

#define WEED_LEAF_THREAD_CANCELLED   "t_cancelled"

Definition at line 416 of file machinestate.h.

◆ WEED_LEAF_THREAD_PARAM

#define WEED_LEAF_THREAD_PARAM   "thrd_param"

Definition at line 424 of file machinestate.h.

◆ WEED_LEAF_THREAD_PARAM0

#define WEED_LEAF_THREAD_PARAM0   _WEED_LEAF_THREAD_PARAM("0")

Definition at line 426 of file machinestate.h.

◆ WEED_LEAF_THREAD_PARAM1

#define WEED_LEAF_THREAD_PARAM1   _WEED_LEAF_THREAD_PARAM("1")

Definition at line 427 of file machinestate.h.

◆ WEED_LEAF_THREAD_PARAM2

#define WEED_LEAF_THREAD_PARAM2   _WEED_LEAF_THREAD_PARAM("2")

Definition at line 428 of file machinestate.h.

◆ WEED_LEAF_THREAD_PROCESSING

#define WEED_LEAF_THREAD_PROCESSING   "t_processing"

Definition at line 414 of file machinestate.h.

◆ WEED_LEAF_THREADFUNC

#define WEED_LEAF_THREADFUNC   "tfunction"

Definition at line 413 of file machinestate.h.

◆ WEED_PLANT_LIVES

#define WEED_PLANT_LIVES   31337

Definition at line 196 of file machinestate.h.

◆ WM_KWIN

#define WM_KWIN   "KWin"

Definition at line 594 of file machinestate.h.

◆ WM_KWIN_COLOR

#define WM_KWIN_COLOR   ""

Definition at line 597 of file machinestate.h.

◆ WM_KWIN_DISP

#define WM_KWIN_DISP   ""

Definition at line 598 of file machinestate.h.

◆ WM_KWIN_PANEL

#define WM_KWIN_PANEL   ""

Definition at line 595 of file machinestate.h.

◆ WM_KWIN_POW

#define WM_KWIN_POW   ""

Definition at line 599 of file machinestate.h.

◆ WM_KWIN_SETTINGS

#define WM_KWIN_SETTINGS   "systemseettings5"

Definition at line 600 of file machinestate.h.

◆ WM_KWIN_SSAVE

#define WM_KWIN_SSAVE   ""

Definition at line 596 of file machinestate.h.

◆ WM_KWIN_SSHOT

#define WM_KWIN_SSHOT   ""

Definition at line 603 of file machinestate.h.

◆ WM_KWIN_TASKMGR

#define WM_KWIN_TASKMGR   "systemmonitor"

Definition at line 602 of file machinestate.h.

◆ WM_KWIN_TERMINAL

#define WM_KWIN_TERMINAL   "Konsole"

Definition at line 601 of file machinestate.h.

◆ WM_XFCE4_COLOR

#define WM_XFCE4_COLOR   "xfce4-color-settings"

Definition at line 586 of file machinestate.h.

◆ WM_XFCE4_DISP

#define WM_XFCE4_DISP   "xfce4-display-settings"

Definition at line 587 of file machinestate.h.

◆ WM_XFCE4_PANEL

#define WM_XFCE4_PANEL   "xfce4-panel"

Definition at line 584 of file machinestate.h.

◆ WM_XFCE4_POW

#define WM_XFCE4_POW   "xfce4-power-manager-settings"

Definition at line 588 of file machinestate.h.

◆ WM_XFCE4_SETTINGS

#define WM_XFCE4_SETTINGS   "xfce4-settings-manager"

Definition at line 589 of file machinestate.h.

◆ WM_XFCE4_SSAVE

#define WM_XFCE4_SSAVE   "xfce4-ssave"

Definition at line 585 of file machinestate.h.

◆ WM_XFCE4_SSHOT

#define WM_XFCE4_SSHOT   "xfce4-screenshooter"

Definition at line 592 of file machinestate.h.

◆ WM_XFCE4_TASKMGR

#define WM_XFCE4_TASKMGR   "xfce4-taskmanager"

Definition at line 591 of file machinestate.h.

◆ WM_XFCE4_TERMINAL

#define WM_XFCE4_TERMINAL   "xfce4-terminal"

Definition at line 590 of file machinestate.h.

◆ WM_XFWM4

#define WM_XFWM4   "Xfwm4"

Definition at line 583 of file machinestate.h.

◆ XDG_CURRENT_DESKTOP

#define XDG_CURRENT_DESKTOP   "XDG_CURRENT_DESKTOP"

Definition at line 605 of file machinestate.h.

◆ XDG_SESSION_TYPE

#define XDG_SESSION_TYPE   "XDG_SESSION_TYPE"

Definition at line 606 of file machinestate.h.

Typedef Documentation

◆ calloc_f

typedef void*(* calloc_f) (size_t, size_t)

Definition at line 26 of file machinestate.h.

◆ free_and_return_f

typedef void*(* free_and_return_f) (void *)

Definition at line 20 of file machinestate.h.

◆ free_f

typedef void(* free_f) (void *)

Definition at line 19 of file machinestate.h.

◆ funcptr_bool_t

typedef int(* funcptr_bool_t) ()

Definition at line 457 of file machinestate.h.

◆ funcptr_dbl_t

typedef double(* funcptr_dbl_t) ()

Definition at line 456 of file machinestate.h.

◆ funcptr_funcptr_t

typedef weed_funcptr_t(* funcptr_funcptr_t) ()

Definition at line 460 of file machinestate.h.

◆ funcptr_int64_t

typedef int64_t(* funcptr_int64_t) ()

Definition at line 459 of file machinestate.h.

◆ funcptr_int_t

typedef int(* funcptr_int_t) ()

Definition at line 455 of file machinestate.h.

◆ funcptr_plantptr_t

typedef weed_plant_t(* funcptr_plantptr_t) ()

Definition at line 462 of file machinestate.h.

◆ funcptr_string_t

typedef char*(* funcptr_string_t) ()

Definition at line 458 of file machinestate.h.

◆ funcptr_voidptr_t

typedef void*(* funcptr_voidptr_t) ()

Definition at line 461 of file machinestate.h.

◆ funcsig_t

typedef uint64_t funcsig_t

Definition at line 453 of file machinestate.h.

◆ lives_funcptr_t

typedef void*(* lives_funcptr_t) (void *)

Definition at line 378 of file machinestate.h.

◆ lives_proc_thread_t

typedef weed_plantptr_t lives_proc_thread_t

Definition at line 206 of file machinestate.h.

◆ lives_thread_attr_t

typedef uint64_t lives_thread_attr_t

Definition at line 435 of file machinestate.h.

◆ lives_thread_t

typedef LiVESList lives_thread_t

Definition at line 434 of file machinestate.h.

◆ malloc_and_copy_f

typedef void*(* malloc_and_copy_f) (size_t, const void *)

Definition at line 27 of file machinestate.h.

◆ malloc_f

typedef void*(* malloc_f) (size_t)

Definition at line 18 of file machinestate.h.

◆ memcmp_f

typedef int(* memcmp_f) (const void *, const void *, size_t)

Definition at line 22 of file machinestate.h.

◆ memcpy_f

typedef void*(* memcpy_f) (void *, const void *, size_t)

Definition at line 21 of file machinestate.h.

◆ memmove_f

typedef void*(* memmove_f) (void *, const void *, size_t)

Definition at line 24 of file machinestate.h.

◆ memset_f

typedef void*(* memset_f) (void *, int, size_t)

Definition at line 23 of file machinestate.h.

◆ realloc_f

typedef void*(* realloc_f) (void *, size_t)

Definition at line 25 of file machinestate.h.

◆ unmalloc_and_copy_f

typedef void(* unmalloc_and_copy_f) (size_t, void *)

Definition at line 28 of file machinestate.h.

Enumeration Type Documentation

◆ lives_storage_status_t

disk/storage status values

Enumerator
LIVES_STORAGE_STATUS_UNKNOWN 
LIVES_STORAGE_STATUS_NORMAL 
LIVES_STORAGE_STATUS_WARNING 
LIVES_STORAGE_STATUS_CRITICAL 
LIVES_STORAGE_STATUS_OVERFLOW 
LIVES_STORAGE_STATUS_OVER_QUOTA 
LIVES_STORAGE_STATUS_OFFLINE 

Definition at line 181 of file machinestate.h.

Function Documentation

◆ _ext_calloc()

void* _ext_calloc ( size_t  ,
size_t   
)

◆ _ext_free()

void _ext_free ( void *  )

Definition at line 556 of file machinestate.c.

Referenced by _ext_free_and_return(), and _ext_unmalloc_and_copy().

◆ _ext_free_and_return()

void* _ext_free_and_return ( void *  )

Definition at line 565 of file machinestate.c.

◆ _ext_malloc()

void* _ext_malloc ( size_t  n)

Definition at line 530 of file machinestate.c.

◆ _ext_malloc_and_copy()

void* _ext_malloc_and_copy ( size_t  ,
const void *   
)

Definition at line 539 of file machinestate.c.

◆ _ext_memcpy()

void* _ext_memcpy ( void *  ,
const void *  ,
size_t   
)

Definition at line 567 of file machinestate.c.

◆ _ext_memmove()

void* _ext_memmove ( void *  ,
const void *  ,
size_t   
)

Definition at line 573 of file machinestate.c.

◆ _ext_memset()

void* _ext_memset ( void *  ,
int  ,
size_t   
)

Definition at line 571 of file machinestate.c.

◆ _ext_realloc()

void* _ext_realloc ( void *  ,
size_t   
)

Definition at line 575 of file machinestate.c.

◆ _ext_unmalloc_and_copy()

void _ext_unmalloc_and_copy ( size_t  ,
void *   
)

Definition at line 547 of file machinestate.c.

◆ activate_x11_window()

boolean activate_x11_window ( const char *  wid)

Definition at line 2998 of file machinestate.c.

Referenced by do_startup_interface_query(), and do_workdir_query().

◆ autotune_u64()

void autotune_u64 ( weed_plant_t *  tuner,
uint64_t  min,
uint64_t  max,
int  ntrials,
double  cost 
)

Definition at line 182 of file machinestate.c.

◆ autotune_u64_end()

uint64_t autotune_u64_end ( weed_plant_t **  tuner,
uint64_t  val 
)

Definition at line 259 of file machinestate.c.

◆ check_dev_busy()

int check_dev_busy ( char *  devstr)

Definition at line 876 of file machinestate.c.

Referenced by on_live_tvcard_activate().

◆ check_for_bad_ffmpeg()

int check_for_bad_ffmpeg ( void  )

Definition at line 1382 of file machinestate.c.

Referenced by load_frame_image().

◆ check_snap()

boolean check_snap ( const char *  prog)

Definition at line 3257 of file machinestate.c.

◆ compress_files_in_dir()

boolean compress_files_in_dir ( const char *  dir,
int  method,
void *  data 
)

compress all files in dir with gzip (directories are not compressed) gzip default action is to compress all files, replacing foo.bar with foo.bar.gz if a file already has a .gz extension then it will be left uncchanged

in future, method and data may be used to select compression method for now they are ignored

Definition at line 898 of file machinestate.c.

◆ dir_to_file_details()

lives_proc_thread_t dir_to_file_details ( LiVESList **  listp,
const char *  dir,
const char *  orig_loc,
uint64_t  extra 
)

create a list from a (sub)directory '.

' and '..' are ignored subdir can be NULL runs in a proc_htread

Definition at line 1353 of file machinestate.c.

◆ disk_monitor_check_result()

int64_t disk_monitor_check_result ( const char *  dir)

Definition at line 726 of file machinestate.c.

Referenced by check_for_disk_space(), and check_storage_space().

◆ disk_monitor_forget()

void disk_monitor_forget ( void  )

Definition at line 769 of file machinestate.c.

Referenced by disk_monitor_start().

◆ disk_monitor_running()

boolean disk_monitor_running ( const char *  dir)

◆ disk_monitor_start()

lives_proc_thread_t disk_monitor_start ( const char *  dir)

Definition at line 717 of file machinestate.c.

Referenced by disk_monitor_check_result().

◆ disk_monitor_wait_result()

int64_t disk_monitor_wait_result ( const char *  dir,
ticks_t  timeout 
)

Definition at line 742 of file machinestate.c.

◆ fast_hash()

uint32_t fast_hash ( const char *  key)

approx 5 - 10 % faster than lives_string_hash

Definition at line 1596 of file machinestate.c.

Referenced by get_val_from_cached_list().

◆ fastrand()

uint64_t fastrand ( void  )

Definition at line 40 of file machinestate.c.

Referenced by fastrand_dbl().

◆ fastrand_add()

void fastrand_add ( uint64_t  entropy)

Definition at line 47 of file machinestate.c.

◆ fastrand_dbl()

double fastrand_dbl ( double  range)

Definition at line 49 of file machinestate.c.

Referenced by fastrand_int().

◆ fastrand_int()

uint32_t fastrand_int ( uint32_t  range)

pick a pseudo random uint between 0 and range (inclusive)

Definition at line 54 of file machinestate.c.

Referenced by pick_nice_colour().

◆ fg_run_func()

void* fg_run_func ( lives_proc_thread_t  lpt,
void *  retval 
)

no funcptrs or custom...yet

Definition at line 2045 of file machinestate.c.

Referenced by lives_fg_run().

◆ free_fdets_list()

void free_fdets_list ( LiVESList **  )

Definition at line 1084 of file machinestate.c.

◆ gen_unique_id()

uint64_t gen_unique_id ( void  )

if we have a genuine RNG for 64 bits, then the probability of generating

Definition at line 68 of file machinestate.c.

Referenced by init_random(), lives_get_randbytes(), and open_set_file().

◆ get_cpu_load()

int64_t get_cpu_load ( int  cpun)

percent * 1 million

return reported load for CPU cpun (% * 1 million) as a bonus, if cpun == -1, returns boot time

Definition at line 3396 of file machinestate.c.

◆ get_dir_size()

off_t get_dir_size ( const char *  dirname)

Definition at line 1069 of file machinestate.c.

Referenced by on_utube_select().

◆ get_disk_load()

double get_disk_load ( const char *  mp)

Definition at line 3359 of file machinestate.c.

◆ get_distro_dets()

boolean get_distro_dets ( void  )

Definition at line 3268 of file machinestate.c.

◆ get_ds_free()

uint64_t get_ds_free ( const char *  dir)

Definition at line 776 of file machinestate.c.

Referenced by check_workdir_valid(), and get_storage_status().

◆ get_file_size()

off_t get_file_size ( int  fd)

because of padding bytes... !!!!

Definition at line 943 of file machinestate.c.

Referenced by _lives_buffered_rdonly_slurp(), and lives_buffered_orig_size().

◆ get_machine_dets()

boolean get_machine_dets ( void  )

Definition at line 3319 of file machinestate.c.

◆ get_max_align()

size_t get_max_align ( size_t  req_size,
size_t  align_max 
)

Definition at line 596 of file machinestate.c.

Referenced by insert_newlines().

◆ get_md5sum()

char* get_md5sum ( const char *  filename)

for future use

Definition at line 646 of file machinestate.c.

◆ get_mountpoint_for()

char* get_mountpoint_for ( const char *  dir)

◆ get_num_cpus()

int get_num_cpus ( void  )

Definition at line 3297 of file machinestate.c.

◆ get_storage_status()

lives_storage_status_t get_storage_status ( const char *  dir,
uint64_t  warn_level,
int64_t *  dsval,
int64_t  resvd 
)

◆ get_systmp()

char* get_systmp ( const char *  suff,
boolean  is_dir 
)

Definition at line 3232 of file machinestate.c.

Referenced by on_open_utube_activate().

◆ get_thread_data()

lives_thread_data_t* get_thread_data ( void  )

Definition at line 2145 of file machinestate.c.

Referenced by get_threadvars().

◆ get_threadvars()

lives_threadvars_t* get_threadvars ( void  )

Definition at line 2156 of file machinestate.c.

◆ get_wid_for_name()

char* get_wid_for_name ( const char *  wname)

x11

x11

Definition at line 2917 of file machinestate.c.

Referenced by hide_desktop_panel(), and show_desktop_panel().

◆ get_window_stack_level()

int get_window_stack_level ( LiVESXWindow *  ,
int *  nwins 
)

Definition at line 3080 of file machinestate.c.

◆ get_wm_caps()

boolean get_wm_caps ( void  )

Definition at line 3018 of file machinestate.c.

◆ get_worktmp()

char* get_worktmp ( const char *  prefix)

Definition at line 3246 of file machinestate.c.

Referenced by open_ascrap_file(), and open_scrap_file().

◆ get_worktmpfile()

char* get_worktmpfile ( const char *  prefix)

Definition at line 3251 of file machinestate.c.

◆ get_x11_visible()

boolean get_x11_visible ( const char *  wname)

Definition at line 3123 of file machinestate.c.

◆ GNU_ALIGN()

void GNU_ALIGN ( )

◆ grep_in_cmd()

char* grep_in_cmd ( const char *  cmd,
int  mstart,
int  npieces,
const char *  mphrase,
int  ridx,
int  rlen 
)

Definition at line 2754 of file machinestate.c.

Referenced by check_snap(), get_wid_for_name(), and get_x11_visible().

◆ hide_desktop_panel()

boolean hide_desktop_panel ( void  )

Definition at line 3110 of file machinestate.c.

◆ hide_x11_window()

boolean hide_x11_window ( const char *  wid)

Definition at line 2973 of file machinestate.c.

Referenced by hide_desktop_panel().

◆ init_memfuncs()

boolean init_memfuncs ( void  )

Definition at line 630 of file machinestate.c.

◆ init_random()

void init_random ( void  )

Definition at line 92 of file machinestate.c.

◆ lives_calloc_safety()

void* lives_calloc_safety ( size_t  nmemb,
size_t  xsize 
)

◆ lives_chomp()

char* lives_chomp ( char *  string)

see also lives_strchomp() which removes all whitespace

Definition at line 1641 of file machinestate.c.

Referenced by get_mountpoint_for(), lives_label_chomp(), and splash_msg().

◆ lives_concat()

char* lives_concat ( char *  ,
char *   
)

nb: lives strconcat

Definition at line 1426 of file machinestate.c.

Referenced by explain_missing_activate().

◆ lives_concat_sep()

char* lives_concat_sep ( char *  st,
const char *  sep,
char *  x 
)

nb: lives strconcat

Definition at line 1412 of file machinestate.c.

◆ lives_datetime()

char* lives_datetime ( uint64_t  secs,
boolean  use_local 
)

Definition at line 860 of file machinestate.c.

Referenced by lives_datetime_rel(), and lives_event_list_new().

◆ lives_datetime_rel()

char* lives_datetime_rel ( const char *  datetime)

replace date w. yesterday, today

Definition at line 842 of file machinestate.c.

◆ lives_format_storage_space_string()

char* lives_format_storage_space_string ( uint64_t  space)

Definition at line 664 of file machinestate.c.

Referenced by ds_critical_msg(), ds_warning_msg(), and on_utube_select().

◆ lives_free_and_return()

void* lives_free_and_return ( void *  p)

TODO: this file should be split into at least: memory functions, thread functions, file utils.

Definition at line 593 of file machinestate.c.

◆ lives_free_check()

void lives_free_check ( void *  p)

◆ lives_get_current_ticks()

ticks_t lives_get_current_ticks ( void  )

◆ lives_get_randbytes()

void lives_get_randbytes ( void *  ptr,
size_t  size 
)

Definition at line 60 of file machinestate.c.

◆ lives_get_relative_ticks()

ticks_t lives_get_relative_ticks ( ticks_t  origsecs,
ticks_t  orignsecs 
)

◆ lives_plant_new()

weed_plant_t* lives_plant_new ( int  subtype)

Definition at line 2266 of file machinestate.c.

Referenced by lives_plant_new_with_index().

◆ lives_plant_new_with_index()

weed_plant_t* lives_plant_new_with_index ( int  subtype,
int64_t  index 
)

Definition at line 2273 of file machinestate.c.

◆ lives_proc_thread_cancel()

boolean lives_proc_thread_cancel ( lives_proc_thread_t  )

Definition at line 1946 of file machinestate.c.

Referenced by do_effect(), load_rfx_preview(), and render_to_clip().

◆ lives_proc_thread_cancelled()

boolean lives_proc_thread_cancelled ( lives_proc_thread_t  )

Definition at line 1971 of file machinestate.c.

Referenced by _item_to_file_details(), and virtual_to_images().

◆ lives_proc_thread_check()

boolean lives_proc_thread_check ( lives_proc_thread_t  )

returns FALSE while the thread is running, TRUE once it has finished

returns FALSE while the thread is running, TRUE once it has finished

Definition at line 1916 of file machinestate.c.

Referenced by lives_proc_thread_dontcare().

◆ lives_proc_thread_create()

lives_proc_thread_t lives_proc_thread_create ( lives_thread_attr_t  attr,
lives_funcptr_t  func,
int  return_type,
const char *  args_fmt,
  ... 
)

create the specific plant which defines a background task to be run

  • func is any function of a recognised type, with 0 - 16 parameters, and a value of type <return type> which may be retrieved by later calling the appropriate lives_proc_thread_join_*() function
  • args_fmt is a 0 terminated string describing the arguments of func, i ==int, d == double, b == boolean (int), s == string (0 terminated), I == uint64_t, int64_t, P = weed_plant_t *, V / v == (void *), F == weed_funcptr_t return_type is enumerated, e.g WEED_SEED_INT64. Return_type of 0 indicates no return value (void), then the thread will free its own resources and NULL is returned from this function (fire and forget) return_type of -1 has a special meaning, in this case no result is returned, but the thread can be monitored by calling: lives_proc_thread_check() with the return : - this function is guaranteed to return FALSE whilst the thread is running and TRUE thereafter, the proc_thread should be freed once TRUE id returned and not before. for the other return_types, the appropriate join function should be called and it will block until the thread has completed its task and return a copy of the actual return value of the func alternatively, if return_type is non-zero, then the returned value from this function may be reutlised by passing it as the parameter to run_as_thread().

Definition at line 1730 of file machinestate.c.

Referenced by dir_to_file_details(), do_effect(), lives_buffered_rdonly_slurp(), load_rfx_preview(), ordfile_to_file_details(), and render_to_clip().

◆ lives_proc_thread_dontcare()

boolean lives_proc_thread_dontcare ( lives_proc_thread_t  )

tell a threead with return value that we no longer need the value so it can free itself

if thread is running, tell it we no longer care about return value, so it can free itself if finished we just call lives_proc_thread_join() to free it a mutex is used to ensure the proc_thread does not finish between setting the flag and checking if it has ifnished

Definition at line 1953 of file machinestate.c.

Referenced by disk_monitor_forget().

◆ lives_proc_thread_free()

void lives_proc_thread_free ( lives_proc_thread_t  lpt)

Definition at line 1672 of file machinestate.c.

◆ lives_proc_thread_get_cancellable()

boolean lives_proc_thread_get_cancellable ( lives_proc_thread_t  )

Definition at line 1942 of file machinestate.c.

Referenced by lives_proc_thread_cancel().

◆ lives_proc_thread_join()

void lives_proc_thread_join ( lives_proc_thread_t  )

◆ lives_proc_thread_join_boolean()

int lives_proc_thread_join_boolean ( lives_proc_thread_t  )

Definition at line 1989 of file machinestate.c.

◆ lives_proc_thread_join_double()

double lives_proc_thread_join_double ( lives_proc_thread_t  )

Definition at line 1988 of file machinestate.c.

◆ lives_proc_thread_join_funcptr()

weed_funcptr_t lives_proc_thread_join_funcptr ( lives_proc_thread_t  )

Definition at line 1992 of file machinestate.c.

◆ lives_proc_thread_join_int()

int lives_proc_thread_join_int ( lives_proc_thread_t  )

Definition at line 1987 of file machinestate.c.

◆ lives_proc_thread_join_int64()

int64_t lives_proc_thread_join_int64 ( lives_proc_thread_t  )

Definition at line 1990 of file machinestate.c.

◆ lives_proc_thread_join_plantptr()

weed_plantptr_t lives_proc_thread_join_plantptr ( lives_proc_thread_t  )

Definition at line 1994 of file machinestate.c.

◆ lives_proc_thread_join_string()

char* lives_proc_thread_join_string ( lives_proc_thread_t  )

Definition at line 1991 of file machinestate.c.

◆ lives_proc_thread_join_voidptr()

void* lives_proc_thread_join_voidptr ( lives_proc_thread_t  )

Definition at line 1993 of file machinestate.c.

◆ lives_proc_thread_set_cancellable()

void lives_proc_thread_set_cancellable ( lives_proc_thread_t  )

only threads with no return value can possibly be cancellable. For threads with a value, use lives_proc_thread_dontcare()

Definition at line 1938 of file machinestate.c.

Referenced by _item_to_file_details(), render_to_clip(), and virtual_to_images().

◆ lives_proc_thread_signalled()

int lives_proc_thread_signalled ( lives_proc_thread_t  tinfo)

returns FALSE while the thread is running, TRUE once it has finished

Definition at line 1926 of file machinestate.c.

◆ lives_proc_thread_signalled_idx()

int64_t lives_proc_thread_signalled_idx ( lives_proc_thread_t  tinfo)

returns FALSE while the thread is running, TRUE once it has finished

Definition at line 1931 of file machinestate.c.

◆ lives_proc_thread_sync_ready()

void lives_proc_thread_sync_ready ( lives_proc_thread_t  )

Definition at line 1911 of file machinestate.c.

◆ lives_random()

uint64_t lives_random ( void  )

Definition at line 58 of file machinestate.c.

◆ lives_recalloc()

void* lives_recalloc ( void *  p,
size_t  nmemb,
size_t  omemb,
size_t  xsize 
)

realloc from omemb * size to nmemb * size memory allocated via calloc, with DEF_ALIGN alignment and EXTRA_BYTES extra padding

Definition at line 615 of file machinestate.c.

◆ lives_srandom()

void lives_srandom ( unsigned int  seed)

Definition at line 56 of file machinestate.c.

Referenced by init_random().

◆ lives_strappend()

int lives_strappend ( const char *  string,
int  len,
const char *  xnew 
)

see also: lives_concat()

Definition at line 1436 of file machinestate.c.

Referenced by get_mime_type(), handle_backend_errors(), and lives_strappendf().

◆ lives_strappendf()

const char* lives_strappendf ( const char *  string,
int  len,
const char *  fmt,
  ... 
)

Definition at line 1444 of file machinestate.c.

◆ lives_strcmp()

boolean lives_strcmp ( const char *  ,
const char *   
)

◆ lives_strcmp_ordered()

int lives_strcmp_ordered ( const char *  ,
const char *   
)

Definition at line 1531 of file machinestate.c.

Referenced by lives_utf8_strcmpfunc().

◆ lives_strdup_quick()

char* lives_strdup_quick ( const char *  s)

Definition at line 1484 of file machinestate.c.

◆ lives_string_hash()

uint32_t lives_string_hash ( const char *  string)

Definition at line 1585 of file machinestate.c.

◆ lives_strlen()

size_t lives_strlen ( const char *  )

◆ lives_strncmp()

boolean lives_strncmp ( const char *  ,
const char *  ,
size_t   
)

◆ lives_strstop()

char* lives_strstop ( char *  ,
const char  term 
)

truncate st, replacing term with \0

Definition at line 1634 of file machinestate.c.

Referenced by get_distro_dets(), get_filename(), and lives_get_filename().

◆ lives_strtrim()

char* lives_strtrim ( const char *  buff)

return string with start and end newlines stripped see also lives_strstrip() which removes all whitespace

Definition at line 1651 of file machinestate.c.

◆ lives_thread_create()

int lives_thread_create ( lives_thread_t thread,
lives_thread_attr_t  attr,
lives_funcptr_t  func,
void *  arg 
)

Definition at line 2318 of file machinestate.c.

Referenced by resubmit_proc_thread().

◆ lives_thread_data_create()

lives_thread_data_t* lives_thread_data_create ( uint64_t  idx)

Definition at line 2174 of file machinestate.c.

◆ lives_thread_join()

uint64_t lives_thread_join ( lives_thread_t  work,
void **  retval 
)

Definition at line 2376 of file machinestate.c.

Referenced by check_layer_ready().

◆ lives_threadpool_finish()

void lives_threadpool_finish ( void  )

Definition at line 2295 of file machinestate.c.

◆ lives_threadpool_init()

void lives_threadpool_init ( void  )

Definition at line 2280 of file machinestate.c.

◆ main_thread_execute()

void* main_thread_execute ( lives_funcptr_t  func,
int  return_type,
void *  retval,
const char *  args_fmt,
  ... 
)

◆ nxtval()

uint64_t nxtval ( uint64_t  val,
uint64_t  lim,
boolean  less 
)

decompose val into i, j divide by 6 until val mod 6 is non zero

divide by 2 until we reach 1; if the result of a division is odd we add or subtract 1

Definition at line 198 of file machinestate.c.

Referenced by autotune_u64_end().

◆ ordfile_to_file_details()

lives_proc_thread_t ordfile_to_file_details ( LiVESList **  listp,
const char *  ofname,
const char *  orig_loc,
uint64_t  extra 
)

Definition at line 1360 of file machinestate.c.

◆ proxy_realloc()

void* proxy_realloc ( void *  ptr,
size_t  new_size 
)

◆ quick_calloc()

void* quick_calloc ( size_t  n,
size_t  s 
)

Definition at line 628 of file machinestate.c.

Referenced by _ext_calloc().

◆ quick_free()

void quick_free ( void *  p)

Definition at line 626 of file machinestate.c.

◆ reget_afilesize()

void reget_afilesize ( int  fileno)

◆ reget_afilesize_inner()

off_t reget_afilesize_inner ( int  fileno)

Definition at line 1001 of file machinestate.c.

Referenced by on_effects_paused(), and reget_afilesize().

◆ reset_effort()

void reset_effort ( void  )

Definition at line 2642 of file machinestate.c.

◆ resubmit_proc_thread()

void resubmit_proc_thread ( lives_proc_thread_t  ,
lives_thread_attr_t   
)

(re)submission point, the function call is added to the threadpool tasklist if we have sufficient threads the task will be run at once, if all threads are busy then MINPOOLTHREADS new threads will be created and added to the pool

run any function as a lives_thread

tell the thread to clean up after itself [but it won't delete thread_info]

Definition at line 2106 of file machinestate.c.

◆ reverse_buffer()

boolean reverse_buffer ( uint8_t *  buff,
size_t  count,
size_t  chunk 
)

halve the number of bytes, since we will work forwards and back to meet in the middle

swap 8 bytes at a time from start and end

remainder should be only 6, 4, or 2 bytes in the middle

swap 4 bytes at a time from start and end

remainder should be only 6 or 2 bytes in the middle, with a chunk size of 4 or 2 or 1

swap 2 bytes at a time from start and end

swap single bytes

Definition at line 2509 of file machinestate.c.

◆ reverse_bytes()

void reverse_bytes ( char *  buff,
size_t  count,
size_t  granularity 
)

◆ send_to_trash()

LiVESResponseType send_to_trash ( const char *  item)

Definition at line 2827 of file machinestate.c.

◆ sget_file_size()

off_t sget_file_size ( const char *  name)

◆ show_desktop_panel()

boolean show_desktop_panel ( void  )

Definition at line 3098 of file machinestate.c.

Referenced by catch_sigint(), and on_sepwin_activate().

◆ swab2()

void swab2 ( const void *  from,
const void *  to,
size_t  granularity 
)

Definition at line 2448 of file machinestate.c.

Referenced by swab4().

◆ swab4()

void swab4 ( const void *  from,
const void *  to,
size_t  granularity 
)

Definition at line 2462 of file machinestate.c.

Referenced by LEFloat_to_BEFloat(), and swab8().

◆ swab8()

void swab8 ( const void *  from,
const void *  to,
size_t  granularity 
)

Definition at line 2483 of file machinestate.c.

◆ unhide_x11_window()

boolean unhide_x11_window ( const char *  wid)

Definition at line 2987 of file machinestate.c.

Referenced by show_desktop_panel().

◆ update_effort()

void update_effort ( int  nthings,
boolean  badthings 
)

+1 for each badthing, so when it pops out we subtract it

  • all the good things, so when it pops out we add it (i.e subtract the value)

no badthings, good

Definition at line 2656 of file machinestate.c.

ARGS8
#define ARGS8(t1, t2, t3, t4, t5, t6, t7, t8)
Definition: machinestate.h:473
ARGS9
#define ARGS9(t1, t2, t3, t4, t5, t6, t7, t8, t9)
Definition: machinestate.h:474
_RV_
#define _RV_
Definition: machinestate.h:451
ONE_BILLION
#define ONE_BILLION
Definition: mainwindow.h:25
ARGS10
#define ARGS10(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10)
Definition: machinestate.h:475
ARGS7
#define ARGS7(t1, t2, t3, t4, t5, t6, t7)
Definition: machinestate.h:472