Exemplo n.º 1
0
/* add a new prefix description */
void prefix_add (char *pfxstr)
{
	gchar *loc;
	gint last_index = dxcc_count() - 1;
	dxcc_data *last_dx = dxcc_by_index(last_index);
	prefix_data *new_prefix = g_new (prefix_data, 1);

	loc = strchr(pfxstr, '[');
	if (loc != NULL) {
	    new_prefix -> itu = atoi(loc + 1);
	    *loc = '\0';
	}
	else
	    new_prefix -> itu = last_dx -> itu;

	loc = strchr(pfxstr, '(');
	if (loc != NULL) {
	    new_prefix -> cq = atoi(loc + 1);
	    *loc = '\0';
	}
	else
	    new_prefix -> cq = last_dx -> cq;

	new_prefix -> pfx = g_strdup(pfxstr);
	new_prefix -> dxcc_index = last_index;

	g_ptr_array_add (prefix, new_prefix);
}
Exemplo n.º 2
0
int show_mults(void)
{
    extern int use_rxvt;
    extern int countries[MAX_DATALINES];
    extern int bandinx;
    extern int cqww;

    int i, j, k, l, bandmask = 0;
    static char prefix[5];
    static char zonecmp[3] = "";
    int ch;

    int iMax = dxcc_count();

    if (cqww == 1) {

	mvprintw(12, 29, "E,A,F,N,S,O");

	refreshp();

	ch = getchar();

	while (ch != '\015') {

	    if (ch == 27)
		break;

	    zonecmp[0] = '\0';
	    if (ch == 'E' || ch == 'e')
		strcat(zonecmp, "EU");
	    else if (ch == 'A' || ch == 'a')
		strcat(zonecmp, "AS");
	    else if (ch == 'F' || ch == 'f')
		strcat(zonecmp, "AF");
	    else if (ch == 'N' || ch == 'n')
		strcat(zonecmp, "NA");
	    else if (ch == 'S' || ch == 's')
		strcat(zonecmp, "SA");
	    else if (ch == 'O' || ch == 'o')
		strcat(zonecmp, "OC");
	    else
		strcat(zonecmp, "EU");

	    attron(COLOR_PAIR(C_LOG) | A_STANDOUT);

	    for (l = 1; l < 6; l++)
		mvprintw(l, 0,
			 "                                                                                ");

	    i = 0;

	    for (k = 1; k < 6; k++) {

		for (j = 0; j <= 19; j++) {

		    while ((i < iMax) && 
			((strncmp(dxcc_by_index(i) -> continent, zonecmp, 2)) 
				!= 0)) {
			i++;
		    }
		    if (i == iMax)
		  	 break;

		    switch (bandinx) {
		    case BANDINDEX_160:{
			    bandmask = BAND160;
			    break;
			}
		    case BANDINDEX_80:{
			    bandmask = BAND80;
			    break;
			}
		    case BANDINDEX_40:{
			    bandmask = BAND40;
			    break;
			}
		    case BANDINDEX_20:{
			    bandmask = BAND20;
			    break;
			}
		    case BANDINDEX_15:{
			    bandmask = BAND15;
			    break;
			}
		    case BANDINDEX_10:{
			    bandmask = BAND10;
			    break;
			}
		    }

		    if ((countries[i] & bandmask) == 0) {
			prefix[0] = '\0';
			strncat(prefix, dxcc_by_index(i)->pfx, 3);

			strncat(prefix, "     ", 4 - strlen(prefix));

			if (use_rxvt == 0)
			    attron(COLOR_PAIR(C_INPUT) | A_BOLD);
			else
			    attron(COLOR_PAIR(C_INPUT));

			mvprintw(k, j * 4, prefix);
			refreshp();
			i++;

		    } else {

			mvprintw(k, j * 4, "    ");
			refreshp();
			i++;

		    }

		}
		if (i == iMax)
		    break;

	    }

	    ch = getchar();

	    attron(COLOR_PAIR(C_LOG) | A_STANDOUT);


	}			// end while

	for (l = 1; l < 6; l++)
	    mvprintw(l, 0,
		     "                                                                                ");
    } else

	multiplierinfo();

    return (0);
}