programming:python:pyradix_search_all_patch
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
programming:python:pyradix_search_all_patch [2008/07/05 21:28] – crustymonkey | programming:python:pyradix_search_all_patch [2008/07/05 22:10] (current) – crustymonkey | ||
---|---|---|---|
Line 13: | Line 13: | ||
Usage: | Usage: | ||
< | < | ||
- | Radix.search_all_containing(< | + | Radix.search_all_containing(< |
</ | </ | ||
<code python> | <code python> | ||
Line 61: | Line 61: | ||
Here is the code for the patch, followed by a link to the file. | Here is the code for the patch, followed by a link to the file. | ||
< | < | ||
- | --- radix_python.c | + | --- radix_python.c |
- | +++ radix_python.c.new | + | +++ radix_python.c.new |
@@ -453,6 +453,52 @@ | @@ -453,6 +453,52 @@ | ||
return (PyObject *)node_obj; | return (PyObject *)node_obj; | ||
Line 89: | Line 89: | ||
+ long prefixlen = -1; | + long prefixlen = -1; | ||
+ int packlen = -1; | + int packlen = -1; | ||
- | + | + | + if ((node_list = PyList_New(0)) == NULL) |
+ | + | ||
+ | + | ||
- | + if (!PyArg_ParseTupleAndKeywords(args, | + | + if (!PyArg_ParseTupleAndKeywords(args, |
+ & | + & | ||
+ | + | ||
Line 103: | Line 104: | ||
+ } | + } | ||
+ | + | ||
- | + | + | + |
- | + | + | |
+ while ((parent = node-> | + while ((parent = node-> | ||
- | + node_obj = parent-> | + | + if (parent-> |
- | + | + | + PyList_Append(node_list , (PyObject *)parent-> |
+ node = parent; | + node = parent; | ||
+ } | + } |
programming/python/pyradix_search_all_patch.txt · Last modified: 2008/07/05 22:10 by crustymonkey