mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-12-22 08:56:52 -05:00
implement proper refcounting in polyplib
split polyplib to multiple modules add some prelimenary documentation add doxygen support git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@123 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
1c2ec47cf1
commit
22cb23eedb
45 changed files with 2853 additions and 12800 deletions
|
|
@ -52,25 +52,36 @@ void *pa_xrealloc(void *ptr, size_t size) {
|
|||
return p;
|
||||
}
|
||||
|
||||
void* pa_xmemdup(const void *p, size_t l) {
|
||||
if (!p)
|
||||
return NULL;
|
||||
else {
|
||||
char *r = pa_xmalloc(l);
|
||||
memcpy(r, p, l);
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
char *pa_xstrdup(const char *s) {
|
||||
if (!s)
|
||||
return NULL;
|
||||
else {
|
||||
char *r = strdup(s);
|
||||
if (!r)
|
||||
oom();
|
||||
|
||||
return r;
|
||||
}
|
||||
return pa_xmemdup(s, strlen(s)+1);
|
||||
}
|
||||
|
||||
char *pa_xstrndup(const char *s, size_t l) {
|
||||
if (!s)
|
||||
return NULL;
|
||||
else {
|
||||
char *r = strndup(s, l);
|
||||
if (!r)
|
||||
oom();
|
||||
char *r;
|
||||
size_t t = strlen(s);
|
||||
|
||||
if (t > l)
|
||||
t = l;
|
||||
|
||||
r = pa_xmemdup(s, t+1);
|
||||
r[t] = 0;
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue