LiVES  3.2.0
Macros | Functions
utils.c File Reference
#include <fcntl.h>
#include <dirent.h>
#include <sys/statvfs.h>
#include "main.h"
#include "interface.h"
#include "audio.h"
#include "resample.h"
#include "callbacks.h"
#include "cvirtual.h"

Go to the source code of this file.

Macros

#define ASPECT_ALLOWANCE   0.005
 
#define AUTOTUNE
 
#define O_DSYNC   O_SYNC
 
#define NO_O_DSYNC
 
#define WRITE_ALL
 
#define VER_MAJOR_MULT   1000000
 
#define VER_MINOR_MULT   1000
 
#define VER_MICRO_MULT   1
 
#define BSIZE   (8)
 
#define INITSIZE   32
 
#define BL_LIM   128
 

Functions

char * filename_from_fd (char *val, int fd)
 : return filename from an open fd, freeing val first More...
 
LIVES_GLOBAL_INLINE int lives_open3 (const char *pathname, int flags, mode_t mode)
 
LIVES_GLOBAL_INLINE int lives_open2 (const char *pathname, int flags)
 
LIVES_GLOBAL_INLINE ssize_t lives_readlink (const char *path, char *buf, size_t bufsiz)
 
LIVES_GLOBAL_INLINE boolean lives_fsync (int fd)
 
LIVES_GLOBAL_INLINE void lives_sync (int times)
 
LIVES_GLOBAL_INLINE boolean lives_setenv (const char *name, const char *value)
 
LIVES_GLOBAL_INLINE boolean lives_unsetenv (const char *name)
 
int lives_system (const char *com, boolean allow_error)
 
ssize_t lives_popen (const char *com, boolean allow_error, char *buff, ssize_t buflen)
 
lives_pgid_t lives_fork (const char *com)
 
ssize_t lives_write (int fd, const void *buf, ssize_t count, boolean allow_fail)
 
ssize_t lives_write_le (int fd, const void *buf, ssize_t count, boolean allow_fail)
 
int lives_fputs (const char *s, FILE *stream)
 
char * lives_fgets (char *s, int size, FILE *stream)
 
size_t lives_fread (void *ptr, size_t size, size_t nmemb, FILE *stream)
 
size_t lives_fread_string (char *buff, size_t stlen, const char *fname)
 
lives_file_buffer_tfind_in_file_buffers (int fd)
 
lives_file_buffer_tfind_in_file_buffers_by_pathname (const char *pathname)
 
ssize_t lives_read (int fd, void *buf, ssize_t count, boolean allow_less)
 
ssize_t lives_read_le (int fd, void *buf, ssize_t count, boolean allow_less)
 
void lives_invalidate_all_file_buffers (void)
 
LIVES_GLOBAL_INLINE int lives_open_buffered_rdonly (const char *pathname)
 
boolean _lives_buffered_rdonly_slurp (int fd, off_t skip)
 
void lives_buffered_rdonly_slurp (int fd, off_t skip)
 
LIVES_GLOBAL_INLINE boolean lives_buffered_rdonly_set_reversed (int fd, boolean val)
 
LIVES_GLOBAL_INLINE int lives_create_buffered (const char *pathname, int mode)
 
LIVES_GLOBAL_INLINE int lives_create_buffered_nosync (const char *pathname, int mode)
 
int lives_open_buffered_writer (const char *pathname, int mode, boolean append)
 
int lives_close_buffered (int fd)
 
size_t get_read_buff_size (int sztype)
 
off_t lives_lseek_buffered_rdonly (int fd, off_t offset)
 
off_t lives_lseek_buffered_rdonly_absolute (int fd, off_t offset)
 
ssize_t lives_read_buffered (int fd, void *buf, ssize_t count, boolean allow_less)
 
ssize_t lives_read_le_buffered (int fd, void *buf, ssize_t count, boolean allow_less)
 
boolean lives_read_buffered_eof (int fd)
 
ssize_t lives_write_buffered (int fd, const char *buf, ssize_t count, boolean allow_fail)
 
ssize_t lives_buffered_write_printf (int fd, boolean allow_fail, const char *fmt,...)
 
ssize_t lives_write_le_buffered (int fd, const void *buf, ssize_t count, boolean allow_fail)
 
off_t lives_lseek_buffered_writer (int fd, off_t offset)
 
off_t lives_buffered_offset (int fd)
 
size_t lives_buffered_orig_size (int fd)
 
int lives_chdir (const char *path, boolean no_error_dlg)
 
LIVES_GLOBAL_INLINE boolean lives_freep (void **ptr)
 
LIVES_GLOBAL_INLINE int lives_kill (lives_pid_t pid, int sig)
 
LIVES_GLOBAL_INLINE int lives_killpg (lives_pgid_t pgrp, int sig)
 
LIVES_GLOBAL_INLINE void clear_mainw_msg (void)
 
LIVES_GLOBAL_INLINE uint64_t lives_10pow (int pow)
 
LIVES_GLOBAL_INLINE double lives_fix (double val, int decimals)
 
LIVES_GLOBAL_INLINE uint32_t get_approx_ln (uint32_t x)
 
LIVES_GLOBAL_INLINE uint64_t get_approx_ln64 (uint64_t x)
 
LIVES_GLOBAL_INLINE uint64_t get_near2pow (uint64_t val)
 
void reset_playback_clock (void)
 
ticks_t lives_get_current_playback_ticks (int64_t origsecs, int64_t orignsecs, lives_time_source_t *time_source)
 
LIVES_GLOBAL_INLINE lives_alarm_t lives_alarm_reset (lives_alarm_t alarm_handle, ticks_t ticks)
 
lives_alarm_t lives_alarm_set (ticks_t ticks)
 set alarm for now + delta ticks (10 nanosec) param ticks (10 nanoseconds) is the offset when we want our alarm to trigger returns int handle or -1 call lives_get_alarm(handle) to test if time arrived More...
 
ticks_t lives_alarm_check (lives_alarm_t alarm_handle)
 
boolean lives_alarm_clear (lives_alarm_t alarm_handle)
 
LIVES_GLOBAL_INLINE float LEFloat_to_BEFloat (float f)
 
LIVES_GLOBAL_INLINE double calc_time_from_frame (int clip, int frame)
 
LIVES_GLOBAL_INLINE int calc_frame_from_time (int filenum, double time)
 nearest frame [1, frames] More...
 
LIVES_GLOBAL_INLINE int calc_frame_from_time2 (int filenum, double time)
 nearest frame [1, frames+1] More...
 
LIVES_GLOBAL_INLINE int calc_frame_from_time3 (int filenum, double time)
 nearest frame rounded down, [1, frames+1] More...
 
LIVES_GLOBAL_INLINE int calc_frame_from_time4 (int filenum, double time)
 nearest frame, no maximum More...
 
void calc_aframeno (int fileno)
 
frames_t calc_new_playback_position (int fileno, ticks_t otc, ticks_t *ntc)
 
void calc_maxspect (int rwidth, int rheight, int *cwidth, int *cheight)
 
void calc_minspect (int rwidth, int rheight, int *cwidth, int *cheight)
 
void calc_midspect (int rwidth, int rheight, int *cwidth, int *cheight)
 
void init_clipboard (void)
 
weed_plant_t * get_nth_info_message (int n)
 
char * dump_messages (int start, int end)
 
int free_n_msgs (int frval)
 
int add_messages_to_list (const char *text)
 
boolean d_print_urgency (double timeout, const char *fmt,...)
 
boolean d_print_overlay (double timeout, const char *fmt,...)
 
void d_print (const char *fmt,...)
 
LIVES_GLOBAL_INLINE void d_print_cancelled (void)
 
LIVES_GLOBAL_INLINE void d_print_failed (void)
 
LIVES_GLOBAL_INLINE void d_print_done (void)
 
