static struct sesslist sesslist;
static void mac_config(int midsession){    Session *s;    WinInfo *wi;    static struct sesslist sesslist;    Str255 mactitle;    char *str;    if (midsession) {        s = mac_windowsession(FrontWindow());    } else {          s = snew(Session);        memset(s, 0, sizeof(*s));        do_defaults(NULL, &s->cfg);        s->hasfile = FALSE;	s->session_closed = FALSE;    }    /* Copy the configuration somewhere else in case this is a *     * reconfiguration and the user cancels the operation      */    s->temp_cfg = s->cfg;    if (HAVE_COLOR_QD())	s->settings_window = GetNewCWindow(wSettings, NULL, (WindowPtr)-1);    else	s->settings_window = GetNewWindow(wSettings, NULL, (WindowPtr)-1);    get_sesslist(&sesslist, TRUE);    s->ctrlbox = ctrl_new_box();    setup_config_box(s->ctrlbox, &sesslist, midsession, 0, 0);    s->settings_ctrls.data = &s->temp_cfg;    if (midsession)        s->settings_ctrls.end = &mac_enddlg_reconfig;    else        s->settings_ctrls.end = &mac_enddlg_config;    macctrl_layoutbox(s->ctrlbox, s->settings_window, &s->settings_ctrls);    wi = snew(WinInfo);    memset(wi, 0, sizeof(*wi));    wi->s = s;    wi->mcs = &s->settings_ctrls;    wi->wtype = wSettings;    wi->update = &macctrl_update;    wi->click = &macctrl_click;    wi->key = &macctrl_key;    wi->activate = &macctrl_activate;    wi->adjustmenus = &macctrl_adjustmenus;    wi->close = &mac_closedlg;    SetWRefCon(s->settings_window, (long)wi);    if (midsession)        str = dupprintf("%s Reconfiguration", appname);    else        str = dupprintf("%s Configuration", appname);    c2pstrcpy(mactitle, str);    sfree(str);    SetWTitle(s->settings_window, mactitle);    ShowWindow(s->settings_window);}