Lines Matching defs:ctypes
3 import ctypes
6 ctypes.c_wchar
11 dll = ctypes.CDLL(_ctypes_test.__file__)
13 wcslen.argtypes = [ctypes.c_wchar_p]
18 self.prev_conv_mode = ctypes.set_conversion_mode("ascii", "strict")
21 ctypes.set_conversion_mode(*self.prev_conv_mode)
24 ctypes.set_conversion_mode("ascii", "strict")
30 self.assertRaises(ctypes.ArgumentError, wcslen, "ab?")
33 ctypes.set_conversion_mode("ascii", "replace")
40 ctypes.set_conversion_mode("ascii", "ignore")
48 ctypes.set_conversion_mode("latin-1", "strict")
55 ctypes.set_conversion_mode("ascii", "strict")
56 buf = ctypes.create_unicode_buffer("abc")
59 ctypes.set_conversion_mode("ascii", "replace")
60 buf = ctypes.create_unicode_buffer("ab???")
67 ctypes.set_conversion_mode("ascii", "ignore")
68 buf = ctypes.create_unicode_buffer("ab???")
77 func = ctypes.CDLL(_ctypes_test.__file__)._testfunc_p_p
81 self.prev_conv_mode = ctypes.set_conversion_mode("ascii", "strict")
82 func.argtypes = [ctypes.c_char_p]
83 func.restype = ctypes.c_char_p
86 ctypes.set_conversion_mode(*self.prev_conv_mode)
88 func.restype = ctypes.c_int
91 ctypes.set_conversion_mode("ascii", "strict")
94 self.assertRaises(ctypes.ArgumentError, func, u"ab?")
97 ctypes.set_conversion_mode("ascii", "ignore")
103 ctypes.set_conversion_mode("ascii", "replace")
109 ctypes.set_conversion_mode("ascii", "strict")
110 buf = ctypes.create_string_buffer(u"abc")
113 ctypes.set_conversion_mode("ascii", "replace")
114 buf = ctypes.create_string_buffer(u"ab???")
121 ctypes.set_conversion_mode("ascii", "ignore")
122 buf = ctypes.create_string_buffer(u"ab???")