LIVES_GLOBAL_INLINE void d_print_file_error_failed (void)
 
LIVES_GLOBAL_INLINE void d_print_enough (int frames)
 
void buffer_lmap_error (lives_lmap_error_t lerror, const char *name, livespointer user_data, int clipno, int frameno, double atime, boolean affects_current)
 
void unbuffer_lmap_errors (boolean add)
 
boolean add_lmap_error (lives_lmap_error_t lerror, const char *name, livespointer user_data, int clipno, int frameno, double atime, boolean affects_current)
 
void clear_lmap_errors (void)
 
boolean check_for_lock_file (const char *set_name, int type)
 check for set lock file do this via the back-end (smogrify) this allows for the locking scheme to be more flexible More...
 
boolean do_std_checks (const char *type_name, const char *type, size_t maxlen, const char *nreject)
 
boolean is_legal_set_name (const char *set_name, boolean allow_dupes, boolean leeway)
 
LIVES_GLOBAL_INLINE const char * get_image_ext_for_type (lives_img_type_t imgtype)
 
LIVES_GLOBAL_INLINE lives_img_type_t lives_image_ext_to_img_type (const char *img_ext)
 
LIVES_GLOBAL_INLINE const char * image_ext_to_lives_image_type (const char *img_ext)
 
LIVES_GLOBAL_INLINE lives_img_type_t lives_image_type_to_img_type (const char *lives_img_type)
 
LIVES_GLOBAL_INLINE char * make_image_file_name (lives_clip_t *sfile, frames_t frame, const char *img_ext)
 lives_image_type can be a string, lives_img_type_t is an enumeration More...
 
boolean check_frame_count (int idx, boolean last_checked)
 check number of frames is correct for files of type CLIP_TYPE_DISK More...
 
int get_frame_count (int idx, int start)
 sets mainw->files[idx]->frames with current framecount More...
 
boolean get_frames_sizes (int fileno, int frame, int *hsize, int *vsize)
 
boolean lives_string_ends_with (const char *string, const char *fmt,...)
 
void get_dirname (char *filename)
 
char * get_dir (const char *filename)
 
LIVES_GLOBAL_INLINE void get_basename (char *filename)
 
LIVES_GLOBAL_INLINE void get_filename (char *filename, boolean strip_dir)
 
LIVES_GLOBAL_INLINE char * lives_get_filename (char *uri)
 return filename (no dir, no .ext) More...
 
char * get_extension (const char *filename)
 
char * ensure_extension (const char *fname, const char *ext)
 
LIVES_GLOBAL_INLINE char * lives_ellipsize (char *txt, size_t maxlen, LiVESEllipsizeMode mode)
 
LIVES_GLOBAL_INLINE char * lives_pad (char *txt, size_t minlen, int align)
 
LIVES_GLOBAL_INLINE char * lives_pad_ellipsize (char *txt, size_t fixlen, int palign, LiVESEllipsizeMode emode)
 
boolean ensure_isdir (char *fname)
 
boolean dirs_equal (const char *dira, const char *dirb)
 
void get_location (const char *exe, char *val, int maxlen)
 
LIVES_LOCAL_INLINE lives_presence_t has_executable (const char *exe)
 
boolean check_for_executable (lives_checkstatus_t *cap, const char *exec)
 
uint64_t get_version_hash (const char *exe, const char *sep, int piece)
 
uint64_t make_version_hash (const char *ver)
 
char * unhash_version (uint64_t version)
 
char * repl_workdir (const char *entry, boolean fwd)
 
void remove_layout_files (LiVESList *map)
 
LIVES_GLOBAL_INLINE void get_play_times (void)
 recalculate video / audio lengths and draw the timer bars More...
 
void update_play_times (void)
 like get_play_times, but will force redraw of audio waveforms More...
 
void get_total_time (lives_clip_t *file)
 calculate laudio, raudio and video time (may be deprecated and replaced with macros) More...
 
void find_when_to_stop (void)
 
void minimise_aspect_delta (double aspect, int hblock, int vblock, int hsize, int vsize, int *width, int *height)
 
void zero_spinbuttons (void)
 
boolean switch_aud_to_jack (boolean set_in_prefs)
 
boolean switch_aud_to_pulse (boolean set_in_prefs)
 
boolean switch_aud_to_sox (boolean set_in_prefs)
 
void switch_aud_to_none (boolean set_in_prefs)
 
boolean prepare_to_play_foreign (void)
 
boolean after_foreign_play (void)
 
LIVES_GLOBAL_INLINE boolean int_array_contains_value (int *array, int num_elems, int value)
 
void reset_clipmenu (void)
 
boolean check_file (const char *file_name, boolean check_existing)
 check if file exists More...
 
int lives_rmdir (const char *dir, boolean force)
 
int lives_rmdir_with_parents (const char *dir)
 
int lives_rm (const char *file)
 
int lives_rmglob (const char *files)
 
int lives_cp (const char *from, const char *to)
 
int lives_cp_recursive (const char *from, const char *to, boolean incl_dir)
 
int lives_cp_keep_perms (const char *from, const char *to)
 
int lives_mv (const char *from, const char *to)
 
int lives_touch (const char *tfile)
 
int lives_ln (const char *from, const char *to)
 
int lives_chmod (const char *target, const char *mode)
 
int lives_cat (const char *from, const char *to, boolean append)
 
int lives_echo (const char *text, const char *to, boolean append)
 
void lives_kill_subprocesses (const char *dirname, boolean kill_parent)
 
void lives_suspend_resume_process (const char *dirname, boolean suspend)
 
boolean check_dir_access (const char *dir, boolean leaveit)
 
void activate_url_inner (const char *link)
 
void activate_url (LiVESAboutDialog *about, const char *link, livespointer data)
 
void show_manual_section (const char *lang, const char *section)
 
void wait_for_bg_audio_sync (int fileno)
 
boolean create_event_space (int length)
 
int lives_list_strcmp_index (LiVESList *list, livesconstpointer data, boolean case_sensitive)
 
void add_to_recent (const char *filename, double start, frames_t frames, const char *extra_params)
 
int verhash (char *xv)
 
void set_undoable (const char *what, boolean sensitive)
 
void set_redoable (const char *what, boolean sensitive)
 
void set_sel_label (LiVESWidget *sel_label)
 
LIVES_GLOBAL_INLINE void lives_list_free_strings (LiVESList *list)
 
LIVES_GLOBAL_INLINE void lives_slist_free_all (LiVESSList **list)
 
LIVES_GLOBAL_INLINE void lives_list_free_all (LiVESList **list)
 
LIVES_GLOBAL_INLINE void cached_list_free (LiVESList **list)
 
void print_cache (LiVESList *cache)
 
LiVESList * cache_file_contents (const char *filename)
 
char * get_val_from_cached_list (const char *key, size_t maxlen, LiVESList *cache)
 
char * clip_detail_to_string (lives_clip_details_t what, size_t *maxlenp)
 
boolean get_clip_value (int which, lives_clip_details_t what, void *retval, size_t maxlen)
 
boolean save_clip_value (int which, lives_clip_details_t what, void *val)
 
LiVESList * get_set_list (const char *dir, boolean utf8)
 
boolean check_for_ratio_fps (double fps)
 
double get_ratio_fps (const char *string)
 
char * remove_trailing_zeroes (double val)
 
uint32_t get_signed_endian (boolean is_signed, boolean little_endian)
 produce bitmapped value More...
 
size_t get_token_count (const char *string, int delim)
 
char * get_nth_token (const char *string, const char *delim, int pnumber)
 
int lives_utf8_strcasecmp (const char *s1, const char *s2)
 
LIVES_GLOBAL_INLINE int lives_utf8_strcmp (const char *s1, const char *s2)
 
LIVES_GLOBAL_INLINE LiVESList * lives_list_sort_alpha (LiVESList *list, boolean fwd)
 
