Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2923559
escape.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
659 B
Referenced Files
None
Subscribers
None
escape.h
View Options
#ifndef STRINGS_H
#define STRINGS_H
#include
<stdbool.h>
#include
<stddef.h>
#include
<stdint.h>
static
inline
uint8_t
unhex
(
uint8_t
c
)
{
return
(
c
&
0xF
)
+
(
c
>>
6
)
*
9
;
}
static
inline
bool
is_xdigit
(
int
c
)
{
return
(
unsigned
)
c
<
256
&&
(
(
c
>=
'0'
&&
c
<=
'9'
)
||
(
c
>=
'a'
&&
c
<=
'f'
)
||
(
c
>=
'A'
&&
c
<=
'F'
)
);
}
static
inline
bool
is_octal_escape
(
const
uint8_t
*
in
,
size_t
pos
)
{
uint8_t
c
=
in
[
pos
+
1
];
return
c
>=
'0'
&&
c
<=
'7'
&&
!
(
c
==
'0'
&&
!
(
in
[
pos
+
2
]
>=
'0'
&&
in
[
pos
+
2
]
<=
'7'
));
}
size_t
decode_escape
(
const
uint8_t
*
in
,
size_t
pos
,
size_t
end
,
uint8_t
*
out
,
size_t
*
out_pos
,
uint8_t
quote
);
#endif
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Fri, Mar 27, 5:57 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
512098
Default Alt Text
escape.h (659 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment