Unnamed Fossil Project

Check-in [f23cfce1ab]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:updated
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f23cfce1abaf20c7883143443683c1f08eaabfaa
User & Date: monster 2012-08-22 11:14:28
Context
2012-09-01
16:12
fixes check-in: 1c2ae75e99 user: monster tags: trunk
2012-08-22
11:14
updated check-in: f23cfce1ab user: monster tags: trunk
2012-08-18
19:17
updated check-in: c7f5e2041c user: monster tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to array.hc.

423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
  {
    void *self = a;
    void *compare;
    if ( a->at && a->count )
      {
        if ( 0 != (compare = Yo_Find_Method_Of(&self,Oj_Compare_Elements_OjMID,0)) )
          {
          #if !defined __windoze && !defined __NetBSD__ && !defined __linux__
            qsort_r(a->at,a->count,sizeof(void*),compare,(void*)Array_Sort_Qsort_Compare);
          #elif defined __windoze && _MSC_VER > 1400 
            qsort_s(a->at,a->count,sizeof(void*),compare,(void*)Array_Sort_Qsort_Compare);
          #else /* use global variable */
            __Xchg_Interlock
              {
                Array_Sort_Qsort_Compare_Static_Compare = compare;







|







423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
  {
    void *self = a;
    void *compare;
    if ( a->at && a->count )
      {
        if ( 0 != (compare = Yo_Find_Method_Of(&self,Oj_Compare_Elements_OjMID,0)) )
          {
          #if !defined __windoze && !defined __NetBSD__ && !defined __linux__ && !defined __CYGWIN__
            qsort_r(a->at,a->count,sizeof(void*),compare,(void*)Array_Sort_Qsort_Compare);
          #elif defined __windoze && _MSC_VER > 1400 
            qsort_s(a->at,a->count,sizeof(void*),compare,(void*)Array_Sort_Qsort_Compare);
          #else /* use global variable */
            __Xchg_Interlock
              {
                Array_Sort_Qsort_Compare_Static_Compare = compare;

Changes to cipher.hc.

431
432
433
434
435
436
437
438
439
440
441
442
443
444
445

char *Oj_Encrypt_Str2Hex(void *cipher, char *S)
#ifdef _YO_CIPHER_BUILTIN
  {
    char *ret;
    __Auto_Ptr(ret)
      {
        YO_BUFFER *bf = Oj_Encrypt_Bytes(cipher,S,strlen(S));
        ret = Str_Hex_Encode(bf->at,bf->count);
      }
    return ret;
  }
#endif
  ;








|







431
432
433
434
435
436
437
438
439
440
441
442
443
444
445

char *Oj_Encrypt_Str2Hex(void *cipher, char *S)
#ifdef _YO_CIPHER_BUILTIN
  {
    char *ret;
    __Auto_Ptr(ret)
      {
        YO_BUFFER *bf = Oj_Encrypt_Bytes(cipher,S,strlen(S)+1);
        ret = Str_Hex_Encode(bf->at,bf->count);
      }
    return ret;
  }
#endif
  ;

Changes to ctoken.hc.

495
496
497
498
499
500
501

      }
    return 1;
  }
#endif
  ;
  
#endif /* C_once_DD56FBFA_631C_47CD_B2A4_E6C8932594C8 */








>
495
496
497
498
499
500
501
502
      }
    return 1;
  }
#endif
  ;
  
#endif /* C_once_DD56FBFA_631C_47CD_B2A4_E6C8932594C8 */

Changes to httpx.hc.

93
94
95
96
97
98
99

100
101
102
103
104
105
106
...
114
115
116
117
118
119
120



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
...
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
...
795
796
797
798
799
800
801
802
803
804
805
806

807
808
809
810
811
812
813
    unsigned keepalive:  1;
    unsigned legacy10:   1;
    unsigned ssl:        1;
    unsigned proxy:      1;
    unsigned interrupted:1;
    unsigned chunked:    1;
    unsigned retry:      8;

        
  } YO_HTTPX;

void YO_HTTPX_Destruct(YO_HTTPX *httpx)
#ifdef _HTTPX_BUILTIN
  {
    __Unrefe(httpx->netchnl);
................................................................................
    __Unrefe(httpx->content);
    free(httpx->status_text);
    free(httpx->rqst);
    __Destruct(httpx);
  }
#endif
  ;



  
enum 
  {
    HTTPX_ASYNC       = 0x010000,
    HTTPX_KEEPALIVE   = 0x020000,
    HTTPX_LEGACY_10   = 0x040000,
    HTTPX_RETRY       = 0x080000,
    
    YO_HTTPX_RETRAY_DELAY = 3, // sec
    YO_HTTPX_BUFFERD_CONTSTRM_LEN = 64*KILOBYTE,
    
    HTTPX_GET         = __FOUR_CHARS('G','E','T','_'),
    HTTPX_PUT         = __FOUR_CHARS('P','U','T','_'),
    HTTPX_POST        = __FOUR_CHARS('P','O','S','T'),
    HTTPX_HEAD        = __FOUR_CHARS('H','E','A','D'),
    HTTPX_DELETE      = __FOUR_CHARS('D','E','L','T'),
................................................................................
      && !HTTPX_SUCCEEDED(status) 
      && !(status&(HTTPX_PERMANENT_ERROR|HTTPX_INTERRUPTED)) )
      {
        Oj_Close(httpx->netchnl);
        httpx->netchnl = 0; 
        httpx->keepalive = 0;
        if ( httpx->outstrm ) Oj_Truncate(httpx->outstrm,0);
        Tasque_Alert(YO_HTTPX_RETRAY_DELAY*1000,Cbk_Httpx_Retry,httpx);
        return;
      }
  
    if ( httpx->mon_callback )
      httpx->mon_callback(httpx->mon_obj,httpx,httpx->state|status);

    if ( ( httpx->interrupted || !HTTPX_SUCCEEDED(status) )
................................................................................
    
    if ( flags & HTTPX_ASYNC )
      httpx->async = 1;
    if ( flags & HTTPX_KEEPALIVE )
      httpx->keepalive = 1;
    if ( flags & HTTPX_LEGACY_10 )
      httpx->legacy10 = 1;
    if ( flags & HTTPX_RETRY )
      {
        httpx->retry = (flags & 0x0ff);
        if ( !httpx->retry ) httpx->retry = 0x0ff;
      }

      
    if ( httpx->url->proto && httpx->url->proto != URLX_HTTP  )  
      __Raise(YO_ERROR_ILLFORMED,__yoTa("unknown HTTPX protocol requested",0));

    if ( !httpx->url->port ) 
      if ( !httpx->url->proto || httpx->url->proto == URLX_HTTP ) 
        httpx->url->port = 80;







>







 







>
>
>






<

<







 







|







 







<
<
|
<
<
>







93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130

131

132
133
134
135
136
137
138
...
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
...
797
798
799
800
801
802
803


804


805
806
807
808
809
810
811
812
    unsigned keepalive:  1;
    unsigned legacy10:   1;
    unsigned ssl:        1;
    unsigned proxy:      1;
    unsigned interrupted:1;
    unsigned chunked:    1;
    unsigned retry:      8;
    unsigned delay:      8;
        
  } YO_HTTPX;

void YO_HTTPX_Destruct(YO_HTTPX *httpx)
#ifdef _HTTPX_BUILTIN
  {
    __Unrefe(httpx->netchnl);
................................................................................
    __Unrefe(httpx->content);
    free(httpx->status_text);
    free(httpx->rqst);
    __Destruct(httpx);
  }
#endif
  ;

#define HTTPX_RETRY(x) ((x)&0x0ff)
#define HTTPX_DELAY(x) (((x)<<8)&0x0ff)
  
enum 
  {
    HTTPX_ASYNC       = 0x010000,
    HTTPX_KEEPALIVE   = 0x020000,
    HTTPX_LEGACY_10   = 0x040000,

    

    YO_HTTPX_BUFFERD_CONTSTRM_LEN = 64*KILOBYTE,
    
    HTTPX_GET         = __FOUR_CHARS('G','E','T','_'),
    HTTPX_PUT         = __FOUR_CHARS('P','U','T','_'),
    HTTPX_POST        = __FOUR_CHARS('P','O','S','T'),
    HTTPX_HEAD        = __FOUR_CHARS('H','E','A','D'),
    HTTPX_DELETE      = __FOUR_CHARS('D','E','L','T'),
................................................................................
      && !HTTPX_SUCCEEDED(status) 
      && !(status&(HTTPX_PERMANENT_ERROR|HTTPX_INTERRUPTED)) )
      {
        Oj_Close(httpx->netchnl);
        httpx->netchnl = 0; 
        httpx->keepalive = 0;
        if ( httpx->outstrm ) Oj_Truncate(httpx->outstrm,0);
        Tasque_Alert(httpx->delay*1000,Cbk_Httpx_Retry,httpx);
        return;
      }
  
    if ( httpx->mon_callback )
      httpx->mon_callback(httpx->mon_obj,httpx,httpx->state|status);

    if ( ( httpx->interrupted || !HTTPX_SUCCEEDED(status) )
................................................................................
    
    if ( flags & HTTPX_ASYNC )
      httpx->async = 1;
    if ( flags & HTTPX_KEEPALIVE )
      httpx->keepalive = 1;
    if ( flags & HTTPX_LEGACY_10 )
      httpx->legacy10 = 1;


    httpx->retry = (flags & 0x0ff);


    httpx->delay = ((flags>>8) & 0x0ff);
      
    if ( httpx->url->proto && httpx->url->proto != URLX_HTTP  )  
      __Raise(YO_ERROR_ILLFORMED,__yoTa("unknown HTTPX protocol requested",0));

    if ( !httpx->url->port ) 
      if ( !httpx->url->proto || httpx->url->proto == URLX_HTTP ) 
        httpx->url->port = 80;

Changes to mime.hc.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    http://www.gnu.org/licenses/

Otherwise:

Permission is hereby granted, free of charge, to any person obtaining a copy
................................................................................
#endif
  ;
  
int Mime_Code_Of(char *mime_type)
#ifdef _YO_MIME_BUILTIN
  {
    int i;
    char _S[80] = {0};
    char *S = _S;
    for ( i = 0; mime_type[i] && i < sizeof(_S)-1; ++i ) _S[i] = Tolower(mime_type[i]);
    if ( !strncmp(S,"application/",12) )
      {
        S += 12;
        if ( !strncmp(S,"x-",2) ) S +=2;
        if ( !strcmp(S,"octet-stream") ) return YO_MIME_OCTS;
        if ( !strcmp(S,"javascript") )   return YO_MIME_JS;
        if ( !strcmp(S,"msdownload") )   return YO_MIME_EXE;







|







 







|
|
|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    http://www.gnu.org/licenses/

Otherwise:

Permission is hereby granted, free of charge, to any person obtaining a copy
................................................................................
#endif
  ;
  
int Mime_Code_Of(char *mime_type)
#ifdef _YO_MIME_BUILTIN
  {
    int i;
    char SS[80] = {0,};
    char *S = SS;
    for ( i = 0; mime_type[i] && i < sizeof(SS)-1; ++i ) SS[i] = Tolower(mime_type[i]);
    if ( !strncmp(S,"application/",12) )
      {
        S += 12;
        if ( !strncmp(S,"x-",2) ) S +=2;
        if ( !strcmp(S,"octet-stream") ) return YO_MIME_OCTS;
        if ( !strcmp(S,"javascript") )   return YO_MIME_JS;
        if ( !strcmp(S,"msdownload") )   return YO_MIME_EXE;

Changes to mysql.hc.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#include "yoyo.hc"

#ifdef __windoze
# include <winsock2.h>
#endif

#include <mysql.h>
#include <mysqld_error.h>

#ifdef _LIBYOYO
#define _YO_MYSQL_BUILTIN
#endif

void Msql_free_results(MYSQL_RES *rset)
#ifdef _YO_MYSQL_BUILTIN







|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

#include "yoyo.hc"

#ifdef __windoze
# include <winsock2.h>
#endif

#include <mysql/mysql.h>
#include <mysql/mysqld_error.h>

#ifdef _LIBYOYO
#define _YO_MYSQL_BUILTIN
#endif

void Msql_free_results(MYSQL_RES *rset)
#ifdef _YO_MYSQL_BUILTIN

Changes to tasque.hc.

195
196
197
198
199
200
201


202
203
204
205
206
207

208
209
210
211
212
213
214
...
217
218
219
220
221
222
223
224

225
226
227
228
229
230
231
...
265
266
267
268
269
270
271
272


273
274
275
276
277
278
279
...
291
292
293
294
295
296
297
298

299
300
301
302
303
304
305
      }
      
    Thread_Notify(&Tasque_Lock);
  }
#endif
  ;



void Tasque_Queue(/*tasque_proc_t*/ void *task, void *obj, /*tasque_update_t*/ void *update, void *monitor)
#ifdef _YO_TASQUE_BUILTIN
  {
    __Thr_Lock(&Tasque_Lock)
      {
        YO_TASQUE_TASK *t = __Object_Dtor(sizeof(YO_TASQUE_TASK),YO_TASQUE_TASK_Destruct);

        t->task = task;
        t->obj  = __Refe(obj);
        t->update = update;
        t->monitor = __Refe(monitor);
        Slist_Push((YO_TASQUE_TASK**)&Tasque_Task_In,__Retain(t));
      }
    
................................................................................
  }
#endif
  ;

void Tasque_Alert(int ms, /*tasque_alert_t*/ void *callback, void *obj)
#ifdef _YO_TASQUE_BUILTIN
  {
    YO_TASQUE_ALERT *t = __Object_Dtor(sizeof(YO_TASQUE_ALERT),YO_TASQUE_ALERT_Destruct);

    quad_t deadline = Get_System_Millis() + ms;
    t->deadline = deadline;
    t->callback = callback;
    t->obj = __Refe(obj);
    Slist_Push(&Tasque_Alerts_List,__Retain(t));
  }
#endif
................................................................................
    int i;
    quad_t deadline = worktime ? Get_System_Millis() + worktime : 0;
    YO_TASQUE_TASK *t;

    if ( !Tasque_ONCARE && Tasque_COUNT < Tasque_MAX )
      {
        YO_TASQUE_PROCESSOR * volatile p = 0;
        thread_t thr = Thread_Run_Sure(Tasque_Task_Processor,&p,TASQUE_STACK_SIZE);        


        while ( !p ) Switch_to_Thread();
        __Thr_Lock(&Tasque_Lock) p->thr = thr;
      }
      
    Tasque_Perform_Alert();
    
    if ( !Tasque_Task_Out  )
................................................................................
        Tasque_Perform_Alert();
      }
    while (Tasque_Task_Out && ( !deadline || Get_System_Millis() < deadline) ); 
    
    Tasque_Perform_Alert();

    __Thr_Lock(&Tasque_Lock)
      i =  !!Tasque_Task_In || !!Tasque_Task_Out || !!Tasque_Task_Care || !!Tasque_Alerts_List;

    return i;
  }
#endif
  ;

void Tasque_Finish_Task_List(YO_TASQUE_TASK * volatile *lst,int status)
#ifdef _YO_TASQUE_BUILTIN







>
>
|




|
>







 







|
>







 







|
>
>







 







|
>







195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
...
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
...
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
...
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
      }
      
    Thread_Notify(&Tasque_Lock);
  }
#endif
  ;

void Tasque_Queue(
  /*tasque_proc_t*/ void *task, void *obj, 
  /*tasque_update_t*/ void *update, void *monitor)
#ifdef _YO_TASQUE_BUILTIN
  {
    __Thr_Lock(&Tasque_Lock)
      {
        YO_TASQUE_TASK *t = __Object_Dtor(sizeof(YO_TASQUE_TASK),
                                          YO_TASQUE_TASK_Destruct);
        t->task = task;
        t->obj  = __Refe(obj);
        t->update = update;
        t->monitor = __Refe(monitor);
        Slist_Push((YO_TASQUE_TASK**)&Tasque_Task_In,__Retain(t));
      }
    
................................................................................
  }
#endif
  ;

void Tasque_Alert(int ms, /*tasque_alert_t*/ void *callback, void *obj)
#ifdef _YO_TASQUE_BUILTIN
  {
    YO_TASQUE_ALERT *t = __Object_Dtor(sizeof(YO_TASQUE_ALERT),
                                       YO_TASQUE_ALERT_Destruct);
    quad_t deadline = Get_System_Millis() + ms;
    t->deadline = deadline;
    t->callback = callback;
    t->obj = __Refe(obj);
    Slist_Push(&Tasque_Alerts_List,__Retain(t));
  }
#endif
................................................................................
    int i;
    quad_t deadline = worktime ? Get_System_Millis() + worktime : 0;
    YO_TASQUE_TASK *t;

    if ( !Tasque_ONCARE && Tasque_COUNT < Tasque_MAX )
      {
        YO_TASQUE_PROCESSOR * volatile p = 0;
        thread_t thr = Thread_Run_Sure((thread_func_t)Tasque_Task_Processor
                                       ,(void*)&p
                                       ,TASQUE_STACK_SIZE);        
        while ( !p ) Switch_to_Thread();
        __Thr_Lock(&Tasque_Lock) p->thr = thr;
      }
      
    Tasque_Perform_Alert();
    
    if ( !Tasque_Task_Out  )
................................................................................
        Tasque_Perform_Alert();
      }
    while (Tasque_Task_Out && ( !deadline || Get_System_Millis() < deadline) ); 
    
    Tasque_Perform_Alert();

    __Thr_Lock(&Tasque_Lock)
      i =     !!Tasque_Task_In || !!Tasque_Task_Out || !!Tasque_Task_Care 
           || !!Tasque_Alerts_List;
    return i;
  }
