dir-util.cpp revision a63dbee6633e3ed991bb2b34cbed7c9f02c1a839
/**
* @file
* Utility functions for filenames.
*/
#include <errno.h>
#include <string>
#include <cstring>
#include <glib/gconvert.h>
#include <glib/gstrfuncs.h>
{
while (base_len != 0
{
--base_len;
}
{
retPos++;
}
}
}
}
}
return result;
}
char const *sp_extension_from_path(char const *const path)
{
return NULL;
}
char const *p = path;
while (*p != '\0') p++;
if (* p != '.') return NULL;
p++;
return p;
}
/* current == "./", parent == "../" */
{
/* endp points the last position which is safe in the result buffer. */
char *rp;
int length;
if (*path == G_DIR_SEPARATOR)
{
goto erange;
goto finish;
}
{
return (NULL);
}
else if (size == 1)
goto erange;
{
goto erange;
/* rp points the last char. */
if (*rp == G_DIR_SEPARATOR)
*rp = 0;
else
rp++;
/* rp point NULL char */
if (*++path == G_DIR_SEPARATOR)
{
/* Append G_DIR_SEPARATOR to the tail of path name. */
*rp++ = G_DIR_SEPARATOR;
goto erange;
*rp = 0;
}
goto finish;
}
--bp;
/* up to root. */
{
{
pp += 3;
;
}
{
pp += 2;
}
{
pp += 2;
;
}
else
break;
}
/* down to leaf. */
goto erange;
*rp++ = G_DIR_SEPARATOR;
goto erange;
return result;
return (NULL);
}
{
// endp points the last position which is safe in the result buffer.
char *rp;
if (*path != G_DIR_SEPARATOR)
{
goto erange;
goto finish;
}
{
return (NULL);
}
else if (size == 1)
goto erange;
/* seek to branched point. */
if (*pp == G_DIR_SEPARATOR)
{
*rp++ = '.';
*rp++ = G_DIR_SEPARATOR;
goto erange;
*rp = 0;
goto finish;
}
/* up to root. */
{
goto erange;
*rp++ = '.';
*rp++ = '.';
*rp++ = G_DIR_SEPARATOR;
}
goto erange;
*rp = 0;
/* down to leaf. */
if (*branch)
{
goto erange;
}
else
*--rp = 0;
return result;
return (NULL);
}
{
if (!uri) {
return NULL;
}
gsize bytesWritten = 0;
-1,
&error);
return ret;
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vi: set autoindent shiftwidth=4 tabstop=8 filetype=cpp expandtab softtabstop=4 encoding=utf-8 textwidth=99 :