char * subst (const char *xstring, const char *from, const char *to)
 
char * insert_newlines (const char *text, int maxwidth)
 
LIVES_GLOBAL_INLINE int hextodec (const char *string)
 
boolean is_writeable_dir (const char *dir)
 
boolean lives_make_writeable_dir (const char *newdir)
 
LIVES_GLOBAL_INLINE LiVESInterpType get_interp_value (short quality, boolean low_for_mt)
 
LIVES_GLOBAL_INLINE LiVESList * buff_to_list (const char *buffer, const char *delim, boolean allow_blanks, boolean strip)
 
LIVES_GLOBAL_INLINE LiVESList * lives_list_append_unique (LiVESList *xlist, const char *add)
 
LIVES_GLOBAL_INLINE LiVESList * lives_list_move_to_first (LiVESList *list, LiVESList *item)
 
LiVESList * lives_list_delete_string (LiVESList *list, const char *string)
 
LIVES_GLOBAL_INLINE LiVESList * lives_list_copy_strings (LiVESList *list)
 
boolean string_lists_differ (LiVESList *alist, LiVESList *blist)
 

Macro Definition Documentation

◆ ASPECT_ALLOWANCE

#define ASPECT_ALLOWANCE   0.005

Definition at line 21 of file utils.c.

◆ AUTOTUNE

#define AUTOTUNE

Definition at line 623 of file utils.c.

◆ BL_LIM

#define BL_LIM   128

Definition at line 5754 of file utils.c.

◆ BSIZE

#define BSIZE   (8)

Definition at line 5481 of file utils.c.

◆ INITSIZE

#define INITSIZE   32

Definition at line 5482 of file utils.c.

◆ NO_O_DSYNC

#define NO_O_DSYNC

Definition at line 695 of file utils.c.

◆ O_DSYNC

#define O_DSYNC   O_SYNC

Definition at line 694 of file utils.c.

◆ VER_MAJOR_MULT

#define VER_MAJOR_MULT   1000000

Definition at line 3496 of file utils.c.

◆ VER_MICRO_MULT

#define VER_MICRO_MULT   1

Definition at line 3498 of file utils.c.

◆ VER_MINOR_MULT

#define VER_MINOR_MULT   1000

Definition at line 3497 of file utils.c.

◆ WRITE_ALL

#define WRITE_ALL

Function Documentation

◆ _lives_buffered_rdonly_slurp()

boolean _lives_buffered_rdonly_slurp ( int  fd,
off_t  skip 
)

Definition at line 641 of file utils.c.

Referenced by lives_buffered_rdonly_slurp().

◆ activate_url()

void activate_url ( LiVESAboutDialog *  about,
const char *  link,
livespointer  data 
)

Definition at line 4624 of file utils.c.

Referenced by on_about_activate().

◆ activate_url_inner()

void activate_url_inner ( const char *  link)

◆ add_lmap_error()

boolean add_lmap_error ( lives_lmap_error_t  lerror,
const char *  name,
livespointer  user_data,
int  clipno,
int  frameno,
double  atime,
boolean  affects_current 
)

Definition at line 2673 of file utils.c.

Referenced by on_close_activate(), recover_layout_map(), and unbuffer_lmap_errors().

◆ add_messages_to_list()

int add_messages_to_list ( const char *  text)

Definition at line 2416 of file utils.c.

Referenced by d_print().

◆ add_to_recent()

void add_to_recent ( const char *  filename,
double  start,
frames_t  frames,
const char *  extra_params 
)

Definition at line 4701 of file utils.c.

◆ after_foreign_play()

boolean after_foreign_play ( void  )

Definition at line 4193 of file utils.c.

Referenced by on_capture_activate().

◆ buff_to_list()

LIVES_GLOBAL_INLINE LiVESList* buff_to_list ( const char *  buffer,
const char *  delim,
boolean  allow_blanks,
boolean  strip 
)

Definition at line 5755 of file utils.c.

◆ buffer_lmap_error()

void buffer_lmap_error ( lives_lmap_error_t  lerror,
const char *  name,
livespointer  user_data,
int  clipno,
int  frameno,
double  atime,
boolean  affects_current 
)

Definition at line 2640 of file utils.c.

◆ cache_file_contents()

LiVESList* cache_file_contents ( const char *  filename)

Definition at line 4909 of file utils.c.

Referenced by reload_clip().

◆ cached_list_free()

LIVES_GLOBAL_INLINE void cached_list_free ( LiVESList **  list)

Definition at line 4881 of file utils.c.

Referenced by reload_clip(), and reload_set().

◆ calc_aframeno()

void calc_aframeno ( int  fileno)

Definition at line 1845 of file utils.c.

Referenced by calc_new_playback_position().

◆ calc_frame_from_time()

LIVES_GLOBAL_INLINE int calc_frame_from_time ( int  filenum,
double  time 
)

◆ calc_frame_from_time2()

LIVES_GLOBAL_INLINE int calc_frame_from_time2 ( int  filenum,
double  time 
)

nearest frame [1, frames+1]

Definition at line 1768 of file utils.c.

Referenced by on_mouse_sel_start(), and on_mouse_sel_update().

◆ calc_frame_from_time3()

LIVES_GLOBAL_INLINE int calc_frame_from_time3 ( int  filenum,
double  time 
)

nearest frame rounded down, [1, frames+1]

Definition at line 1778 of file utils.c.

Referenced by on_mouse_sel_start(), and on_mouse_sel_update().

◆ calc_frame_from_time4()

LIVES_GLOBAL_INLINE int calc_frame_from_time4 ( int  filenum,
double  time 
)

nearest frame, no maximum

Definition at line 1788 of file utils.c.

Referenced by lives_ce_update_timeline(), play_all(), render_events(), storeclip_callback(), and update_sel_menu().

◆ calc_maxspect()

void calc_maxspect ( int  rwidth,
int  rheight,
int *  cwidth,
int *  cheight 
)

Definition at line 2174 of file utils.c.

Referenced by get_letterbox_sizes(), and get_player_size().

◆ calc_midspect()

void calc_midspect ( int  rwidth,
int  rheight,
int *  cwidth,
int *  cheight 
)

Definition at line 2216 of file utils.c.

◆ calc_minspect()

void calc_minspect ( int  rwidth,
int  rheight,
int *  cwidth,
int *  cheight 
)

Definition at line 2195 of file utils.c.

◆ calc_new_playback_position()

frames_t calc_new_playback_position ( int  fileno,
ticks_t  otc,
ticks_t ntc 
)

if we are scratching we do the following: the time since the last call is considered to have happened at an increased fps (fwd or back) we recalculate the frame at ntc as if we were at the faster framerate.

the frame number changed, but we will recalulate the value using mainw->deltaticks

retain the fractional part for next time

