static void hashIChars(void) {
    static const char which[] = "which";
    static const char WHICH2[] = "WHICH";
    static const char where[] = "where";
    UErrorCode status = U_ZERO_ERROR;
    UHashtable *hash;

    hash = uhash_open(uhash_hashIChars, uhash_compareIChars, NULL, &status);
    if (U_FAILURE(status)) {
        log_err("FAIL: uhash_open failed with %s and returned 0x%08x\n",
                u_errorName(status), hash);
        return;
    }
    if (hash == NULL) {
        log_err("FAIL: uhash_open returned NULL\n");
        return;
    }
    log_verbose("Ok: uhash_open returned 0x%08X\n", hash);

    _put(hash, which, 1, 0);
    _put(hash, WHICH2, 2, 1);
    _put(hash, where, 3, 0);
    if(uhash_count(hash) != 2){
         log_err("FAIL: uhas_count() failed. Expected: 1, Got: %d\n", uhash_count(hash));
    }
    _remove(hash, which, 2);

    uhash_close(hash);
}
static void put(struct test_target *real,
		struct test_target *ref)
{
	int x = rand() % (2*real->width) - real->width;
	int y = rand() % (2*real->height) - real->height;
	int w = rand() % real->width;
	int h = rand() % real->height;
	int color = rand();
	int alu = rand() % 16;

	_put(real, x, y, w, h, color, alu);
	_put(ref, x, y, w, h, color, alu);
}
Exemple #3
0
static void TestBasic(void) {
    const char one[4] =   {0x6F, 0x6E, 0x65, 0}; /* "one" */
    const char one2[4] =  {0x6F, 0x6E, 0x65, 0}; /* Get around compiler optimizations */
    const char two[4] =   {0x74, 0x77, 0x6F, 0}; /* "two" */
    const char three[6] = {0x74, 0x68, 0x72, 0x65, 0x65, 0}; /* "three" */
    const char omega[6] = {0x6F, 0x6D, 0x65, 0x67, 0x61, 0}; /* "omega" */
    UErrorCode status = U_ZERO_ERROR;
    UHashtable *hash;

    hash = uhash_open(hashChars, isEqualChars,  &status);
    if (U_FAILURE(status)) {
        log_err("FAIL: uhash_open failed with %s and returned 0x%08x\n",
                u_errorName(status), hash);
        return;
    }
    if (hash == NULL) {
        log_err("FAIL: uhash_open returned NULL\n");
        return;
    }
    log_verbose("Ok: uhash_open returned 0x%08X\n", hash);

    _put(hash, one, 1, 0);
    _put(hash, omega, 24, 0);
    _put(hash, two, 2, 0);
    _put(hash, three, 3, 0);
    _put(hash, one, -1, 1);
    _put(hash, two, -2, 2);
    _put(hash, omega, 48, 24);
    _put(hash, one, 100, -1);
    _get(hash, three, 3);
    _remove(hash, two, -2);
    _get(hash, two, 0);
    _get(hash, one, 100);
    _put(hash, two, 200, 0);
    _get(hash, omega, 48);
    _get(hash, two, 200);

    if(_compareChars((void*)one, (void*)three) == TRUE ||
        _compareChars((void*)one, (void*)one2) != TRUE ||
        _compareChars((void*)one, (void*)one) != TRUE ||
        _compareChars((void*)one, NULL) == TRUE  )  {
        log_err("FAIL: compareChars failed\n");
    }
    if(_compareIChars((void*)one, (void*)three) == TRUE ||
        _compareIChars((void*)one, (void*)one) != TRUE ||
        _compareIChars((void*)one, (void*)one2) != TRUE ||
        _compareIChars((void*)one, NULL) == TRUE  )  {
        log_err("FAIL: compareIChars failed\n");
    }
     
    uhash_close(hash);

}
Exemple #4
0
void Selector::operator=(const char *s) const {
    _traverse();
    auto push = [this, s]() {
        detail::_push(_state._l, std::string{s});
    };
    _put(push);
    lua_settop(_state._l, 0);
}
Exemple #5
0
static long GetInt( void * Array, LONG wIndex )
{
    long iRet;
    _put();
    _cAt( Array, wIndex, S_ANY, _tos );
    iRet = _sptol( _tos );
    _0POP();

    return iRet;
}
Exemple #6
0
static u4_nopt
_put(u4_lane lane,
     u4_twig twig,
     u4_noun a,
     u4_noun b,
     u4_pt pt)
{
    if ( pt == 0 ) {
        return u4_k_safe(lane, a);
    }
    else {
        pt -= 1;
        {
            if ( u4_n_atom(b) ) {
                return u4_bull;
            }
            else {
                u4_noun head = u4_ch(b);
                u4_noun tail = u4_ct(b);

                if ( 0 == u4_a_bit(twig, pt) ) {
                    u4_noun put_head = _put(lane, twig, a, head, pt);

                    if ( u4_bull == put_head ) {
                        return u4_bull;
                    }
                    else return u4_k_cell(lane, put_head, tail);
                }
                else {
                    u4_noun put_tail = _put(lane, twig, a, tail, pt);

                    if ( u4_bull == put_tail ) {
                        return u4_bull;
                    }
                    else return u4_k_cell(lane, head, put_tail);
                }
            }
        }
    }
}
Exemple #7
0
void Selector::_check_create_table() {
    _traverse();
    _get();
    if (lua_istable(_state._l, -1) == 0 ) { // not table
        lua_pop(_state._l, 1); // flush the stack
        auto put = [this]() {
            lua_newtable(_state._l);
        };
        _put(put);
    } else {
        lua_pop(_state._l, 1);
    }
}
void Put(int *tokens)

