2006-05-17 20:09:57 +00:00
|
|
|
#ifndef foocoreutilhfoo
|
|
|
|
|
#define foocoreutilhfoo
|
2004-06-23 23:17:30 +00:00
|
|
|
|
2004-07-16 19:56:36 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
|
|
/***
|
|
|
|
|
This file is part of polypaudio.
|
|
|
|
|
|
|
|
|
|
polypaudio is free software; you can redistribute it and/or modify
|
2004-11-14 14:58:54 +00:00
|
|
|
it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
published by the Free Software Foundation; either version 2.1 of the
|
|
|
|
|
License, or (at your option) any later version.
|
2004-07-16 19:56:36 +00:00
|
|
|
|
|
|
|
|
polypaudio is distributed in the hope that it will be useful, but
|
|
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2004-11-14 14:58:54 +00:00
|
|
|
Lesser General Public License for more details.
|
2004-07-16 19:56:36 +00:00
|
|
|
|
2004-11-14 14:58:54 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
License along with polypaudio; if not, write to the Free Software
|
2004-07-16 19:56:36 +00:00
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
|
USA.
|
|
|
|
|
***/
|
|
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
#include <sys/types.h>
|
2004-08-22 21:13:58 +00:00
|
|
|
#include <inttypes.h>
|
2004-09-05 00:03:16 +00:00
|
|
|
#include <stdarg.h>
|
2004-11-04 21:27:12 +00:00
|
|
|
#include <stdio.h>
|
2004-09-05 00:03:16 +00:00
|
|
|
|
2006-02-17 12:10:58 +00:00
|
|
|
#include <polypcore/gccmacro.h>
|
2004-06-23 23:17:30 +00:00
|
|
|
|
2006-01-10 17:51:06 +00:00
|
|
|
struct timeval;
|
|
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
void pa_make_nonblock_fd(int fd);
|
2004-06-23 23:17:30 +00:00
|
|
|
|
2004-07-03 23:35:12 +00:00
|
|
|
int pa_make_secure_dir(const char* dir);
|
2004-11-11 21:18:33 +00:00
|
|
|
int pa_make_secure_parent_dir(const char *fn);
|
2004-07-03 23:35:12 +00:00
|
|
|
|
2006-05-11 11:08:58 +00:00
|
|
|
ssize_t pa_read(int fd, void *buf, size_t count);
|
2006-05-11 11:30:35 +00:00
|
|
|
ssize_t pa_write(int fd, const void *buf, size_t count);
|
2004-07-06 00:08:44 +00:00
|
|
|
ssize_t pa_loop_read(int fd, void*data, size_t size);
|
|
|
|
|
ssize_t pa_loop_write(int fd, const void*data, size_t size);
|
|
|
|
|
|
2004-09-15 13:03:25 +00:00
|
|
|
void pa_check_signal_is_blocked(int sig);
|
2004-07-07 00:22:46 +00:00
|
|
|
|
2004-09-05 00:03:16 +00:00
|
|
|
char *pa_sprintf_malloc(const char *format, ...) PA_GCC_PRINTF_ATTR(1,2);
|
|
|
|
|
char *pa_vsprintf_malloc(const char *format, va_list ap);
|
2004-07-10 20:56:38 +00:00
|
|
|
|
2004-11-04 18:57:31 +00:00
|
|
|
char *pa_strlcpy(char *b, const char *s, size_t l);
|
|
|
|
|
|
2006-04-22 20:05:01 +00:00
|
|
|
char *pa_parent_dir(const char *fn);
|
|
|
|
|
|
2004-09-01 00:23:51 +00:00
|
|
|
void pa_raise_priority(void);
|
|
|
|
|
void pa_reset_priority(void);
|
|
|
|
|
|
2004-09-01 22:36:49 +00:00
|
|
|
int pa_fd_set_cloexec(int fd, int b);
|
|
|
|
|
|
2004-09-13 23:28:30 +00:00
|
|
|
int pa_parse_boolean(const char *s);
|
|
|
|
|
|
2004-09-14 17:52:11 +00:00
|
|
|
char *pa_split(const char *c, const char*delimiters, const char **state);
|
2004-09-17 19:45:44 +00:00
|
|
|
char *pa_split_spaces(const char *c, const char **state);
|
2004-09-14 17:52:11 +00:00
|
|
|
|
2004-09-27 21:05:55 +00:00
|
|
|
char *pa_strip_nl(char *s);
|
|
|
|
|
|
2004-09-15 13:03:25 +00:00
|
|
|
const char *pa_strsignal(int sig);
|
|
|
|
|
|
2006-02-24 17:14:23 +00:00
|
|
|
int pa_own_uid_in_group(const char *name, gid_t *gid);
|
|
|
|
|
int pa_uid_in_group(uid_t uid, const char *name);
|
2004-09-23 15:47:11 +00:00
|
|
|
|
2004-09-28 22:47:48 +00:00
|
|
|
int pa_lock_fd(int fd, int b);
|
2004-09-27 15:40:18 +00:00
|
|
|
|
2004-09-28 22:47:48 +00:00
|
|
|
int pa_lock_lockfile(const char *fn);
|
2004-11-20 23:48:18 +00:00
|
|
|
int pa_unlock_lockfile(const char *fn, int fd);
|
2004-09-27 15:40:18 +00:00
|
|
|
|
2006-05-14 00:41:18 +00:00
|
|
|
FILE *pa_open_config_file(const char *global, const char *local, const char *env, char **result, const char *mode);
|
2004-11-04 21:27:12 +00:00
|
|
|
|
2004-11-07 20:48:46 +00:00
|
|
|
char *pa_hexstr(const uint8_t* d, size_t dlength, char *s, size_t slength);
|
2004-11-08 23:48:19 +00:00
|
|
|
size_t pa_parsehex(const char *p, uint8_t *d, size_t dlength);
|
2004-11-07 20:48:46 +00:00
|
|
|
|
2004-11-11 21:18:33 +00:00
|
|
|
int pa_startswith(const char *s, const char *pfx);
|
2006-02-21 23:34:50 +00:00
|
|
|
int pa_endswith(const char *s, const char *sfx);
|
2004-11-11 21:18:33 +00:00
|
|
|
|
|
|
|
|
char *pa_runtime_path(const char *fn, char *s, size_t l);
|
|
|
|
|
|
2004-12-11 00:10:41 +00:00
|
|
|
int pa_atoi(const char *s, int32_t *ret_i);
|
|
|
|
|
int pa_atou(const char *s, uint32_t *ret_u);
|
|
|
|
|
|
2004-06-23 23:17:30 +00:00
|
|
|
#endif
|