or subtracted from the selection end (backwards) [if we started backwards then the boundary crossing will be with the

must set norecurse, otherwise we can end up in an infinite loop since dirchange_callback calls this function

????

Definition at line 1865 of file utils.c.

◆ calc_time_from_frame()

LIVES_GLOBAL_INLINE double calc_time_from_frame ( int  clip,
int  frame 
)

◆ check_dir_access()

boolean check_dir_access ( const char *  dir,
boolean  leaveit 
)

◆ check_file()

boolean check_file ( const char *  file_name,
boolean  check_existing 
)

check if file exists

Definition at line 4312 of file utils.c.

Referenced by rfxbuilder_to_script().

◆ check_for_executable()

boolean check_for_executable ( lives_checkstatus_t cap,
const char *  exec 
)

◆ check_for_lock_file()

boolean check_for_lock_file ( const char *  set_name,
int  type 
)

check for set lock file do this via the back-end (smogrify) this allows for the locking scheme to be more flexible

smogrify indicates a lock very simply by by writing > 0 bytes to stdout we read this via popen

type == 0 for load, type == 1 for save

Definition at line 2894 of file utils.c.

Referenced by is_legal_set_name(), and reload_set().

◆ check_for_ratio_fps()

boolean check_for_ratio_fps ( double  fps)

Definition at line 5361 of file utils.c.

Referenced by add_to_clipmenu(), and on_resample_vid_ok().

◆ check_frame_count()

boolean check_frame_count ( int  idx,
boolean  last_checked 
)

check number of frames is correct for files of type CLIP_TYPE_DISK

  • check the image files (e.g. jpeg or png)

use a "goldilocks" algorithm (just the right frames, not too few and not too many)

ignores gaps

make sure nth frame is there...

...make sure n + 1 th frame is not

too many frames

just right

Definition at line 3074 of file utils.c.

◆ clear_lmap_errors()

void clear_lmap_errors ( void  )

Definition at line 2858 of file utils.c.

Referenced by on_lerrors_clear_clicked().

◆ clear_mainw_msg()

LIVES_GLOBAL_INLINE void clear_mainw_msg ( void  )

◆ clip_detail_to_string()

char* clip_detail_to_string ( lives_clip_details_t  what,
size_t *  maxlenp 
)

Definition at line 4980 of file utils.c.

Referenced by do_header_missing_detail_error(), get_clip_value(), and save_clip_value().

◆ create_event_space()

boolean create_event_space ( int  length)

Definition at line 4660 of file utils.c.

Referenced by event_list_to_block().

◆ d_print()

void d_print ( const char *  fmt,
  ... 
)

Definition at line 2542 of file utils.c.

Referenced by add_file_info(), build_init_config(), camready(), check_rfx_for_lives(), close_current_file(), d_print_urgency(), do_audio_import_error(), do_effect(), do_read_failed_error_s(), do_set_noclips_error(), do_system_failed_error(), do_write_failed_error_s(), dprint_recneg(), get_best_audio(), lives2lives_read_stream(), lives_exit(), load_decoders(), load_event_list(), load_rte_defs(), load_vpp_defaults(), mt_change_vals_activate(), mt_clear_timeline(), on_capture_activate(), on_change_speed_ok_clicked(), on_del_node_clicked(), on_delete_rfx_activate(), on_effects_paused(), on_erase_subs_activate(), on_export_proj_activate(), on_export_rfx_activate(), on_fade_audio_activate(), on_import_proj_activate(), on_import_rfx_activate(), on_import_theme_activate(), on_load_cdtrack_ok_clicked(), on_load_subs_activate(), on_normalise_audio_activate(), on_paste_as_new_activate(), on_promote_rfx_activate(), on_rebuild_rfx_activate(), on_recaudclip_ok_clicked(), on_record_perf_activate(), on_redo_activate(), on_render_activate(), on_resample_vid_ok(), on_resaudio_ok_clicked(), on_rev_clipboard_activate(), on_save_rte_defs_activate(), on_undo_activate(), on_vj_realize_activate(), on_vppa_save_clicked(), open_decoder_plugin(), open_raw1394(), open_vid_playback_plugin(), pad_init_silence(), play_file(), print_layout_wiped(), remove_layout_files(), render_to_clip(), resample_clipboard(), resize_message_area(), resize_widgets_for_monitor(), rfxbuilder_to_script(), and start_render_effect_events().

◆ d_print_cancelled()

LIVES_GLOBAL_INLINE void d_print_cancelled ( void  )

◆ d_print_done()

LIVES_GLOBAL_INLINE void d_print_done ( void  )

◆ d_print_enough()

LIVES_GLOBAL_INLINE void d_print_enough ( int  frames)

Definition at line 2630 of file utils.c.

Referenced by add_file_info(), on_cancel_keep_button_clicked(), and on_vj_realize_activate().

◆ d_print_failed()

LIVES_GLOBAL_INLINE void d_print_failed ( void  )

◆ d_print_file_error_failed()

LIVES_GLOBAL_INLINE void d_print_file_error_failed ( void  )

◆ d_print_overlay()

boolean d_print_overlay ( double  timeout,
const char *  fmt,
  ... 
)

Definition at line 2523 of file utils.c.

Referenced by on_volch_pressed(), and show_sync_callback().

◆ d_print_urgency()

boolean d_print_urgency ( double  timeout,
const char *  fmt,
  ... 
)

Definition at line 2497 of file utils.c.

◆ dirs_equal()

boolean dirs_equal ( const char *  dira,
const char *  dirb 
)

Definition at line 3390 of file utils.c.

◆ do_std_checks()

boolean do_std_checks ( const char *  type_name,
const char *  type,
size_t  maxlen,
const char *  nreject 
)

Definition at line 2929 of file utils.c.

Referenced by is_legal_set_name(), and on_import_theme_activate().

◆ dump_messages()

char* dump_messages ( int  start,
int  end 
)

Definition at line 2338 of file utils.c.

Referenced by do_messages_window().

◆ ensure_extension()

char* ensure_extension ( const char *  fname,
const char *  ext 
)

Definition at line 3232 of file utils.c.

◆ ensure_isdir()

boolean ensure_isdir ( char *  fname)

Definition at line 3346 of file utils.c.

Referenced by check_workdir_valid(), and dirs_equal().

◆ filename_from_fd()

char* filename_from_fd ( char *  val,
int  fd 
)

: return filename from an open fd, freeing val first

in case of error function returns val

if fd is a buffered file then the function just returns the known name, else the name is procured from /proc

call like: foo = filename_from_fd(foo,fd); lives_free(foo); input param foo can be NULL or some (non-const) string buffer if non-NULL the old value will be freed, so e.g

char *badfile = NULL; while (condition) { .... if (failed) badfile = filename_from_fd(badfile, fd); } if (badfile != NULL) lives_free(badfile);

or:

char *badfile = NULL; badfile = filename_from_fd(badfile, fd); if (badfile == NULL) // error getting filename

Definition at line 60 of file utils.c.

Referenced by lives_write().

◆ find_in_file_buffers()

lives_file_buffer_t* find_in_file_buffers ( int  fd)

◆ find_in_file_buffers_by_pathname()

lives_file_buffer_t* find_in_file_buffers_by_pathname ( const char *  pathname)

Definition at line 419 of file utils.c.

◆ find_when_to_stop()

void find_when_to_stop ( void  )

Definition at line 3722 of file utils.c.

Referenced by on_loop_cont_activate(), and on_loop_video_activate().

◆ free_n_msgs()

int free_n_msgs ( int  frval)

Definition at line 2381 of file utils.c.

Referenced by pref_factory_int().

◆ get_approx_ln()

LIVES_GLOBAL_INLINE uint32_t get_approx_ln ( uint32_t  x)

Definition at line 1453 of file utils.c.

◆ get_approx_ln64()

LIVES_GLOBAL_INLINE uint64_t get_approx_ln64 ( uint64_t  x)

Definition at line 1458 of file utils.c.

Referenced by get_near2pow().

◆ get_basename()

LIVES_GLOBAL_INLINE void get_basename ( char *  filename)

◆ get_clip_value()

boolean get_clip_value ( int  which,
lives_clip_details_t  what,
void *  retval,
size_t  maxlen 
)

ascrap_file now uses a different header name; this is to facilitate diskspace cleanup otherwise it may be wrongly classified as a recoverable clip (here this is largely academic, since the values are only read during crash recovery, and the header should have been cached)

Definition at line 5039 of file utils.c.

Referenced by get_decoder_cdata(), open_set_file(), and reload_clip().

◆ get_dir()

char* get_dir ( const char *  filename)

Definition at line 3185 of file utils.c.

Referenced by get_capabilities(), and on_filesel_button_clicked().

◆ get_dirname()

void get_dirname ( char *  filename)

◆ get_extension()

char* get_extension ( const char *  filename)

Definition at line 3217 of file utils.c.

Referenced by do_comments_dialog(), and on_filesel_button_clicked().

◆ get_filename()

LIVES_GLOBAL_INLINE void get_filename ( char *  filename,
boolean  strip_dir 
)

Definition at line 3205 of file utils.c.

Referenced by create_comments_dialog(), and on_load_subs_activate().

◆ get_frame_count()

int get_frame_count ( int  idx,
int  start 
)

sets mainw->files[idx]->frames with current framecount

calls smogrify which physically finds the last frame using a (fast) O(log n) binary search method for CLIP_TYPE_DISK only (CLIP_TYPE_FILE should use the decoder plugin frame count)

Definition at line 3109 of file utils.c.

Referenced by add_file_info(), check_for_bad_ffmpeg(), do_effect(), load_frame_image(), and on_toy_activate().

◆ get_frames_sizes()

boolean get_frames_sizes ( int  fileno,
int  frame,
int *  hsize,
int *  vsize 
)

Definition at line 3124 of file utils.c.

◆ get_image_ext_for_type()

LIVES_GLOBAL_INLINE const char* get_image_ext_for_type ( lives_img_type_t  imgtype)

◆ get_interp_value()

LIVES_GLOBAL_INLINE LiVESInterpType get_interp_value ( short  quality,
boolean  low_for_mt 
)

Definition at line 5744 of file utils.c.

◆ get_location()

void get_location ( const char *  exe,
char *  val,
int  maxlen 
)

◆ get_near2pow()

LIVES_GLOBAL_INLINE uint64_t get_near2pow ( uint64_t  val)

Definition at line 1463 of file utils.c.

◆ get_nth_info_message()

weed_plant_t* get_nth_info_message ( int  n)

Definition at line 2304 of file utils.c.

◆ get_nth_token()

char* get_nth_token ( const char *  string,
const char *  delim,
int  pnumber 
)

Definition at line 5443 of file utils.c.

◆ get_play_times()

LIVES_GLOBAL_INLINE void get_play_times ( void  )

◆ get_ratio_fps()

double get_ratio_fps ( const char *  string)

Definition at line 5379 of file utils.c.

Referenced by on_vppa_ok_clicked(), and open_vid_playback_plugin().

◆ get_read_buff_size()

size_t get_read_buff_size ( int  sztype)

Definition at line 771 of file utils.c.

◆ get_set_list()

LiVESList* get_set_list ( const char *  dir,
boolean  utf8 
)

Definition at line 5305 of file utils.c.

Referenced by create_rename_dialog().

◆ get_signed_endian()

uint32_t get_signed_endian ( boolean  is_signed,
boolean  little_endian 
)

produce bitmapped value

Definition at line 5408 of file utils.c.

Referenced by add_file_info(), on_ins_silence_details_clicked(), on_recaudclip_ok_clicked(), and on_resaudio_ok_clicked().

◆ get_token_count()

size_t get_token_count ( const char *  string,
int  delim 
)

◆ get_total_time()

void get_total_time ( lives_clip_t file)

calculate laudio, raudio and video time (may be deprecated and replaced with macros)

Definition at line 3690 of file utils.c.

Referenced by start_render_effect_events().

◆ get_val_from_cached_list()

char* get_val_from_cached_list ( const char *  key,
size_t  maxlen,
LiVESList *  cache 
)

Definition at line 4966 of file utils.c.

Referenced by get_clip_value(), and get_theme_colour_pref().

◆ get_version_hash()

uint64_t get_version_hash ( const char *  exe,
const char *  sep,
int  piece 
)

get version hash output for an executable from the backend

Definition at line 3475 of file utils.c.

◆ has_executable()

LIVES_LOCAL_INLINE lives_presence_t has_executable ( const char *  exe)

Definition at line 3421 of file utils.c.

Referenced by check_for_executable().

◆ hextodec()

LIVES_GLOBAL_INLINE int hextodec ( const char *  string)

Definition at line 5694 of file utils.c.

Referenced by prepare_to_play_foreign(), and script_to_rfxbuilder().

◆ image_ext_to_lives_image_type()

LIVES_GLOBAL_INLINE const char* image_ext_to_lives_image_type ( const char *  img_ext)

Definition at line 3039 of file utils.c.

Referenced by do_imgfmts_error(), and lives_image_ext_to_img_type().

◆ init_clipboard()

void init_clipboard ( void  )

Definition at line 2238 of file utils.c.

Referenced by do_effect().

◆ insert_newlines()

char* insert_newlines ( const char *  text,
int  maxwidth 
)

< we will insert a nl here

Definition at line 5591 of file utils.c.

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

◆ int_array_contains_value()

LIVES_GLOBAL_INLINE boolean int_array_contains_value ( int *  array,
int  num_elems,
int  value 
)

Definition at line 4284 of file utils.c.

Referenced by get_best_audio().

◆ is_legal_set_name()

boolean is_legal_set_name ( const char *  set_name,
boolean  allow_dupes,
boolean  leeway 
)

◆ is_writeable_dir()

boolean is_writeable_dir ( const char *  dir)

Definition at line 5701 of file utils.c.

Referenced by check_workdir_valid(), get_ds_free(), and get_storage_status().

◆ LEFloat_to_BEFloat()

LIVES_GLOBAL_INLINE float LEFloat_to_BEFloat ( float  f)

Definition at line 1750 of file utils.c.

◆ lives_10pow()

LIVES_GLOBAL_INLINE uint64_t lives_10pow ( int  pow)

◆ lives_alarm_check()

ticks_t lives_alarm_check ( lives_alarm_t  alarm_handle)

guard against long interrupts (when debugging for example)

Definition at line 1687 of file utils.c.

Referenced by do_auto_dialog(), load_frame_image(), load_rfx_preview(), on_fade_audio_activate(), preview_audio(), start_audio_stream(), switch_audio_clip(), and wait_for_bg_audio_sync().

◆ lives_alarm_clear()

boolean lives_alarm_clear ( lives_alarm_t  alarm_handle)

◆ lives_alarm_reset()

LIVES_GLOBAL_INLINE lives_alarm_t lives_alarm_reset ( lives_alarm_t  alarm_handle,
ticks_t  ticks 
)

Definition at line 1618 of file utils.c.

Referenced by d_print_overlay(), and lives_alarm_set().

◆ lives_alarm_set()

lives_alarm_t lives_alarm_set ( ticks_t  ticks)

set alarm for now + delta ticks (10 nanosec) param ticks (10 nanoseconds) is the offset when we want our alarm to trigger returns int handle or -1 call lives_get_alarm(handle) to test if time arrived

Definition at line 1643 of file utils.c.

Referenced by d_print_urgency(), do_auto_dialog(), load_frame_image(), load_rfx_preview(), on_fade_audio_activate(), preview_audio(), start_audio_stream(), switch_audio_clip(), and wait_for_bg_audio_sync().

◆ lives_buffered_offset()

off_t lives_buffered_offset ( int  fd)

Definition at line 1364 of file utils.c.

Referenced by save_srt_subtitles(), and save_sub_subtitles().

◆ lives_buffered_orig_size()

size_t lives_buffered_orig_size ( int  fd)

Definition at line 1377 of file utils.c.

◆ lives_buffered_rdonly_set_reversed()

LIVES_GLOBAL_INLINE boolean lives_buffered_rdonly_set_reversed ( int  fd,
boolean  val 
)

Definition at line 681 of file utils.c.

Referenced by changed_fps_during_pb().

◆ lives_buffered_rdonly_slurp()

void lives_buffered_rdonly_slurp ( int  fd,
off_t  skip 
)

Definition at line 671 of file utils.c.

Referenced by load_event_list(), and migrate_layouts().

◆ lives_buffered_write_printf()

ssize_t lives_buffered_write_printf ( int  fd,
boolean  allow_fail,
const char *  fmt,
  ... 
)

Definition at line 1316 of file utils.c.

Referenced by save_sub_subtitles().

◆ lives_cat()

int lives_cat ( const char *  from,
const char *  to,
boolean  append 
)

Definition at line 4484 of file utils.c.

◆ lives_chdir()

int lives_chdir ( const char *  path,
boolean  no_error_dlg 
)

returns 0 on success on failure pops up an error dialog, unless no_error_dlg is TRUE

Definition at line 1393 of file utils.c.

Referenced by cd_to_plugin_dir(), close_clip_decoder(), reload_clip(), weed_call_deinit_func(), and weed_call_init_func().

◆ lives_chmod()

int lives_chmod ( const char *  target,
const char *  mode 
)

Definition at line 4475 of file utils.c.

◆ lives_close_buffered()

int lives_close_buffered ( int  fd)

◆ lives_cp()

int lives_cp ( const char *  from,
const char *  to 
)

◆ lives_cp_keep_perms()

int lives_cp_keep_perms ( const char *  from,
const char *  to 
)

Definition at line 4437 of file utils.c.

◆ lives_cp_recursive()

int lives_cp_recursive ( const char *  from,
const char *  to,
boolean  incl_dir 
)

Definition at line 4423 of file utils.c.

Referenced by build_init_config().

◆ lives_create_buffered()

LIVES_GLOBAL_INLINE int lives_create_buffered ( const char *  pathname,
int  mode 
)

◆ lives_create_buffered_nosync()

LIVES_GLOBAL_INLINE int lives_create_buffered_nosync ( const char *  pathname,
int  mode 
)

Definition at line 702 of file utils.c.

◆ lives_echo()

int lives_echo ( const char *  text,
const char *  to,
boolean  append 
)

Definition at line 4500 of file utils.c.

Referenced by add_to_recovery_file().

◆ lives_ellipsize()

LIVES_GLOBAL_INLINE char* lives_ellipsize ( char *  txt,
size_t  maxlen,
LiVESEllipsizeMode  mode 
)

eg. txt = "abcdefgh", maxlen = 6, LIVES_ELLIPSIZE_END -> txt == "...gh" + NUL txt = "abcdefgh", maxlen = 6, LIVES_ELLIPSIZE_START -> txt == "ab..." + NUL txt = "abcdefgh", maxlen = 6, LIVES_ELLIPSIZE_MIDDLE -> txt == "a...h" + NUL

Definition at line 3262 of file utils.c.

Referenced by lives_pad_ellipsize().

◆ lives_fgets()

char* lives_fgets ( char *  s,
int  size,
FILE *  stream 
)

Definition at line 368 of file utils.c.

Referenced by load_rfx_preview(), and reload_set().

◆ lives_fix()

LIVES_GLOBAL_INLINE double lives_fix ( double  val,
int  decimals 
)

Definition at line 1446 of file utils.c.

Referenced by changed_fps_during_pb().

◆ lives_fork()

lives_pgid_t lives_fork ( const char *  com)

Definition at line 288 of file utils.c.

Referenced by autolives_toggle(), rec(), and start_audio_stream().

◆ lives_fputs()

int lives_fputs ( const char *  s,
FILE *  stream 
)

Definition at line 359 of file utils.c.

Referenced by rfxbuilder_to_script(), and save_clip_value().

◆ lives_fread()

size_t lives_fread ( void *  ptr,
size_t  size,
size_t  nmemb,
FILE *  stream 
)

Definition at line 379 of file utils.c.

Referenced by do_auto_dialog().

◆ lives_fread_string()

size_t lives_fread_string ( char *  buff,
size_t  stlen,
const char *  fname 
)

Definition at line 388 of file utils.c.

Referenced by check_backend_return(), and on_cancel_keep_button_clicked().

◆ lives_freep()

LIVES_GLOBAL_INLINE boolean lives_freep ( void **  ptr)

Definition at line 1411 of file utils.c.

Referenced by add_to_clipmenu(), ask_permission_dialog_complex(), backup_recording(), close_current_file(), close_temp_handle(), close_vid_playback_plugin(), d_print_overlay(), d_print_urgency(), del_frame_index(), do_auto_dialog(), do_comments_dialog(), do_rfx_cleanup(), do_warning_dialog_with_check(), do_workdir_query(), do_yesno_dialog_with_check(), enabled_in_channels(), enabled_out_channels(), end_fs_preview(), fill_abuffer_from(), fill_param_vals_to(), get_audio_channel_in(), get_audio_frame_clip(), get_audio_frame_seek(), get_audio_frame_vel(), get_external_window_hints(), get_frame_event_clip(), get_frame_event_frame(), get_monitors(), has_audio_chans_in(), has_audio_chans_out(), has_video_chans_in(), has_video_chans_out(), init_clipboard(), init_event_is_relevant(), insert_audio_event_at(), insert_frames(), interpolate_param(), is_audio_channel_in(), is_audio_channel_out(), lives_ce_update_timeline(), lives_exit(), lives_general_button_clicked(), lives_list_free_strings(), load_frame_image(), load_frame_index(), move_event_left(), mt_change_vals_activate(), multitrack(), num_alpha_channels(), num_in_params(), on_cancel_keep_button_clicked(), on_capture2_activate(), on_capture_activate(), on_effects_paused(), on_export_proj_activate(), on_fade_audio_activate(), on_ins_silence_details_clicked(), on_load_set_activate(), on_multitrack_activate(), on_open_utube_activate(), on_paste_as_new_activate(), on_prefs_close_clicked(), on_recaudclip_ok_clicked(), on_redo_activate(), on_resaudio_ok_clicked(), on_rte_info_clicked(), on_utube_select(), pre_analyse(), prep_audio_player(), pump_io_chan(), reload_clip(), render_events(), render_to_clip(), restore_frame_index_back(), rfx_free(), rfx_free_all(), rfx_params_free(), rte_set_defs_activate(), rte_set_defs_cancel(), sample_silence_stream(), save_event_frames(), send_to_trash(), set_copy_to(), set_new_set_name(), set_string_param(), show_sync_callback(), startup_message_fatal(), stored_event_list_free_undos(), subtitles_free(), switch_to_file(), update_play_times(), weed_apply_audio_instance(), weed_filter_in_paramtmpl(), weed_parameter_has_variable_elements_strict(), and weed_params_to_rfx().

◆ lives_fsync()

LIVES_GLOBAL_INLINE boolean lives_fsync ( int  fd)

Definition at line 109 of file utils.c.

◆ lives_get_current_playback_ticks()

ticks_t lives_get_current_playback_ticks ( int64_t  origsecs,
int64_t  orignsecs,
lives_time_source_t time_source 
)

synchronised timing it can be helpful to imagine a virtual clock which is at currrent time: clock time - cadjticks = virtual time = other time + adjticks cadjticks and adjticks are only set when we switch from one source to another, i.e the virtual clock will run @ different rates depending on the source. This is fine as it enables sync with the clock source, provided the time doesn't jump when moving from one source to another. when the source changes we then alter either cadjticks or adjticks so that the initial timing matches e.g when switching to clock source, cadjticks and adjticks will have diverged. So we want to set new cadjtick s.t: clock ticks - cadjticks == source ticks + adjticks. i.e cadjticks = clock ticks - (source ticks + adjticks). we use the delta calculated the last time, since the other source may longer be available. this should not be a concern since this function is called very frequently recalling cadjticks_new = clock_ticks - (source_ticks + adjticks), and substituting for delta we get:

conversely, when switching from clock to source, adjticks_new = clock_ticks - cadjticks - source_ticks again, this just delta + adjticks; in this case we can use current delta since it is assumed that the system clock is always available

this scheme does, however introduce a small problem, which is that when the sources are switched, we assume that the time on both clocks is equivalent. This can lead to a problem when switching clips, since temporarily we switch to system time and then back to soundcard. However, this can cause some updates to the timer to be missed, i.e the audio is playing but the samples are not counted, however we cannot simply add these to the soundcard timer, as they will be lost due to the resync. hence we need mainw->syncticks --> a global adjustment which is independant of the clock source. This is similar to mainw->deltaticks for the player, however, deltaticks is a temporary impulse, whereas syncticks is a permanent adjustment.

Definition at line 1481 of file utils.c.

Referenced by aud_lock_callback(), avsync_force(), changed_fps_during_pb(), and resync_audio().

◆ lives_get_filename()

LIVES_GLOBAL_INLINE char* lives_get_filename ( char *  uri)

return filename (no dir, no .ext)

Definition at line 3214 of file utils.c.

◆ lives_image_ext_to_img_type()

LIVES_GLOBAL_INLINE lives_img_type_t lives_image_ext_to_img_type ( const char *  img_ext)

Definition at line 3034 of file utils.c.

◆ lives_image_type_to_img_type()

LIVES_GLOBAL_INLINE lives_img_type_t lives_image_type_to_img_type ( const char *  lives_img_type)

Definition at line 3046 of file utils.c.

Referenced by lives_image_ext_to_img_type().

◆ lives_invalidate_all_file_buffers()

void lives_invalidate_all_file_buffers ( void  )

Definition at line 557 of file utils.c.

◆ lives_kill()

LIVES_GLOBAL_INLINE int lives_kill ( lives_pid_t  pid,
int  sig 
)

Definition at line 1423 of file utils.c.

◆ lives_kill_subprocesses()

void lives_kill_subprocesses ( const char *  dirname,
boolean  kill_parent 
)

◆ lives_killpg()

LIVES_GLOBAL_INLINE int lives_killpg ( lives_pgid_t  pgrp,
int  sig 
)

Definition at line 1432 of file utils.c.

Referenced by autolives_toggle(), on_camstop_clicked(), and stop_audio_stream().

◆ lives_list_append_unique()

LIVES_GLOBAL_INLINE LiVESList* lives_list_append_unique ( LiVESList *  xlist,
const char *  add 
)

◆ lives_list_copy_strings()

LIVES_GLOBAL_INLINE LiVESList* lives_list_copy_strings ( LiVESList *  list)

Definition at line 5820 of file utils.c.

◆ lives_list_delete_string()

LiVESList* lives_list_delete_string ( LiVESList *  list,
const char *  string 
)

Definition at line 5801 of file utils.c.

◆ lives_list_free_all()

LIVES_GLOBAL_INLINE void lives_list_free_all ( LiVESList **  list)

◆ lives_list_free_strings()

LIVES_GLOBAL_INLINE void lives_list_free_strings ( LiVESList *  list)

Definition at line 4860 of file utils.c.

Referenced by lives_list_free_all(), and lives_slist_free_all().

◆ lives_list_move_to_first()

LIVES_GLOBAL_INLINE LiVESList* lives_list_move_to_first ( LiVESList *  list,
LiVESList *  item 
)

Definition at line 5789 of file utils.c.

Referenced by get_decoder_cdata().

◆ lives_list_sort_alpha()

LIVES_GLOBAL_INLINE LiVESList* lives_list_sort_alpha ( LiVESList *  list,
boolean  fwd 
)

stable sort, so input list should NOT be freed handles utf-8 strings

Definition at line 5474 of file utils.c.

Referenced by create_rename_dialog().

◆ lives_list_strcmp_index()

int lives_list_strcmp_index ( LiVESList *  list,
livesconstpointer  data,
boolean  case_sensitive 
)

◆ lives_ln()

int lives_ln ( const char *  from,
const char *  to 
)

Definition at line 4464 of file utils.c.

◆ lives_lseek_buffered_rdonly()

off_t lives_lseek_buffered_rdonly ( int  fd,
off_t  offset 
)

Definition at line 895 of file utils.c.

Referenced by read_filter_defaults(), and read_generator_sizes().

◆ lives_lseek_buffered_rdonly_absolute()

off_t lives_lseek_buffered_rdonly_absolute ( int  fd,
off_t  offset 
)

Definition at line 907 of file utils.c.

Referenced by get_float_audio_val_at_time(), and render_events().

◆ lives_lseek_buffered_writer()

off_t lives_lseek_buffered_writer ( int  fd,
off_t  offset 
)

Definition at line 1338 of file utils.c.

◆ lives_make_writeable_dir()

boolean lives_make_writeable_dir ( const char *  newdir)

create a directory (including parents) and ensure we can actually write to it

Definition at line 5721 of file utils.c.

Referenced by build_init_config(), on_save_set_activate(), and on_utube_select().

◆ lives_mv()

int lives_mv ( const char *  from,
const char *  to 
)

Definition at line 4446 of file utils.c.

Referenced by insert_blank_frames(), on_utube_select(), and rewrite_recovery_file().

◆ lives_open2()

LIVES_GLOBAL_INLINE int lives_open2 ( const char *  pathname,
int  flags 
)

◆ lives_open3()

LIVES_GLOBAL_INLINE int lives_open3 ( const char *  pathname,
int  flags,
mode_t  mode 
)

Definition at line 94 of file utils.c.

Referenced by save_vpp_defaults().

◆ lives_open_buffered_rdonly()

LIVES_GLOBAL_INLINE int lives_open_buffered_rdonly ( const char *  pathname)

◆ lives_open_buffered_writer()

int lives_open_buffered_writer ( const char *  pathname,
int  mode,
boolean  append 
)

Definition at line 706 of file utils.c.

◆ lives_pad()

LIVES_GLOBAL_INLINE char* lives_pad ( char *  txt,
size_t  minlen,
int  align 
)

Definition at line 3303 of file utils.c.

Referenced by lives_pad_ellipsize().

◆ lives_pad_ellipsize()

LIVES_GLOBAL_INLINE char* lives_pad_ellipsize ( char *  txt,
size_t  fixlen,
int  palign,
LiVESEllipsizeMode  emode 
)

Definition at line 3333 of file utils.c.

◆ lives_popen()

ssize_t lives_popen ( const char *  com,
boolean  allow_error,
char *  buff,
ssize_t  buflen 
)

◆ lives_read()

ssize_t lives_read ( int  fd,
void *  buf,
ssize_t  count,
boolean  allow_less 
)

◆ lives_read_buffered()

ssize_t lives_read_buffered ( int  fd,
void *  buf,
ssize_t  count,
boolean  allow_less 
)

function can be called with buf == NULL to preload a buffer with at least (count) bytes

buffer used up

Definition at line 924 of file utils.c.

Referenced by apply_rte_audio(), get_float_audio_val_at_time(), lives_read_le_buffered(), load_layout_map(), load_rte_defs(), read_filter_defaults(), and read_generator_sizes().

◆ lives_read_buffered_eof()

boolean lives_read_buffered_eof ( int  fd)

Definition at line 1170 of file utils.c.

◆ lives_read_le()

ssize_t lives_read_le ( int  fd,
void *  buf,
ssize_t  count,
boolean  allow_less 
)

Definition at line 486 of file utils.c.

Referenced by load_vpp_defaults(), and open_set_file().

◆ lives_read_le_buffered()

ssize_t lives_read_le_buffered ( int  fd,
void *  buf,
ssize_t  count,
boolean  allow_less 
)

◆ lives_readlink()

LIVES_GLOBAL_INLINE ssize_t lives_readlink ( const char *  path,
char *  buf,
size_t  bufsiz 
)

Definition at line 104 of file utils.c.

Referenced by filename_from_fd().

◆ lives_rm()

int lives_rm ( const char *  file)

◆ lives_rmdir()

int lives_rmdir ( const char *  dir,
boolean  force 
)

◆ lives_rmdir_with_parents()

int lives_rmdir_with_parents ( const char *  dir)

Definition at line 4386 of file utils.c.

Referenced by remove_layout_files().

◆ lives_rmglob()

int lives_rmglob ( const char *  files)

Definition at line 4404 of file utils.c.

◆ lives_setenv()

LIVES_GLOBAL_INLINE boolean lives_setenv ( const char *  name,
const char *  value 
)

Definition at line 120 of file utils.c.

◆ lives_slist_free_all()

LIVES_GLOBAL_INLINE void lives_slist_free_all ( LiVESSList **  list)

Definition at line 4865 of file utils.c.

◆ lives_string_ends_with()

boolean lives_string_ends_with ( const char *  string,
const char *  fmt,
  ... 
)

Definition at line 3143 of file utils.c.

Referenced by open_set_file().

◆ lives_suspend_resume_process()

void lives_suspend_resume_process ( const char *  dirname,
boolean  suspend 
)

Definition at line 4527 of file utils.c.

Referenced by on_effects_paused(), and on_stop_clicked().

◆ lives_sync()

LIVES_GLOBAL_INLINE void lives_sync ( int  times)

Definition at line 115 of file utils.c.

Referenced by do_effect(), reget_afilesize_inner(), and wait_for_bg_audio_sync().

◆ lives_system()

int lives_system ( const char *  com,
boolean  allow_error 
)

◆ lives_touch()

int lives_touch ( const char *  tfile)

◆ lives_unsetenv()

LIVES_GLOBAL_INLINE boolean lives_unsetenv ( const char *  name)

Definition at line 132 of file utils.c.

◆ lives_utf8_strcasecmp()

int lives_utf8_strcasecmp ( const char *  s1,
const char *  s2 
)

◆ lives_utf8_strcmp()

LIVES_GLOBAL_INLINE int lives_utf8_strcmp ( const char *  s1,
const char *  s2 
)

Definition at line 5469 of file utils.c.

Referenced by reload_clip().

◆ lives_write()

ssize_t lives_write ( int  fd,
const void *  buf,
ssize_t  count,
boolean  allow_fail 
)

TODO ****: this needs to be threadsafe

Definition at line 309 of file utils.c.

Referenced by check_dir_access(), lives_write_buffered(), and lives_write_le().

◆ lives_write_buffered()

ssize_t lives_write_buffered ( int  fd,
const char *  buf,
ssize_t  count,
boolean  allow_fail 
)

◆ lives_write_le()

ssize_t lives_write_le ( int  fd,
const void *  buf,
ssize_t  count,
boolean  allow_fail 
)

Definition at line 350 of file utils.c.

◆ lives_write_le_buffered()

ssize_t lives_write_le_buffered ( int  fd,
const void *  buf,
ssize_t  count,
boolean  allow_fail 
)

Definition at line 1329 of file utils.c.

◆ make_image_file_name()

LIVES_GLOBAL_INLINE char* make_image_file_name ( lives_clip_t sfile,
frames_t  frame,
const char *  img_ext 
)

◆ make_version_hash()

uint64_t make_version_hash ( const char *  ver)

convert a version to uint64_t hash, for comparing

Definition at line 3500 of file utils.c.

Referenced by do_effect(), and script_to_rfxbuilder().

◆ minimise_aspect_delta()

void minimise_aspect_delta ( double  aspect,
int  hblock,
int  vblock,
int  hsize,
int  vsize,
int *  width,
int *  height 
)

Definition at line 3750 of file utils.c.

◆ prepare_to_play_foreign()

boolean prepare_to_play_foreign ( void  )

Definition at line 4055 of file utils.c.

Referenced by on_capture2_activate().

◆ print_cache()

void print_cache ( LiVESList *  cache)

for debugging

Definition at line 4897 of file utils.c.

◆ remove_layout_files()

void remove_layout_files ( LiVESList *  map)

Definition at line 3559 of file utils.c.

Referenced by on_clear_event_list_activate(), and on_lerrors_delete_clicked().

◆ remove_trailing_zeroes()

char* remove_trailing_zeroes ( double  val)

Definition at line 5395 of file utils.c.

Referenced by on_vpp_advanced_clicked().

◆ repl_workdir()

char* repl_workdir ( const char *  entry,
boolean  fwd 
)

Definition at line 3534 of file utils.c.

Referenced by load_layout_map(), remove_layout_files(), and save_layout_map().

◆ reset_clipmenu()

void reset_clipmenu ( void  )

Definition at line 4290 of file utils.c.

Referenced by on_render_activate(), reload_set(), and switch_to_file().

◆ reset_playback_clock()

void reset_playback_clock ( void  )

Definition at line 1474 of file utils.c.

◆ save_clip_value()

boolean save_clip_value ( int  which,
lives_clip_details_t  what,
void *  val 
)

ascrap_file now uses a different header name; this is to facilitate diskspace cleanup otherwise it may be wrongly classified as a recoverable clip

Definition at line 5175 of file utils.c.

Referenced by do_comments_dialog(), do_effect(), lives_exit(), on_change_speed_ok_clicked(), on_ins_silence_details_clicked(), on_load_cdtrack_ok_clicked(), on_rename_clip_name(), on_vj_reset_activate(), reget_afilesize(), reload_clip(), render_to_clip(), and save_clip_values().

◆ set_redoable()

void set_redoable ( const char *  what,
boolean  sensitive 
)

Definition at line 4813 of file utils.c.

◆ set_sel_label()

void set_sel_label ( LiVESWidget *  sel_label)

◆ set_undoable()

void set_undoable ( const char *  what,
boolean  sensitive 
)

◆ show_manual_section()

void show_manual_section ( const char *  lang,
const char *  section 
)

Definition at line 4629 of file utils.c.

Referenced by show_manual_activate().

◆ string_lists_differ()

boolean string_lists_differ ( LiVESList *  alist,
LiVESList *  blist 
)

Definition at line 5831 of file utils.c.

◆ subst()

char* subst ( const char *  xstring,
const char *  from,
const char *  to 
)

◆ switch_aud_to_jack()

boolean switch_aud_to_jack ( boolean  set_in_prefs)

Definition at line 3819 of file utils.c.

Referenced by pref_factory_string().

◆ switch_aud_to_none()

void switch_aud_to_none ( boolean  set_in_prefs)

Definition at line 4001 of file utils.c.

Referenced by handle_audio_timeout(), and pref_factory_string().

◆ switch_aud_to_pulse()

boolean switch_aud_to_pulse ( boolean  set_in_prefs)

Definition at line 3884 of file utils.c.

Referenced by pref_factory_string().

◆ switch_aud_to_sox()

boolean switch_aud_to_sox ( boolean  set_in_prefs)

Definition at line 3944 of file utils.c.

Referenced by pref_factory_string().

◆ unbuffer_lmap_errors()

void unbuffer_lmap_errors ( boolean  add)

◆ unhash_version()

char* unhash_version ( uint64_t  version)

Definition at line 3522 of file utils.c.

Referenced by do_gamma_import_warn().

◆ update_play_times()

void update_play_times ( void  )

like get_play_times, but will force redraw of audio waveforms

Definition at line 3677 of file utils.c.

Referenced by on_load_cdtrack_ok_clicked(), pref_change_colours(), pref_change_xcolours(), and reget_afilesize().

◆ verhash()

int verhash ( char *  xv)

Definition at line 4755 of file utils.c.

Referenced by do_effect().

◆ wait_for_bg_audio_sync()

void wait_for_bg_audio_sync ( int  fileno)

Definition at line 4644 of file utils.c.

Referenced by add_file_info().

◆ zero_spinbuttons()

void zero_spinbuttons ( void  )

Definition at line 3807 of file utils.c.

Referenced by close_current_file(), and switch_to_file().