{
	int i=1,j=0,whereabout=0;
	if(Put_Semantic_Analyser(tokens,&i,&whereabout)==-1)
		return;
	switch(tokens[i])
	{
	case Obj_book:
		{
			_put(Obj_book,whereabout);
			player.num_object--;
			printf("You have put down the book.\n");
			step++;
			break;
		}
	case Obj_phone:
		{
			_put(Obj_phone,whereabout);
			player.num_object--;
			printf("You have put down the phone.\n");
			step++;
			break;
		}
	case Obj_body:
		{
			_put(Obj_body,whereabout);
			player.num_object--;
			printf("You have put down the body.\n");
			step++;
			break;
		}
	default:
		{
			printf("This object is either not here or not important.\n");
			break;
		}
	}
}
void LZHLEncoder::putMatch( const uint8_t* src, size_t nRaw, size_t matchOver, size_t disp )
{
  assert( nRaw <= maxRaw );
  assert( matchOver <= maxMatchOver );
  assert( disp >= 0 && disp < LZBUFSIZE );
  putRaw( src, nRaw );
  struct MatchOverItem { uint16_t symbol; int nBits; uint16_t bits; };

  static MatchOverItem _matchOverTable[] = {
    { 264, 1, 0x00 },

    { 265, 2, 0x00 },
    { 265, 2, 0x02 },

    { 266, 3, 0x00 },
    { 266, 3, 0x02 },
    { 266, 3, 0x04 },
    { 266, 3, 0x06 },

    { 267, 4, 0x00 },
    { 267, 4, 0x02 },
    { 267, 4, 0x04 },
    { 267, 4, 0x06 },
    { 267, 4, 0x08 },
    { 267, 4, 0x0A },
    { 267, 4, 0x0C },
    { 267, 4, 0x0E },
  };

  if ( matchOver < 8 ) {
    _put( 256 + (uint16_t)matchOver );

  } else if ( matchOver < 38 ) {
    matchOver -= 8;
    MatchOverItem* item = &_matchOverTable[ matchOver >> 1 ];
    _put( item->symbol, item->nBits, item->bits | (matchOver & 0x01) );

  } else {
Exemple #10
0
/* u4_op_put():
**
**   Insert (a) at (twig) in (b).  Return bull if there is no
**   such twig.
*/
u4_nopt
u4_op_put(u4_lane lane,
          u4_twig twig,
          u4_noun a,
          u4_noun b)
{
    u4_st st = u4_a_bin(twig, 0);

    if ( !st ) {
        return u4_trip;
    }
    else {
        u4_pt pt = (st - 1);

        return _put(lane, twig, a, b, pt);
    }
}
Exemple #11
0
void cput_queue(unsigned int eax, unsigned int ebx, unsigned char mode)
{
  const char* p = (char*)&eax;
  const char* q = (char*)&ebx;
  
  _put(p, 0);
  _put(p, 1);
  _put(p, 2);
  _put(p, 3);
  _put(q, 0);
  _put(q, 1);
  _put(q, 2);
  _put(q, 3);

  con_write(&tty);

  //  printf("(%x,%x)\t", eax, ebx);
  //  printf("(mode %x)\n", mode);
}
Exemple #12
0
void LZHLEncoder::_callStat() {
  nextStat = 2;   // to avoid recursion, >=2

  _put( NHUFFSYMBOLS - 2 );

  HUFFINT groups[ 16 ];
  stat->calcStat( groups );

  int lastNBits = 0;

  for( int i=0; i < 16 ; ++i ) {
    int nBits = groups[ i ];
    assert( nBits >= lastNBits && nBits <= 8 );
    int delta = nBits - lastNBits;
    lastNBits = nBits;
    _putBits( delta + 1, 1 );
  }
}
// Places value and status at key if there is no value at key or if cache
// entry for key is in progress. Otherwise, it leaves the current value and
// status there.
// On entry. gCacheMutex must not be held. value must be
// included in the reference count of the object to which it points.
// On exit, value and status are changed to what was already in the cache if
// something was there and not in progress. Otherwise, value and status are left
// unchanged in which case they are placed in the cache on a best-effort basis.
// Caller must call removeRef() on value.
void UnifiedCache::_putIfAbsentAndGet(
        const CacheKeyBase &key,
        const SharedObject *&value,
        UErrorCode &status) const {
    Mutex lock(&gCacheMutex);
    const UHashElement *element = uhash_find(fHashtable, &key);
    if (element != NULL && !_inProgress(element)) {
        _fetch(element, value, status);
        return;
    }
    if (element == NULL) {
        UErrorCode putError = U_ZERO_ERROR;
        // best-effort basis only.
        _putNew(key, value, status, putError);
        return;
    }
    _put(element, value, status);
}
void old_man()

{
	printf("\"I see strength in you,son.Now I'm going to tell something very important.\"\n");
	_sleep(4000);
	printf("\"WuHan University of Technology is in great danger now.Only you can save WHUT now.There's a secret that had been passed in generations.My grandfather told me this,actually.\"\n");
	_sleep(5000);
	printf("\"Once upon a time,this was a land of freedom.the king was very kind and good.People lived here happily.Until one day,A evil wizard called \'Blah\' showed up in this land with his evil dragon pet \'Blahh\'.He killed the king and kidnapped the princess.\"\n");
	_sleep(7500);
	printf("\"And then he ruled the kingdom.It's was a dark time.People suffered.Until one day,a hero stood out.The sword made by his father he held,he slayed the dragon and then defeated Blah and save the princess.Then he renamed what's left of the kingdom\'WuHan University of Technology.\'\"\n");
	_sleep(75000);
	//This is where I left off.
	printf("\"As time passed the place became what we see today.It was said that the hero's spirit got into the sword after he died.And then weird things began to happen around the sword.In the end,people kept the sword in a secret location pertected by a group of people.Great evil has fallen today.You must find the sword.Find the man named F...\"\n");
	_sleep(75000);
	printf("\".......eh....\"\n(The wise-looking old man just dropped dead.You held him in your arm.And you realized that he had been losing a lot of blood.)\n");
	_pick(uObj_man,-1);
	_put(Obj_body,-1);
	condition[Condi_Oldman]=0;
}
Exemple #15
0
// Places value and status at key if there is no value at key or if cache
// entry for key is in progress. Otherwise, it leaves the current value and
// status there.
// On entry. gCacheMutex must not be held. value must be
// included in the reference count of the object to which it points.
// On exit, value and status are changed to what was already in the cache if
// something was there and not in progress. Otherwise, value and status are left
// unchanged in which case they are placed in the cache on a best-effort basis.
// Caller must call removeRef() on value.
void UnifiedCache::_putIfAbsentAndGet(
        const CacheKeyBase &key,
        const SharedObject *&value,
        UErrorCode &status) const {
    Mutex lock(&gCacheMutex);
    const UHashElement *element = uhash_find(fHashtable, &key);
    if (element != NULL && !_inProgress(element)) {
        _fetch(element, value, status);
        return;
    }
    if (element == NULL) {
        UErrorCode putError = U_ZERO_ERROR;
        // best-effort basis only.
        _putNew(key, value, status, putError);
    } else {
        _put(element, value, status);
    }
    // Run an eviction slice. This will run even if we added a master entry
    // which doesn't increase the unused count, but that is still o.k
    _runEvictionSlice();
}
Exemple #16
0
/**
 * qentry_t->load(): Load and append entries from given filepath
 *
 * @param   entry   qentry_t pointer
 * @param   filepath save file path
 *
 * @return  a number of loaded entries.
 */
static int _load(qentry_t *entry, const char *filepath)
{
    if (entry == NULL) return 0;

    FILE *fp = fopen(filepath, "r");
    if (fp == NULL) return 0;

    int cnt;
    for (cnt = 0; ; cnt++) {
        char *line = _q_fgetline(fp, MAX_LINEBUF);
        if (line == NULL) break;

        // parse & store
        char *data = line;
        char *name  = _q_makeword(data, '=');
        _q_strtrim(data);
        _q_strtrim(name);

        size_t size = _q_urldecode(data);
        _put(entry, name, data, size, false);
    }

    return cnt;
}
void QNodeMap::put(const char *name, QNode *n) {
#ifndef __clang_analyzer__ // avoid false memory leak triggering
	_put(strdup(name),(void*)n, MAP_FLAG_FREE_NAME );
#endif
}
void           Affine2Vector::put(int start_index, const Affine2Vector& subvec) { _put(*this, start_index, subvec); }
Exemple #19
0
int8_t msgque_put_immeda(msgque_t que,lnode *msg)
{
	return _put(que,msg,1);
}
Exemple #20
0
int8_t msgque_put(msgque_t que,lnode *msg)
{
	return _put(que,msg,2);
}
Exemple #21
0
/**
 * qentry_t->putint(): Add integer object into linked-list structure.
 *
 * @param   entry   qentry_t pointer
 * @param   name    key name.
 * @param   num number value
 * @param   replace in case of false, just insert. in case of true, remove all
 *                  same key then insert object if found.
 *
 * @return  true if successful, otherwise returns false.
 */
static bool _putint(qentry_t *entry, const char *name, int num, bool replace)
{
    char str[20+1];
    if (snprintf(str, 20+1, "%d", num) >= 20+1) str[20] = '\0';
    return _put(entry, name, (void *)str, strlen(str) + 1, replace);
}
Exemple #22
0
/**
 * qentry_t->putstr(): Add string object into linked-list structure.
 *
 * @param   entry   qentry_t pointer
 * @param   name    key name.
 * @param   str string value
 * @param   replace in case of false, just insert. in case of true, remove all
 *                  same key then insert object if found.
 *
 * @return  true if successful, otherwise returns false.
 */
static bool _putstr(qentry_t *entry, const char *name, const char *str,
                    bool replace)
{
    size_t size = (str!=NULL) ? (strlen(str) + 1) : 0;
    return _put(entry, name, (const void *)str, size, replace);
}
Exemple #23
0
void LZHLEncoder::putRaw( const uint8_t* src, size_t sz ) {
  for( const uint8_t* srcEnd = src + sz; src < srcEnd ; ++src ) {
    _put( *src );
  }
}
Exemple #24
0
	void put(const std::vector<range> &r, const void *buffer) {
            _put(rebase(r), buffer);
	}
int _dbg_printf(const char *fmt, va_list ap) {
	char *p, *s, c, filler;
	int i, precision, width;
	int n = 0;
	bool is_long, left_align, sign;
	long l;
#if MPRINTF_USE_FLOAT
	double f;
	char tmpbuf[2*MAX_FILLER + 1];
#else
	char tmpbuf[MAX_FILLER + 1];
#endif

	for (;;) {

		//agarrar nuevo caracter de formato
		c = *fmt++;

		//chequeo eos
		if (c == 0) return n;

		//copio los caracteres comunes
		if (c != '%') {
			_put(c);
			n++;
			continue;
		}

		//encontré un '%'
		p = tmpbuf;
		s = tmpbuf;

		//left align
		left_align = FALSE;
		if (*fmt == '-') {
			fmt++;
			left_align = TRUE;
		}
		
		sign = FALSE;
		if (*fmt == '+') {
			fmt++;
			sign = TRUE;
		}

		//filler
		filler = ' ';
		if (*fmt == '0') {
			fmt++;
			filler = '0';
		}

		//width
		width = 0;
		while (TRUE) {
			c = *fmt++;
			if (c >= '0' && c <= '9')
				c -= '0';
			else if (c == '*')
				c = va_arg(ap, int);
			else
				break;
			width = width * 10 + c;
		}

		//precision
		precision = 0;
		if (c == '.') {

			if (*fmt == 'n') {
				fmt++;

			}
			while (TRUE) {
				c = *fmt++;
				if (c >= '0' && c <= '9')
					c -= '0';
				else if (c == '*')
					c = va_arg(ap, int);
				else
					break;
				precision = precision * 10 + c;
			}
		}
Exemple #26
0
void    Vector::put(int start_index, const Vector& x)             { _put(*this, start_index, x); }
void QStringMap::put(const char *name, const char *value) {
#ifndef __clang_analyzer__ // avoid false memory leak triggering
	_put(strdup(name),(void*)strdup(value), MAP_FLAG_FREE_NAME | MAP_FLAG_FREE_VALUE);
#endif
}
Exemple #28
0
//-----------------------------------------------------------------------=
                                                        // ÚÄ1ra Col.a Pintar
                                                        // ³
static void PaintTheLine( HDC hDC, RECT * rct, WORD wIndex,
                               void *pAtext, void *pAsizes,
                               HPEN hWhitePen, HPEN hGrayPen, BOOL bTree,
                               void *pAJustify, WORD wPressed,
                               BOOL bHeader, WORD nStyle,
                               WORD wFocus, BOOL bFocused,
                               void *pTextColor, void *pBkColor,
                               WORD wRowPos, WORD nHeightCtrl,
                               LONG nClrLine, BOOL bFooter,
                               BOOL bSelect, void *pFont,
                               BOOL bDrawFocusRect )
{
   RECT box, wholebox, rctadj;
   int iMaxRight = rct->right;

   WORD wLenJust = 0 ;
   WORD wLen     = _VARRAYLEN( pAtext );
   WORD wType, wcLen;
   LONG lValue;
   char * cValue;
   HPEN hOldPen, hPen;
   BITMAP bmp;
   WORD wRow, wCol;
   LONG lColor ;
   HBRUSH hBrush;
   LONG lTextColorOld = -1 ; // CeSoTech
   LONG lBkColorOld   = -1 ; // CeSoTech
   void * pEvalOld ;
   HFONT hFont ; // CeSoTech
   WORD wAlign ; // CeSoTech

   // CeSoTech
   LONG nClrLineC = ( nStyle == 2 || nStyle == 6 || nStyle == 8 ||
                      nStyle == 10 ) ? GetSysColor( COLOR_BTNSHADOW ) : 0 ;

   // CeSoTech
   if ( nClrLine >= 0 )   // Desde Clipper manda color especifico linea
      nClrLineC = nClrLine ;

   if ( ! bDrawHeaders )
      bHeader = FALSE ;

   if ( bFooter )
      bHeader = TRUE ; //-> Para que lo pinte con similar aspecto

   //CeSoTech
   // Si es un estilo sin separadores horizontales, pintar uno mas arriba
   //CeSoTech para que que bien completa el area !!!
   if ( ! (bHeader) && (nStyle == 0 || nStyle == 5 || nStyle == 6 ||
                        nStyle == 9 || nStyle == 10) )
      rct->top--       ;

   wholebox.top    = rct->top+1;
   wholebox.left   = rct->left;
   wholebox.bottom = rct->bottom;
   wholebox.right  = rct->right;

   rct->right  = 0;

   box.top    = rct->top ;
   box.bottom = rct->bottom - 1;

   if( !wIndex || wIndex > wLen )
       wIndex = 1;

   if ( pAJustify )
       wLenJust = _VARRAYLEN( pAJustify );

   while( wIndex <= wLen )
   {

        rct->left   = rct->right;

        rct->right  = ( wIndex == wLen ? iMaxRight
                                      : rct->left + GetInt( pAsizes, wIndex ) );

        // CeSoTech // Cuando estoy estoy en la ultima celda, NO pintar hasta
                    // el final si no existe ajuste de ultima columna.
        if ( ( wIndex == wLen ) && ( ! bAdjLastCol )  )
        {
           rct->right  = rct->left + GetInt( pAsizes, wIndex ) +( bHeader ? 1 : 0 ) ;
           if ( !bAdjBrowse )
              wholebox.right = rct->right ; // Tambien ajusto el borde focus

        }
        // CeSoTech //

        wAlign = HA_LEFT | VA_CENTER ;  // Alineacion por defecto
        wcLen = 0;
        ///////// INICIO Toma de datos celda !!!

        if ( wIndex <= wLenJust )
        {
          _put();
          //_cAt( pAJustify, wIndex, S_ANY, _tos );
          _cAt( pAJustify, wIndex, S_LOG, _tos );
          wAlign = ( WORD ) _itemGetL( _tos );
          //wAlign = _sptol( _tos ); //_sptoq( _tos );
          _0POP();
        }
        _put();
        _cAt( pAtext, wIndex, S_ANY, _tos );
        wType = _itemType( _tos );
        // aki esta er tema
        if ( wType & NUMERIC )
           lValue = _sptol( _tos );
        else if ( wType & CHARACTER )
        {
           cValue = _VSTR( _tos );
           wcLen = _itemSize( _tos );
        }

        _0POP();
        ///////// FIN Toma de datos celda !!!

        if( wFocus > 0 && wIndex != wFocus )
        {
           if( rct->right >= iMaxRight )
           {
               wIndex = wLen + 1;   // ya no pintamos m s
           }
           else
              ++wIndex;
           continue;
        }

        if( bTree || ( GetInt( pAsizes, wIndex ) > 0 ) )    //Si NO es columna oculta (x Freeze)
        {                                                   //(Es lo mismo no hacer esto,

           if( (wType & NUMERIC) && bTree )
           {
               if( lValue )
               {
                  DrawMasked( hDC, (HBITMAP) lValue, ( rct->top < 1 ? 1 : rct->top ), rct->left );
               }
           }
           else  // Si es Numerico Bmp no Tree, o , es Character !!!!
           {

               if ( pBkColor )  // Bloque de Color Fondo Celda
               {
                  _putsym( _SymEVAL );
                  _xpushm( pBkColor );
                  _putln( wRowPos );
                  _putln( wIndex );
                  _putln( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xeval( 3 ) ;
                  if ( _parinfo( -1 ) & NUMERIC )
                    lBkColorOld = SetBkColor( hDC, _parnl( - 1 ) ) ;
               }

               if( pTextColor ) // Bloque de Color Texto Celda
               {
                  _putsym( _SymEVAL );
                  _xpushm( pTextColor );
                  _putln( wRowPos );
                  _putln( wIndex );
                  _putln( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xeval( 3 ) ;
                  if ( _parinfo( -1 ) & NUMERIC )
                    lTextColorOld = SetTextColor( hDC, _parnl( - 1 ) ) ;
               }

               hFont = 0 ;
               if( pFont )      // Bloque de Font Celda
               {
                  _putsym( _SymEVAL );
                  _xpushm( pFont );
                  _putln( wRowPos );
                  _putln( wIndex );
                  _putln( bFooter ? 2 : ( bHeader ? 1 : ( bSelect ? 3 : 0 ) ) );
                  _xeval( 3 ) ;
                  if ( _parinfo( -1 ) & NUMERIC )
                     hFont = (HFONT) _parnl( - 1 ) ;
               }

               /////// CeSoTech ///////
               if (!bHeader) rct->top ++;

               if( wType & NUMERIC )   // Es un BitMap
               {
                  FW_DrawBitmapCenter( hDC, (HBITMAP) lValue, rct, nStyle, bSelect );
               }
               else                    // Es una Cadena
               {
                  FW_DrawText( hDC, rct,
                               ( wType & CHARACTER ) ? cValue : "",
                               wAlign, wcLen, hFont, bHeader ) ;

               }


               /////// CeSoTech restauracion de colores //////
               if ( lTextColorOld >= 0 )
               {
                  SetTextColor( hDC, lTextColorOld ) ;
                  lTextColorOld = -1 ;
               }
               if ( lBkColorOld >= 0 )
               {
                  SetBkColor( hDC, lBkColorOld ) ;
                  lBkColorOld = -1 ;
               }


               /// CeSoTech ///
               // Si hay modalidad ajustar el Browse y no hay ajuste de ultima
               // columna, deber‚ pintar hasta el final hasta cubrir toda
               // el area, hasta llegar a la derecha del control. (Col.Ficticia)
               if ( bAdjBrowse && wIndex == wLen && !bAdjLastCol &&
                    rct->right <= iMaxRight )
               {
                  rctadj.top    = rct->top;
                  rctadj.left   = rct->right ;
                  rctadj.bottom = rct->bottom;
                  rctadj.right  = wholebox.right  ;

                  if ( nStyle == 3 )
                     rctadj.top--;

                  if ( wFocus == 0 )  // Si No es CellStyle (Pinto hasta final)
                     ExtTextOut( hDC, 0, rct->top, ETO_OPAQUE, &rctadj, "", 0, 0 );

                  if ( bHeader ) // Pinto Bordes Header Falso
                   {
                      rctadj.right  = wholebox.right - 2  ;
                      rctadj.bottom = rctadj.bottom - 2 ;
                      WndDrawBox( hDC, &rctadj, hWhitePen, hGrayPen );
                      rctadj.bottom++  ;
                      rctadj.right++  ;
                      WndDrawBox( hDC, &rctadj, hWhitePen, GetStockObject( BLACK_PEN ) );

                      if ( bFooter ) // Si es Footer (Linea Negra de Arriba Foot)
                      {
                        hPen = GetStockObject( BLACK_PEN );
                        hOldPen = SelectObject( hDC, hPen );
                        MoveToEx( hDC, rctadj.left-1, rctadj.top-1, NULL );
                        LineTo( hDC, rctadj.right+1, rctadj.top-1 );
                        SelectObject( hDC, hOldPen );
                      }

                  }
               }
               /// CeSoTech Fin ///

               if (!bHeader) rct->top --;
           }

           box.left   = rct->left;

           box.right  = ( wIndex < wLen && rct->right <= iMaxRight ?
                                                        rct->right - 1 :
                                                        iMaxRight - 1 );

           // CeSoTech // El Borde derecho de Box de la ultima columna,
                       // no estirarlo cuando no exista ajuste de ultima columna
                       // PERO cuando nLineStyle (nStyle) es 7/8 (Lineas Horiz)
                       // queda anti-estetico cortar los renglones, cuando no hay
                       // ajuste ult.col. y hay ajuste de browse. Por ello
                       // se verificara que para cortar el borde no se de esta
                       // condicion.
           if ( ( wIndex == wLen ) && ( ! bAdjLastCol ) )
           {
              if (! (!bHeader && (nStyle==7 || nStyle==8) && !bAdjLastCol && bAdjBrowse) )
               box.right  = rct->left + GetInt( pAsizes, wIndex ) - 1 ;
           }

           if( ! bTree )
           {
              WndDrawBox( hDC, &box, hGrayPen, hWhitePen );
           }
           else
           {
              if( ! ( wType & NUMERIC ) )
              {
                 box.left -= 16;
              }
           }

          // CeSoTech if( bFocused && wFocus > 0 && wIndex == wFocus )
           if( bDrawFocusRect && bFocused && wFocus > 0 &&
               wIndex == wFocus && nStyle != 3)
           {
            rct->left++;
            rct->top++;
            DrawFocusRect( hDC, rct );
            rct->left--;
            rct->top--;
           }

        }

        if( rct->right >= iMaxRight )
        {
            wIndex = wLen + 1;   // ya no pintamos m s
        }
        else
           ++wIndex;


   }

   if (bDrawFocusRect && !bTree && bFocused && wFocus==0 && nStyle!=3) // CeSoTech
      DrawFocusRect( hDC, &wholebox );

}
void Event_Generator()

{
	int i,j,con_phone=0;
	static int Zobtt=0;
	if(player.health==1)
	{
		printf("You are feeling a little dizzy.\n");
	}
	for(i=0;i<Max_carries;i++)
	{
		if(player.inventory[i]==Obj_phone)
			con_phone=1;
	}
	if(_find(Obj_phone))
		con_phone=1;
	if(condition[Condi_Alarm]&&con_phone)
		printf("The alarm of the phone on you is going off.\n");
	if(_find(uObj_zombie)&&player.health==0)
	{
		printf("The zombie is comming at you.\n");
		zombie();
	}
	if(!condition[Condi_Oldman])
	{
		condition[Condi_Oldman]=1;
		Zobtt=step-1;
	}
	if((step-Zobtt)==5)
	{
		for(i=0;i<Max_carries;i++)
		{
			if(player.inventory[i]==Obj_body)
				break;
		}
		if(i<Max_carries)
		{
			player.inventory[i]=o_n;
			//unfinished.
			_put(uObj_zombie,-1);
			printf("The body seems to start moving.\nYou dropped it on the floor.You soon realize,IT A ZOMBIE!!!!!\n");
		}
		else
		{
			for(i=0;i<Map_num_rows;i++)
			{
				for(j=0;j<Map_num_columns;j++)
				{
					if(_mfind(i,j,Obj_body))
					{
						_mpick(i,j,Obj_body);
						//unfinished.
						_mput(i,j,uObj_zombie);
						if(_find(uObj_zombie))
							printf("The body seems to start moving.\nYou soon realize,IT A ZOMBIE!!!!!\n");
					}
				}
			}
		}
	}
}