-static void inbuf_putc(Session *s, int c) {
- char ch = c;
-
- from_backend(s->term, 0, &ch, 1);
-}
-
-static void inbuf_putstr(Session *s, const char *c) {
-
- from_backend(s->term, 0, (char *)c, strlen(c));
-}
-
-static void display_resource(Session *s, unsigned long type, short id) {
- Handle h;
- int len;
- char *t;
-
- h = GetResource(type, id);
- if (h == NULL)
- fatalbox("Can't get test resource");
- len = GetResourceSizeOnDisk(h);
- DetachResource(h);
- HNoPurge(h);
- HLock(h);
- t = *h;
- from_backend(s->term, 0, t, len);
- term_out(s->term);
- DisposeHandle(h);
-}
-
-void mac_opensession(void) {
- Session *s;
- StandardFileReply sfr;
- static const OSType sftypes[] = { 'Sess', 0, 0, 0 };
- void *sesshandle;
-
- s = smalloc(sizeof(*s));
- memset(s, 0, sizeof(*s));
-
- StandardGetFile(NULL, 1, sftypes, &sfr);
- if (!sfr.sfGood) goto fail;
-
- sesshandle = open_settings_r_fsp(&sfr.sfFile);
- if (sesshandle == NULL) goto fail;
- load_open_settings(sesshandle, TRUE, &s->cfg);
- close_settings_r(sesshandle);
- s->back = &loop_backend;
- mac_startsession(s);
- return;
-
- fail:
- sfree(s);
- return;
-}
-