* add mu_util_print_encoded, mu_util_printerr_encoded, mu_util_fputs_encoded,

for printing where the input (in utf8) is converted to the current locale
  before  printing (WIP)
This commit is contained in:
Dirk-Jan C. Binnema
2011-05-31 23:17:09 +03:00
parent c81f13cbdd
commit 096c92e5c2
2 changed files with 111 additions and 0 deletions

View File

@ -23,6 +23,7 @@
#define __MU_UTIL_H__
#include <glib.h>
#include <stdio.h>
#include <dirent.h>
#include <sys/stat.h> /* for mode_t */
@ -133,6 +134,40 @@ int mu_util_create_writeable_fd (const char* path, mode_t mode,
*/
gboolean mu_util_is_local_file (const char* path);
/**
* write a string (assumed to be in utf8-format) to a stream,
* converted to the current locale
*
* @param str a string
* @param stream a stream
*
* @return TRUE if printing worked, FALSE otherwise
*/
gboolean mu_util_fputs_encoded (const char *str, FILE *stream);
/**
* print a formatted string (assumed to be in utf8-format) to stdout,
* converted to the current locale
*
* @param a standard printf() format string, followed by a parameter list
*
* @return TRUE if printing worked, FALSE otherwise
*/
gboolean mu_util_print_encoded (const char *frm, ...) G_GNUC_PRINTF(1,2);
/**
* print a formatted string (assumed to be in utf8-format) to stderr,
* converted to the current locale
*
* @param a standard printf() format string, followed by a parameter list
*
* @return TRUE if printing worked, FALSE otherwise
*/
gboolean mu_util_printerr_encoded (const char *frm, ...) G_GNUC_PRINTF(1,2);
/**
* try to 'play' (ie., open with it's associated program) a
* file. depends on xdg-open to do the actual opening