2 #ifndef h_pnd_utility_h
3 #define h_pnd_utility_h
9 // expand_tilde() will only function correctly if a user is actually logged in; perhaps you
10 // want to spin until it looks like someone has in fact done so. (most devices will likely
11 // have auto-login, but its not instantaneous!)
12 // r_username is optional; if present, will receive a copy of username
13 unsigned char pnd_check_login ( char *r_username, unsigned int maxlen );
15 // given a malloc'd pointer to a string, expand ~ to $HOME as often as it is found, returning a
16 // new string; the old string is destroyed in the process, or returned as-is.
17 char *pnd_expand_tilde ( char *freeable_buffer );
19 // arbtrary execute function; fire and forget really
20 void pnd_exec_no_wait_1 ( char *fullpath, char *arg1 );
22 // NOTE: Does _NOT_ automatically pick up PXML-overrides; you can call that function if you want
23 pnd_pxml_handle *pnd_pxml_get_by_path ( char *fullpath );
25 // determine_mountpoint() will examine a path, and return the mountpoint that this path
26 // is sitting on; returns 1 on success, meaning the target was populated.
27 // consider for a similar effect: df /home -> look at "Mounted on"
28 unsigned char pnd_determine_mountpoint ( char *fullpath, char *r_mountpoint, unsigned int mountpoint_len );
30 // filecopy will return >0 on success
31 unsigned char pnd_filecopy ( char *sourcepath, char *targetpath );