Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
5dafe360
Commit
5dafe360
authored
Sep 22, 2007
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving inline functions into its own .h file.
parent
6619d5fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
0 deletions
+84
-0
ifuncs.h
ifuncs.h
+84
-0
No files found.
ifuncs.h
0 → 100644
View file @
5dafe360
/* Inline functions. */
static
inline
void
alloc_xbuf
(
xbuf
*
xb
,
size_t
sz
)
{
if
(
!
(
xb
->
buf
=
new_array
(
char
,
sz
)))
out_of_memory
(
"alloc_xbuf"
);
xb
->
size
=
sz
;
xb
->
len
=
xb
->
pos
=
0
;
}
static
inline
void
realloc_xbuf
(
xbuf
*
xb
,
size_t
sz
)
{
char
*
bf
=
realloc_array
(
xb
->
buf
,
char
,
sz
);
if
(
!
bf
)
out_of_memory
(
"realloc_xbuf"
);
xb
->
buf
=
bf
;
xb
->
size
=
sz
;
}
static
inline
int
to_wire_mode
(
mode_t
mode
)
{
#ifdef SUPPORT_LINKS
#if _S_IFLNK != 0120000
if
(
S_ISLNK
(
mode
))
return
(
mode
&
~
(
_S_IFMT
))
|
0120000
;
#endif
#endif
return
mode
;
}
static
inline
mode_t
from_wire_mode
(
int
mode
)
{
#if _S_IFLNK != 0120000
if
((
mode
&
(
_S_IFMT
))
==
0120000
)
return
(
mode
&
~
(
_S_IFMT
))
|
_S_IFLNK
;
#endif
return
mode
;
}
static
inline
int
isDigit
(
const
char
*
ptr
)
{
return
isdigit
(
*
(
unsigned
char
*
)
ptr
);
}
static
inline
int
isPrint
(
const
char
*
ptr
)
{
return
isprint
(
*
(
unsigned
char
*
)
ptr
);
}
static
inline
int
isSpace
(
const
char
*
ptr
)
{
return
isspace
(
*
(
unsigned
char
*
)
ptr
);
}
static
inline
int
isLower
(
const
char
*
ptr
)
{
return
islower
(
*
(
unsigned
char
*
)
ptr
);
}
static
inline
int
isUpper
(
const
char
*
ptr
)
{
return
isupper
(
*
(
unsigned
char
*
)
ptr
);
}
static
inline
int
toLower
(
const
char
*
ptr
)
{
return
tolower
(
*
(
unsigned
char
*
)
ptr
);
}
static
inline
int
toUpper
(
const
char
*
ptr
)
{
return
toupper
(
*
(
unsigned
char
*
)
ptr
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment