Ejemplo n.º 1
0
void SQLEXECUTEROWSET_swap(char* buffer)
{
	short number_of_param = ExecuteRowset_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
//	IDL_char *stmtLabel;
//	IDL_string cursorName;
	IDL_short *sqlStmtType;
	IDL_long *inputRowCnt;
	SQL_DataValue_def *inputDataValue;
	IDL_short *sqlAsyncEnable;
	IDL_long *queryTimeout;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	sqlStmtType = (IDL_short *)(param[3] + (long)buffer);
	inputRowCnt = (IDL_long *)(param[4] + (long)buffer);
	inputDataValue = (SQL_DataValue_def *)(param[5] + (long)buffer);
	sqlAsyncEnable = (IDL_short *)(param[6] + (long)buffer);
	queryTimeout = (IDL_long *)(param[7] + (long)buffer);
//
// swap
//
	LONG_swap(dialogueId);
	SHORT_swap(sqlStmtType);
	LONG_swap(inputRowCnt);
	ULONG_swap(&inputDataValue->_length);
	SHORT_swap(sqlAsyncEnable);
	LONG_swap(queryTimeout);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 2
0
void SQLSETCONNECTATTR_swap(char* buffer)
{
	short number_of_param = SetConnectionOption_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
	IDL_short *connectionOption;
	IDL_long *optionValueNum;
//	IDL_string optionValueStr;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	connectionOption = (IDL_short *)(param[1] + (long)buffer);;
	optionValueNum = (IDL_long *)(param[2] + (long)buffer);;
//
// swap
//
	LONG_swap(dialogueId);
	SHORT_swap(connectionOption);
	LONG_swap(optionValueNum);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 3
0
void SQLPREPARE_swap(char* buffer)
{
	short number_of_param = Prepare_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;
	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
//	IDL_char *stmtLabel;
//	IDL_char *stmtExplainLabel;
	IDL_short *stmtType;
//	IDL_string sqlString;
	IDL_short *sqlAsyncEnable;
	IDL_long *queryTimeout;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	stmtType = (IDL_short *)(param[3] + (long)buffer);;
	sqlAsyncEnable = (IDL_short *)(param[5] + (long)buffer);;
	queryTimeout = (IDL_long *)(param[6] + (long)buffer);;
//
// swap
//
	LONG_swap(dialogueId);
	SHORT_swap(stmtType);
	SHORT_swap(sqlAsyncEnable);
	LONG_swap(queryTimeout);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 4
0
void SQLEXECUTECALL_swap(char* buffer)
{
	short number_of_param = ExecuteCall_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
//	IDL_char *stmtLabel;
//	IDL_string cursorName;
	IDL_short *sqlStmtType;
	IDL_long *inputRowCnt;
	SQLValueList_def *inputValueList;
	IDL_short *sqlAsyncEnable;
	IDL_long *queryTimeout;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	sqlStmtType = (IDL_short *)(param[3] + (long)buffer);
	inputRowCnt = (IDL_long *)(param[4] + (long)buffer);
	inputValueList = (SQLValueList_def *)(param[5] + (long)buffer);
	sqlAsyncEnable = (IDL_short *)(param[6] + (long)buffer);
	queryTimeout = (IDL_long *)(param[7] + (long)buffer);
//
// swap
//
	LONG_swap(dialogueId);
	SHORT_swap(sqlStmtType);
	LONG_swap(inputRowCnt);
	SQL_VALUE_LIST_swap(buffer, inputValueList);
	SHORT_swap(sqlAsyncEnable);
	LONG_swap(queryTimeout);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 5
0
void SQLFETCHPERF_swap(char* buffer)
{
	short number_of_param = FetchPerf_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
//	IDL_char *stmtLabel;
	IDL_long *maxRowCnt;
	IDL_long *maxRowLen;
	IDL_short *sqlAsyncEnable;
	IDL_long *queryTimeout;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	maxRowCnt = (IDL_long *)(param[2] + (long)buffer);
	maxRowLen = (IDL_long *)(param[3] + (long)buffer);
	sqlAsyncEnable = (IDL_short *)(param[4] + (long)buffer);
	queryTimeout = (IDL_long *)(param[5] + (long)buffer);
//
// swap
//
	LONG_swap(dialogueId);
	LONG_swap(maxRowCnt);
	LONG_swap(maxRowLen);
	SHORT_swap(sqlAsyncEnable);
	LONG_swap(queryTimeout);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 6
0
void UPDATESRVRSTATE_swap(char* buffer)
{
	short number_of_param = UpdateSrvrState_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	IDL_long *srvrType; 
//	IDL_char *srvrObjRef;
	IDL_long *srvrState;

	srvrType = (IDL_long *)(param[0] + (long)buffer);
	srvrState = (IDL_long *)(param[2] + (long)buffer);
//
// swap srvrType
//
	LONG_swap(srvrType);
//
// swap srvrState
//
	LONG_swap(srvrState);

	swapPointers(buffer, number_of_param);
	
}
Ejemplo n.º 7
0
void STOPSRVR_swap(char* buffer)
{
	short number_of_param = StopSrvr_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
	IDL_long *srvrType; 
//	IDL_char *srvrObjRef;
	IDL_long *StopType;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	srvrType = (IDL_long *)(param[1] + (long)buffer);
	StopType = (IDL_long *)(param[3] + (long)buffer);
//
// swap dialogueId
//
	LONG_swap(dialogueId);
//
// swap srvrType
//
	LONG_swap(srvrType);
//
// swap StopType
//
	LONG_swap(StopType);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 8
0
void SQLEXECDIRECT_swap(char* buffer)
{
	short number_of_param = ExecDirect_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;
	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
//	IDL_char *stmtLabel;
//	IDL_string cursorName;
//	IDL_char *stmtExplainLabel;
	IDL_short* stmtType;
	IDL_short *sqlStmtType;
//	IDL_string sqlString;
	IDL_short *sqlAsyncEnable;
	IDL_long *queryTimeout;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	stmtType = (IDL_short *)(param[4] + (long)buffer);
	sqlStmtType = (IDL_short *)(param[5] + (long)buffer);
	sqlAsyncEnable = (IDL_short *)(param[7] + (long)buffer);
	queryTimeout = (IDL_long *)(param[8] + (long)buffer);
//
// swap
//
	LONG_swap(dialogueId);
	SHORT_swap(stmtType);
	SHORT_swap(sqlStmtType);
	SHORT_swap(sqlAsyncEnable);
	LONG_swap(queryTimeout);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 9
0
/** swaps the current token with the token buffer */
static
void swapTokenBuffer(
   LPINPUT*              lpinput             /**< LP reading data */
   )
{
   assert(lpinput != NULL);

   swapPointers(&lpinput->token, &lpinput->tokenbuf);
}
Ejemplo n.º 10
0
/** swaps the current token with the token buffer */
static
void swapTokenBuffer(
    BLKINPUT*             blkinput            /**< BLK reading data */
)
{
    assert(blkinput != NULL);

    swapPointers(&blkinput->token, &blkinput->tokenbuf);
}
Ejemplo n.º 11
0
/** swaps the current token with the token buffer */
static
void swapTokenBuffer(
    DECINPUT*             decinput            /**< DEC reading data */
)
{
    assert(decinput != NULL);

    swapPointers(&decinput->token, &decinput->tokenbuf);
}
Ejemplo n.º 12
0
/** puts the buffered token on the token stack, such that it is read at the next call to getNextToken() */
static
void pushBufferToken(
   LPINPUT*              lpinput             /**< LP reading data */
   )
{
   assert(lpinput != NULL);
   assert(lpinput->npushedtokens < LP_MAX_PUSHEDTOKENS);

   swapPointers(&lpinput->pushedtokens[lpinput->npushedtokens], &lpinput->tokenbuf);
   lpinput->npushedtokens++;
}
Ejemplo n.º 13
0
/** puts the current token on the token stack, such that it is read at the next call to getNextToken() */
static
void pushToken(
    DECINPUT*             decinput            /**< DEC reading data */
)
{
    assert(decinput != NULL);
    assert(decinput->npushedtokens < DEC_MAX_PUSHEDTOKENS);

    swapPointers(&decinput->pushedtokens[decinput->npushedtokens], &decinput->token);
    decinput->npushedtokens ++;
}
Ejemplo n.º 14
0
/** puts the current token on the token stack, such that it is read at the next call to getNextToken() */
static
void pushToken(
    BLKINPUT*             blkinput            /**< BLK reading data */
)
{
    assert(blkinput != NULL);
    assert(blkinput->npushedtokens < BLK_MAX_PUSHEDTOKENS);

    swapPointers(&blkinput->pushedtokens[blkinput->npushedtokens], &blkinput->token);
    blkinput->npushedtokens++;
}
Ejemplo n.º 15
0
void GETOBJREF_swap(char* buffer)
{
	short number_of_param = GetObjRefHdl_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	CONNECTION_CONTEXT_def *inContext; 
	USER_DESC_def *userDesc;
	IDL_long *srvrType;
	IDL_short *retryCount;

	inContext = (CONNECTION_CONTEXT_def *)(param[0] + (long)buffer); 
	userDesc = (USER_DESC_def *)(param[1] + (long)buffer);
	srvrType = (IDL_long *)(param[2] + (long)buffer);
	retryCount = (IDL_short *)(param[3] + (long)buffer);
//
// swap CONNECTION_CONTEXT_def
//
	SHORT_swap(&inContext->accessMode);
	SHORT_swap(&inContext->autoCommit);
	SHORT_swap(&inContext->queryTimeoutSec);
	SHORT_swap(&inContext->idleTimeoutSec);
	SHORT_swap(&inContext->loginTimeoutSec);
	SHORT_swap(&inContext->txnIsolationLevel);
	SHORT_swap(&inContext->rowSetSize);
	LONG_swap(&inContext->diagnosticFlag);
	ULONG_swap(&inContext->processId);
	ULONG_swap(&inContext->ctxACP);
	ULONG_swap(&inContext->ctxDataLang);
	ULONG_swap(&inContext->ctxErrorLang);
	SHORT_swap(&inContext->ctxCtrlInferNCHAR);
	VERSION_LIST_swap(buffer, &inContext->clientVersionList);
//
// swap userDesc
//
	LONG_swap(&userDesc->userDescType);
	ULONG_swap(&userDesc->userSid._length);
	ULONG_swap(&userDesc->password._length);
//
// swap srvrType
//
	LONG_swap(srvrType);
//
// swap retryCount
//
	SHORT_swap(retryCount);

	swapPointers(buffer, number_of_param);
	
}
Ejemplo n.º 16
0
void SQLGETCATALOGS_swap(char* buffer)
{
	short number_of_param = GetSQLCatalogs_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
//	IDL_char *stmtLabel;
	IDL_short *APIType;
//	IDL_char *catalogNm;
//	IDL_char *schemaNm;
//	IDL_char *tableNm;
//	IDL_char *tableTypeList;
//	IDL_char *columnNm;
	IDL_long *columnType;
	IDL_long *rowIdScope;
	IDL_long *nullable;
	IDL_long *uniqueness;
	IDL_long *accuracy;
	IDL_short *sqlType;
	IDL_unsigned_long *metadataId;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	APIType = (IDL_short *)(param[2] + (long)buffer);
	columnType = (IDL_long *)(param[8] + (long)buffer);
	rowIdScope = (IDL_long *)(param[9] + (long)buffer);
	nullable = (IDL_long *)(param[10] + (long)buffer);
	uniqueness = (IDL_long *)(param[11] + (long)buffer);
	accuracy = (IDL_long *)(param[12] + (long)buffer);
	sqlType = (IDL_short *)(param[13] + (long)buffer);
	metadataId = (IDL_unsigned_long *)(param[14] + (long)buffer);
//
// swap
//
	LONG_swap(dialogueId);
	SHORT_swap(APIType);
	LONG_swap(columnType);
	LONG_swap(rowIdScope);
	LONG_swap(nullable);
	LONG_swap(uniqueness);
	LONG_swap(accuracy);
	SHORT_swap(sqlType);
	ULONG_swap(metadataId);

	swapPointers(buffer, number_of_param);
}
node_t add_two_lists(node_t list1,node_t list2,node_t list3)
{
        node_t cur;
        if(list1 == NULL)
        {
                return list2;
        }
        else if(list2 == NULL)
        {
                return list1;
        }

        int length1 = getLength(list1);
        int length2 = getLength(list2);
        
        int carry = 0;

        if(length1 == length2)
        {
                list3 = addSameSize(list1,list2,&carry);
        }
        else
        {
                int difference = abs(length1 - length2);

                if(length1 < length2)
                {
                        swapPointers(&list1,&list2);
                }

                for(cur = list1; difference--; cur = cur -> link);

                list3 = addSameSize(cur,list2,&carry);
                addCarryToRemaining(list1,cur,&carry,&list3);
        }

        if(carry != 0)
        {
                node_t temp = (node_t)malloc(sizeof(struct node));
                temp -> key = carry;
                temp -> link = list3;
                list3 = temp;
        }

        return list3;

}
Ejemplo n.º 18
0
void SQLCONNECT_swap(char* buffer)
{
	short number_of_param = InitializeDialogue_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	USER_DESC_def *userDesc; 
	CONNECTION_CONTEXT_def *inContext;
	DIALOGUE_ID_def *dialogueId;

	userDesc = (USER_DESC_def *)(param[0] + (long)buffer);
	inContext = (CONNECTION_CONTEXT_def *)(param[1] + (long)buffer); 
	dialogueId = (IDL_long *)(param[2] + (long)buffer);
//
// swap userDesc
//
	LONG_swap(&userDesc->userDescType);
	ULONG_swap(&userDesc->userSid._length);
	ULONG_swap(&userDesc->password._length);
//
// swap CONNECTION_CONTEXT_def
//
	SHORT_swap(&inContext->accessMode);
	SHORT_swap(&inContext->autoCommit);
	SHORT_swap(&inContext->queryTimeoutSec);
	SHORT_swap(&inContext->idleTimeoutSec);
	SHORT_swap(&inContext->loginTimeoutSec);
	SHORT_swap(&inContext->txnIsolationLevel);
	SHORT_swap(&inContext->rowSetSize);
	LONG_swap(&inContext->diagnosticFlag);
	ULONG_swap(&inContext->processId);
	ULONG_swap(&inContext->ctxACP);
	ULONG_swap(&inContext->ctxDataLang);
	ULONG_swap(&inContext->ctxErrorLang);
	SHORT_swap(&inContext->ctxCtrlInferNCHAR);
	VERSION_LIST_swap(buffer, &inContext->clientVersionList);
//
// swap DIALOGUE_ID_def
//
	LONG_swap(dialogueId);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 19
0
void SQLDISCONNECT_swap(char* buffer)
{
	short number_of_param = TerminateDialogue_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
//
// swap DIALOGUE_ID_def
//
	LONG_swap(dialogueId);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 20
0
void AddLists( node *head1 , node *head2 , node **res ){
	
	if( head1 == NULL ){
	
		*res = head2;
		return;
		
	}
	
	if( head2 == NULL ){
	
		*res = head1;
		return;
		
	}
	
	int l1 = getSize( head1 );
	int l2 = getSize( head2 );
	int carry = 0;
	
	if( l1 == l2 )
		*res = AddSameSize( head1 , head2 , &carry );
		
	else{
		
		int diff = abs( l1 - l2 );
		//std::cout<<l1<<"  "<<l2<<"  "<<diff<<"\n"; 
		
		if( l1 < l2 )
			swapPointers( &head1 , &head2 );
		
		node *cur;
		
		for( cur = head1 ; diff-- ; cur = cur -> next );
		
		*res = AddSameSize( cur , head2 , &carry );	
		AddRemainingList( head1 , cur , &carry , res );
	}	
	
	if( carry )
		insert( res , carry);
}
Ejemplo n.º 21
0
void SQLENDTRAN_swap(char* buffer)
{
	short number_of_param = EndTransaction_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
	IDL_unsigned_short *transactionOpt;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	transactionOpt = (IDL_unsigned_short *)(param[1] + (long)buffer);
//
// swap
//
	LONG_swap(dialogueId);
	USHORT_swap(transactionOpt);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 22
0
void SQLFREESTMT_swap(char* buffer)
{
	short number_of_param = Close_in_params;
	long* param = (long*)buffer;
	long* pointers = (long*)buffer;

	pointers += number_of_param;

	DIALOGUE_ID_def *dialogueId;
//	IDL_char *stmtLabel
	IDL_unsigned_short *freeResourceOpt;

	dialogueId = (IDL_long *)(param[0] + (long)buffer);
	freeResourceOpt = (IDL_unsigned_short *)(param[2] + (long)buffer);
//
// swap
//
	LONG_swap(dialogueId);
	USHORT_swap(freeResourceOpt);

	swapPointers(buffer, number_of_param);
}
Ejemplo n.º 23
0
/** reads the next token from the input file into the token buffer; returns whether a token was read */
static
SCIP_Bool getNextToken(
   SCIP*                 scip,               /**< SCIP data structure */
   LPINPUT*              lpinput             /**< LP reading data */
   )
{
   SCIP_Bool hasdot;
   LPEXPTYPE exptype;
   char* buf;
   int tokenlen;

   assert(lpinput != NULL);
   assert(lpinput->linepos < LP_MAX_LINELEN);

   /* check the token stack */
   if( lpinput->npushedtokens > 0 )
   {
      swapPointers(&lpinput->token, &lpinput->pushedtokens[lpinput->npushedtokens-1]);
      lpinput->npushedtokens--;

      SCIPdebugMessage("(line %d) read token again: '%s'\n", lpinput->linenumber, lpinput->token);
      return TRUE;
   }

   /* skip delimiters */
   buf = lpinput->linebuf;
   while( isDelimChar(buf[lpinput->linepos]) )
   {
      if( buf[lpinput->linepos] == '\0' )
      {
         if( !getNextLine(scip, lpinput) )
         {
            lpinput->section = LP_END;
            SCIPdebugMessage("(line %d) end of file\n", lpinput->linenumber);
            return FALSE;
         }
         assert(lpinput->linepos == 0);
      }
      else
         lpinput->linepos++;
   }
   assert(lpinput->linepos < LP_MAX_LINELEN);
   assert(!isDelimChar(buf[lpinput->linepos]));

   /* check if the token is a value */
   hasdot = FALSE;
   exptype = LP_EXP_NONE;
   if( isValueChar(buf[lpinput->linepos], buf[lpinput->linepos+1], TRUE, &hasdot, &exptype) )
   {
      /* read value token */
      tokenlen = 0;
      do
      {
         assert(tokenlen < LP_MAX_LINELEN);
         assert(!isDelimChar(buf[lpinput->linepos]));
         lpinput->token[tokenlen] = buf[lpinput->linepos];
         tokenlen++;
         lpinput->linepos++;
      }
      while( isValueChar(buf[lpinput->linepos], buf[lpinput->linepos+1], FALSE, &hasdot, &exptype) );
   }
   else
   {
      /* read non-value token */
      tokenlen = 0;
      do
      {
         assert(tokenlen < LP_MAX_LINELEN);
         lpinput->token[tokenlen] = buf[lpinput->linepos];
         tokenlen++;
         lpinput->linepos++;
         if( tokenlen == 1 && isTokenChar(lpinput->token[0]) )
            break;
      }
      while( !isDelimChar(buf[lpinput->linepos]) && !isTokenChar(buf[lpinput->linepos]) );

      /* if the token is a power sign '^', skip a following '2'
       * if the token is an equation sense '<', '>', or '=', skip a following '='
       * if the token is an equality token '=' and the next character is a '<' or '>', replace the token by the inequality sense
       */
      if( tokenlen >= 1 && lpinput->token[tokenlen-1] == '^' && buf[lpinput->linepos] == '2' )
      {
         lpinput->linepos++;
      }
      if( tokenlen >= 1
         && (lpinput->token[tokenlen-1] == '<' || lpinput->token[tokenlen-1] == '>' || lpinput->token[tokenlen-1] == '=')
         && buf[lpinput->linepos] == '=' )
      {
         lpinput->linepos++;
      }
      else if( lpinput->token[tokenlen-1] == '=' && (buf[lpinput->linepos] == '<' || buf[lpinput->linepos] == '>') )
      {
         lpinput->token[tokenlen-1] = buf[lpinput->linepos];
         lpinput->linepos++;
      }
   }
   assert(tokenlen < LP_MAX_LINELEN);
   lpinput->token[tokenlen] = '\0';

   SCIPdebugMessage("(line %d) read token: '%s'\n", lpinput->linenumber, lpinput->token);

   return TRUE;
}
Ejemplo n.º 24
0
/** reads the next token from the input file into the token buffer; returns whether a token was read */
static
SCIP_Bool getNextToken(
    BLKINPUT*             blkinput            /**< BLK reading data */
)
{
    SCIP_Bool hasdot;
    BLKEXPTYPE exptype;
    char* buf;
    int tokenlen;

    assert(blkinput != NULL);
    assert(blkinput->linepos < BLK_MAX_LINELEN);

    /* check the token stack */
    if( blkinput->npushedtokens > 0 )
    {
        swapPointers(&blkinput->token, &blkinput->pushedtokens[blkinput->npushedtokens-1]);
        blkinput->npushedtokens--;
        SCIPdebugMessage("(line %d) read token again: '%s'\n", blkinput->linenumber, blkinput->token);
        return TRUE;
    }

    /* skip delimiters */
    buf = blkinput->linebuf;
    while( isDelimChar(buf[blkinput->linepos]) )
    {
        if( buf[blkinput->linepos] == '\0' )
        {
            if( !getNextLine(blkinput) )
            {
                blkinput->section = BLK_END;
                SCIPdebugMessage("(line %d) end of file\n", blkinput->linenumber);
                return FALSE;
            }
            assert(blkinput->linepos == 0);
        }
        else
            blkinput->linepos++;
    }
    assert(blkinput->linepos < BLK_MAX_LINELEN);
    assert(!isDelimChar(buf[blkinput->linepos]));

    /* check if the token is a value */
    hasdot = FALSE;
    exptype = BLK_EXP_NONE;
    if( isValueChar(buf[blkinput->linepos], buf[blkinput->linepos+1], TRUE, &hasdot, &exptype) ) /*lint !e679*/
    {
        /* read value token */
        tokenlen = 0;
        do
        {
            assert(tokenlen < BLK_MAX_LINELEN);
            assert(!isDelimChar(buf[blkinput->linepos]));
            blkinput->token[tokenlen] = buf[blkinput->linepos];
            ++tokenlen;
            ++(blkinput->linepos);
            assert(blkinput->linepos < BLK_MAX_LINELEN);
        }
        while( isValueChar(buf[blkinput->linepos], buf[blkinput->linepos+1], FALSE, &hasdot, &exptype) ); /*lint !e679*/
    }
    else
    {
        /* read non-value token */
        tokenlen = 0;
        do
        {
            assert(tokenlen < BLK_MAX_LINELEN);
            blkinput->token[tokenlen] = buf[blkinput->linepos];
            tokenlen++;
            blkinput->linepos++;
            if( tokenlen == 1 && isTokenChar(blkinput->token[0]) )
                break;
        }
        while( !isDelimChar(buf[blkinput->linepos]) && !isTokenChar(buf[blkinput->linepos]) );

        /* if the token is an equation sense '<', '>', or '=', skip a following '='
         * if the token is an equality token '=' and the next character is a '<' or '>', replace the token by the inequality sense
         */
        if( tokenlen >= 1
                && (blkinput->token[tokenlen-1] == '<' || blkinput->token[tokenlen-1] == '>' || blkinput->token[tokenlen-1] == '=')
                && buf[blkinput->linepos] == '=' )
        {
            blkinput->linepos++;
        }
        else if( blkinput->token[tokenlen-1] == '=' && (buf[blkinput->linepos] == '<' || buf[blkinput->linepos] == '>') )
        {
            blkinput->token[tokenlen-1] = buf[blkinput->linepos];
            blkinput->linepos++;
        }
    }
    assert(tokenlen < BLK_MAX_LINELEN);
    blkinput->token[tokenlen] = '\0';

    SCIPdebugMessage("(line %d) read token: '%s'\n", blkinput->linenumber, blkinput->token);

    return TRUE;
}