LiVES
3.2.0
|
Go to the source code of this file.
Macros | |
#define | NCYCS 16 |
#define | OIL_MEMCPY_MAX_BYTES 12288 |
susbtitute memory functions. These must be real functions and not #defines since we need fn pointers More... | |
#define | _cpy_if_nonnull(d, s, size) (d ? lives_memcpy(d, s, size) : d) |
#define | SECS_IN_DAY 86400 |
#define | DU_BLOCKSIZE 1 |
#define | hasNulByte(x) (((x) - 0x0101010101010101) & ~(x) & 0x8080808080808080) |
each byte B can be thought of as a signed char, subtracting 1 sets bit 7 if B was <= 0, then AND with ~B clears bit 7 if it was already set (i.e B was < 0), thus bit 7 only remains set if the byte started as 0. More... | |
#define | getnulpos(nulmask) |
#define | getnulpos_be(nulmask) |
#define | HASHROOT 5381 |
#define | get16bits(d) (*((const uint16_t *) (d))) |
#define | FUNCSIG_VOID 0X00000000 |
#define | FUNCSIG_INT 0X00000001 |
#define | FUNCSIG_DOUBLE 0X00000002 |
#define | FUNCSIG_STRING 0X00000004 |
#define | FUNCSIG_VOIDP 0X0000000D |
#define | FUNCSIG_INT_INT64 0X00000015 |
#define | FUNCSIG_STRING_INT 0X00000041 |
#define | FUNCSIG_STRING_BOOL 0X00000043 |
#define | FUNCSIG_VOIDP_VOIDP 0X000000DD |
#define | FUNCSIG_VOIDP_DOUBLE 0X000000D2 |
#define | FUNCSIG_PLANTP_BOOL 0X000000E3 |
#define | FUNCSIG_VOIDP_VOIDP_VOIDP 0X00000DDD |
#define | FUNCSIG_PLANTP_VOIDP_INT64 0X00000ED5 |
#define | FUNCSIG_STRING_STRING_VOIDP_INT 0X000044D1 |
#define | FUNCSIG_INT_INT_BOOL_VOIDP 0X0000113D |
#define | FUNCSIG_INT_INT_INT_BOOL_VOIDP 0X0001113D |
#define | FUNCSIG_VOIDP_STRING_STRING_INT64_INT 0X000D4451 |
#define | FUNCSIG_STRING_STRING_VOIDP_INT_STRING_VOIDP 0X0044D14D |
#define | _join(stype) |
#define | MINPOOLTHREADS 8 |
#define | XTEMP "XXXXXXXXXX" |
#define | DISK_STATS_FILE "/proc/diskstats" |
#define | CPU_STATS_FILE "/proc/stat" |
Typedefs | |
typedef weed_plantptr_t | lives_proc_thread_t |
lives proc_threads API More... | |
Functions | |
LIVES_LOCAL_INLINE char * | mini_popen (char *cmd) |
LIVES_GLOBAL_INLINE uint64_t | fastrand (void) |
LIVES_GLOBAL_INLINE void | fastrand_add (uint64_t entropy) |
LIVES_GLOBAL_INLINE double | fastrand_dbl (double range) |
LIVES_GLOBAL_INLINE uint32_t | fastrand_int (uint32_t range) |
pick a pseudo random uint between 0 and range (inclusive) More... | |
LIVES_GLOBAL_INLINE void | lives_srandom (unsigned int seed) |
LIVES_GLOBAL_INLINE uint64_t | lives_random (void) |
void | lives_get_randbytes (void *ptr, size_t size) |
uint64_t | gen_unique_id (void) |
void | init_random () |
void | make_nxttab (void) |
void | autotune_u64 (weed_plant_t *tuner, uint64_t min, uint64_t max, int ntrials, double cost) |
uint64_t | nxtval (uint64_t val, uint64_t lim, boolean less) |
uint64_t | autotune_u64_end (weed_plant_t **tuner, uint64_t val) |
void * | _ext_malloc (size_t n) |
void * | _ext_malloc_and_copy (size_t bsize, const void *block) |
void | _ext_unmalloc_and_copy (size_t bsize, void *p) |
void | _ext_free (void *p) |
void * | _ext_free_and_return (void *p) |
void * | _ext_memcpy (void *dest, const void *src, size_t n) |
int | _ext_memcmp (const void *s1, const void *s2, size_t n) |
void * | _ext_memset (void *p, int i, size_t n) |
void * | _ext_memmove (void *dest, const void *src, size_t n) |
void * | _ext_realloc (void *p, size_t n) |
void * | _ext_calloc (size_t nmemb, size_t msize) |
LIVES_GLOBAL_INLINE void * | lives_free_and_return (void *p) |
TODO: this file should be split into at least: memory functions, thread functions, file utils. More... | |
LIVES_GLOBAL_INLINE size_t | get_max_align (size_t req_size, size_t align_max) |
LIVES_GLOBAL_INLINE void * | lives_calloc_safety (size_t nmemb, size_t xsize) |
LIVES_GLOBAL_INLINE void * | lives_recalloc (void *p, size_t nmemb, size_t omemb, size_t xsize) |
void | quick_free (void *p) |
void * | quick_calloc (size_t n, size_t s) |
boolean | init_memfuncs (void) |
boolean | init_thread_memfuncs (void) |
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 ds_resvd) |
boolean | disk_monitor_running (const char *dir) |
lives_proc_thread_t | disk_monitor_start (const char *dir) |
int64_t | disk_monitor_check_result (const char *dir) |
LIVES_GLOBAL_INLINE int64_t | disk_monitor_wait_result (const char *dir, ticks_t timeout) |
void | disk_monitor_forget (void) |
uint64_t | get_ds_free (const char *dir) |
LIVES_GLOBAL_INLINE ticks_t | lives_get_relative_ticks (ticks_t origsecs, ticks_t orignsecs) |
LIVES_GLOBAL_INLINE ticks_t | lives_get_current_ticks (void) |
char * | lives_datetime_rel (const char *datetime) |
char * | lives_datetime (uint64_t secs, boolean use_local) |
boolean | check_dev_busy (char *devstr) |
boolean | compress_files_in_dir (const char *dir, int method, void *data) |
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) |
boolean | is_empty_dir (const char *dirname) |
char * | get_mountpoint_for (const char *dir) |
off_t | get_dir_size (const char *dirname) |
void | free_fdets_list (LiVESList **listp) |
int | stat_to_file_dets (const char *fname, lives_file_dets_t *fdets) |
void * | _item_to_file_details (LiVESList **listp, const char *item, const char *orig_loc, uint64_t extra, int type) |
create a list from a (sub)directory '. More... | |
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 '. More... | |
lives_proc_thread_t | ordfile_to_file_details (LiVESList **listp, const char *ofname, const char *orig_loc, uint64_t extra) |
int | check_for_bad_ffmpeg (void) |
LIVES_GLOBAL_INLINE char * | lives_concat_sep (char *st, const char *sep, char *x) |
LIVES_GLOBAL_INLINE char * | lives_concat (char *st, char *x) |
LIVES_GLOBAL_INLINE int | lives_strappend (const char *string, int len, const char *xnew) |
LIVES_GLOBAL_INLINE const char * | lives_strappendf (const char *string, int len, const char *fmt,...) |
LIVES_GLOBAL_INLINE size_t | lives_strlen (const char *s) |
LIVES_GLOBAL_INLINE char * | lives_strdup_quick (const char *s) |
LIVES_GLOBAL_INLINE boolean | lives_strcmp (const char *st1, const char *st2) |
returns FALSE if strings match More... | |
LIVES_GLOBAL_INLINE int | lives_strcmp_ordered (const char *st1, const char *st2) |
LIVES_GLOBAL_INLINE boolean | lives_strncmp (const char *st1, const char *st2, size_t len) |
returns FALSE if strings match More... | |
LIVES_GLOBAL_INLINE uint32_t | lives_string_hash (const char *st) |
LIVES_GLOBAL_INLINE uint32_t | fast_hash (const char *key) |
LIVES_GLOBAL_INLINE char * | lives_strstop (char *st, const char term) |
LIVES_GLOBAL_INLINE char * | lives_chomp (char *buff) |
LIVES_GLOBAL_INLINE char * | lives_strtrim (const char *buff) |
LIVES_GLOBAL_INLINE void | lives_proc_thread_free (lives_proc_thread_t lpt) |
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 More... | |
void * | main_thread_execute (lives_funcptr_t func, int return_type, void *retval, const char *args_fmt,...) |
LIVES_GLOBAL_INLINE void | lives_proc_thread_sync_ready (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE boolean | lives_proc_thread_check (lives_proc_thread_t tinfo) |
returns FALSE while the thread is running, TRUE once it has finished More... | |
LIVES_GLOBAL_INLINE int | lives_proc_thread_signalled (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE int64_t | lives_proc_thread_signalled_idx (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE void | lives_proc_thread_set_cancellable (lives_proc_thread_t tinfo) |
only threads with no return value can possibly be cancellable. For threads with a value, use lives_proc_thread_dontcare() More... | |
LIVES_GLOBAL_INLINE boolean | lives_proc_thread_get_cancellable (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE boolean | lives_proc_thread_cancel (lives_proc_thread_t tinfo) |
boolean | lives_proc_thread_dontcare (lives_proc_thread_t tinfo) |
tell a threead with return value that we no longer need the value so it can free itself More... | |
LIVES_GLOBAL_INLINE boolean | lives_proc_thread_cancelled (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE void | lives_proc_thread_join (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE int | lives_proc_thread_join_int (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE double | lives_proc_thread_join_double (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE int | lives_proc_thread_join_boolean (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE int64_t | lives_proc_thread_join_int64 (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE char * | lives_proc_thread_join_string (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE weed_funcptr_t | lives_proc_thread_join_funcptr (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE void * | lives_proc_thread_join_voidptr (lives_proc_thread_t tinfo) |
LIVES_GLOBAL_INLINE weed_plantptr_t | lives_proc_thread_join_plantptr (lives_proc_thread_t tinfo) |
void * | fg_run_func (lives_proc_thread_t lpt, void *retval) |
void | resubmit_proc_thread (lives_proc_thread_t thread_info, lives_thread_attr_t attr) |
(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... | |
lives_thread_data_t * | get_thread_data (void) |
LIVES_GLOBAL_INLINE lives_threadvars_t * | get_threadvars (void) |
lives_thread_data_t * | lives_thread_data_create (uint64_t idx) |
boolean | do_something_useful (lives_thread_data_t *tdata) |
LIVES_GLOBAL_INLINE weed_plant_t * | lives_plant_new (int subtype) |
LIVES_GLOBAL_INLINE weed_plant_t * | lives_plant_new_with_index (int subtype, int64_t index) |
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_GLOBAL_INLINE pid_t | lives_getpid (void) |
LIVES_GLOBAL_INLINE int | lives_getuid (void) |
LIVES_GLOBAL_INLINE int | lives_getgid (void) |
LIVES_GLOBAL_INLINE void | swab2 (const void *from, const void *to, size_t gran) |
LIVES_GLOBAL_INLINE void | swab4 (const void *from, const void *to, size_t gran) |
LIVES_GLOBAL_INLINE void | swab8 (const void *from, const void *to, size_t gran) |
LIVES_GLOBAL_INLINE void | reverse_bytes (char *buff, size_t count, size_t gran) |
boolean | reverse_buffer (uint8_t *buff, size_t count, size_t chunk) |
void | reset_effort (void) |
void | update_effort (int nthings, boolean badthings) |
char * | grep_in_cmd (const char *cmd, int mstart, int npieces, const char *mphrase, int ridx, int rlen) |
LIVES_LOCAL_INLINE boolean | mini_run (char *cmd) |
LiVESResponseType | send_to_trash (const char *item) |
char * | get_wid_for_name (const char *wname) |
x11 stuff More... | |
boolean | hide_x11_window (const char *wid) |
boolean | unhide_x11_window (const char *wid) |
boolean | activate_x11_window (const char *wid) |
boolean | get_wm_caps (void) |
int | get_window_stack_level (LiVESXWindow *xwin, int *nwins) |
boolean | show_desktop_panel (void) |
boolean | hide_desktop_panel (void) |
boolean | get_x11_visible (const char *wname) |
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) |
boolean | get_distro_dets (void) |
int | get_num_cpus (void) |
boolean | get_machine_dets (void) |
double | get_disk_load (const char *mp) |
int64_t | get_cpu_load (int cpun) |
percent * 1 million More... | |
#define _cpy_if_nonnull | ( | d, | |
s, | |||
size | |||
) | (d ? lives_memcpy(d, s, size) : d) |
Definition at line 527 of file machinestate.c.
#define _join | ( | stype | ) |
Definition at line 1976 of file machinestate.c.
#define CPU_STATS_FILE "/proc/stat" |
Definition at line 3394 of file machinestate.c.
#define DISK_STATS_FILE "/proc/diskstats" |
Definition at line 3357 of file machinestate.c.
#define DU_BLOCKSIZE 1 |
Definition at line 1066 of file machinestate.c.
#define FUNCSIG_DOUBLE 0X00000002 |
#define FUNCSIG_INT 0X00000001 |
#define FUNCSIG_INT_INT64 0X00000015 |
#define FUNCSIG_INT_INT_BOOL_VOIDP 0X0000113D |
#define FUNCSIG_INT_INT_INT_BOOL_VOIDP 0X0001113D |
#define FUNCSIG_PLANTP_BOOL 0X000000E3 |
#define FUNCSIG_PLANTP_VOIDP_INT64 0X00000ED5 |
#define FUNCSIG_STRING 0X00000004 |
#define FUNCSIG_STRING_BOOL 0X00000043 |
#define FUNCSIG_STRING_INT 0X00000041 |
#define FUNCSIG_STRING_STRING_VOIDP_INT 0X000044D1 |
#define FUNCSIG_STRING_STRING_VOIDP_INT_STRING_VOIDP 0X0044D14D |
#define FUNCSIG_VOID 0X00000000 |
#define FUNCSIG_VOIDP 0X0000000D |
#define FUNCSIG_VOIDP_DOUBLE 0X000000D2 |
#define FUNCSIG_VOIDP_STRING_STRING_INT64_INT 0X000D4451 |
#define FUNCSIG_VOIDP_VOIDP 0X000000DD |
#define FUNCSIG_VOIDP_VOIDP_VOIDP 0X00000DDD |
#define get16bits | ( | d | ) | (*((const uint16_t *) (d))) |
Definition at line 1594 of file machinestate.c.
#define getnulpos | ( | nulmask | ) |
Definition at line 1460 of file machinestate.c.
#define getnulpos_be | ( | nulmask | ) |
Definition at line 1464 of file machinestate.c.
#define HASHROOT 5381 |
Definition at line 1584 of file machinestate.c.
#define hasNulByte | ( | x | ) | (((x) - 0x0101010101010101) & ~(x) & 0x8080808080808080) |
each byte B can be thought of as a signed char, subtracting 1 sets bit 7 if B was <= 0, then AND with ~B clears bit 7 if it was already set (i.e B was < 0), thus bit 7 only remains set if the byte started as 0.
Definition at line 1459 of file machinestate.c.
#define MINPOOLTHREADS 8 |
Definition at line 2128 of file machinestate.c.
#define NCYCS 16 |
Definition at line 196 of file machinestate.c.
#define OIL_MEMCPY_MAX_BYTES 12288 |
susbtitute memory functions. These must be real functions and not #defines since we need fn pointers
Definition at line 430 of file machinestate.c.
#define SECS_IN_DAY 86400 |
Definition at line 841 of file machinestate.c.
#define XTEMP "XXXXXXXXXX" |
Definition at line 3170 of file machinestate.c.
typedef weed_plantptr_t lives_proc_thread_t |
lives proc_threads API
(see that function for more comments)
Definition at line 1670 of file machinestate.c.
void* _ext_calloc | ( | size_t | nmemb, |
size_t | msize | ||
) |
Definition at line 584 of file machinestate.c.
void _ext_free | ( | void * | p | ) |
Definition at line 556 of file machinestate.c.
Referenced by _ext_free_and_return(), and _ext_unmalloc_and_copy().
void* _ext_free_and_return | ( | void * | p | ) |
Definition at line 565 of file machinestate.c.
void* _ext_malloc | ( | size_t | n | ) |
Definition at line 530 of file machinestate.c.
void* _ext_malloc_and_copy | ( | size_t | bsize, |
const void * | block | ||
) |
Definition at line 539 of file machinestate.c.
int _ext_memcmp | ( | const void * | s1, |
const void * | s2, | ||
size_t | n | ||
) |
Definition at line 569 of file machinestate.c.
void* _ext_memcpy | ( | void * | dest, |
const void * | src, | ||
size_t | n | ||
) |
Definition at line 567 of file machinestate.c.
void* _ext_memmove | ( | void * | dest, |
const void * | src, | ||
size_t | n | ||
) |
Definition at line 573 of file machinestate.c.
void* _ext_memset | ( | void * | p, |
int | i, | ||
size_t | n | ||
) |
Definition at line 571 of file machinestate.c.
void* _ext_realloc | ( | void * | p, |
size_t | n | ||
) |
Definition at line 575 of file machinestate.c.
void _ext_unmalloc_and_copy | ( | size_t | bsize, |
void * | p | ||
) |
Definition at line 547 of file machinestate.c.
void* _item_to_file_details | ( | LiVESList ** | listp, |
const char * | item, | ||
const char * | orig_loc, | ||
uint64_t | extra, | ||
int | type | ||
) |
create a list from a (sub)directory '.
' and '..' are ignored subdir can be NULL
Definition at line 1227 of file machinestate.c.
Referenced by dir_to_file_details(), and ordfile_to_file_details().
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().
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.
uint64_t autotune_u64_end | ( | weed_plant_t ** | tuner, |
uint64_t | val | ||
) |
Definition at line 259 of file machinestate.c.
boolean check_dev_busy | ( | char * | devstr | ) |
Definition at line 876 of file machinestate.c.
Referenced by on_live_tvcard_activate().
int check_for_bad_ffmpeg | ( | void | ) |
Definition at line 1382 of file machinestate.c.
Referenced by load_frame_image().
boolean check_snap | ( | const char * | prog | ) |
Definition at line 3257 of file machinestate.c.
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.
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.
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().
void disk_monitor_forget | ( | void | ) |
Definition at line 769 of file machinestate.c.
Referenced by disk_monitor_start().
boolean disk_monitor_running | ( | const char * | dir | ) |
Definition at line 715 of file machinestate.c.
Referenced by disk_monitor_check_result(), disk_monitor_forget(), and 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().
LIVES_GLOBAL_INLINE int64_t disk_monitor_wait_result | ( | const char * | dir, |
ticks_t | timeout | ||
) |
Definition at line 742 of file machinestate.c.
boolean do_something_useful | ( | lives_thread_data_t * | tdata | ) |
yes, why don't you lend a hand instead of just lying around nanosleeping...
Definition at line 2194 of file machinestate.c.
LIVES_GLOBAL_INLINE 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().
LIVES_GLOBAL_INLINE uint64_t fastrand | ( | void | ) |
Definition at line 40 of file machinestate.c.
Referenced by fastrand_dbl().
LIVES_GLOBAL_INLINE void fastrand_add | ( | uint64_t | entropy | ) |
Definition at line 47 of file machinestate.c.
LIVES_GLOBAL_INLINE double fastrand_dbl | ( | double | range | ) |
Definition at line 49 of file machinestate.c.
Referenced by fastrand_int().
LIVES_GLOBAL_INLINE 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().
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().
void free_fdets_list | ( | LiVESList ** | listp | ) |
Definition at line 1084 of file machinestate.c.
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().
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.
off_t get_dir_size | ( | const char * | dirname | ) |
Definition at line 1069 of file machinestate.c.
Referenced by on_utube_select().
double get_disk_load | ( | const char * | mp | ) |
Definition at line 3359 of file machinestate.c.
boolean get_distro_dets | ( | void | ) |
Definition at line 3268 of file machinestate.c.
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().
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().
boolean get_machine_dets | ( | void | ) |
Definition at line 3319 of file machinestate.c.
LIVES_GLOBAL_INLINE 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().
char* get_md5sum | ( | const char * | filename | ) |
for future use
Definition at line 646 of file machinestate.c.
char* get_mountpoint_for | ( | const char * | dir | ) |
Definition at line 1030 of file machinestate.c.
Referenced by do_workdir_query(), ds_critical_msg(), ds_warning_msg(), and on_utube_select().
int get_num_cpus | ( | void | ) |
Definition at line 3297 of file machinestate.c.
lives_storage_status_t get_storage_status | ( | const char * | dir, |
uint64_t | warn_level, | ||
int64_t * | dsval, | ||
int64_t | ds_resvd | ||
) |
Definition at line 693 of file machinestate.c.
Referenced by check_storage_space(), do_system_failed_error(), do_write_failed_error_s(), do_write_failed_error_s_with_retry(), and on_utube_select().
char* get_systmp | ( | const char * | suff, |
boolean | is_dir | ||
) |
Definition at line 3232 of file machinestate.c.
Referenced by on_open_utube_activate().
lives_thread_data_t* get_thread_data | ( | void | ) |
Definition at line 2145 of file machinestate.c.
Referenced by get_threadvars().
LIVES_GLOBAL_INLINE lives_threadvars_t* get_threadvars | ( | void | ) |
Definition at line 2156 of file machinestate.c.
char* get_wid_for_name | ( | const char * | wname | ) |
x11 stuff
x11
Definition at line 2917 of file machinestate.c.
Referenced by hide_desktop_panel(), and show_desktop_panel().
int get_window_stack_level | ( | LiVESXWindow * | xwin, |
int * | nwins | ||
) |
Definition at line 3080 of file machinestate.c.
boolean get_wm_caps | ( | void | ) |
Definition at line 3018 of file machinestate.c.
char* get_worktmp | ( | const char * | prefix | ) |
Definition at line 3246 of file machinestate.c.
Referenced by open_ascrap_file(), and open_scrap_file().
char* get_worktmpfile | ( | const char * | prefix | ) |
Definition at line 3251 of file machinestate.c.
boolean get_x11_visible | ( | const char * | wname | ) |
Definition at line 3123 of file machinestate.c.
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().
boolean hide_desktop_panel | ( | void | ) |
Definition at line 3110 of file machinestate.c.
boolean hide_x11_window | ( | const char * | wid | ) |
Definition at line 2973 of file machinestate.c.
Referenced by hide_desktop_panel().
boolean init_memfuncs | ( | void | ) |
Definition at line 630 of file machinestate.c.
void init_random | ( | void | ) |
Definition at line 92 of file machinestate.c.
boolean init_thread_memfuncs | ( | void | ) |
Definition at line 638 of file machinestate.c.
boolean is_empty_dir | ( | const char * | dirname | ) |
Definition at line 1013 of file machinestate.c.
LIVES_GLOBAL_INLINE void* lives_calloc_safety | ( | size_t | nmemb, |
size_t | xsize | ||
) |
Definition at line 603 of file machinestate.c.
Referenced by apply_rte_audio(), float_deinterleave(), float_interleave(), init_jack_audio_buffers(), init_pulse_audio_buffers(), lives_recalloc(), and push_audio_to_channel().
LIVES_GLOBAL_INLINE char* lives_chomp | ( | char * | buff | ) |
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_GLOBAL_INLINE char* lives_concat | ( | char * | st, |
char * | x | ||
) |
nb: lives strconcat
Definition at line 1426 of file machinestate.c.
Referenced by explain_missing_activate().
LIVES_GLOBAL_INLINE char* lives_concat_sep | ( | char * | st, |
const char * | sep, | ||
char * | x | ||
) |
nb: lives strconcat
Definition at line 1412 of file machinestate.c.
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().
char* lives_datetime_rel | ( | const char * | datetime | ) |
replace date w. yesterday, today
Definition at line 842 of file machinestate.c.
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_GLOBAL_INLINE 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_GLOBAL_INLINE ticks_t lives_get_current_ticks | ( | void | ) |
Definition at line 835 of file machinestate.c.
Referenced by autotune_u64(), autotune_u64_end(), do_auto_dialog(), get_disk_load(), lives_alarm_check(), lives_alarm_reset(), load_frame_image(), mt_auto_backup(), and switch_audio_clip().
void lives_get_randbytes | ( | void * | ptr, |
size_t | size | ||
) |
Definition at line 60 of file machinestate.c.
LIVES_GLOBAL_INLINE ticks_t lives_get_relative_ticks | ( | ticks_t | origsecs, |
ticks_t | orignsecs | ||
) |
Definition at line 813 of file machinestate.c.
Referenced by lives_get_current_playback_ticks(), lives_get_current_ticks(), load_frame_image(), and on_effects_paused().
LIVES_GLOBAL_INLINE int lives_getgid | ( | void | ) |
Definition at line 2420 of file machinestate.c.
Referenced by backup_recording(), mt_load_recovery_layout(), recover_layout_cancelled(), and write_backup_layout_numbering().
LIVES_GLOBAL_INLINE pid_t lives_getpid | ( | void | ) |
Definition at line 2408 of file machinestate.c.
Referenced by get_capabilities().
LIVES_GLOBAL_INLINE int lives_getuid | ( | void | ) |
Definition at line 2416 of file machinestate.c.
Referenced by backup_recording(), mt_load_recovery_layout(), recover_layout_cancelled(), and write_backup_layout_numbering().
LIVES_GLOBAL_INLINE weed_plant_t* lives_plant_new | ( | int | subtype | ) |
Definition at line 2266 of file machinestate.c.
Referenced by lives_plant_new_with_index().
LIVES_GLOBAL_INLINE weed_plant_t* lives_plant_new_with_index | ( | int | subtype, |
int64_t | index | ||
) |
Definition at line 2273 of file machinestate.c.
LIVES_GLOBAL_INLINE boolean lives_proc_thread_cancel | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1946 of file machinestate.c.
Referenced by do_effect(), load_rfx_preview(), and render_to_clip().
LIVES_GLOBAL_INLINE boolean lives_proc_thread_cancelled | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1971 of file machinestate.c.
Referenced by _item_to_file_details(), and virtual_to_images().
LIVES_GLOBAL_INLINE boolean lives_proc_thread_check | ( | lives_proc_thread_t | tinfo | ) |
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_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
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().
boolean lives_proc_thread_dontcare | ( | lives_proc_thread_t | tinfo | ) |
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_GLOBAL_INLINE void lives_proc_thread_free | ( | lives_proc_thread_t | lpt | ) |
Definition at line 1672 of file machinestate.c.
LIVES_GLOBAL_INLINE boolean lives_proc_thread_get_cancellable | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1942 of file machinestate.c.
Referenced by lives_proc_thread_cancel().
LIVES_GLOBAL_INLINE void lives_proc_thread_join | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1979 of file machinestate.c.
Referenced by check_layer_ready(), lives_proc_thread_cancel(), and lives_proc_thread_dontcare().
LIVES_GLOBAL_INLINE int lives_proc_thread_join_boolean | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1989 of file machinestate.c.
LIVES_GLOBAL_INLINE double lives_proc_thread_join_double | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1988 of file machinestate.c.
LIVES_GLOBAL_INLINE weed_funcptr_t lives_proc_thread_join_funcptr | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1992 of file machinestate.c.
LIVES_GLOBAL_INLINE int lives_proc_thread_join_int | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1987 of file machinestate.c.
LIVES_GLOBAL_INLINE int64_t lives_proc_thread_join_int64 | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1990 of file machinestate.c.
LIVES_GLOBAL_INLINE weed_plantptr_t lives_proc_thread_join_plantptr | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1994 of file machinestate.c.
LIVES_GLOBAL_INLINE char* lives_proc_thread_join_string | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1991 of file machinestate.c.
LIVES_GLOBAL_INLINE void* lives_proc_thread_join_voidptr | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1993 of file machinestate.c.
LIVES_GLOBAL_INLINE void lives_proc_thread_set_cancellable | ( | lives_proc_thread_t | tinfo | ) |
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_GLOBAL_INLINE 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_GLOBAL_INLINE 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_GLOBAL_INLINE void lives_proc_thread_sync_ready | ( | lives_proc_thread_t | tinfo | ) |
Definition at line 1911 of file machinestate.c.
LIVES_GLOBAL_INLINE uint64_t lives_random | ( | void | ) |
Definition at line 58 of file machinestate.c.
LIVES_GLOBAL_INLINE 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_GLOBAL_INLINE void lives_srandom | ( | unsigned int | seed | ) |
Definition at line 56 of file machinestate.c.
Referenced by init_random().
LIVES_GLOBAL_INLINE 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_GLOBAL_INLINE const char* lives_strappendf | ( | const char * | string, |
int | len, | ||
const char * | fmt, | ||
... | |||
) |
Definition at line 1444 of file machinestate.c.
LIVES_GLOBAL_INLINE boolean lives_strcmp | ( | const char * | st1, |
const char * | st2 | ||
) |
returns FALSE if strings match
Definition at line 1506 of file machinestate.c.
Referenced by after_param_text_changed(), check_for_executable(), check_for_lock_file(), dirs_equal(), disk_monitor_check_result(), do_workdir_query(), find_in_file_buffers_by_pathname(), get_val_from_cached_list(), lives_exit(), lives_list_strcmp_index(), lives_struct_is_a(), lives_utf8_strcasecmp(), on_filesel_button_clicked(), on_prefs_apply_clicked(), on_save_set_activate(), on_utube_select(), pref_factory_bitmapped(), pref_factory_bool(), pref_factory_float(), pref_factory_int(), pref_factory_int64(), pref_factory_string(), pref_factory_string_choice(), send_to_trash(), and set_css_value_direct().
LIVES_GLOBAL_INLINE int lives_strcmp_ordered | ( | const char * | st1, |
const char * | st2 | ||
) |
Definition at line 1531 of file machinestate.c.
Referenced by lives_utf8_strcmpfunc().
LIVES_GLOBAL_INLINE char* lives_strdup_quick | ( | const char * | s | ) |
Definition at line 1484 of file machinestate.c.
LIVES_GLOBAL_INLINE uint32_t lives_string_hash | ( | const char * | st | ) |
Definition at line 1585 of file machinestate.c.
LIVES_GLOBAL_INLINE size_t lives_strlen | ( | const char * | s | ) |
Definition at line 1468 of file machinestate.c.
Referenced by check_workdir_valid(), ensure_extension(), ensure_isdir(), fast_hash(), get_mountpoint_for(), insert_newlines(), lives_buffered_write_printf(), lives_concat(), lives_concat_sep(), lives_ellipsize(), lives_pad(), lives_pad_ellipsize(), lives_signal_connect_async(), lives_standard_formatted_label_new(), lives_strappend(), lives_string_ends_with(), load_rte_defs(), on_capture2_activate(), on_save_rte_defs_activate(), on_utube_select(), reload_set(), remove_layout_files(), and repl_workdir().
LIVES_GLOBAL_INLINE boolean lives_strncmp | ( | const char * | st1, |
const char * | st2, | ||
size_t | len | ||
) |
returns FALSE if strings match
Definition at line 1554 of file machinestate.c.
Referenced by get_disk_load(), lives_datetime_rel(), lives_signal_connect_async(), lives_string_ends_with(), load_rfx_preview(), load_rte_defs(), on_cancel_keep_button_clicked(), on_utube_select(), pump_io_chan(), remove_layout_files(), and repl_workdir().
LIVES_GLOBAL_INLINE char* lives_strstop | ( | char * | st, |
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_GLOBAL_INLINE 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.
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_t* lives_thread_data_create | ( | uint64_t | idx | ) |
Definition at line 2174 of file machinestate.c.
uint64_t lives_thread_join | ( | lives_thread_t | work, |
void ** | retval | ||
) |
Definition at line 2376 of file machinestate.c.
Referenced by check_layer_ready().
void lives_threadpool_finish | ( | void | ) |
Definition at line 2295 of file machinestate.c.
void lives_threadpool_init | ( | void | ) |
Definition at line 2280 of file machinestate.c.
void* main_thread_execute | ( | lives_funcptr_t | func, |
int | return_type, | ||
void * | retval, | ||
const char * | args_fmt, | ||
... | |||
) |
Definition at line 1741 of file machinestate.c.
Referenced by animate_multitrack(), choose_file_bg(), clear_context(), do_threaded_dialog(), end_threaded_dialog(), kill_play_window(), lives_dialog_run(), lives_widget_show_all_from_bg(), make_play_window(), mt_tl_move(), on_full_screen_activate(), resize_play_window(), and threaded_dialog_spin().
void make_nxttab | ( | void | ) |
Definition at line 120 of file machinestate.c.
LIVES_LOCAL_INLINE char * mini_popen | ( | char * | cmd | ) |
Definition at line 2814 of file machinestate.c.
Referenced by get_cpu_load(), get_disk_load(), get_distro_dets(), get_machine_dets(), and get_mountpoint_for().
LIVES_LOCAL_INLINE boolean mini_run | ( | char * | cmd | ) |
Definition at line 2806 of file machinestate.c.
Referenced by activate_x11_window(), hide_x11_window(), send_to_trash(), and unhide_x11_window().
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().
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.
void* quick_calloc | ( | size_t | n, |
size_t | s | ||
) |
Definition at line 628 of file machinestate.c.
Referenced by _ext_calloc().
void quick_free | ( | void * | p | ) |
Definition at line 626 of file machinestate.c.
void reget_afilesize | ( | int | fileno | ) |
Definition at line 972 of file machinestate.c.
Referenced by add_file_info(), on_fade_audio_activate(), on_load_cdtrack_ok_clicked(), on_normalise_audio_activate(), on_recaudclip_ok_clicked(), on_redo_activate(), on_resaudio_ok_clicked(), play_sel(), start_render_effect_events(), and switch_to_file().
off_t reget_afilesize_inner | ( | int | fileno | ) |
Definition at line 1001 of file machinestate.c.
Referenced by on_effects_paused(), and reget_afilesize().
void reset_effort | ( | void | ) |
Definition at line 2642 of file machinestate.c.
void resubmit_proc_thread | ( | lives_proc_thread_t | thread_info, |
lives_thread_attr_t | attr | ||
) |
(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.
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.
LIVES_GLOBAL_INLINE void reverse_bytes | ( | char * | buff, |
size_t | count, | ||
size_t | gran | ||
) |
Definition at line 2502 of file machinestate.c.
Referenced by lives_read_le(), lives_read_le_buffered(), lives_write_le(), and lives_write_le_buffered().
LiVESResponseType send_to_trash | ( | const char * | item | ) |
Definition at line 2827 of file machinestate.c.
off_t sget_file_size | ( | const char * | name | ) |
Definition at line 962 of file machinestate.c.
Referenced by check_for_bad_ffmpeg(), load_frame_image(), load_frame_index(), on_utube_select(), reget_afilesize_inner(), save_frame_index(), and save_layout_map().
boolean show_desktop_panel | ( | void | ) |
Definition at line 3098 of file machinestate.c.
Referenced by catch_sigint(), and on_sepwin_activate().
int stat_to_file_dets | ( | const char * | fname, |
lives_file_dets_t * | fdets | ||
) |
Definition at line 1099 of file machinestate.c.
LIVES_GLOBAL_INLINE void swab2 | ( | const void * | from, |
const void * | to, | ||
size_t | gran | ||
) |
Definition at line 2448 of file machinestate.c.
Referenced by swab4().
LIVES_GLOBAL_INLINE void swab4 | ( | const void * | from, |
const void * | to, | ||
size_t | gran | ||
) |
Definition at line 2462 of file machinestate.c.
Referenced by LEFloat_to_BEFloat(), and swab8().
LIVES_GLOBAL_INLINE void swab8 | ( | const void * | from, |
const void * | to, | ||
size_t | gran | ||
) |
Definition at line 2483 of file machinestate.c.
boolean unhide_x11_window | ( | const char * | wid | ) |
Definition at line 2987 of file machinestate.c.
Referenced by show_desktop_panel().
void update_effort | ( | int | nthings, |
boolean | badthings | ||
) |
+1 for each badthing, so when it pops out we subtract it
no badthings, good
Definition at line 2656 of file machinestate.c.