#endif
  ;

void Tasque_Finish_Task_List(YO_TASQUE_TASK * volatile *lst,int status)
#ifdef _YO_TASQUE_BUILTIN

Changes to tcpip.hc.

520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
    iot->count = count-cc;
    
    {
      char bf[80];
      char bbf[128];
      sprintf(bf,"err:%%d,count:%%d,bytes:%%.%ds\n",Yo_Minu(iot->count,80)); 
      sprintf(bbf,bf,iot->err,iot->count,iot->dta);
      OutputDebugStringA(bbf);
    }
  }
#endif
  ;
  
void Cbk_Tcp_Recv(YO_TCPSOK *sok, YO_TCP_IOT *iot, int status)
#ifdef _YO_TCPIP_BUILTIN







<







520
521
522
523
524
525
526

527
528
529
530
531
532
533
    iot->count = count-cc;
    
    {
      char bf[80];
      char bbf[128];
      sprintf(bf,"err:%%d,count:%%d,bytes:%%.%ds\n",Yo_Minu(iot->count,80)); 
      sprintf(bbf,bf,iot->err,iot->count,iot->dta);

    }
  }
#endif
  ;
  
void Cbk_Tcp_Recv(YO_TCPSOK *sok, YO_TCP_IOT *iot, int status)
#ifdef _YO_TCPIP_BUILTIN

