I think I found the answer to my own question.  Can anyone spot any
issues with the following solution? The application I'm writing will
be hitting these callbacks pretty heavily so I'm nervous about mucking
up the memory management and creating one of those bugs that passes
undetected through testing but nails you in production.

def my_callback(p_cstring):
    answer = 'foobar'

    address = VENDOR_malloc(len(answer)+1)

    cstring = c_char_p.from_address( address )

    cstring.value = answer
    p_cstring.contents = cstring
    return
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to