|
@@ -4794,6 +4794,26 @@ write_function_instance(ostream &out, FunctionRemap *remap,
|
|
|
clear_error = true;
|
|
clear_error = true;
|
|
|
only_pyobjects = false;
|
|
only_pyobjects = false;
|
|
|
|
|
|
|
|
|
|
+ } else if (TypeManager::is_vector_unsigned_char(type)) {
|
|
|
|
|
+ indent(out, indent_level) << "unsigned char *" << param_name << "_str = NULL;\n";
|
|
|
|
|
+ indent(out, indent_level) << "Py_ssize_t " << param_name << "_len;\n";
|
|
|
|
|
+
|
|
|
|
|
+ if (args_type == AT_single_arg) {
|
|
|
|
|
+ extra_param_check << " && PyBytes_AsStringAndSize(arg, (char **)&"
|
|
|
|
|
+ << param_name << "_str, &" << param_name << "_len) >= 0";
|
|
|
|
|
+ } else {
|
|
|
|
|
+ format_specifiers += "\" FMTCHAR_BYTES \"#";
|
|
|
|
|
+ parameter_list += ", &" + param_name + "_str, &" + param_name + "_len";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ pexpr_string = type->get_local_name(&parser);
|
|
|
|
|
+ pexpr_string += "(" + param_name + "_str, " + param_name + "_str + " + param_name + "_len" + ")";
|
|
|
|
|
+ expected_params += "bytes";
|
|
|
|
|
+
|
|
|
|
|
+ // Remember to clear the TypeError that any of the above methods raise.
|
|
|
|
|
+ clear_error = true;
|
|
|
|
|
+ only_pyobjects = false;
|
|
|
|
|
+
|
|
|
} else if (TypeManager::is_bool(type)) {
|
|
} else if (TypeManager::is_bool(type)) {
|
|
|
if (args_type == AT_single_arg) {
|
|
if (args_type == AT_single_arg) {
|
|
|
param_name = "arg";
|
|
param_name = "arg";
|
|
@@ -6072,7 +6092,8 @@ pack_return_value(ostream &out, int indent_level, FunctionRemap *remap,
|
|
|
TypeManager::is_char_pointer(type) ||
|
|
TypeManager::is_char_pointer(type) ||
|
|
|
TypeManager::is_wchar_pointer(type) ||
|
|
TypeManager::is_wchar_pointer(type) ||
|
|
|
TypeManager::is_pointer_to_PyObject(type) ||
|
|
TypeManager::is_pointer_to_PyObject(type) ||
|
|
|
- TypeManager::is_pointer_to_Py_buffer(type)) {
|
|
|
|
|
|
|
+ TypeManager::is_pointer_to_Py_buffer(type) ||
|
|
|
|
|
+ TypeManager::is_vector_unsigned_char(type)) {
|
|
|
// Most types are now handled by the many overloads of Dtool_WrapValue,
|
|
// Most types are now handled by the many overloads of Dtool_WrapValue,
|
|
|
// defined in py_panda.h.
|
|
// defined in py_panda.h.
|
|
|
indent(out, indent_level)
|
|
indent(out, indent_level)
|
|
@@ -6713,6 +6734,8 @@ is_cpp_type_legal(CPPType *in_ctype) {
|
|
|
return true;
|
|
return true;
|
|
|
} else if (TypeManager::is_basic_string_wchar(type)) {
|
|
} else if (TypeManager::is_basic_string_wchar(type)) {
|
|
|
return true;
|
|
return true;
|
|
|
|
|
+ } else if (TypeManager::is_vector_unsigned_char(type)) {
|
|
|
|
|
+ return true;
|
|
|
} else if (TypeManager::is_simple(type)) {
|
|
} else if (TypeManager::is_simple(type)) {
|
|
|
return true;
|
|
return true;
|
|
|
} else if (TypeManager::is_pointer_to_simple(type)) {
|
|
} else if (TypeManager::is_pointer_to_simple(type)) {
|