* src/haiku_select.cc (be_add_refs_data): New function.
* src/haikuselect.c (haiku_lisp_to_message): Handle `ref' type
correctly.
* src/haikuselect.h: Update prototypes.
return msg->AddData (name, type_code, buf, buf_size) != B_OK;
}
+
+int
+be_add_refs_data (void *message, const char *name,
+ const char *filename)
+{
+ BEntry entry (filename);
+ entry_ref ref;
+ BMessage *msg = (BMessage *) message;
+
+ if (entry.InitCheck () != B_OK)
+ return 1;
+
+ if (entry.GetRef (&ref) != B_OK)
+ return 1;
+
+ return msg->AddRef (name, &ref) != B_OK;
+}
switch (type_code)
{
case 'RREF':
- signal_error ("Cannot deserialize data type", type_sym);
+ CHECK_STRING (data);
+
+ if (be_add_refs_data (message, SSDATA (name), SSDATA (data)))
+ signal_error ("Invalid file name", data);
break;
case 'SHRT':
extern int be_add_message_data (void *message, const char *name,
int32 type_code, const void *buf,
ssize_t buf_size);
+ extern int be_add_refs_data (void *message, const char *name,
+ const char *filename);
#ifdef __cplusplus
};
#endif