static void *user_thread(void *_d) { doc *d = _d; d->u.s = USER_EDIT; while (1) { switch (d->u.s) { case USER_EDIT: lock(d); d->c.t = SUB_CURSOR; /* at end of line or in front of a BAR we go "default", not "i mode" * we also set vertical_item to some out of bound value */ if (d->c.item == d->l[d->c.line].size || (d->l[d->c.line].i[d->c.item].size == 1 && d->l[d->c.line].i[d->c.item].i[0].t == BAR)) { d->c.vertical_item = d->c.item == d->l[d->c.line].size ? 0 : d->l[d->c.line].i[d->c.item].size; unlock(d); /* replot done in user_default */ user_default(d); } else { unlock(d); /* replot done in user_i_mode */ user_i_mode(d); } break; case USER_APPEND: lock(d); d->c.t = FULL_CURSOR; /* this one not necessary I think */ d->c.vertical_item = 0; unlock(d); /* replot done in user_default */ user_default(d); break; } } return 0; }
void login_diffuser() { int diff_choice; printf("### Subuntu Login Menu ###\n"); printf("### 1. Steven Zaluk ###\n"); printf("### 2. Default User ###\n"); printf("### 3. Not Listed? ###\n"); printf("Please choose the profile you want: "); scanf("%d", &diff_choice); if(diff_choice == 1) { user_stevezaluk(); } else if(diff_choice == 2) { user_default(); } else if(diff_choice == 3) { not_listed(); } }