+pascal OSErr mac_aevt_oapp(const AppleEvent *req, AppleEvent *reply,
+ long refcon)
+{
+ DescType type;
+ Size size;
+
+ if (AEGetAttributePtr(req, keyMissedKeywordAttr, typeWildCard,
+ &type, NULL, 0, &size) == noErr)
+ return errAEParamMissed;
+
+ /* XXX we should do something here. */
+ return noErr;
+}
+
+pascal OSErr mac_aevt_odoc(const AppleEvent *req, AppleEvent *reply,
+ long refcon)
+{
+ DescType type;
+ AEKeyword keywd;
+ Size size;
+ AEDescList docs = { typeNull, NULL };
+ OSErr err;
+ long ndocs, i;
+ FSSpec fss;
+
+ err = AEGetParamDesc(req, keyDirectObject, typeAEList, &docs);
+ if (err != noErr) goto out;
+
+ if (AEGetAttributePtr(req, keyMissedKeywordAttr, typeWildCard,
+ &type, NULL, 0, &size) == noErr) {
+ err = errAEParamMissed;
+ goto out;
+ }
+
+ err = AECountItems(&docs, &ndocs);
+ if (err != noErr) goto out;
+
+ for (i = 0; i < ndocs; i++) {
+ err = AEGetNthPtr(&docs, i, typeFSS, &keywd, &type, &fss, sizeof(fss),
+ &size);
+ if (err != noErr) goto out;
+ err = mac_opensessionfrom(&fss);
+ if (err != noErr) goto out;
+ }
+
+ out:
+ AEDisposeDesc(&docs);
+ return err;
+}
+
+pascal OSErr mac_aevt_pdoc(const AppleEvent *req, AppleEvent *reply,
+ long refcon)
+{
+ DescType type;
+ Size size;
+
+ if (AEGetAttributePtr(req, keyMissedKeywordAttr, typeWildCard,
+ &type, NULL, 0, &size) == noErr)
+ return errAEParamMissed;
+
+ /* We can't meaningfully do anything here. */
+ return errAEEventNotHandled;
+}
+