示例#1
0
void CB_HardReInit()
{
	M.BroadcastMessage(DM_CBDESTROY, 0, 0);
	{
		mir_cslock lck(ToolBarCS);
		wipeList(LButtonsList);
		wipeList(RButtonsList);
	}
	LastCID = 4000;
	dwSepCount = 0;

	CB_InitDefaultButtons();
	NotifyEventHooks(hHookToolBarLoadedEvt, 0, 0);
}
示例#2
0
文件: smlist.c 项目: brnrc/ion-dtn
int	Sm_list_clear(const char *fileName, int lineNbr, PsmPartition partition,
		PsmAddress list, SmListDeleteFn deleteFn, void *arg)
{
	CHKERR(partition);
	CHKERR(list);
	return wipeList(fileName, lineNbr, partition, list, deleteFn, arg, 0);
}
示例#3
0
int main(void) {

	setvbuf(stdout, NULL, _IONBF, 0);

	Header head;

	head.head = NULL;
	head.tail = NULL;
	head.nodeCount = 0;

	int menu = 0, list = 0;

	do {

		do {
			system("cls");
			printf("\n Manipular qual lista.\n");
			printf("1 - Encadeada.\n");
			printf("2 - Sequencial.\n");

			scanf("%d", &list);

			system("cls");
		} while (list != 1 && list != 2);

		system("cls");
		printf("\n Digite o numero da opcao desejada.\n");
		printf("1 - Inserir elemento no final da lista.\n");
		printf("2 - Inserir elemento no inicio da lista.\n");
		printf("3 - Remover elemento a partir de um valor.\n");
		printf("4 - Imprimir a lista.\n");
		printf("5 - Inserir na posicao N.\n");
		printf("6 - Remover ultimo da lista.\n");
		printf("7 - Remover primeiro da lista.\n");
		printf("8 - Remover elemento na posicao N.\n");
		printf("9 - Carregar lista do arquivo.\n");
		printf("10 - Salvar lista atual em arquivo.\n");
		printf("11 - Inserction.\n");
		printf("12 - Selection.\n");
		printf("13 - Bubble.\n");
		printf("14 - Shell.\n");
		printf("15 - Quick.\n");
		printf("16 - Merge.\n");
		printf("17 - Busca Binaria.\n");
		printf("18 - Busca Seq.\n");

		printf("20 - Sair.\n");

		scanf("%d", &menu);

		system("cls");

		switch (menu) {
		case 1:
			if (list == 1) {
				insertNodeAtTheEnd(&head, getValue(), 1);
				reference(&head);
			} else {
				insertSeqAtTheEnd(getValue(), 1);
			}
			break;
		case 2:
			if (list == 1) {
				insertNodeAtStart(&head, getValue(), 1);
				reference(&head);
			} else {
				insertSeqAtStart(getValue(), 1);
			}
			break;
		case 3:
			if (list == 1) {
				deleteNodeByValue(&head);
				reference(&head);
			} else {
				deleteSeqByValue();
			}
			break;
		case 4:
			if (list == 1) {
				printList(&head);
			} else {
				printSeq();
			}
			break;
		case 5:
			if (list == 1) {
				insertAtN(&head, getValue(), getPosIns(&head));
				reference(&head);
			} else {
				insertSeqAtN(getValue(), getPosSeqIns());
			}
			break;
		case 6:
			if (list == 1) {
				deleteLastNode(&head, 1);
				reference(&head);
			} else {
				deleteLastSeq(1);
			}
			break;
		case 7:
			if (list == 1) {
				deleteFirstNode(&head, 1);
				reference(&head);
			} else {
				deleteFirstSeq(1);
			}
			break;
		case 8:
			if (list == 1) {
				deleteNodeAtN(&head, getPosDel(&head));
				reference(&head);
			} else {
				deleteSeqAtN(getPosSeqDel(), 1);
			}
			break;
		case 9:
			listOptions(&head, list);
			break;
		case 10:
			if (list == 1) {
				writeLinkedList(&head);
			} else {
				writeSequentialList();
			}
			break;
		case 11:
			if (list == 1) {
				linkedInserctionSort(&head);
			} else {
				inserctionSort();
			}
			break;
		case 12:
			if (list == 1) {
				linkedSelectionSort(&head);
			} else {
				selectionSort();
			}
			;
			break;
		case 13:
			if (list == 1) {
				linkedBubbleSort(&head);
			} else {
				bubbleSort();
			}
			break;
		case 14:
			if (list == 1) {
				linkedShellSort(&head);
			} else {
				shellSort();
			}
			break;
		case 15:
			if (list == 1) {
				linkedCallQuickSort(&head);
			} else {
				callQuickSort();
			}
			break;
		case 16:
			if (list == 1) {
				linkedCallMergeSort(head.nodeCount);
			} else {
				callMergeSort();
			}
			break;
		case 17:
			if (list == 1) {
				linkedCallBynarySearch(&head);
			} else {
				callBynarySearch();
			}
			break;
		case 18:
			if (list == 1) {
				searchNodeByValue(&head);
			} else {
				searchByValue();
			}
			break;
		}

	} while (menu != 20);

	wipeList(&head);

	return EXIT_SUCCESS;
}