Changes to xdatasec.hc.

255
256
257
258
259
260
261

      }
    return ok;
  }
#endif
  ;

#endif /* C_once_9CC5C44A_A9F9_40B3_85DA_10A2EE2AD4FC */








>
255
256
257
258
259
260
261
262
      }
    return ok;
  }
#endif
  ;

#endif /* C_once_9CC5C44A_A9F9_40B3_85DA_10A2EE2AD4FC */

Changes to xddb.hc.

227
228
229
230
231
232
233

234
235
236
237
238
239
240
241
242
243
244
245
246
247

248

249

250
251
252
253
254
255
256
257
258
259
260

261
262
263
264
265
266

267
268
269
270
271
272
273
...
274
275
276
277
278
279
280

281

282
283
284
285
286
287
288
289
...
308
309
310
311
312
313
314

315
316


317
318
319

320
321


322
323
324

325
326


327
328
329

330
331


332
333
334
335
336
337
338
339
340
...
360
361
362
363
364
365
366

367
368


369
370
371
372
373
374
375
376
377
...
393
394
395
396
397
398
399

400
401


402
403
404

405
406


407
408
409
410
411
412
413

414
415


416
417
418

419
420


421
422
423

424
425


426
427
428

429
430


431
432
433

434
435


436
437
438

439
440


441
442
443

444
445


446
447
448

449
450


451
452
453

454
455


456
457
458

459
460


461
462
463
464
                at = bf->bytes;
                count = bf->count;
              }
          }
          
        hdr_len = Hex2_To_Unsigned(at+13);
          

        if ( hdr_len < 21 || hdr_len > count || Crc_16(0,at+hdr_len,count-hdr_len) != Hex4_To_Unsigned(at+16) )
          __Raise(YO_ERROR_CORRUPTED,__yoTa("document corrupted",0));

        switch ( at[8] )
          {
            case XDDB_FORMAT_TEXT:
              doc = Def_Parse_Str(at+hdr_len);
              break;
            case XDDB_FORMAT_ZIPPED_TEXT:
              {
                int zOk;
                long final_size = Hex4_To_Unsigned(at+9);
                bf = Buffer_Init(final_size);
                zOk = Zlib_Uncompress(bf->at,&final_size,at+hdr_len,count-hdr_len);

                if ( zOk != 0 )

                  __Raise_Format(YO_ERROR_DECOMPRESS_DATA,(__yoTa("failed to decompress document: %s",0),Zlib_Error(zOk)));

                /*doc = Def_Parse_Str(bf->at);
                bf = Buffer_Copy(at+16,count-16);
                Zlib_Buffer_Uncompress(bf,final_size);*/
                doc = Def_Parse_Str(bf->at);
                break;
              }
            case XDDB_FORMAT_BINARY:
            case XDDB_FORMAT_ZIPPED_BINARY:
              //doc = Xdata_Binary_Decode(at+16,count-16);
              break;
            default:

              __Raise(YO_ERROR_INCONSISTENT,__yoTa("unsupported document format",0));
          }
        key_len = Hex2_To_Unsigned(at+20);
        if ( 22 + key_len != hdr_len ) 
          __Raise(YO_ERROR_CORRUPTED,__yoTa("document corrupted",0));
        Xvalue_Set_Str(Xnode_Value(&doc->root,YO_XDDB_KEY_PROPERTY,1),at+22,key_len);

        Xddb_Set_Revision(doc,Hex8_To_Unsigned(at));
      }
      
    return doc;
  }
#endif
  ;
................................................................................

#define Xddb_Build_Unique_Key() __Pool(Xddb_Build_Unique_Key_Npl())
char *Xddb_Build_Unique_Key_Npl()
#ifdef _YO_XDDB_BUILTIN 
  {
    int pid = getpid();
    

    byte_t uuid[YO_XDDB_UUID_LENGTH] = {0,0,0,0,0,0,0,0}; /* 8 bytes garanty */

    static byte_t uuid1[YO_XDDB_UUID_LENGTH] = {0,0,0,0,0,0,0,0}; /* 8 bytes garanty */
    char   out[(YO_XDDB_UUID_LENGTH*8+5)/6 + 1] = {0,};
    
    do {
    
      time_t tmx = time(0);
      double clo = clock();
      
................................................................................
    } while ( 1 );
    
    return __Memcopy_Npl(out,sizeof(out));
  }
#endif
  ;


_YO_XDDB_EXTERN char Xddb_Delete_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_delete/@*"); 
void Xddb_Delete(YO_XDDB *xddb, char *key) _YO_XDDB_BUILTIN_CODE(


  { ((void(*)(void*,void*))Yo_Find_Method_Of(&xddb,Xddb_Delete_OjMID,YO_RAISE_ERROR))
        (xddb,key); });


_YO_XDDB_EXTERN char Xddb_Get_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_get/@**"); 
void *Xddb_Get(YO_XDDB *xddb, char *key, YO_XDATA *dflt) _YO_XDDB_BUILTIN_CODE(


  { return ((void*(*)(void*,void*,void*))Yo_Find_Method_Of(&xddb,Xddb_Get_OjMID,YO_RAISE_ERROR))
        (xddb,key,dflt); });


_YO_XDDB_EXTERN char Xddb_Has_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_has/@*"); 
int Xddb_Has(YO_XDDB *xddb, char *key) _YO_XDDB_BUILTIN_CODE(


  { return ((int(*)(void*,void*))Yo_Find_Method_Of(&xddb,Xddb_Has_OjMID,YO_RAISE_ERROR))
        (xddb,key); });


_YO_XDDB_EXTERN char Xddb_Store_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_store/@*i"); 
int Xddb_Store(YO_XDDB *xddb, YO_XDATA *doc, int strict_revision) _YO_XDDB_BUILTIN_CODE(


  { return ((int(*)(void*,void*,int))Yo_Find_Method_Of(&xddb,Xddb_Store_OjMID,YO_RAISE_ERROR))
        (xddb,doc,strict_revision); });

#define Xddb_Update(Xddb,Doc) Xddb_Store(Xddb,Doc,1)

int Xddb_Newdoc(YO_XDDB *xddb, YO_XDATA *doc, char *key)
#ifdef _YO_XDDB_BUILTIN 
  {
    Xnode_Value_Set_Str(&doc->root,YO_XDDB_KEY_PROPERTY,key);
................................................................................
    Xnode_Value_Set_Str(&doc->root,YO_XDDB_KEY_PROPERTY,k);
    Xddb_Store(xddb,doc,-1);
    return k;
  }
#endif
  ;
    

_YO_XDDB_EXTERN char Xddb_Source_String_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_source_string/@"); 
char *Xddb_Source_String(void *xddb) _YO_XDDB_BUILTIN_CODE(


  { return ((char*(*)(void*))Yo_Find_Method_Of(&xddb,Xddb_Source_String_OjMID,YO_RAISE_ERROR))
        (xddb); });

char *Xddb_Format_String(YO_XDDB *xddb)
#ifdef _YO_XDDB_BUILTIN 
  {
    switch ( xddb->doc_format )
      {
      case XDDB_FORMAT_TEXT:   return "text";
................................................................................
        return Str_Copy_L(key,(p-key)+1);
      }
    return 0;
  }
#endif
  ;
  

_YO_XDDB_EXTERN char Xddb_Strm_Cancel_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_strm_cancel/@"); 
void Xddb_Strm_Cancel(void *strm) _YO_XDDB_BUILTIN_CODE(


  { ((void(*)(void*))Yo_Find_Method_Of(&strm,Xddb_Strm_Cancel_OjMID,YO_RAISE_ERROR))
        (strm); });


_YO_XDDB_EXTERN char Xddb_Strm_Commit_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_strm_commit/@*i"); 
char *Xddb_Strm_Commit(void *strm, char *key, int overwrite) _YO_XDDB_BUILTIN_CODE(


  { return ((char*(*)(void*,void*,int))Yo_Find_Method_Of(&strm,Xddb_Strm_Commit_OjMID,YO_RAISE_ERROR))
        (strm,key,overwrite); });

#define Xddb_Strm_Commit_Overwrite(Strm,Key) Xddb_Strm_Commit(Strm,Key,1)
#define Xddb_Strm_Commit_New(Strm,Key) Xddb_Strm_Commit(Strm,Key,0)
#define Xddb_Strm_Commit_Unique(Strm) Xddb_Strm_Commit(Strm,0,0)


_YO_XDDB_EXTERN char Xddb_Strm_Open_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_strm_open/@*"); 
void *Xddb_Strm_Open(YO_XDDB *xddb, char *key) _YO_XDDB_BUILTIN_CODE(


  { return ((void*(*)(void*,void*))Yo_Find_Method_Of(&xddb,Xddb_Strm_Open_OjMID,YO_RAISE_ERROR))
        (xddb,key); });


_YO_XDDB_EXTERN char Xddb_Strm_Create_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_strm_create/@i"); 
void *Xddb_Strm_Create(YO_XDDB *xddb, int mime) _YO_XDDB_BUILTIN_CODE(


  { return ((void*(*)(void*,int))Yo_Find_Method_Of(&xddb,Xddb_Strm_Create_OjMID,YO_RAISE_ERROR))
        (xddb,mime); });


_YO_XDDB_EXTERN char Xddb_Strm_Delete_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_strm_delete/@*"); 
void Xddb_Strm_Delete(YO_XDDB *xddb, char *key) _YO_XDDB_BUILTIN_CODE(


  { ((void(*)(void*,void*))Yo_Find_Method_Of(&xddb,Xddb_Strm_Delete_OjMID,YO_RAISE_ERROR))
        (xddb,key); });


_YO_XDDB_EXTERN char Xddb_Seq_Open_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_seq_open/@*i"); 
void *Xddb_Seq_Open(YO_XDDB *xddb, char *key, int mknew) _YO_XDDB_BUILTIN_CODE(


  { return ((void *(*)(void*,void*, int))Yo_Find_Method_Of(&xddb,Xddb_Seq_Open_OjMID,YO_RAISE_ERROR))
        (xddb,key,mknew); });


_YO_XDDB_EXTERN char Xddb_Seq_Delete_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_seq_delete/@*"); 
void Xddb_Seq_Delete(YO_XDDB *xddb, char *key) _YO_XDDB_BUILTIN_CODE(


  { ((void(*)(void*,void*))Yo_Find_Method_Of(&xddb,Xddb_Seq_Delete_OjMID,YO_RAISE_ERROR))
        (xddb,key); });


_YO_XDDB_EXTERN char Xddb_Seq_Take_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_seq_take/@"); 
YO_XDATA *Xddb_Seq_Take(void *seq) _YO_XDDB_BUILTIN_CODE(


  { return ((void*(*)(void*))Yo_Find_Method_Of(&seq,Xddb_Seq_Take_OjMID,YO_RAISE_ERROR))
        (seq); });


_YO_XDDB_EXTERN char Xddb_Seq_Next_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_seq_next/@"); 
YO_XDATA *Xddb_Seq_Next(void *seq) _YO_XDDB_BUILTIN_CODE(


  { return ((void*(*)(void*))Yo_Find_Method_Of(&seq,Xddb_Seq_Next_OjMID,YO_RAISE_ERROR))
        (seq); });


_YO_XDDB_EXTERN char Xddb_Seq_Multi_Next_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_seq_multi_next/@i"); 
YO_ARRAY *Xddb_Seq_Multi_Next(void *seq,int count) _YO_XDDB_BUILTIN_CODE(


  { return ((void*(*)(void*,int))Yo_Find_Method_Of(&seq,Xddb_Seq_Multi_Next_OjMID,YO_RAISE_ERROR))
        (seq,count); });


_YO_XDDB_EXTERN char Xddb_Seq_Push_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_seq_push/@*"); 
void Xddb_Seq_Push(YO_XDDB *seq, YO_XDATA *doc) _YO_XDDB_BUILTIN_CODE(


  { ((void(*)(void*,void*))Yo_Find_Method_Of(&seq,Xddb_Seq_Push_OjMID,YO_RAISE_ERROR))
        (seq,doc); });


_YO_XDDB_EXTERN char Xddb_Seq_Erase_OjMID[] _YO_XDDB_BUILTIN_CODE( = "xddb_seq_erase/@*"); 
void Xddb_Seq_Erase(YO_XDDB *seq) _YO_XDDB_BUILTIN_CODE(


  { ((void(*)(void*))Yo_Find_Method_Of(&seq,Xddb_Seq_Erase_OjMID,YO_RAISE_ERROR))
        (seq); });

#endif /* C_once_63CF3893_FBF5_4DA0_9B2D_792FE7BBBCAB */







>
|












|
>

>
|
>











>
|




|
>







 







>
|
>
|







 







>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|







 







>
|
|
>
>
|
|







 







>
|
|
>
>
|
|

>
|
|
>
>
|
|





>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|

>
|
|
>
>
|
|


227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
...
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
...
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
...
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
...
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
                at = bf->bytes;
                count = bf->count;
              }
          }
          
        hdr_len = Hex2_To_Unsigned(at+13);
          
        if ( hdr_len < 21 || hdr_len > count 
           || Crc_16(0,at+hdr_len,count-hdr_len) != Hex4_To_Unsigned(at+16) )
          __Raise(YO_ERROR_CORRUPTED,__yoTa("document corrupted",0));

        switch ( at[8] )
          {
            case XDDB_FORMAT_TEXT:
              doc = Def_Parse_Str(at+hdr_len);
              break;
            case XDDB_FORMAT_ZIPPED_TEXT:
              {
                int zOk;
                long final_size = Hex4_To_Unsigned(at+9);
                bf = Buffer_Init(final_size);
                zOk = Zlib_Uncompress(bf->at,&final_size
                                     ,at+hdr_len,count-hdr_len);
                if ( zOk != 0 )
                  __Raise_Format(YO_ERROR_DECOMPRESS_DATA
                          ,(__yoTa("failed to decompress document: %s",0)
                            ,Zlib_Error(zOk)));
                /*doc = Def_Parse_Str(bf->at);
                bf = Buffer_Copy(at+16,count-16);
                Zlib_Buffer_Uncompress(bf,final_size);*/
                doc = Def_Parse_Str(bf->at);
                break;
              }
            case XDDB_FORMAT_BINARY:
            case XDDB_FORMAT_ZIPPED_BINARY:
              //doc = Xdata_Binary_Decode(at+16,count-16);
              break;
            default:
              __Raise(YO_ERROR_INCONSISTENT
                     ,__yoTa("unsupported document format",0));
          }
        key_len = Hex2_To_Unsigned(at+20);
        if ( 22 + key_len != hdr_len ) 
          __Raise(YO_ERROR_CORRUPTED,__yoTa("document corrupted",0));
        Xvalue_Set_Str(Xnode_Value(&doc->root,YO_XDDB_KEY_PROPERTY,1)
                      ,at+22,key_len);
        Xddb_Set_Revision(doc,Hex8_To_Unsigned(at));
      }
      
    return doc;
  }
