Пример #1
0
interp_list *do_terminate(interp_list *current,interp_list *previous) {

	/* Delete the current node from the list of interpretations */

	current = delete_old(current,previous);

	/* Keep any necessary statistics for the -v option */

	if (verbose) {
		terminated_spines += 1;
	}
	return current;
}
Пример #2
0
interp_list *do_join(interp_list *current) {

	interp_list *pointer;	
	char first_interp[NAME_LENGTH];

	pointer = current->next_interp;

	/* The next node must exist and contain a join spine indicator */

	if (pointer == NULL) {
		print_syntax_error(ERROR20);
		current->indicator = '*';
	} else if (pointer->indicator != 'v') {
		print_syntax_error(ERROR21);
		current->indicator = '*';

	/* If it does, join the two spines */

	} else {
		current->indicator = '*';

		/* Keep any necessary statistics for the -v option */

		if (verbose) {
			joined_spines += 1;
		}

		/* Continue to join spines until the end of the list is */
		/* reached or there are no more join path indicators	*/

		while (pointer != NULL && pointer->indicator == 'v') {

			/* They must be compatable spines to join them */

			if (strcmp(current->name,pointer->name) != 0) {
				print_syntax_error(ERROR22);
			}

			/* Delete the next spine */

			pointer = delete_old(pointer,current);
			pointer = pointer->next_interp;
			if (verbose) {
				joined_spines += 1;
			}
		}
	}
	return current;
}
	int
main (void)
{
	mongo_sync_connection *conn;

	conn = mongo_sync_connect ("localhost", 27017, FALSE);
	if (!conn)
	{
		fprintf (stderr, "Connection failed: %s\n", strerror (errno));
		return 1;
	}

	delete_old (conn);
	do_inserts (conn);
//	create_index (conn);
	do_query (conn);

	mongo_sync_disconnect (conn);

	return 0;
}