void list_extensions () { disp_list ("Final Cartridge 3 Basic Extension keywords for", final_cart_3, "%-15s", 4); rtc (stderr); disp_list ("Graphics52 Basic Extension keywords for", graphics_52, "%-15s", 4); rtc (stderr); disp_list ("6510+ Assembler Extension keywords for", asm6510plus, "%-15s", 4); }
void disp_nwk(unsigned char key) { unsigned int i, pos, empty; int nodepos; struct NodeCfg ncfg; static char nodelist[5][32]; static char * nodes[5] = {&nodelist[0][0], &nodelist[1][0],&nodelist[2][0], &nodelist[3][0], &nodelist[4][0]}; if(key == MNU_CLR_ALL) OLED_cls(); display_label(1); pos = cnodeDispCfg.upperNode2Disp; // OLED_puts(0, 18, 0xff, font6x9, "Node list"); for(i = 0, empty = 1; i < 5; i++) { if(pos != -1) { empty = 0; if((nodepos = strgFindNode(getNextChildExtAddress(&pos), &ncfg)) >= 0) { if((nodepos = strgGetNodeName(nodepos, nodes[i], 32)) < 0) strcpy(nodes[i], FSTR_MNU_CONFIG_ERR); } else strcpy(nodes[i], FSTR_MNU_NODE_NOTCONF); } else nodes[i][0] = 0; } if(empty) strcpy(nodes[0], FSTR_MNU_NONE); disp_list(nodes, 5, -1, 1); }
int main(int argc, char *argv[]) { struct node *list; int i; /* 4 <-> 3 <-> 2 <-> 1 <-> 0 */ for (i = 0; i < 5; i++) add_as_head(&list, i); /* 4 <-> 3 <-> 2 <-> 1 <-> 0 <-> 99 */ add_as_tail(&list, 99); /* 4 <-> 3 <-> 2 <-> 1 <-> 0 */ delete_node_by_value(&list, 99); /* 3 <-> 2 <-> 1 <-> 0 */ delete_head(&list); /* 3 <-> 1 <-> 0 */ delete_node(list->next); /* 3 <-> 1 */ delete_tail(&list); disp_list(list); free_list(&list); return EXIT_SUCCESS; }
void disp_msgs(unsigned char key) { if((key == MNU_CLR_ALL) || (key == MNU_UPDATE)) { if(key == MNU_CLR_ALL) OLED_cls(); display_label(1); disp_list(NULL, 0, -1, 1); } // OLED_puts(0, 18, 0xff, font6x9, "Messages"); }
/*==================================================== * disp_pvalue -- Display details of specified pvalue * Drilldown in variable debugger * This is primarily to display contents of container values * val: [IN] value to display *==================================================*/ static void disp_pvalue (PVALUE val) { switch (which_pvalue_type(val)) { case PGNODE: { NODE node = pvalue_to_node(val); char buffer[256] = ""; size_t len = sizeof(buffer); STRING str = buffer; if (ntag(node)) { llstrappf(str, len, uu8, "%s: ", ntag(node)); } if (nval(node)) { llstrapps(str, len, uu8, nval(node)); } msg_info(str); } return; case PINDI: case PFAM: case PSOUR: case PEVEN: case POTHR: { RECORD rec = pvalue_to_record(val); NODE node = nztop(rec); size_t len = 128; STRING txt = generic_to_list_string(node, NULL, len, " ", NULL, TRUE); msg_info(txt); } return; case PLIST: { LIST list = pvalue_to_list(val); disp_list(list); } return; case PTABLE: { TABLE tab = pvalue_to_table(val); disp_table(tab); } return; case PSET: { INDISEQ seq = pvalue_to_seq(val); disp_seq(seq); } return; } }
int read_board(int fd) { char *line; int nb_match; t_list *lst; while ((fd == 0 && get_next_line(fd, &line) > 0 && ft_strcmp(line, "")) || (fd > 0 && get_next_line(fd, &line) > 0)) { if ((nb_match = verif_board(line))) add_link(nb_match); else return (0); free(line); } lst = singleton(); if (line && !lst->next) return (print_error()); if (fd) close(fd); disp_list(0); game(); return (0); }
void disp_zones_cfg(unsigned char key) { unsigned int i; unsigned int selection; int err; static char namelist[5][32]; static char * names[5] = {&namelist[0][0], &namelist[1][0],&namelist[2][0], &namelist[3][0], &namelist[4][0]}; if((key == MNU_CLR_ALL) || (key == MNU_UPDATE)) { if(key == MNU_CLR_ALL) OLED_cls(); if(!zdispcfg.showCurSelection) { display_label(1); for(i = 0; i < 5; i++) { //if(strgGetZoneName(zdispcfg.upperZone2Disp + i, &namelist[i][0], 32) <= 0) if((err = strgGetZoneName(zdispcfg.upperZone2Disp + i, &namelist[i][0], 32)) < 0) { //format_str(&namelist[i][0], 32, "MMC err: %d", (err == -6) ? i : err); //i++; break; } strcat(&namelist[i][0], zoneState2Str(zdispcfg.upperZone2Disp + i)); } selection = zdispcfg.curSelIdx - zdispcfg.upperZone2Disp; /* if(!i) { strcpy(&namelist[0][0], "<none>"); i++; } disp_list(names, i, zdispcfg.curSelIdx - zdispcfg.upperZone2Disp); */ } else { struct ZoneCfg zcfg; int name_len; if(strgGetZone(zdispcfg.curSelIdx, &zcfg) != STRG_SUCCESS) return; if(strgGetZoneName(zdispcfg.curSelIdx, &namelist[0][0], 32 * 5) < 0) return; if(key == MNU_UPDATE) OLED_clrLine(0, 9); OLED_puts(0, 0, 0xff, font6x9, FSTR_MNU_ZONE); OLED_puts(6 * sizeof(FSTR_MNU_ZONE), 0, 0xff, font6x9, &namelist[0][0]); OLED_puts(6 * (sizeof(FSTR_MNU_ZONE) + strlen(&namelist[0][0])), 0, 0xff, font6x9, zoneState2Str(zdispcfg.curSelIdx)); name_len = 0; for(i = 0; i < zdispcfg.displayedNodesNum; i++) { if((name_len = strgGetNodeName(zdispcfg.displayedNodes[i], &namelist[i][0], 32)) < 0) break; //strcat(&namelist[i][0], isNodeConnected(zdispcfg.displayedNodes[i]) ? " ("FSTR_MNU_CONNECTED")" : " ("FSTR_MNU_NOTCONNECTED")"); //name_len = strlen(&namelist[i][0]) * 6; name_len *= 6; if(name_len > zdispcfg.mostLeftDispPos) zdispcfg.mostLeftDispPos = name_len; } //selection = -1; selection = zdispcfg.selectedNodeIdx; if((selection >= 0) && (selection < 5)) strcat(&namelist[selection][0], isNodeConnected(zdispcfg.displayedNodes[selection]) ? "("FSTR_MNU_CONNECTED")" : "("FSTR_MNU_NOTCONNECTED")"); /* if(isNodeConnected(zdispcfg.displayedNodes[zdispcfg.selectedNodeIdx])) OLED_puts(zdispcfg.mostLeftDispPos + 6 * 9, 9, 0xff, font6x9, FSTR_MNU_CONNECTED); else OLED_puts(zdispcfg.mostLeftDispPos + 6 * 9, 9, 0xff, font6x9, FSTR_MNU_NOTCONNECTED); */ } if(!i) { strcpy(&namelist[i][0], FSTR_MNU_NONE); i++; } disp_list(names, i, selection, 1); } }
void on_msg_add(void) { if(active.menu != &net_msg) return; disp_list(NULL, 5, -1, 1); }
void list_special () { char *desc = "These are the valid special substitions for"; disp_list (desc, special, "%-20s", 3); }
void list_keywords () { char *desc = "These are the valid Commodore Basic keywords for"; disp_list (desc, keywords, "%-15s", 4); }