#endif
  ;
................................................................................

#define Xddb_Build_Unique_Key() __Pool(Xddb_Build_Unique_Key_Npl())
char *Xddb_Build_Unique_Key_Npl()
#ifdef _YO_XDDB_BUILTIN 
  {
    int pid = getpid();
    
    /* 8 bytes garanty */
    byte_t uuid[YO_XDDB_UUID_LENGTH] = {0,0,0,0,0,0,0,0};
    /* 8 bytes garanty */
    static byte_t uuid1[YO_XDDB_UUID_LENGTH] = {0,0,0,0,0,0,0,0}; 
    char   out[(YO_XDDB_UUID_LENGTH*8+5)/6 + 1] = {0,};
    
    do {
    
      time_t tmx = time(0);
      double clo = clock();
      
................................................................................
    } while ( 1 );
    
    return __Memcopy_Npl(out,sizeof(out));
  }
#endif
  ;

_YO_XDDB_EXTERN char Xddb_Delete_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_delete/@*"); 
void Xddb_Delete(YO_XDDB *xddb, char *key) 
  _YO_XDDB_BUILTIN_CODE(
  { ((void(*)(void*,void*))
        Yo_Find_Method_Of(&xddb,Xddb_Delete_OjMID,YO_RAISE_ERROR))
            (xddb,key); });

_YO_XDDB_EXTERN char Xddb_Get_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_get/@**"); 
void *Xddb_Get(YO_XDDB *xddb, char *key, YO_XDATA *dflt) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((void*(*)(void*,void*,void*))
        Yo_Find_Method_Of(&xddb,Xddb_Get_OjMID,YO_RAISE_ERROR))
            (xddb,key,dflt); });

_YO_XDDB_EXTERN char Xddb_Has_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_has/@*"); 
int Xddb_Has(YO_XDDB *xddb, char *key) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((int(*)(void*,void*))
        Yo_Find_Method_Of(&xddb,Xddb_Has_OjMID,YO_RAISE_ERROR))
            (xddb,key); });

_YO_XDDB_EXTERN char Xddb_Store_OjMID[]   
                     _YO_XDDB_BUILTIN_CODE( = "xddb_store/@*i"); 
int Xddb_Store(YO_XDDB *xddb, YO_XDATA *doc, int strict_revision) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((int(*)(void*,void*,int))
        Yo_Find_Method_Of(&xddb,Xddb_Store_OjMID,YO_RAISE_ERROR))
            (xddb,doc,strict_revision); });

#define Xddb_Update(Xddb,Doc) Xddb_Store(Xddb,Doc,1)

int Xddb_Newdoc(YO_XDDB *xddb, YO_XDATA *doc, char *key)
#ifdef _YO_XDDB_BUILTIN 
  {
    Xnode_Value_Set_Str(&doc->root,YO_XDDB_KEY_PROPERTY,key);
................................................................................
    Xnode_Value_Set_Str(&doc->root,YO_XDDB_KEY_PROPERTY,k);
    Xddb_Store(xddb,doc,-1);
    return k;
  }
#endif
  ;
    
_YO_XDDB_EXTERN char Xddb_Source_String_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_source_string/@"); 
char *Xddb_Source_String(void *xddb) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((char*(*)(void*))
        Yo_Find_Method_Of(&xddb,Xddb_Source_String_OjMID,YO_RAISE_ERROR))
            (xddb); });

char *Xddb_Format_String(YO_XDDB *xddb)
#ifdef _YO_XDDB_BUILTIN 
  {
    switch ( xddb->doc_format )
      {
      case XDDB_FORMAT_TEXT:   return "text";
................................................................................
        return Str_Copy_L(key,(p-key)+1);
      }
    return 0;
  }
#endif
  ;
  
_YO_XDDB_EXTERN char Xddb_Strm_Cancel_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_strm_cancel/@"); 
void Xddb_Strm_Cancel(void *strm) 
  _YO_XDDB_BUILTIN_CODE(
  { ((void(*)(void*))
      Yo_Find_Method_Of(&strm,Xddb_Strm_Cancel_OjMID,YO_RAISE_ERROR))
          (strm); });

_YO_XDDB_EXTERN char Xddb_Strm_Commit_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_strm_commit/@*i"); 
char *Xddb_Strm_Commit(void *strm, char *key, int overwrite) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((char*(*)(void*,void*,int))
        Yo_Find_Method_Of(&strm,Xddb_Strm_Commit_OjMID,YO_RAISE_ERROR))
            (strm,key,overwrite); });

#define Xddb_Strm_Commit_Overwrite(Strm,Key) Xddb_Strm_Commit(Strm,Key,1)
#define Xddb_Strm_Commit_New(Strm,Key) Xddb_Strm_Commit(Strm,Key,0)
#define Xddb_Strm_Commit_Unique(Strm) Xddb_Strm_Commit(Strm,0,0)

_YO_XDDB_EXTERN char Xddb_Strm_Open_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_strm_open/@*"); 
void *Xddb_Strm_Open(YO_XDDB *xddb, char *key) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((void*(*)(void*,void*))
        Yo_Find_Method_Of(&xddb,Xddb_Strm_Open_OjMID,YO_RAISE_ERROR))
            (xddb,key); });

_YO_XDDB_EXTERN char Xddb_Strm_Create_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_strm_create/@i"); 
void *Xddb_Strm_Create(YO_XDDB *xddb, int mime) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((void*(*)(void*,int))
        Yo_Find_Method_Of(&xddb,Xddb_Strm_Create_OjMID,YO_RAISE_ERROR))
            (xddb,mime); });

_YO_XDDB_EXTERN char Xddb_Strm_Delete_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_strm_delete/@*"); 
void Xddb_Strm_Delete(YO_XDDB *xddb, char *key) 
  _YO_XDDB_BUILTIN_CODE(
  { ((void(*)(void*,void*))
        Yo_Find_Method_Of(&xddb,Xddb_Strm_Delete_OjMID,YO_RAISE_ERROR))
            (xddb,key); });

_YO_XDDB_EXTERN char Xddb_Seq_Open_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_seq_open/@*i"); 
void *Xddb_Seq_Open(YO_XDDB *xddb, char *key, int mknew) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((void *(*)(void*,void*, int))
        Yo_Find_Method_Of(&xddb,Xddb_Seq_Open_OjMID,YO_RAISE_ERROR))
            (xddb,key,mknew); });

_YO_XDDB_EXTERN char Xddb_Seq_Delete_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_seq_delete/@*"); 
void Xddb_Seq_Delete(YO_XDDB *xddb, char *key) 
  _YO_XDDB_BUILTIN_CODE(
  { ((void(*)(void*,void*))
        Yo_Find_Method_Of(&xddb,Xddb_Seq_Delete_OjMID,YO_RAISE_ERROR))
            (xddb,key); });

_YO_XDDB_EXTERN char Xddb_Seq_Take_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_seq_take/@"); 
YO_XDATA *Xddb_Seq_Take(void *seq) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((void*(*)(void*))
        Yo_Find_Method_Of(&seq,Xddb_Seq_Take_OjMID,YO_RAISE_ERROR))
            (seq); });

_YO_XDDB_EXTERN char Xddb_Seq_Next_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_seq_next/@"); 
YO_XDATA *Xddb_Seq_Next(void *seq) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((void*(*)(void*))
        Yo_Find_Method_Of(&seq,Xddb_Seq_Next_OjMID,YO_RAISE_ERROR))
            (seq); });

_YO_XDDB_EXTERN char Xddb_Seq_Multi_Next_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_seq_multi_next/@i"); 
YO_ARRAY *Xddb_Seq_Multi_Next(void *seq,int count) 
  _YO_XDDB_BUILTIN_CODE(
  { return ((void*(*)(void*,int))
        Yo_Find_Method_Of(&seq,Xddb_Seq_Multi_Next_OjMID,YO_RAISE_ERROR))
            (seq,count); });

_YO_XDDB_EXTERN char Xddb_Seq_Push_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_seq_push/@*"); 
void Xddb_Seq_Push(YO_XDDB *seq, YO_XDATA *doc) 
  _YO_XDDB_BUILTIN_CODE(
  { ((void(*)(void*,void*))
        Yo_Find_Method_Of(&seq,Xddb_Seq_Push_OjMID,YO_RAISE_ERROR))
            (seq,doc); });

