std::string program_name()
{
	
	return "Round Gone V0.4" + Enter();
	
}
	std::string card_to_string()
	{
		
		return "[" + rank_to_string(card_rank) + "~" + color_to_string(card_color) + "]" + Enter();
		
	}
Exemplo n.º 3
0
/*
 * Edit signature file with a simple line editor.
 */
int editsignature(void)
{
    FILE    *fp;
    int	    i, x;
    char    *temp, *temp1;

    temp  = calloc(PATH_MAX, sizeof(char));
    temp1 = calloc(PATH_MAX, sizeof(char));
    snprintf(temp, PATH_MAX, "%s/%s/.signature", CFG.bbs_usersdir, exitinfo.Name);

    while (TRUE) {
	Enter(1);
	/* Functions available: */
	poutCR(CFG.HiliteF, CFG.HiliteB, (char *) Language(113));
	Enter(1);
	/* (L)ist, (R)eplace text, (E)dit line, (A)bort, (S)ave */
	pout(YELLOW, RED, (char *) Language(114));
	Enter(2);

	/* Select: */
  	pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(115));

	alarm_on();
	i = toupper(Readkey());
	Enter(1);

	if (i == Keystroke(114, 3)) {
	    /* Aborting... */
	    pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(116));
	    Syslog('+', "User aborted .signature editor");
	    free(temp);
	    free(temp1);
	    return TRUE;

	} else if (i == Keystroke(114, 2)) {
	    Enter(1);
	    /* Edit which line: */
	    snprintf(temp, 80, " %s", (char *) Language(118));
	    pout(CFG.HiliteF, CFG.HiliteB, temp);
	    colour(CFG.InputColourF, CFG.InputColourB);
	    GetstrC(temp, 3);

	    if ((strcmp(temp, "")) == 0)
		break;

	    i = atoi(temp);
	    if ((i < 1) || (i > MAXSIGLINES)) {
		Enter(1);
		/* Line does not exist. */
		poutCR(LIGHTRED, BLACK, (char *) Language(119));
		break;
	    }

	    x = strlen(sLiNE[i-1]);
	    snprintf(temp, 80, "%d:", i);
	    pout(LIGHTRED, BLACK, temp);
	    pout(CFG.InputColourF, CFG.InputColourB, sLiNE[i-1]);
	    GetstrP(sLiNE[i-1], LENSIGLINES-1, x);

	} else if (i == Keystroke(114, 0)) {
	    /* List lines */
	    toprow();
	    for (i = 0; i < MAXSIGLINES; i++) {
		snprintf(temp, 80, "%d:", i+1);
		pout(LIGHTRED, BLACK, temp);
		poutCR(CFG.MoreF, CFG.MoreB, sLiNE[i]);
	    }
	    botrow();

	} else if (i == Keystroke(114, 4)) {
	    Enter(1);
	    /* Saving... */
	    pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(340));

	    /* Open TextFile for Writing NextUser Info */
	    snprintf(temp, PATH_MAX, "%s/%s/.signature", CFG.bbs_usersdir, exitinfo.Name);
	    if ((fp = fopen(temp, "w")) == NULL) {
		WriteError("$Can't open %s", temp);
		free(temp);
		free(temp1);
		return TRUE;
	    }
	    for (i = 0; i < MAXSIGLINES; i++) {
		if (strlen(sLiNE[i]))
		    fprintf(fp, "%s\n", sLiNE[i]);
	    }
	    fclose(fp);
		
	    Syslog('+', "User Saved .signature");
	    free(temp);
	    free(temp1);
	    return TRUE;

	} else if (i == Keystroke(114, 1)) {
	    Enter(1);
	    /* Edit which line: */
	    pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(118));
	    colour(CFG.InputColourF, CFG.InputColourB);
	    GetstrC(temp, 3);

	    if ((strcmp(temp, "")) == 0)
		break;

	    i = atoi(temp);

	    if ((i < 1) || (i > MAXSIGLINES)) {
		Enter(1);
		/* Line does not exist. */
		poutCR(LIGHTRED, BLACK, (char *) Language(119));
		break;
	    }

	    Enter(1);
	    /* Line reads: */
	    poutCR(CFG.MoreF, CFG.MoreB, (char *) Language(186));
	    snprintf(temp, 81, "%d:%s", i, sLiNE[i-1]);
	    poutCR(CFG.MoreF, CFG.MoreB, temp);

	    Enter(1);
	    /* Text to replace: */
	    pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(195));
	    colour(CFG.InputColourF, CFG.InputColourB);
	    GetstrC(temp, LENSIGLINES-1);

	    if ((strcmp(temp, "")) == 0)
		break;

	    /* Replacement text: */
	    pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(196));
	    colour(CFG.InputColourF, CFG.InputColourB);
	    GetstrC(temp1, LENSIGLINES-1);

	    if ((strcmp(temp1, "")) == 0)
		break;
	    strreplace(sLiNE[i-1], temp, temp1);

	} else
	    Enter(1);
    }

    free(temp);
    free(temp1);
    return FALSE;
}
Exemplo n.º 4
0
void RecursiveEdgeVisitor::VisitCollection(Collection* e) {
  AtCollection(e);
  Enter(e);
  e->AcceptMembers(this);
  Leave();
}
Exemplo n.º 5
0
void RecursiveEdgeVisitor::VisitPersistent(Persistent* e) {
  AtPersistent(e);
  Enter(e);
  e->ptr()->Accept(this);
  Leave();
}
Exemplo n.º 6
0
void RecursiveEdgeVisitor::VisitWeakMember(WeakMember* e) {
  AtWeakMember(e);
  Enter(e);
  e->ptr()->Accept(this);
  Leave();
}
Exemplo n.º 7
0
void RecursiveEdgeVisitor::VisitOwnPtr(OwnPtr* e) {
  AtOwnPtr(e);
  Enter(e);
  e->ptr()->Accept(this);
  Leave();
}