spkgdeveloper's documentation

Misc API


Detailed Description

Misc utility functions.


Defines

#define _debug(fmt, args...)   msg(4, fmt, ##args)
 Print a debug message.
#define _notice(fmt, args...)   msg(3, fmt, ##args)
 Print a notice.
#define _warning(fmt, args...)   msg(2, fmt, ##args)
 Print a warning.
#define _inform(fmt, args...)   msg(1, fmt, ##args)
 Print an information.

Enumerations

enum  sys_ftype {
  SYS_ERR = 0, SYS_NONE, SYS_DIR, SYS_REG,
  SYS_SYM, SYS_BLK, SYS_CHR, SYS_FIFO,
  SYS_SOCK
}
 File type. More...

Functions

G_BEGIN_DECLS void msg_setup (gint verbosity)
 Setup messages.
void msg (const gint type, const gchar *fmt,...) G_GNUC_PRINTF(2
 Print a message.
G_BEGIN_DECLS gchar * parse_pkgname (const gchar *path, guint elem) G_GNUC_MALLOC
 Parse package name into parts.
gint parse_slackdesc (const gchar *slackdesc, const gchar *sname, gchar *desc[11])
 Parse slack-desc file from buffer into parts.
gchar * gen_slackdesc (const gchar *sname, gchar *desc[11]) G_GNUC_MALLOC
 Generate slack-desc file from parsed buffer.
gint parse_createlink (gchar *line, gchar **dir, gchar **link, gchar **target)
 Parse link line in the doinst_sh file.
gint parse_cleanuplink (gchar *line)
 Parse cleanup link line in the doinst_sh file.
gint iter_str_lines (gchar **b, gchar **e, gchar **n, gchar **ln)
 Iterate through null-termianted buffer line by line.
gint iter_buf_lines (gchar **b, gchar **e, gchar **n, gchar *eof, gchar **ln)
 Iterate through buffer line by line and terminate just before eof.
G_BEGIN_DECLS gchar * path_sanitize_slashes (const gchar *path) G_GNUC_MALLOC
 Remove trailing slashes and squeeze any consecutive slashes into one.
gchar * path_simplify (const gchar *path) G_GNUC_MALLOC
 Powerful path simplification function.
gchar ** path_get_elements (const gchar *path) G_GNUC_MALLOC
 Get path elements.
gchar * sanitize_root_path (const gchar *root) G_GNUC_MALLOC
 Sanitize root path.
gint sig_trap (struct error *e)
 Trap signals.
sys_ftype sys_file_type (const gchar *path, gboolean deref)
 Get type of the file.
sys_ftype sys_file_type_stat (const gchar *path, gboolean deref, struct stat *s)
 Get type of the file and fill stat structure.
time_t sys_file_mtime (const gchar *path, gboolean deref)
 Get mtime of the file.
gint sys_rm_rf (const gchar *path)
 Implementation of the rm -rf.
gint sys_mkdir_p (const gchar *path)
 Implementation of the mkdir -p.
void sys_sigblock (sigset_t *sigs)
 Block all signals.
void sys_sigunblock (sigset_t *sigs)
 Unblock all signals.
gint sys_lock_new (const gchar *path, struct error *e)
 Create new lock.
gint sys_lock_trywait (gint fd, gint timeout, struct error *e)
 Try to acquire lock.
gint sys_lock_put (gint fd, struct error *e)
 Give up lock.
void sys_lock_del (gint fd)
 Close lock file.
gint sys_write_buffer_to_file (const gchar *file, const gchar *buf, gsize len, struct error *e)
 Write buffer to a file.

Variables

G_BEGIN_DECLS gboolean sig_break
 Will be true if process received breaking signal.

Documentation for spkg, Sun Jul 23 13:12:53 2006.