_YO_XDDB_EXTERN char Xddb_Seq_Erase_OjMID[] 
                     _YO_XDDB_BUILTIN_CODE( = "xddb_seq_erase/@*"); 
void Xddb_Seq_Erase(YO_XDDB *seq) 
  _YO_XDDB_BUILTIN_CODE(
  { ((void(*)(void*))
        Yo_Find_Method_Of(&seq,Xddb_Seq_Erase_OjMID,YO_RAISE_ERROR))
            (seq); });

#endif /* C_once_63CF3893_FBF5_4DA0_9B2D_792FE7BBBCAB */

Changes to xddbmsql.hc.

82
83
84
85
86
87
88

89

90
91
92
93
94

95
96
97
98
99
100
101
...
118
119
120
121
122
123
124

125


126
127
128
129
130

131
132
133
134
135
136
137
...
147
148
149
150
151
152
153


154
155
156
157
158

159
160
161
162
163
164
165
...
211
212
213
214
215
216
217



218
219
220
221
222
223
224
225
226

227
228
229
230
231
232
233
234

235

236
237
238
239
240
241
242
243
244
245
246



247
248
249
250
251
252
253
254
255

256
257
258
259
260
261
262
263
264
265

266
267
268
269
270
271
272
273
...
275
276
277
278
279
280
281

282

283
284
285
286
287

288
289
290
291
292
293
294
295
...
323
324
325
326
327
328
329

330

331

332
333
334
335
336

337

338
339
340
341
342

343

344

345

346
347
348
349

350

351
352
353

354

355

356
357
358
359
360
361

362


363



364


365



366

367
368
369
370
371
372
373
374
375

376



377

378
379
380
381
382
383
384
385
386
387
388
389
  {
    MYSQL_ROW row;
    MYSQL_RES *rset;
    YO_BUFFER *bf = 0;
   
    __Auto_Ptr(bf)
      { 

        if ( mysql_query(sqldb->con,__Format("SELECT body FROM %s_%s WHERE docid = '%s'",sqldb->dbpfx,colid,docid)) )

          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format(YO_ERROR_INVALID_PARAM,
                  (__yoTa("failed to retrive document: %s",0),mysql_error(sqldb->con)));      

          }
        else
          __Mysql_Results(sqldb->con,rset)
            {
              row = mysql_fetch_row(rset);
              if ( row )
                {
................................................................................
    MYSQL_ROW row;
    MYSQL_RES *rset;
    
    memset(&stats,0,sizeof(stats));
    
    __Auto_Release
      { 

        if ( mysql_query(sqldb->con,__Format("SELECT revision,dtt FROM %s_%s WHERE docid = '%s'",sqldb->dbpfx,colid,docid)) )


          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format(YO_ERROR_INVALID_PARAM,
                  (__yoTa("failed to retrive document stats: %s",0),mysql_error(sqldb->con)));      

          }
        else
          __Mysql_Results(sqldb->con,rset)
            {
              row = mysql_fetch_row(rset);
              if ( row )
                {
................................................................................
#endif
  ;

void XddbMsql_Create_Doc_Table(YO_XDDBmSQL *sqldb, char *colid)
#ifdef _YO_XDDBmSQL_BUILTIN
  {
    if ( mysql_query(sqldb->con,


      __Format("CREATE TABLE IF NOT EXISTS %s_%s ( docid char(%d) PRIMARY KEY, revision INTEGER, dtt VARCHAR(20), body BLOB)",
                sqldb->dbpfx,colid,XDDBSQL_DOC_ENCODED_ID_LEN)) )
      {
        __Raise_Format(YO_ERROR_IO,
            (__yoTa("failed to create collection: %s",0),mysql_error(sqldb->con)));      

      }
  }
#endif
  ;

void XddbMsql_Quote_Append(YO_BUFFER *bf, void *S, int len)
#ifdef _YO_XDDBmSQL_BUILTIN
................................................................................
          
        q = p;
      }
  }
#endif
  ;
  



int XddbMsql_Insert_Doc(YO_XDDBmSQL *sqldb, char *colid, char *docid, int newrev, void *data, int len )
#ifdef _YO_XDDBmSQL_BUILTIN
  {
    int success = 0;
    __Auto_Release
      {
        char *dtt = YmdHMS_Curr_Datetime(0,0,0);
        YO_BUFFER *bf = Buffer_Grow_Reserve(0,len+len/25+128);
        Buffer_Printf(bf,"INSERT INTO %s_%s VALUES( '%s', %d, '%s', '",sqldb->dbpfx,colid,docid,newrev,dtt);

        XddbMsql_Quote_Append(bf,data,len);
        Buffer_Append(bf,"')",2);
      repeat:
        if ( mysql_real_query(sqldb->con,bf->at,bf->count) )
          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format( (err == ER_DUP_ENTRY ? YO_ERROR_ALREADY_EXISTS : YO_ERROR_IO),

                (__yoTa("failed to insert new document: %s",0),mysql_error(sqldb->con)));      

            XddbMsql_Create_Doc_Table(sqldb,colid);
            goto repeat;
          }
        else
          success = mysql_affected_rows(sqldb->con);
      }
    return success;
  }
#endif
  ;
  



int XddbMsql_Update_Doc(YO_XDDBmSQL *sqldb, char *colid, char *docid, int newrev, void *data, int len, int oldrev )
#ifdef _YO_XDDBmSQL_BUILTIN
  {
    int success = 0;
    __Auto_Release
      {
        char *dtt = YmdHMS_Curr_Datetime(0,0,0);
        YO_BUFFER *bf = Buffer_Grow_Reserve(0,len+len/25+128);
        Buffer_Printf(bf,"UPDATE %s_%s SET revision = %d, dtt = '%s', body = '",sqldb->dbpfx,colid,newrev,dtt);

        XddbMsql_Quote_Append(bf,data,len);
        Buffer_Printf(bf,"' WHERE docid = '%s'",docid);
        if ( oldrev )
          Buffer_Printf(bf,"and revision = %d",oldrev);
        if ( mysql_real_query(sqldb->con,bf->at,bf->count) )
          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format(YO_ERROR_IO,
                  (__yoTa("failed to insert new document: %s",0),mysql_error(sqldb->con)));      

            // exists or table dsnt exist is not error, only unsuccesful operation
          }
        else
          success = mysql_affected_rows(sqldb->con);
      }
    return success;
  }
#endif
................................................................................
  
int XddbMsql_Delete_Doc(YO_XDDBmSQL *sqldb, char *colid, char *docid)
#ifdef _YO_XDDBmSQL_BUILTIN
  {
    int success = 0;
    __Auto_Release
      {

        if ( mysql_query(sqldb->con,__Format("DELETE FROM %s_%s WHERE docid = '%s'",sqldb->dbpfx,colid,docid)) )

          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format(YO_ERROR_IO,
                  (__yoTa("failed to insert new document: %s",0),mysql_error(sqldb->con)));      

            // exists or table dsnt exist is not error, only unsuccesful operation
          }
        else
          success = mysql_affected_rows(sqldb->con);
      }
    return success;
  }
