コード例 #1
0
ファイル: test_get_wstr.c プロジェクト: ysleu/RTL8685
static void
MovePrompt(WINDOW *txtwin, int limit, int y, int x)
{
    wchgat(txtwin, Remainder(txtwin), A_NORMAL, 0, NULL);
    wmove(txtwin, y, x);
    ShowPrompt(txtwin, limit);
}
コード例 #2
0
ファイル: GCD2.c プロジェクト: rajeev3983/Spoj-Solutions
int main(){
  int t,i,j,k,a;
  scanf("%d",&t);
  while(t--){
    scanf("%d",&a);
    scanf("%s",b);
    if( a==0 ){
      printf("%s\n",b);
      continue;
    }
    j = Remainder(a);
    printf("%d\n",gcd(a,j));
  }
  return 0;
}
コード例 #3
0
ファイル: test_get_wstr.c プロジェクト: ysleu/RTL8685
static int
ShowFlavor(WINDOW *strwin, WINDOW *txtwin, int flavor, int limit)
{
    const char *name = "?";
    bool limited = FALSE;
    bool wins = (txtwin != stdscr);
    int result;

    switch (flavor) {
    case eGetStr:
	name = wins ? "wget_wstr" : "get_wstr";
	break;
    case eGetNStr:
	limited = TRUE;
	name = wins ? "wgetn_wstr" : "getn_wstr";
	break;
    case eMvGetStr:
	name = wins ? "mvwget_wstr" : "mvget_wstr";
	break;
    case eMvGetNStr:
	limited = TRUE;
	name = wins ? "mvwgetn_wstr" : "mvgetn_wstr";
	break;
    case eMaxFlavor:
	break;
    }

    wmove(strwin, 0, 0);
    werase(strwin);

    if (limited) {
	wprintw(strwin, "%s(%d):", name, limit);
    } else {
	wprintw(strwin, "%s:", name);
    }
    result = limited ? limit : Remainder(txtwin);
    ShowPrompt(txtwin, result);

    wnoutrefresh(strwin);
    return result;
}
コード例 #4
0
/**
Checks whether this is a STATUS response.
If it is, then it starts buiding an atom tree.  
If the tree is completed then the data is parsed straight away.  Otherwise, more data is requested.
If the atom tree is completed by this line, then tree is parsed to decode the response.
@return ENotRecognised if this is not a STATUS response
		EResponseIncomplete if this is a STATUS resposne, but more data is required.
		ECompleteUntagged if this is a STATUS response that has been fully parsed.
*/
CImapCommand::TParseBlockResult CImapStatus::ParseUntaggedResponseL()
	{
	TParseBlockResult result = ENotRecognised;
	
	TPtrC8 response = GetNextPart();
	if(response.CompareF(KImapTxtStatus) == 0)
		{
		TPtrC8 remainingData = Remainder();
   		TBool wantMoreData = iAtomParser->ProcessLineL(remainingData);
   		if (wantMoreData)
   			{
   			result = EResponseIncomplete;
   			}
   		else
   			{
   			ParseStatusResponseL();
   			result = ECompleteUntagged;
   			}
		}
	
	return result;
	}
コード例 #5
0
ファイル: Source.cpp プロジェクト: Zmiecer/BSU
void main() 
{  
	std::cout << "remainder=" << Remainder(-12,5) << std::endl; 
}