Top | ![]() |
![]() |
![]() |
![]() |
gboolean uc_utils_ftp_code_search (const gchar *buffer
,const gchar *code
,const gint len
);
Search for a given FTP code in a buffer.
gchar *
uc_utils_get_string_from_size (const gsize size
);
Convert a size in string format (with unit indication (KB, MB...)).
gchar *
uc_utils_get_server_from_header_field (gchar *field
);
Extract server name/type from a HTTP header "Server" field.
void uc_utils_copy (const gchar *src
,const gchar *dest
);
Copy a file from src
to dest
.
gboolean uc_utils_get_meta_refresh_location (UCLinkProperties *prop
,UCHTMLTag *tag
);
If the page contain a refresh meta tag with a value of 0, replace the current page URL with it.
gchar *
uc_utils_to_utf8 (const gchar *data
);
UTF-8 encode a given string.
Adapted from screem "screem_support_charset_convert()
"
function.
void uc_utils_copy_files (const gchar *src
,const gchar *dest
);
Copy all the file from a given directorie in another.
void
uc_utils_debug_dump_link_properties (const UCLinkProperties *prop
);
Dump the link properties structure to the standard output.
void uc_utils_set_userfriendly_treeview_column (const GtkTreeView *tv
,const gint position
);
Set a treeview column sortable and resizable.
gchar * uc_utils_get_file_content (const gchar *path
,gsize *length
);
Open and read a file to return its content.
void uc_utils_split_email (const gchar *email
,gchar **user
,gchar **domain
);
Fill the two parts of a E-Mail address. user
and domain
argument are
filled with new allocated strings.
gchar *
uc_utils_get_mx (const gchar *domain
);
Return the prefered MX for a given domain. Function adapted from http://www.sslug.dk/emailarkiv/cprog/1999_10/msg00056.html
gboolean
uc_utils_get_yesno (const gchar *yesno
);
Proceed a given string to see if it contains "yes" or "no".
gboolean
uc_utils_mx_is_valid (const gchar *mx
);
Check if a given MX is valid or not.
gchar *
uc_utils_get_ip (const gchar *host
);
Return the IP of the given host. if arg is already an IP, return it as is.
UCEmailStatus uc_utils_email_is_valid (const gchar *email
,const gboolean check_mx
);
Check E-Mail syntax and MX if required.
gchar * uc_utils_string_cut (const gchar *label
,const gsize size
);
Cut a given string to fit with the given length.
gchar * uc_utils_string_format4display (const gchar *label
,const gsize size
);
format a given string to be displayed in UI.
gchar * uc_utils_replace (const gchar *str
,const gchar *old
,const gchar *new
);
Replace one or more characters in a given string.
See: uc_utils_replace1()
gchar * uc_utils_replace1 (gchar *string
,const gchar c1
,const char c2
);
Replace a caracter by another (but do not allocate new memory for the result string).
See: uc_utils_replace()
gchar * uc_utils_replacelr (gchar *string
,const gchar c
);
Remove all line return in a given string.
gchar *
uc_utils_convert_uid2file (const guint32 uid
);
Convert a cache uid to filename.
void uc_utils_get_gnome_proxy_conf (gchar **host
,guint *port
);
Fill given args with the gconf values for the gnome network proxy settings.
gchar *
uc_utils_clean_tag_link_value (gchar *value
);
Clean a link value string.
gpointer uc_utils_search_string_next (gpointer buf
,const gchar *str
,const gchar limit_char
);
Search for the next char after the searched string.
buf |
A gpointer to the source buffer. |
|
str |
The string to search. |
|
limit_char |
The char to stop if found. |
gboolean uc_utils_memcasecmp (const gchar *str1
,const gchar *str2
);
Comparison between two strings, based on the length of the second string.
void
uc_utils_rmfiles (const gchar *path
);
Remove all files in a given directory.
gboolean uc_utils_mkdirs (const gchar *path
,const gboolean create_all
);
Make given path -- create intermediate paths if they don't exist -- and test if we are authorized to write in.
void uc_utils_rmdirs (const gchar *path
,const gboolean delete_all
);
Remove a given path -- remove intermediate paths too.
guint32
uc_utils_vector_length (gpointer data
);
Calculate the length of the given vector.
gchar * uc_utils_strpbrk_or_eos (const gchar *str
,const gchar *accept
);
Return a pointer on a given char address or on the end of the passed string.
gchar * uc_utils_strdup_delim (const gchar *begin
,const gchar *end
);
Make a string with 2 given pointers.
gboolean
uc_utils_test_socket_open (const guint sock
);
Check if a connection if alive or not. -> taken from wget source code
gchar *
uc_utils_get_gnome_browser_conf (void
);
Get the current default gnome web browser or "mozilla" if it does not find it.
gboolean uc_utils_get_auth_fields (GladeXML *g
,GtkWidget *w_auth_user
,GtkWidget *w_auth_password
,gchar **auth_user
,gchar **auth_password
,gchar **auth_line
);
Get user/password from a authentication dialog and build the line for basic authentication to pass to HTTP headers.