#endif
................................................................................
        while ( dbp && *dbp == '/' ) ++dbp;
        if ( dbp && *dbp )
          {
            dbpfx = Path_Basename(dbp);
            dbname = Path_Dirname(dbp);
            if ( !dbname ) { dbname = dbpfx; dbpfx = "xddb";} 
          }

        if ( !dbname )

          __Raise_Format(YO_ERROR_INVALID_PARAM,(__yoTa("mySQL source %s doesn't contain database name",0),source));      

        
        sqldb->con = mysql_init(0);
        sqldb->dbpfx = Str_Copy_Npl(dbpfx,-1);
        
        if ( !mysql_real_connect(sqldb->con,url->host,url->user,pwd,0,0,0,0) )

          __Raise_Format(YO_ERROR_IO,(__yoTa("failed to connect to %s: %s",0),source,mysql_error(sqldb->con)));


        mysql_autocommit(sqldb->con, 1);
        
        if ( kind == XDDB_CREATE_ALWAYS )
          {

            if ( mysql_query(sqldb->con,__Format("DROP DATABASE IF EXISTS %s",dbname))

               ||mysql_query(sqldb->con,__Format("CREATE DATABASE %s",dbname)) )

             __Raise_Format(YO_ERROR_IO,(__yoTa("failed to (re)create databsae %s: %s",0),dbname,mysql_error(sqldb->con)));

          }
        else if ( kind == XDDB_CREATE_NEW )
          {
            if ( mysql_query(sqldb->con,__Format("CREATE DATABASE %s",dbname)) )

             __Raise_Format(YO_ERROR_IO,(__yoTa("failed to create databsae %s: %s",0),dbname,mysql_error(sqldb->con)));

          }
        else if ( kind == XDDB_CREATE_IF_DSNT_EXIST )
          {

            if ( mysql_query(sqldb->con,__Format("CREATE DATABASE IF NOT EXISTS %s",dbname)) )

             __Raise_Format(YO_ERROR_IO,(__yoTa("failed to create databsae %s: %s",0),dbname,mysql_error(sqldb->con)));

          }
        else if ( kind == XDDB_OPEN_EXISTING || kind == XDDB_OPEN_READONLY )
          {
            ; /* nothing */
          }
        if ( mysql_select_db(sqldb->con,dbname) )

          __Raise_Format(YO_ERROR_IO,(__yoTa("failed to select databsae %s: %s",0),dbname,mysql_error(sqldb->con)));


        if ( mysql_query(sqldb->con,__Format("CREATE TABLE IF NOT EXISTS %s_XDDB_INFO ( name varchar(128) UNIQUE, value varchar(128) )",sqldb->dbpfx)) )



         __Raise_Format(YO_ERROR_IO,(__yoTa("failed to create INFO table: %s",0),mysql_error(sqldb->con)));


        if ( mysql_query(sqldb->con,__Format("SELECT value FROM %s_XDDB_INFO WHERE name = 'doc_format'",sqldb->dbpfx)) )



          __Raise_Format(YO_ERROR_IO,(__yoTa("failed to query doc format: %s",0),mysql_error(sqldb->con)));

        else
          {
            MYSQL_RES *rset;
            MYSQL_ROW row;
            __Mysql_Results(sqldb->con,rset)
              {
                if (( row = mysql_fetch_row(rset) ))
                  format = Str_To_Int(*row);
                else

                  if ( mysql_query(sqldb->con,__Format("INSERT INTO %s_XDDB_INFO VALUES ('doc_format','%d')",sqldb->dbpfx,format)) )



                    __Raise_Format(YO_ERROR_IO,(__yoTa("failed to set doc format: %s",0),mysql_error(sqldb->con)));

              }
          }
          
        ret = Xddbsql_Init(sqldb,format,source);
      }
      
    return ret;
  }
#endif
  ;
  
#endif /* C_once_694F4096_7219_47D5_8C2F_7456AB482DDB */







>
|
>



|
|
>







 







>
|
>
>



|
|
>







 







>
>
|



|
>







 







>
>
>
|







|
>







|
>
|
>











>
>
>
|







|
>








|
|
>
|







 







>
|
>



|
|
>
|







 







>

>
|
>





>
|
>





>
|
>
|
>
|
>



|
>
|
>



>
|
>
|
>






>
|
>
>
|
>
>
>
|
>
>
|
>
>
>
|
>









>
|
>
>
>
|
>












82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
...
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
...
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
...
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
...
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
  {
    MYSQL_ROW row;
    MYSQL_RES *rset;
    YO_BUFFER *bf = 0;
   
    __Auto_Ptr(bf)
      { 
        if ( mysql_query(sqldb->con
                   ,__Format("SELECT body FROM %s_%s WHERE docid = '%s'"
                             ,sqldb->dbpfx,colid,docid)) )
          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format(YO_ERROR_INVALID_PARAM
                  ,(__yoTa("failed to retrive document: %s",0)
                    ,mysql_error(sqldb->con)));      
          }
        else
          __Mysql_Results(sqldb->con,rset)
            {
              row = mysql_fetch_row(rset);
              if ( row )
                {
................................................................................
    MYSQL_ROW row;
    MYSQL_RES *rset;
    
    memset(&stats,0,sizeof(stats));
    
    __Auto_Release
      { 
        if ( mysql_query(sqldb->con
                   ,__Format("SELECT revision,dtt FROM %s_%s"
                             " WHERE docid = '%s'"
                             ,sqldb->dbpfx,colid,docid)) )
          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format(YO_ERROR_INVALID_PARAM
                  ,(__yoTa("failed to retrive document stats: %s",0)
                    ,mysql_error(sqldb->con)));      
          }
        else
          __Mysql_Results(sqldb->con,rset)
            {
              row = mysql_fetch_row(rset);
              if ( row )
                {
................................................................................
#endif
  ;

void XddbMsql_Create_Doc_Table(YO_XDDBmSQL *sqldb, char *colid)
#ifdef _YO_XDDBmSQL_BUILTIN
  {
    if ( mysql_query(sqldb->con,
      __Format("CREATE TABLE IF NOT EXISTS %s_%s "
               "( docid char(%d) PRIMARY KEY,"
                " revision INTEGER, dtt VARCHAR(20), body BLOB)",
                sqldb->dbpfx,colid,XDDBSQL_DOC_ENCODED_ID_LEN)) )
      {
        __Raise_Format(YO_ERROR_IO,
            (__yoTa("failed to create collection: %s",0),
                 mysql_error(sqldb->con)));      
      }
  }
#endif
  ;

void XddbMsql_Quote_Append(YO_BUFFER *bf, void *S, int len)
#ifdef _YO_XDDBmSQL_BUILTIN
................................................................................
          
        q = p;
      }
  }
#endif
  ;
  
int XddbMsql_Insert_Doc(
  YO_XDDBmSQL *sqldb, 
  char *colid, char *docid, 
  int newrev, void *data, int len )
#ifdef _YO_XDDBmSQL_BUILTIN
  {
    int success = 0;
    __Auto_Release
      {
        char *dtt = YmdHMS_Curr_Datetime(0,0,0);
        YO_BUFFER *bf = Buffer_Grow_Reserve(0,len+len/25+128);
        Buffer_Printf(bf,"INSERT INTO %s_%s VALUES( '%s', %d, '%s', '"
                         ,sqldb->dbpfx,colid,docid,newrev,dtt);
        XddbMsql_Quote_Append(bf,data,len);
        Buffer_Append(bf,"')",2);
      repeat:
        if ( mysql_real_query(sqldb->con,bf->at,bf->count) )
          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format( (err == ER_DUP_ENTRY ? 
                                      YO_ERROR_ALREADY_EXISTS : YO_ERROR_IO)
                      ,(__yoTa("failed to insert new document: %s",0)
                        ,mysql_error(sqldb->con)));      
            XddbMsql_Create_Doc_Table(sqldb,colid);
            goto repeat;
          }
        else
          success = mysql_affected_rows(sqldb->con);
      }
    return success;
  }
#endif
  ;
  
int XddbMsql_Update_Doc(
  YO_XDDBmSQL *sqldb, 
  char *colid, char *docid, 
  int newrev, void *data, int len, int oldrev )
#ifdef _YO_XDDBmSQL_BUILTIN
  {
    int success = 0;
    __Auto_Release
      {
        char *dtt = YmdHMS_Curr_Datetime(0,0,0);
        YO_BUFFER *bf = Buffer_Grow_Reserve(0,len+len/25+128);
        Buffer_Printf(bf,"UPDATE %s_%s SET revision = %d, dtt = '%s', body = '"
                        ,sqldb->dbpfx,colid,newrev,dtt);
        XddbMsql_Quote_Append(bf,data,len);
        Buffer_Printf(bf,"' WHERE docid = '%s'",docid);
        if ( oldrev )
          Buffer_Printf(bf,"and revision = %d",oldrev);
        if ( mysql_real_query(sqldb->con,bf->at,bf->count) )
          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format(YO_ERROR_IO
                  ,(__yoTa("failed to insert new document: %s",0)
                    ,mysql_error(sqldb->con)));      
            // table already exists or table dsnt exist - is not an error
          }
        else
          success = mysql_affected_rows(sqldb->con);
      }
    return success;
  }
#endif
................................................................................
  
int XddbMsql_Delete_Doc(YO_XDDBmSQL *sqldb, char *colid, char *docid)
#ifdef _YO_XDDBmSQL_BUILTIN
  {
    int success = 0;
    __Auto_Release
      {
        if ( mysql_query(sqldb->con,
                         __Format("DELETE FROM %s_%s WHERE docid = '%s'"
                                  ,sqldb->dbpfx,colid,docid)) )
          {
            int err = mysql_errno(sqldb->con);
            if ( err != ER_NO_SUCH_TABLE )
              __Raise_Format(YO_ERROR_IO
                      ,(__yoTa("failed to insert new document: %s",0)
                        ,mysql_error(sqldb->con)));      
            // table already exists or table dsnt exist - is not an error            
          }
        else
          success = mysql_affected_rows(sqldb->con);
      }
    return success;
  }
#endif
................................................................................
        while ( dbp && *dbp == '/' ) ++dbp;
        if ( dbp && *dbp )
          {
            dbpfx = Path_Basename(dbp);
            dbname = Path_Dirname(dbp);
            if ( !dbname ) { dbname = dbpfx; dbpfx = "xddb";} 
          }
        
        if ( !dbname )
          __Raise_Format(YO_ERROR_INVALID_PARAM
                  ,(__yoTa("mySQL source %s doesn't contain database name",0)
                    ,source));      
        
        sqldb->con = mysql_init(0);
        sqldb->dbpfx = Str_Copy_Npl(dbpfx,-1);
        
        if ( !mysql_real_connect(sqldb->con,url->host,url->user,pwd,0,0,0,0) )
          __Raise_Format(YO_ERROR_IO
                  ,(__yoTa("failed to connect to %s: %s",0)
                    ,source,mysql_error(sqldb->con)));

        mysql_autocommit(sqldb->con, 1);
        
        if ( kind == XDDB_CREATE_ALWAYS )
          {
            if ( mysql_query(sqldb->con
                             ,__Format("DROP DATABASE IF EXISTS %s",dbname))
               ||mysql_query(sqldb->con
                             ,__Format("CREATE DATABASE %s",dbname)) )
              __Raise_Format(YO_ERROR_IO
                      ,(__yoTa("failed to (re)create databsae %s: %s",0)
                      ,dbname,mysql_error(sqldb->con)));
          }
        else if ( kind == XDDB_CREATE_NEW )
          {
            if ( mysql_query(sqldb->con,__Format("CREATE DATABASE %s",dbname)))
              __Raise_Format(YO_ERROR_IO
                      ,(__yoTa("failed to create databsae %s: %s",0)
                        ,dbname,mysql_error(sqldb->con)));
          }
        else if ( kind == XDDB_CREATE_IF_DSNT_EXIST )
          {
            if ( mysql_query(sqldb->con
                       ,__Format("CREATE DATABASE IF NOT EXISTS %s",dbname)) )
              __Raise_Format(YO_ERROR_IO
                      ,(__yoTa("failed to create databsae %s: %s",0)
                        ,dbname,mysql_error(sqldb->con)));
          }
        else if ( kind == XDDB_OPEN_EXISTING || kind == XDDB_OPEN_READONLY )
          {
            ; /* nothing */
          }
        if ( mysql_select_db(sqldb->con,dbname) )
          __Raise_Format(YO_ERROR_IO
                  ,(__yoTa("failed to select databsae %s: %s",0)
                    ,dbname,mysql_error(sqldb->con)));
        if ( mysql_query(sqldb->con
                   ,__Format("CREATE TABLE IF NOT EXISTS %s_XDDB_INFO "
                             "( name varchar(128) UNIQUE, value varchar(128) )"
                             ,sqldb->dbpfx)) )
          __Raise_Format(YO_ERROR_IO
                 ,(__yoTa("failed to create INFO table: %s",0)
                   ,mysql_error(sqldb->con)));
        if ( mysql_query(sqldb->con
                   ,__Format("SELECT value FROM %s_XDDB_INFO"
                             " WHERE name = 'doc_format'"
                             ,sqldb->dbpfx)) )
          __Raise_Format(YO_ERROR_IO
                  ,(__yoTa("failed to query doc format: %s",0)
                    ,mysql_error(sqldb->con)));
        else
          {
            MYSQL_RES *rset;
            MYSQL_ROW row;
            __Mysql_Results(sqldb->con,rset)
              {
                if (( row = mysql_fetch_row(rset) ))
                  format = Str_To_Int(*row);
                else
                  if ( mysql_query(sqldb->con
                             ,__Format("INSERT INTO %s_XDDB_INFO VALUES" 
                                       " ('doc_format','%d')"
                                       ,sqldb->dbpfx,format)) )
                    __Raise_Format(YO_ERROR_IO
                            ,(__yoTa("failed to set doc format: %s",0)
                              ,mysql_error(sqldb->con)));
              }
          }
          
        ret = Xddbsql_Init(sqldb,format,source);
      }
      
    return ret;
  }
