/* * ip_resize -- * Reset the options for a resize event. */ static int ip_resize(SCR *sp, u_int32_t lines, u_int32_t columns) { GS *gp; int rval; /* * XXX * The IP screen has to know the lines and columns before anything * else happens. So, we may not have a valid SCR pointer, and we * have to deal with that. */ if (sp == NULL) { gp = __global_list; OG_VAL(gp, GO_LINES) = OG_D_VAL(gp, GO_LINES) = lines; OG_VAL(gp, GO_COLUMNS) = OG_D_VAL(gp, GO_COLUMNS) = columns; return (0); } rval = api_opts_set(sp, L("lines"), NULL, lines, 0); if (api_opts_set(sp, L("columns"), NULL, columns, 0)) rval = 1; return (rval); }
/* * v_editopt -- * Set an option value. */ static int v_editopt(SCR *sp, VICMD *vp) { int rval; const char *np; size_t nlen; char *p2; INT2CHAR(sp, vp->ev.e_str2, STRLEN(vp->ev.e_str2)+1, np, nlen); p2 = strdup(np); rval = api_opts_set(sp, vp->ev.e_str1, p2, vp->ev.e_val1, vp->ev.e_val1); if (sp->gp->scr_reply != NULL) (void)sp->gp->scr_reply(sp, rval, NULL); free(p2); return (rval); }