Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
d696da95
Commit
d696da95
authored
Jan 28, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add a few explicit casts to avoid gcc compilation warnings
parent
cbe8ade1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
gevent/evdns.pxi
gevent/evdns.pxi
+8
-6
No files found.
gevent/evdns.pxi
View file @
d696da95
...
...
@@ -2,16 +2,18 @@ __all__ += ['dns_init', 'dns_shutdown', 'dns_err_to_string',
'dns_resolve_ipv4'
,
'dns_resolve_ipv6'
,
'dns_resolve_reverse'
,
'dns_resolve_reverse_ipv6'
]
cdef
extern
from
*
:
ctypedef
char
*
const_char_ptr
"const char*"
cdef
extern
from
"libevent.h"
:
ctypedef
void
(
*
evdns_handler
)(
int
result
,
char
t
,
int
count
,
int
ttl
,
void
*
addrs
,
void
*
arg
)
int
evdns_init
()
c
har
*
evdns_err_to_string
(
int
err
)
c
onst_char_ptr
evdns_err_to_string
(
int
err
)
int
evdns_resolve_ipv4
(
char
*
name
,
int
flags
,
evdns_handler
callback
,
void
*
arg
)
int
evdns_resolve_ipv6
(
char
*
name
,
int
flags
,
evdns_handler
callback
,
void
*
arg
)
int
evdns_resolve_reverse
(
char
*
ip
,
int
flags
,
evdns_handler
callback
,
void
*
arg
)
int
evdns_resolve_reverse_ipv6
(
char
*
ip
,
int
flags
,
evdns_handler
callback
,
void
*
arg
)
int
evdns_resolve_reverse
(
void
*
ip
,
int
flags
,
evdns_handler
callback
,
void
*
arg
)
int
evdns_resolve_reverse_ipv6
(
void
*
ip
,
int
flags
,
evdns_handler
callback
,
void
*
arg
)
void
evdns_shutdown
(
int
fail_requests
)
# Result codes
...
...
@@ -46,7 +48,7 @@ def dns_shutdown(int fail_requests=0):
def
dns_err_to_string
(
int
err
):
cdef
c
har
*
result
=
evdns_err_to_string
(
err
)
cdef
c
onst_char_ptr
result
=
evdns_err_to_string
(
err
)
if
result
:
return
result
...
...
@@ -111,7 +113,7 @@ def dns_resolve_reverse(char* packed_ip, int flags, object callback):
- *flags* -- either 0 or DNS_QUERY_NO_SEARCH
- *callback* -- callback with ``(result, type, ttl, addrs)`` prototype
"""
cdef
int
result
=
evdns_resolve_reverse
(
packed_ip
,
flags
,
__evdns_callback
,
<
void
*>
callback
)
cdef
int
result
=
evdns_resolve_reverse
(
<
void
*>
packed_ip
,
flags
,
__evdns_callback
,
<
void
*>
callback
)
if
result
:
raise
IOError
(
'evdns_resolve_reverse(%r, %r) returned %s'
%
(
packed_ip
,
flags
,
result
,
))
Py_INCREF
(
callback
)
...
...
@@ -124,7 +126,7 @@ def dns_resolve_reverse_ipv6(char* packed_ip, int flags, object callback):
- *flags* -- either 0 or DNS_QUERY_NO_SEARCH
- *callback* -- callback with ``(result, type, ttl, addrs)`` prototype
"""
cdef
int
result
=
evdns_resolve_reverse_ipv6
(
packed_ip
,
flags
,
__evdns_callback
,
<
void
*>
callback
)
cdef
int
result
=
evdns_resolve_reverse_ipv6
(
<
void
*>
packed_ip
,
flags
,
__evdns_callback
,
<
void
*>
callback
)
if
result
:
raise
IOError
(
'evdns_resolve_reverse_ipv6(%r, %r) returned %s'
%
(
packed_ip
,
flags
,
result
,
))
Py_INCREF
(
callback
)
...
...
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