#endif
  ;
  
#endif /* C_once_694F4096_7219_47D5_8C2F_7456AB482DDB */

Changes to xddbsql_.hc.

Changes to yoyo.hc.

1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
....
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
....
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
      if ( strcmp(tbl[i].name,name) == 0 )
        return tbl[i].func;
    return 0;
  }
#endif
  ;

void *Yo_Find_Method_Of(void **self,char *name,unsigned flags)
#ifdef _YO_CORE_BUILTIN
  {
    void *o = *self;
    if ( o && STRICT_CHECK(YO_SIGNAT_IS_OK(o)) )
      {
        YO_DYNAMIC *dynco = YO_BASE(o)->dynamic;
        if ( dynco )
          {
            if ( 1 && STRICT_CHECK((dynco->contsig>>8) == YO_DYNCO_ATS || (dynco->contsig>>8) == YO_DYNCO_NYD) )
              {
................................................................................

#ifdef _YO_CORE_BUILTIN
__No_Return void _Yo_Raise(int err,char *msg,char *filename,int lineno)
  {
    YO_C_SUPPORT_INFO *nfo = __Tls_Get(Yo_Csup_Nfo_Tls);
    STRICT_REQUIRE( !nfo || nfo->jb_top < nfo->jb_count );

    printf(__yoTa("err: %d, msg: %s, filename: %s, lineno: %d\n",0),err,msg,filename,lineno);
  
  #if defined _DEBUG && defined __windoze
    if ( IsDebuggerPresent() ) __debugbreak();
  #endif  
  
    if ( err == YO_RERAISE_CURRENT_ERROR && (!nfo || !nfo->err.code) )
      Yo_Fatal(YO_ERROR_UNEXPECTED,__yoTa("no errors occured yet",0),filename,lineno);
................................................................................
    i = snprintf(bt_p,max_bt,__yoTa("--backtrace--",0));
    bt_p+=i;
    max_bt-=i;
    memset(bt_p,0,max_bt--);

    for ( i = 0; i < frames; ++i )
      {
      #ifdef __windoze
        int dif = 0;
        char c = '+';
        int l = snprintf(bt_p,max_bt,__yoTa("\n %-2d=> %s %c%x (%p at %s)",0),
           i,
           "",
           c,
           dif>0?dif:-dif,







|


|







 







|







 







|







1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
....
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
....
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
      if ( strcmp(tbl[i].name,name) == 0 )
        return tbl[i].func;
    return 0;
  }
#endif
  ;

void *Yo_Find_Method_Of(void *self /* VOID**  */,char *name,unsigned flags)
#ifdef _YO_CORE_BUILTIN
  {
    void *o = *(void**)self;
    if ( o && STRICT_CHECK(YO_SIGNAT_IS_OK(o)) )
      {
        YO_DYNAMIC *dynco = YO_BASE(o)->dynamic;
        if ( dynco )
          {
            if ( 1 && STRICT_CHECK((dynco->contsig>>8) == YO_DYNCO_ATS || (dynco->contsig>>8) == YO_DYNCO_NYD) )
              {
................................................................................

#ifdef _YO_CORE_BUILTIN
__No_Return void _Yo_Raise(int err,char *msg,char *filename,int lineno)
  {
    YO_C_SUPPORT_INFO *nfo = __Tls_Get(Yo_Csup_Nfo_Tls);
    STRICT_REQUIRE( !nfo || nfo->jb_top < nfo->jb_count );

    //printf(__yoTa("err: %d, msg: %s, filename: %s, lineno: %d\n",0),err,msg,filename,lineno);
  
  #if defined _DEBUG && defined __windoze
    if ( IsDebuggerPresent() ) __debugbreak();
  #endif  
  
    if ( err == YO_RERAISE_CURRENT_ERROR && (!nfo || !nfo->err.code) )
      Yo_Fatal(YO_ERROR_UNEXPECTED,__yoTa("no errors occured yet",0),filename,lineno);
................................................................................
    i = snprintf(bt_p,max_bt,__yoTa("--backtrace--",0));
    bt_p+=i;
    max_bt-=i;
    memset(bt_p,0,max_bt--);

    for ( i = 0; i < frames; ++i )
      {
      #if defined __windoze || defined __CYGWIN__
        int dif = 0;
        char c = '+';
        int l = snprintf(bt_p,max_bt,__yoTa("\n %-2d=> %s %c%x (%p at %s)",0),
           i,
           "",
           c,
           dif>0?dif:-dif,