Unnamed Fossil Project

Check-in [abbd8eb1ee]
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:abbd8eb1ee99c8896ff58a19680a739b0881b2be
User & Date: monster 2012-08-17 09:12:31
Context
2012-08-18
19:17
updated check-in: c7f5e2041c user: monster tags: trunk
2012-08-17
09:12
updated check-in: abbd8eb1ee user: monster tags: trunk
2012-08-12
10:26
some bugs fixed check-in: b360d43149 user: monster tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to aes.hc.

1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075














1076
1077











1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100

1101
1102
1103
1104
1105
1106
    byte_t key[32];
    Sha2_Digest_Digest(S,strlen(S),key);
    return Aes_Init_Decipher(key,256);
  }
#endif
  ;

void Aes_Encrypt(char *data, int len, char *S)
#ifdef _YO_AES_BUILTIN
  {
    int i;
    YO_AES actx = {0,0,{0}};














    byte_t key[32];
    Sha2_Digest_Digest(S,strlen(S),key);











    Aes_Init_Encipher_Static(&actx,key,256);

    for ( i = 0; i < len && len-i >= 16 ; i += 16 )
      {
        Aes_Encrypt16(&actx,data+i);
      }
  }
#endif
  ;

void Aes_Decrypt(char *data, int len, char *S)
#ifdef _YO_AES_BUILTIN
  {
    int i;
    YO_AES actx = {0,0,{0}};
    byte_t key[32];
    Sha2_Digest_Digest(S,strlen(S),key);
    Aes_Init_Decipher_Static(&actx,key,256);

    for ( i = 0; i < len && len-i >= 16 ; i += 16 )
      {
        Aes_Decrypt16(&actx,data+i);
      }

  }
#endif
  ;

#endif /* C_once_88F44E4C_C507_47B8_A162_CBEC13D572DA */








|




>
>
>
>
>
>
>
>
>
>
>
>
>
>


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

|

|





|


<
<


<
<
<
<
<
<
>






1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115


1116
1117






1118
1119
1120
1121
1122
1123
1124
    byte_t key[32];
    Sha2_Digest_Digest(S,strlen(S),key);
    return Aes_Init_Decipher(key,256);
  }
#endif
  ;

void Aes_Encrypt_Bytes(void *data, int len, void *key, int keylen)
#ifdef _YO_AES_BUILTIN
  {
    int i;
    YO_AES actx = {0,0,{0}};
    if ( len % 16 ) __Raise(YO_ERROR_UNALIGNED,0);
    Aes_Init_Encipher_Static(&actx,key,keylen);

    for ( i = 0; i < len; i += 16 )
      {
        Aes_Encrypt16(&actx,(byte_t*)data+i);
      }
  }
#endif
  ;

void Aes_Encrypt(void *data, int len, char *S)
#ifdef _YO_AES_BUILTIN
  {
    byte_t key[32];
    Sha2_Digest_Digest(S,strlen(S),key);
    Aes_Encrypt_Bytes(data,len&~15,key,sizeof(key));
  }
#endif
  ;

void Aes_Decrypt_Bytes(void *data, int len, void *key, int keylen)
#ifdef _YO_AES_BUILTIN
  {
    int i;
    YO_AES actx = {0,0,{0}};
    if ( len % 16 ) __Raise(YO_ERROR_UNALIGNED,0);
    Aes_Init_Decipher_Static(&actx,key,keylen);

    for ( i = 0; i < len; i += 16 )
      {
        Aes_Decrypt16(&actx,(byte_t*)data+i);
      }
  }
#endif
  ;

void Aes_Decrypt(void *data, int len, char *S)
#ifdef _YO_AES_BUILTIN
  {


    byte_t key[32];
    Sha2_Digest_Digest(S,strlen(S),key);






    Aes_Decrypt_Bytes(data,len&~15,key,sizeof(key));
  }
#endif
  ;

#endif /* C_once_88F44E4C_C507_47B8_A162_CBEC13D572DA */

Changes to blowfish.hc.

510
511
512
513
514
515
516
















517










518
519
520
521
522
523

524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
  }
#endif
  ;

#define Blowfish_Decipher(Skey) Blowfish_Object_Init_With_Text_Key(Skey)
#define Blowfish_Encipher(Skey) Blowfish_Object_Init_With_Text_Key(Skey)

















void Blowfish_Encrypt(char *data, int len, char *passwd)










#ifdef _YO_BLOWFISH_BUILTIN
  {
    int i;
    YO_BLOWFISH bfctx = {{0},{{0},{0}}};
    Blowfish_Init_Static(&bfctx,passwd,strlen(passwd));
    

    for ( i = 0; i < len && len-i >= 8 ; i += 8 )
      {
        Blowfish_Encrypt8(&bfctx,data+i);
      }
  }
#endif
  ;

void Blowfish_Decrypt(char *data, int len, char *passwd)
#ifdef _YO_BLOWFISH_BUILTIN
  {
    int i;
    YO_BLOWFISH bfctx = {{0},{{0},{0}}};
    Blowfish_Init_Static(&bfctx,passwd,strlen(passwd));
    
    for ( i = 0; i < len && len-i >= 8 ; i += 8 )
      {
        Blowfish_Decrypt8(&bfctx,data+i);
      }
  }
#endif
  ;

#endif /* C_once_A87E119A_8C55_442C_94CE_F1B2DF0121AD */








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




|

>
|

|





|


|
<
|
<
<
<
|
<






510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562

563



564

565
566
567
568
569
570
  }
#endif
  ;

#define Blowfish_Decipher(Skey) Blowfish_Object_Init_With_Text_Key(Skey)
#define Blowfish_Encipher(Skey) Blowfish_Object_Init_With_Text_Key(Skey)

void Blowfish_Encrypt_Bytes(void *data, int len, void *key, int key_len)
#ifdef _YO_BLOWFISH_BUILTIN
  {
    int i;
    YO_BLOWFISH bfctx = {{0},{{0},{0}}};
    Blowfish_Init_Static(&bfctx,key,key_len);
    
    if ( len % 8 ) __Raise(YO_ERROR_UNALIGNED,0);
    for ( i = 0; i < len; i += 8 )
      {
        Blowfish_Encrypt8(&bfctx,(byte_t*)data+i);
      }
  }
#endif
  ;

void Blowfish_Encrypt(void *data, int len, char *passwd)
#ifdef _YO_BLOWFISH_BUILTIN
  {
    byte_t key[16] = {0};
    Md5_Digest(passwd,strlen(passwd),key);
    Blowfish_Encrypt_Bytes(data,len&~7,key,sizeof(key));
  }
#endif
  ;

void Blowfish_Decrypt_Bytes(void *data, int len, void *key, int key_len)
#ifdef _YO_BLOWFISH_BUILTIN
  {
    int i;
    YO_BLOWFISH bfctx = {{0},{{0},{0}}};
    Blowfish_Init_Static(&bfctx,key,key_len);
    
    if ( len % 8 ) __Raise(YO_ERROR_UNALIGNED,0);
    for ( i = 0; i < len; i += 8 )
      {
        Blowfish_Decrypt8(&bfctx,(byte_t*)data+i);
      }
  }
#endif
  ;

void Blowfish_Decrypt(void *data, int len, char *passwd)
#ifdef _YO_BLOWFISH_BUILTIN
  {
    byte_t key[16] = {0};

    Md5_Digest(passwd,strlen(passwd),key);



    Blowfish_Decrypt_Bytes(data,len&~7,key,sizeof(key));

  }
#endif
  ;

#endif /* C_once_A87E119A_8C55_442C_94CE_F1B2DF0121AD */

Changes to buffer.hc.

119
120
121
122
123
124
125

126
127
128
129
130
131
132
133
134
135

136
137
138
139
140
141
142
#endif
  ;

void Buffer_Resize(YO_BUFFER *bf,int count)
#ifdef _YO_BUFFER_BUILTIN
  {
    Buffer_Reserve(bf,count);

    bf->count = count;
    if ( bf->at ) bf->at[bf->count] = 0;
  }
#endif
  ;

void Buffer_Grow(YO_BUFFER *bf,int count)
#ifdef _YO_BUFFER_BUILTIN
  {
    Buffer_Grow_Reserve(bf,count);

    bf->count = count;
    bf->at[bf->count] = 0;
  }
#endif
  ;
void Buffer_Append(YO_BUFFER *bf,void *S,int len)
#ifdef _YO_BUFFER_BUILTIN







>










>







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#endif
  ;

void Buffer_Resize(YO_BUFFER *bf,int count)
#ifdef _YO_BUFFER_BUILTIN
  {
    Buffer_Reserve(bf,count);
    if ( bf->count < count ) memset(bf->at+bf->count,0,count-bf->count);
    bf->count = count;
    if ( bf->at ) bf->at[bf->count] = 0;
  }
#endif
  ;

void Buffer_Grow(YO_BUFFER *bf,int count)
#ifdef _YO_BUFFER_BUILTIN
  {
    Buffer_Grow_Reserve(bf,count);
    if ( bf->count < count ) memset(bf->at+bf->count,0,count-bf->count);
    bf->count = count;
    bf->at[bf->count] = 0;
  }
#endif
  ;
void Buffer_Append(YO_BUFFER *bf,void *S,int len)
#ifdef _YO_BUFFER_BUILTIN

Changes to cipher.hc.

49
50
51
52
53
54
55

56
57
58
59
60
61
62
...
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
































































































































334
335
#ifdef _LIBYOYO
#define _YO_CIPHER_BUILTIN
#endif

#include "yoyo.hc"
#include "md5.hc"
#include "sha2.hc"


#ifdef _YO_CIPHER_BUILTIN
# define _YO_CIPHER_BUILTIN_CODE(Code) Code
# define _YO_CIPHER_EXTERN 
#else
# define _YO_CIPHER_BUILTIN_CODE(Code)
# define _YO_CIPHER_EXTERN extern 
................................................................................
  }
#endif
  ;

quad_t Oj_Encrypt_XEX_MDSH(void *cipher, void *S, int S_len, quad_t st)
#ifdef _YO_CIPHER_BUILTIN
  {
    return Oj_Decrypt_XEX_2(cipher,0,S,S_len,st);
  }
#endif
  ;

quad_t Oj_Decrypt_XEX_MDSH(void *cipher, void *S, int S_len, quad_t st)
#ifdef _YO_CIPHER_BUILTIN
  {
    return Oj_Decrypt_XEX_2(cipher,0,S,S_len,st);
  }
#endif
  ;

































































































































#endif /* C_once_1F19AF84_9BBE_46CC_87A4_8252243D7219 */








>







 







|












>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
...
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
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
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
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
#ifdef _LIBYOYO
#define _YO_CIPHER_BUILTIN
#endif

#include "yoyo.hc"
#include "md5.hc"
#include "sha2.hc"
#include "buffer.hc"

#ifdef _YO_CIPHER_BUILTIN
# define _YO_CIPHER_BUILTIN_CODE(Code) Code
# define _YO_CIPHER_EXTERN 
#else
# define _YO_CIPHER_BUILTIN_CODE(Code)
# define _YO_CIPHER_EXTERN extern 
................................................................................
  }
#endif
  ;

quad_t Oj_Encrypt_XEX_MDSH(void *cipher, void *S, int S_len, quad_t st)
#ifdef _YO_CIPHER_BUILTIN
  {
    return Oj_Encrypt_XEX_2(cipher,0,S,S_len,st);
  }
#endif
  ;

quad_t Oj_Decrypt_XEX_MDSH(void *cipher, void *S, int S_len, quad_t st)
#ifdef _YO_CIPHER_BUILTIN
  {
    return Oj_Decrypt_XEX_2(cipher,0,S,S_len,st);
  }
#endif
  ;

quad_t Oj_Encrypt_Buffer_XEX_MDSH(void *cipher, YO_BUFFER *bf, quad_t st)
#ifdef _YO_CIPHER_BUILTIN
  {
    void *foo = cipher;
    int K = Yo_Find_Method_Of(&foo,Oj_Encrypt8_OjMID,0)?7:15;
    int L = (bf->count + K) & ~K;    
    Buffer_Resize(bf,L);
    return Oj_Encrypt_XEX_2(cipher,0,bf->at,L,st);
  }
#endif
  ;

quad_t Oj_Decrypt_Buffer_XEX_MDSH(void *cipher, YO_BUFFER *bf, quad_t st)
#ifdef _YO_CIPHER_BUILTIN
  {
    return Oj_Decrypt_XEX_2(cipher,0,bf->at,bf->count,st);
  }
#endif
  ;

YO_BUFFER *Oj_Encrypt_Bytes(void *cipher, void *S, int L)
#ifdef _YO_CIPHER_BUILTIN
  {
    YO_BUFFER *bf = 0;
    __Auto_Ptr(bf)
      {
        void (*encrypt)(void*,void*) = 0;
        void *foo = cipher;
        quad_t st;
        byte_t ivt[16] = {0,};
        bf = Buffer_Init(0);
        Soft_Random(ivt,sizeof(ivt));
        ivt[7] = (8 - (L % 8));
        Unsigned_To_Two(Crc_16(0,S,L),ivt+5);
        st = Eight_To_Quad(ivt);
        if (( encrypt = Yo_Find_Method_Of(&foo,Oj_Encrypt8_OjMID,0) )) 
          {
            int K = (L + 7) & ~7;
            encrypt(foo,ivt); 
            Buffer_Resize(bf,K+8);
            memcpy(bf->at,ivt,8);
            memcpy(bf->at+8,S,L);
            Oj_Encrypt_XEX_MDSH(cipher,bf->at+8,K,st);
          }
        else 
          {
            int K = (L + 15) & ~15;
            encrypt = Yo_Find_Method_Of(&foo,Oj_Encrypt16_OjMID,YO_RAISE_ERROR);
            encrypt(foo,ivt);
            Buffer_Resize(bf,K+16);
            memcpy(bf->at,ivt,16);
            strcpy(bf->at+16,S);
            Oj_Encrypt_XEX_MDSH(cipher,bf->at+16,K,st);
          }
      }
    return bf;
  }
#endif
  ;

char *Oj_Decrypt_Bytes(void *cipher, YO_BUFFER *bf)
#ifdef _YO_CIPHER_BUILTIN
  {
    __Auto_Release
      {
        void (*decrypt)(void*,void*) = 0;
        void *foo = cipher;
        int L = bf->count;
        quad_t st;
        if (( decrypt = Yo_Find_Method_Of(&foo,Oj_Decrypt8_OjMID,0) )) 
          {
            decrypt(foo,bf->at);
            st = Eight_To_Quad(bf->at);
            foo = bf->at+8;
            L = ( L - 8 ) & ~7; 
          }
        else
          {
            decrypt = Yo_Find_Method_Of(&foo,Oj_Decrypt16_OjMID,YO_RAISE_ERROR);
            decrypt(foo,bf->at);
            st = Eight_To_Quad(bf->at);
            foo = bf->at+16;
            L = ( L - 16 ) & ~15; 
          }
        Oj_Decrypt_XEX_MDSH(cipher,foo,L,st);
        L -= bf->at[7]; 
        if ( L < 1 || Crc_16(0,foo,L) != Two_To_Unsigned(bf->at+5) )
          __Raise(YO_ERROR_CORRUPTED,0);
        memmove(bf->at,foo,L);
        bf->count = L;
      }
      
    return bf->at;
  }
#endif
  ;

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
  ;

char *Oj_Decrypt_Hex2Str(void *cipher, char *S)
#ifdef _YO_CIPHER_BUILTIN
  {
    char *ret = 0;
    __Auto_Ptr(ret)
      {
        int L;
        YO_BUFFER *bf = Buffer_Init(strlen(S)/2+1);
        Str_Hex_Decode_(S,&bf->count,bf->at);
        Oj_Decrypt_Bytes(cipher,bf);
        ret = Buffer_Take_Data(bf);
      }
    return ret;
  }
#endif
  ;
  
#endif /* C_once_1F19AF84_9BBE_46CC_87A4_8252243D7219 */

Changes to file.hc.

1082
1083
1084
1085
1086
1087
1088
1089
1090











1091
1092
1093
1094
1095
1096
1097
....
1111
1112
1113
1114
1115
1116
1117






1118
1119
1120
1121
1122
1123
1124
....
1719
1720
1721
1722
1723
1724
1725










1726
1727
1728
1729
1730
1731
1732
....
1736
1737
1738
1739
1740
1741
1742

1743
1744
1745
1746
1747
1748
1749
....
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
  }
#endif
  ;

_YO_FILE_EXTERN char Oj_Seek_OjMID[] _YO_FILE_BUILTIN_CODE( = "seek/@qi"); 
quad_t Oj_Seek(void *f, quad_t pos, int whence) _YO_FILE_BUILTIN_CODE(
  { return 
      ((quad_t (*)(void*,quad_t,int whence))Yo_Find_Method_Of(&f,Oj_Seek_OjMID,YO_RAISE_ERROR))
        (f,pos,whence); });












quad_t Cfile_Seek(YO_CFILE *f, quad_t pos, int whence)
#ifdef _YO_FILE_BUILTIN
  {
    quad_t old = Cfile_Tell(f);
    if ( old < 0 ) return -1;
    
................................................................................
          File_Check_Error("seek",f->fd,f->name,0);
        return old;
      }
    return 0;
  }
#endif
  ;







YO_CFILE *Cfile_Object(FILE *fd, char *name, int share)
#ifdef _YO_FILE_BUILTIN
  {
    static YO_FUNCTABLE funcs[] = 
      { {0},
        {Oj_Destruct_OjMID,    Cfile_Destruct},
................................................................................

void Buffer_File_Flush()
#ifdef _YO_FILE_BUILTIN
  {
  }
#endif
  ;











void *Buffer_As_File(YO_BUFFER *bf)
#ifdef _YO_FILE_BUILTIN
  {
    static YO_FUNCTABLE funcs[] = 
      { {0},
        {Oj_Destruct_OjMID,    YO_BUFFER_FILE_Destruct},
................................................................................
        {Oj_Available_OjMID,   Buffer_File_Available},
        {Oj_Eof_OjMID,         Buffer_File_Eof},
        {Oj_Length_OjMID,      Buffer_File_Length},
        {Oj_Seek_OjMID,        Buffer_File_Seek},
        {Oj_Tell_OjMID,        Buffer_File_Tell},
        {Oj_Flush_OjMID,       Buffer_File_Flush},
        {Oj_Read_Line_OjMID,   Buffer_File_Read_Line},

        {0}
      };
    YO_BUFFER_FILE *file = __Object(sizeof(YO_BUFFER_FILE),funcs);
    if ( !bf ) bf = Buffer_Init(0);
    file->bf = __Refe(bf);
    return file;
  }
................................................................................
  }
#endif
  ;

int Memory_File_Write(YO_BUFFER_FILE *f, void *buf, int count, int min_count)
#ifdef _YO_FILE_BUILTIN
  {
    if (f->bf->count < f->offs + count )
      __Raise(YO_ERROR_OUT_OF_RANGE,"out of memory range");
    memcpy(f->bf->at+f->offs,buf,count);
    f->offs += count;
    return count;
  }
#endif
  ;







|

>
>
>
>
>
>
>
>
>
>
>







 







>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>







 







>







 







|







1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
....
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
....
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
....
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
....
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
  }
#endif
  ;

_YO_FILE_EXTERN char Oj_Seek_OjMID[] _YO_FILE_BUILTIN_CODE( = "seek/@qi"); 
quad_t Oj_Seek(void *f, quad_t pos, int whence) _YO_FILE_BUILTIN_CODE(
  { return 
      ((quad_t (*)(void*,quad_t,int))Yo_Find_Method_Of(&f,Oj_Seek_OjMID,YO_RAISE_ERROR))
        (f,pos,whence); });

_YO_FILE_EXTERN char Oj_Rewind_OjMID[] _YO_FILE_BUILTIN_CODE( = "rewind/@"); 
void Oj_Rewind(void *f) _YO_FILE_BUILTIN_CODE(
  { 
    quad_t (*f_seek)(void*,quad_t,int) = Yo_Find_Method_Of(&f,Oj_Seek_OjMID,0);
    if ( f_seek ) 
      f_seek(f,0,0);
    else
      ((void(*)(void*))Yo_Find_Method_Of(&f,Oj_Rewind_OjMID,YO_RAISE_ERROR))
        (f); 
  });

quad_t Cfile_Seek(YO_CFILE *f, quad_t pos, int whence)
#ifdef _YO_FILE_BUILTIN
  {
    quad_t old = Cfile_Tell(f);
    if ( old < 0 ) return -1;
    
................................................................................
          File_Check_Error("seek",f->fd,f->name,0);
        return old;
      }
    return 0;
  }
#endif
  ;

_YO_FILE_EXTERN char Oj_Truncate_OjMID[] _YO_FILE_BUILTIN_CODE( = "truncate/@q"); 
quad_t Oj_Truncate(void *f, quad_t length) _YO_FILE_BUILTIN_CODE(
  { return 
      ((quad_t (*)(void*,quad_t))Yo_Find_Method_Of(&f,Oj_Truncate_OjMID,YO_RAISE_ERROR))
        (f,length); });

YO_CFILE *Cfile_Object(FILE *fd, char *name, int share)
#ifdef _YO_FILE_BUILTIN
  {
    static YO_FUNCTABLE funcs[] = 
      { {0},
        {Oj_Destruct_OjMID,    Cfile_Destruct},
................................................................................

void Buffer_File_Flush()
#ifdef _YO_FILE_BUILTIN
  {
  }
#endif
  ;

quad_t Buffer_File_Truncate(YO_BUFFER_FILE *f, quad_t len)
#ifdef _YO_FILE_BUILTIN
  {
    if ( len >= 0 && len < f->bf->count ) 
      Buffer_Resize(f->bf,len);
    return f->bf->count;
  }
#endif
  ;

void *Buffer_As_File(YO_BUFFER *bf)
#ifdef _YO_FILE_BUILTIN
  {
    static YO_FUNCTABLE funcs[] = 
      { {0},
        {Oj_Destruct_OjMID,    YO_BUFFER_FILE_Destruct},
................................................................................
        {Oj_Available_OjMID,   Buffer_File_Available},
        {Oj_Eof_OjMID,         Buffer_File_Eof},
        {Oj_Length_OjMID,      Buffer_File_Length},
        {Oj_Seek_OjMID,        Buffer_File_Seek},
        {Oj_Tell_OjMID,        Buffer_File_Tell},
        {Oj_Flush_OjMID,       Buffer_File_Flush},
        {Oj_Read_Line_OjMID,   Buffer_File_Read_Line},
        {Oj_Truncate_OjMID,    Buffer_File_Truncate},
        {0}
      };
    YO_BUFFER_FILE *file = __Object(sizeof(YO_BUFFER_FILE),funcs);
    if ( !bf ) bf = Buffer_Init(0);
    file->bf = __Refe(bf);
    return file;
  }
................................................................................
  }
#endif
  ;

int Memory_File_Write(YO_BUFFER_FILE *f, void *buf, int count, int min_count)
#ifdef _YO_FILE_BUILTIN
  {
    if ( f->bf->count < f->offs + count )
      __Raise(YO_ERROR_OUT_OF_RANGE,"out of memory range");
    memcpy(f->bf->at+f->offs,buf,count);
    f->offs += count;
    return count;
  }
#endif
  ;

Changes to httpd.hc.

350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
    else
      {
        //if ( rqst->cache_control )
        //  Buffer_Printf(bf,);
        if ( rqst->cookie->count ) for ( i=0; i<rqst->cookie->count; ++i )
          Buffer_Printf(bf,"Set-Cookie: %s\r\n",rqst->cookie->at[i]);
          
        if ( rqst->outstrm )
          {
            if ( rqst->outstrm_charset && rqst->outstrm_type )
              Buffer_Printf(bf,"Content-Type: %s; charset=%s\n\r\n",rqst->outstrm_type,rqst->outstrm_charset);
            else if ( !rqst->outstrm_type || !strncmp_I(rqst->outstrm_type,"text/",5) )
              Buffer_Printf(bf,"Content-Type: %s; charset=utf-8\r\n",rqst->outstrm_type?rqst->outstrm_type:"text/plain");
            //else if ( !rqst->outstrm_type )
            //  Buffer_Printf(bf,"Content-Type: %s\r\n","text/plain");







|







350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
    else
      {
        //if ( rqst->cache_control )
        //  Buffer_Printf(bf,);
        if ( rqst->cookie->count ) for ( i=0; i<rqst->cookie->count; ++i )
          Buffer_Printf(bf,"Set-Cookie: %s\r\n",rqst->cookie->at[i]);
          
        if ( rqst->outstrm || rqst->method == HTTPD_HEAD_METHOD )
          {
            if ( rqst->outstrm_charset && rqst->outstrm_type )
              Buffer_Printf(bf,"Content-Type: %s; charset=%s\n\r\n",rqst->outstrm_type,rqst->outstrm_charset);
            else if ( !rqst->outstrm_type || !strncmp_I(rqst->outstrm_type,"text/",5) )
              Buffer_Printf(bf,"Content-Type: %s; charset=utf-8\r\n",rqst->outstrm_type?rqst->outstrm_type:"text/plain");
            //else if ( !rqst->outstrm_type )
            //  Buffer_Printf(bf,"Content-Type: %s\r\n","text/plain");

Changes to httpx.hc.

63
64
65
66
67
68
69


70
71
72
73
74
75
76
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96

97
98
99
100
101
102
103
...
106
107
108
109
110
111
112

113
114
115
116
117
118
119
120
121
122




123
124
125
126
127
128
129
...
141
142
143
144
145
146
147

148
149
150
151
152
153
154
...
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
298
...
585
586
587
588
589
590
591

592
593
594
595
596
597
598
...
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
...
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
...
697
698
699
700
701
702
703
704
705
706
707








708















709
710
711
712
713
714
715
...
732
733
734
735
736
737
738

739




740
741
742
743
744
745
746
...
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
typedef void (*httpx_collback_t)(void *obj, struct _YO_HTTPX *httpx, int status);

typedef struct _YO_HTTPX
  {
    void *netchnl;
    YO_URL *url;
    YO_URL *proxy_url;


    
    int  method;
    int  maxcount;
    int  left;
    
    void *outstrm;
    void *poststrm;
................................................................................
    YO_DICTO  *hdrs;
    YO_BUFFER *content;
    int   state;
    int   streamed;
    int   status;
    char *status_text;
    
    int async:      1;
    int keepalive:  1;
    int legacy10:   1;
    int ssl:        1;
    int proxy:      1;
    int interrupted:1;
    int chunked:    1;

        
  } YO_HTTPX;

void YO_HTTPX_Destruct(YO_HTTPX *httpx)
#ifdef _HTTPX_BUILTIN
  {
    __Unrefe(httpx->netchnl);
................................................................................
    __Unrefe(httpx->outstrm);
    __Unrefe(httpx->poststrm);
    __Unrefe(httpx->mon_obj);
    __Unrefe(httpx->bf);
    __Unrefe(httpx->hdrs);
    __Unrefe(httpx->content);
    free(httpx->status_text);

    __Destruct(httpx);
  }
#endif
  ;
  
enum 
  {
    HTTPX_ASYNC       = 1,
    HTTPX_KEEPALIVE   = 2,
    HTTPX_LEGACY_10   = 4,




    
    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_REQUESTED               = 0x00000f21,
    HTTPX_GETTING_HEADERS         = 0x00000f30,
    HTTPX_RESPONDED               = 0x00000f31,
    HTTPX_GETTING_CONTENT         = 0x00000f40,
    HTTPX_FINISHED                = 0x00000f41,
    HTTPX_SEND                    = 0x00000e01,
    HTTPX_RECV                    = 0x00000e02,


    HTTPX_INVALID_RESPONSE        = 0x00000d01,
    HTTPX_INVALID_RESPONSE_CODE   = 0x00000d02,
  };

#define HTTPX_SUCCEEDED(Status) (((Status)&0x8f000000) == 0)
#define HTTPX_STATUS(Status)    ((Status)&0x0fff)
................................................................................
        sprintf(len,"%u",(unsigned int)qlen);
        if ( method == HTTPX_POST )
          Httpx_Append_Common_Header_Line(bf,hdrs,"Content-Type","application/x-www-form-urlencoded");
        else
          Httpx_Append_Common_Header_Line(bf,hdrs,"Content-Type","application/octet-stream");
        Httpx_Append_Header_Line(bf,"Content-Length",len);
      }
    Buffer_Append(bf,"\r\n",2);      


  }
#endif
  ;

void Httpx_Interrupt(YO_HTTPX *httpx)
#ifdef _HTTPX_BUILTIN
  {
    httpx->interrupted = 1;
    if ( !httpx->ssl )
      Tcp_Close(httpx->netchnl);
  }
#endif
  ;
















    
void Httpx_Do_Callback(YO_HTTPX *httpx, int status)
#ifdef _HTTPX_BUILTIN
  {












    if ( httpx->mon_callback )
      httpx->mon_callback(httpx->mon_obj,httpx,httpx->state|status);

    if ( ( httpx->interrupted || !HTTPX_SUCCEEDED(status) )
      || ( httpx->state == HTTPX_FINISHED && !httpx->keepalive ) )
      {
        Oj_Close(httpx->netchnl); 

        httpx->keepalive = 0;
      }
      
    if ( !HTTPX_SUCCEEDED(status) )
      {
        httpx->state |= HTTPX_BROKEN;
        if ( httpx->interrupted )
................................................................................
        return;
      }

    Httpx_Do_Callback(httpx,HTTPX_REQUESTED);
    Buffer_Grow_Reserve(httpx->bf,1023);
    httpx->bf->count = 0;
    httpx->keepalive = 0;

    
    Httpx_Aio_Recv(httpx, httpx->bf->at, 1023, 12 /* lengthof HTTP/1.1 200 */
                          ,Cbk_Httpx_Getting_Headers);    
  }
#endif
  ;
  
................................................................................
        Httpx_Do_Callback(httpx,HTTPX_BROKEN
                               |((error&TCP_PERMANENT_ERROR)?HTTPX_PERMANENT_ERROR:0));
        return;
      }
      
    Httpx_Do_Callback(httpx,HTTPX_CONNECTED);
    
    /* httpx->bf contains prepared request */
    Httpx_Aio_Send(httpx, httpx->bf->at, httpx->bf->count,
                           (httpx->method == HTTPX_POST || httpx->method == HTTPX_PUT ) 
                                ?Cbk_Httpx_Post
                                :Cbk_Httpx_Requested);    
  }
#endif
  ;
  
................................................................................
  ;
  
void Httpx_Connect(YO_HTTPX *httpx)
#ifdef _HTTPX_BUILTIN
  {
    if ( httpx->keepalive && httpx->netchnl )
      {
        Httpx_Aio_Send(httpx, httpx->bf->at, httpx->bf->count,
                     (httpx->method == HTTPX_POST || httpx->method == HTTPX_PUT) 
                          ?Cbk_Httpx_Post
                          :Cbk_Httpx_Requested);    
      }
    else
      { 
        __Unrefe(httpx->netchnl);
................................................................................
void Httpx_Query(YO_HTTPX *httpx, int method, char *uri, YO_DICTO *hdrs, void *poststrm, void *contstrm, int maxcount)
#ifdef _HTTPX_BUILTIN
  {
    if ( httpx->status_text ) { free(httpx->status_text); httpx->status_text = 0; }
    httpx->interrupted = 0;
    httpx->status = 0;
    httpx->method = method;
    httpx->maxcount = maxcount?maxcount:INT_MAX;
    httpx->streamed = 0;
    httpx->state = HTTPX_INITILIZED;
    __Unrefe(httpx->outstrm);








    httpx->outstrm = __Refe(contstrm);















    __Unrefe(httpx->poststrm);
    httpx->poststrm = __Refe(poststrm);
    if ( httpx->bf ) httpx->bf->count = 0;
    else httpx->bf = __Refe(Buffer_Init(0));
    Buffer_Reserve(httpx->bf,4*1024-1);
    
    if ( !uri ) 
................................................................................
    
    if ( flags & HTTPX_ASYNC )
      httpx->async = 1;
    if ( flags & HTTPX_KEEPALIVE )
      httpx->keepalive = 1;
    if ( flags & HTTPX_LEGACY_10 )
      httpx->legacy10 = 1;

    




    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;
        
................................................................................
    __Auto_Release
      {
        if ( !httpx ) 
          {
            httpx = Httpx_Client(uri,0);
            uri = 0;
          }
        Httpx_Query(httpx,HTTPX_GET,uri,0,0,0,0);
        ret = Httpx_Perform_Query(httpx);
      }
    return ret;
  }
#endif
  ;
  







>
>







 







|
|
|
|
|
|
|
>







 







>







|
|
|
>
>
>
>







 







>







 







|
>
>













>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




>
>
>
>
>
>
>
>
>
>
>
>






|
>







 







>







 







|
|







 







|







 







|
|
<

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







 







>
|
>
>
>
>







 







|







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
..
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
...
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
...
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
...
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
298
299
300
301
302
303
304
305
306
307
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
...
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
...
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
...
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
...
738
739
740
741
742
743
744
745
746

747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
...
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
...
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
typedef void (*httpx_collback_t)(void *obj, struct _YO_HTTPX *httpx, int status);

typedef struct _YO_HTTPX
  {
    void *netchnl;
    YO_URL *url;
    YO_URL *proxy_url;
    char *rqst;
    int rqst_len;
    
    int  method;
    int  maxcount;
    int  left;
    
    void *outstrm;
    void *poststrm;
................................................................................
    YO_DICTO  *hdrs;
    YO_BUFFER *content;
    int   state;
    int   streamed;
    int   status;
    char *status_text;
    
    unsigned async:      1;
    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->outstrm);
    __Unrefe(httpx->poststrm);
    __Unrefe(httpx->mon_obj);
    __Unrefe(httpx->bf);
    __Unrefe(httpx->hdrs);
    __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_REQUESTED               = 0x00000f21,
    HTTPX_GETTING_HEADERS         = 0x00000f30,
    HTTPX_RESPONDED               = 0x00000f31,
    HTTPX_GETTING_CONTENT         = 0x00000f40,
    HTTPX_FINISHED                = 0x00000f41,
    HTTPX_SEND                    = 0x00000e01,
    HTTPX_RECV                    = 0x00000e02,
    HTTPX_QUERY_RETRY             = 0x00000c00,

    HTTPX_INVALID_RESPONSE        = 0x00000d01,
    HTTPX_INVALID_RESPONSE_CODE   = 0x00000d02,
  };

#define HTTPX_SUCCEEDED(Status) (((Status)&0x8f000000) == 0)
#define HTTPX_STATUS(Status)    ((Status)&0x0fff)
................................................................................
        sprintf(len,"%u",(unsigned int)qlen);
        if ( method == HTTPX_POST )
          Httpx_Append_Common_Header_Line(bf,hdrs,"Content-Type","application/x-www-form-urlencoded");
        else
          Httpx_Append_Common_Header_Line(bf,hdrs,"Content-Type","application/octet-stream");
        Httpx_Append_Header_Line(bf,"Content-Length",len);
      }
    Buffer_Append(bf,"\r\n",2);
    httpx->rqst = __Memcopy_Npl(bf->at,bf->count); 
    httpx->rqst_len = bf->count;     
  }
#endif
  ;

void Httpx_Interrupt(YO_HTTPX *httpx)
#ifdef _HTTPX_BUILTIN
  {
    httpx->interrupted = 1;
    if ( !httpx->ssl )
      Tcp_Close(httpx->netchnl);
  }
#endif
  ;

void Httpx_Connect(YO_HTTPX *httpx);
void Cbk_Httpx_Retry(YO_HTTPX *httpx, int error)
#ifdef _HTTPX_BUILTIN
  {
    if ( !error )
      {
        --httpx->retry;
        httpx->state = HTTPX_QUERY_RETRY;
        if ( httpx->poststrm ) Oj_Rewind(httpx->poststrm);
        Oj_Truncate(httpx->outstrm,0);
        Httpx_Connect(httpx);
      }
  }
#endif
  ;
    
void Httpx_Do_Callback(YO_HTTPX *httpx, int status)
#ifdef _HTTPX_BUILTIN
  {
    if ( httpx->retry 
      && !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) )
      || ( httpx->state == HTTPX_FINISHED && !httpx->keepalive ) )
      {
        Oj_Close(httpx->netchnl);
        httpx->netchnl = 0; 
        httpx->keepalive = 0;
      }
      
    if ( !HTTPX_SUCCEEDED(status) )
      {
        httpx->state |= HTTPX_BROKEN;
        if ( httpx->interrupted )
................................................................................
        return;
      }

    Httpx_Do_Callback(httpx,HTTPX_REQUESTED);
    Buffer_Grow_Reserve(httpx->bf,1023);
    httpx->bf->count = 0;
    httpx->keepalive = 0;
    httpx->streamed  = 0;
    
    Httpx_Aio_Recv(httpx, httpx->bf->at, 1023, 12 /* lengthof HTTP/1.1 200 */
                          ,Cbk_Httpx_Getting_Headers);    
  }
#endif
  ;
  
................................................................................
        Httpx_Do_Callback(httpx,HTTPX_BROKEN
                               |((error&TCP_PERMANENT_ERROR)?HTTPX_PERMANENT_ERROR:0));
        return;
      }
      
    Httpx_Do_Callback(httpx,HTTPX_CONNECTED);
    
    /* httpx->rqst contains prepared request */
    Httpx_Aio_Send(httpx, httpx->rqst, httpx->rqst_len,
                           (httpx->method == HTTPX_POST || httpx->method == HTTPX_PUT ) 
                                ?Cbk_Httpx_Post
                                :Cbk_Httpx_Requested);    
  }
#endif
  ;
  
................................................................................
  ;
  
void Httpx_Connect(YO_HTTPX *httpx)
#ifdef _HTTPX_BUILTIN
  {
    if ( httpx->keepalive && httpx->netchnl )
      {
        Httpx_Aio_Send(httpx, httpx->rqst, httpx->rqst_len,
                     (httpx->method == HTTPX_POST || httpx->method == HTTPX_PUT) 
                          ?Cbk_Httpx_Post
                          :Cbk_Httpx_Requested);    
      }
    else
      { 
        __Unrefe(httpx->netchnl);
................................................................................
void Httpx_Query(YO_HTTPX *httpx, int method, char *uri, YO_DICTO *hdrs, void *poststrm, void *contstrm, int maxcount)
#ifdef _HTTPX_BUILTIN
  {
    if ( httpx->status_text ) { free(httpx->status_text); httpx->status_text = 0; }
    httpx->interrupted = 0;
    httpx->status = 0;
    httpx->method = method;
    __Unrefe(httpx->content);
    httpx->content = 0;

    __Unrefe(httpx->outstrm);
    
    if ( method == HTTPX_GET || method == HTTPX_POST )
      {
        httpx->maxcount = (maxcount>0)?maxcount
                       :(contstrm?INT_MAX:YO_HTTPX_BUFFERD_CONTSTRM_LEN);
        
        if ( contstrm )
          {
            httpx->outstrm = __Refe(contstrm);
          }
        else
          {
            httpx->content = __Refe(Buffer_Init(0));
            httpx->outstrm = __Refe(Buffer_As_File(httpx->content));
          }
      }
    else
      {
        httpx->maxcount = 0;
      }
      
    httpx->streamed = 0;
    httpx->state = HTTPX_INITILIZED;
    
    __Unrefe(httpx->poststrm);
    httpx->poststrm = __Refe(poststrm);
    if ( httpx->bf ) httpx->bf->count = 0;
    else httpx->bf = __Refe(Buffer_Init(0));
    Buffer_Reserve(httpx->bf,4*1024-1);
    
    if ( !uri ) 
................................................................................
    
    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;
        
................................................................................
    __Auto_Release
      {
        if ( !httpx ) 
          {
            httpx = Httpx_Client(uri,0);
            uri = 0;
          }
        Httpx_Query(httpx,HTTPX_HEAD,uri,0,0,0,0);
        ret = Httpx_Perform_Query(httpx);
      }
    return ret;
  }
#endif
  ;
  

Changes to newdes96.hc.

221
222
223
224
225
226
227

228
229
230
231
232
233
234
235
236
237
238
239


240














































241
242
        {Oj_Decrypt8_OjMID, NEWDES96_Decrypt8},
        {0}};
    YO_NEWDES96 *self = Yo_Object(sizeof(YO_NEWDES96),funcs);
    return NEWDES96_Init_Static(self, key, key_len);
  }
#endif
  ;

void *NEWDES96_Object_Init_With_Text_Key(char *Skey)
#ifdef _YO_NEWDES96_BUILTIN
  {
    byte_t key[16] = {0};
    Md5_Digest(Skey,strlen(Skey),key);
    return NEWDES96_Init(key+1,15);
  }
#endif
  ;

#define NEWDES96_Decipher(Skey) NEWDES96_Object_Init_With_Text_Key(Skey)
#define NEWDES96_Encipher(Skey) NEWDES96_Object_Init_With_Text_Key(Skey)

















































#endif /* C_once_144D66DB_5194_4393_9B79_FCE53D00D162 */








>












>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


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
        {Oj_Decrypt8_OjMID, NEWDES96_Decrypt8},
        {0}};
    YO_NEWDES96 *self = Yo_Object(sizeof(YO_NEWDES96),funcs);
    return NEWDES96_Init_Static(self, key, key_len);
  }
#endif
  ;
  
void *NEWDES96_Object_Init_With_Text_Key(char *Skey)
#ifdef _YO_NEWDES96_BUILTIN
  {
    byte_t key[16] = {0};
    Md5_Digest(Skey,strlen(Skey),key);
    return NEWDES96_Init(key+1,15);
  }
#endif
  ;

#define NEWDES96_Decipher(Skey) NEWDES96_Object_Init_With_Text_Key(Skey)
#define NEWDES96_Encipher(Skey) NEWDES96_Object_Init_With_Text_Key(Skey)
#define NEWDES96_Cipher(Skey) NEWDES96_Object_Init_With_Text_Key(Skey)
#define NEWDES96_Init_Cipher(Key,Key_Len) NEWDES96_Init(Key,Key_Len)

void NEWDES96_Encrypt_Bytes(void *data, int len, void *key, int key_len)
#ifdef _YO_NEWDES96_BUILTIN
  {
    int i;
    YO_NEWDES96 nds;
    NEWDES96_Init_Static(&nds, key, key_len);
    if ( len % 8 ) __Raise(YO_ERROR_UNALIGNED,0);
    for ( i = 0; i < len; i += 8 )
      NEWDES96_Encrypt8(&nds,(byte_t*)data+i);  
  }
#endif
  ;
  
void NEWDES96_Encrypt(void *data, int len, char *S)
#ifdef _YO_NEWDES96_BUILTIN
  {
    byte_t key[16];
    Md5_Digest(S,strlen(S),key);
    NEWDES96_Encrypt_Bytes(data,len&~7,key+1,15);
  }
#endif
  ;

void NEWDES96_Decrypt_Bytes(void *data, int len, void *key, int key_len)
#ifdef _YO_NEWDES96_BUILTIN
  {
    int i;
    YO_NEWDES96 nds;
    NEWDES96_Init_Static(&nds, key, key_len);
    if ( len % 8 ) __Raise(YO_ERROR_UNALIGNED,0);
    for ( i = 0; i < len; i += 8 )
      NEWDES96_Decrypt8(&nds,(byte_t*)data+i);  
  }
#endif
  ;

void NEWDES96_Decrypt(void *data, int len, char *S)
#ifdef _YO_NEWDES96_BUILTIN
  {
    byte_t key[16];
    Md5_Digest(S,strlen(S),key);
    NEWDES96_Decrypt_Bytes(data,len&~7,key+1,15);
  }
#endif
  ;

#endif /* C_once_144D66DB_5194_4393_9B79_FCE53D00D162 */

Changes to string.hc.

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
....
1179
1180
1181
1182
1183
1184
1185
1186

1187
1188

1189
1190
1191
1192
1193
1194
1195
....
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793




1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806

_YO_STRING_EXTERN char Str_6bit_Encoding_Table[] /* 64 */ 
#ifdef _YO_STRING_BUILTIN
  = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-"
#endif
  ;

#define Str_5bit_Encode(S,L) Str_Qbit_Encode(S,L,Str_5bit_Encoding_Table,5)
#define Str_5bit_Encode_Upper(S,L) Str_Qbit_Encode(S,L,Str_5bit_Encoding_Table_Upper,5)
#define Str_6bit_Encode(S,L) Str_Qbit_Encode(S,L,Str_6bit_Encoding_Table,6)




char *Str_Qbit_Encode(void *data,int len, char *tbl, int btl)
#ifdef _YO_STRING_BUILTIN
  {
    if ( data && len )
      {
        int rq_len = (len*8+btl-1)/btl;

        char *out = Yo_Malloc(rq_len+1);
        memset(out,0,rq_len+1);
        return Str_Xbit_Encode(data,len*8,btl,tbl,out);
      }
    return 0;
  }
#endif
  ;
................................................................................
#endif
  ;

int Str_To_Bool_Dflt(char *S,int dflt)
#ifdef _YO_STRING_BUILTIN
  {
    if ( S && *S == '#' ) ++S;
    if ( !S || !*S || !strcmp_I(S,"no") || !strcmp_I(S,"off") || !strcmp_I(S,"false") || !strcmp_I(S,"1") )

      return 0;
    if ( !strcmp_I(S,"yes") || !strcmp_I(S,"on") || !strcmp_I(S,"true") || !strcmp_I(S,"0") )

      return 1;
    return dflt;
  }
#endif
  ;

int Str_To_Bool(char *S)
................................................................................
          if ( 0 ) ;
          else if ( *(signed char*)S < 30
            || *S == '|' || *S == '&' || *S == ';' 
            || *S == '<' || *S == '>' || *S == '[' 
            || *S == ']' || *S == '{' || *S == '}'
            || *S == '"' || *S == '\'' ||*S == '\\' 
            || *S == '#' || *S == '$' //|| *S == '%' 
            || *S == '?' || *S == '=' || *S == '`'
          )
            {
              char b[3] = {'#',0,0};
              Unsigned_To_Hex2(*S,b+1);
              R_count += __Elm_Append_Npl(&R,R_count,b,3,1,&R_capacity);
            }
          else R_count += __Elm_Append_Npl(&R,R_count,S,1,1,&R_capacity);
        }
        
    return __Pool(R);
  }
#endif
  ;

char *Str_Quote(char *S)
#ifdef _YO_STRING_BUILTIN  
  {
    int S_len = S? strlen(S):0;
    int R_count = 0;
    int R_capacity = S_len+1;
    char *R = 0;

    if ( S )
      for ( ; *S; ++S )
        {
          if ( 0 ) ;
          else if ( *(signed char*)S < 30
            || *S == '"' || *S == '\'' ||*S == '\\' 
          )
            {
              char b[5] = {0,};




              Str_Hex_Byte(*S,'\\',b);
              R_count += __Elm_Append_Npl(&R,R_count,b,4,1,&R_capacity);
            }
          else R_count += __Elm_Append_Npl(&R,R_count,S,1,1,&R_capacity);
        }
        
    return __Pool(R);
  }
#endif
  ;
    
#endif /* C_once_0ED387CD_668B_44C3_9D91_A6336A2F5F48 */








|
|
|
>
>
>

|
|




>
|







 







|
>

|
>







 







|
<













|












|
<


>
>
>
>
|












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
....
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
....
1761
1762
1763
1764
1765
1766
1767
1768

1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795

1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814

_YO_STRING_EXTERN char Str_6bit_Encoding_Table[] /* 64 */ 
#ifdef _YO_STRING_BUILTIN
  = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-"
#endif
  ;

#define Str_5bit_Encode(S,L) Str_Qbit_Encode(S,L,Str_5bit_Encoding_Table,5,0)
#define Str_5bit_Encode_Upper(S,L) Str_Qbit_Encode(S,L,Str_5bit_Encoding_Table_Upper,5,0)
#define Str_6bit_Encode(S,L) Str_Qbit_Encode(S,L,Str_6bit_Encoding_Table,6,0)
#define Str_5bit_Encode_(S,L,Out) Str_Qbit_Encode(S,L,Str_5bit_Encoding_Table,5,Out)
#define Str_5bit_Encode_Upper_(S,L,Out) Str_Qbit_Encode(S,L,Str_5bit_Encoding_Table_Upper,5,Out)
#define Str_6bit_Encode_(S,L,Out) Str_Qbit_Encode(S,L,Str_6bit_Encoding_Table,6,Out)

char *Str_Qbit_Encode(void *data,int len, char *tbl, int btl, char *out)
#ifdef _YO_STRING_BUILTIN                                                      
  {
    if ( data && len )
      {
        int rq_len = (len*8+btl-1)/btl;
        if ( !out )
          out = Yo_Malloc(rq_len+1);
        memset(out,0,rq_len+1);
        return Str_Xbit_Encode(data,len*8,btl,tbl,out);
      }
    return 0;
  }
#endif
  ;
................................................................................
#endif
  ;

int Str_To_Bool_Dflt(char *S,int dflt)
#ifdef _YO_STRING_BUILTIN
  {
    if ( S && *S == '#' ) ++S;
    if ( !S || !*S || !strcmp_I(S,"no") || !strcmp_I(S,"off") 
      || !strcmp_I(S,"false") || !strcmp_I(S,"1") )
      return 0;
    if ( !strcmp_I(S,"yes") || !strcmp_I(S,"on") || !strcmp_I(S,"true") 
      || !strcmp_I(S,"0") )
      return 1;
    return dflt;
  }
#endif
  ;

int Str_To_Bool(char *S)
................................................................................
          if ( 0 ) ;
          else if ( *(signed char*)S < 30
            || *S == '|' || *S == '&' || *S == ';' 
            || *S == '<' || *S == '>' || *S == '[' 
            || *S == ']' || *S == '{' || *S == '}'
            || *S == '"' || *S == '\'' ||*S == '\\' 
            || *S == '#' || *S == '$' //|| *S == '%' 
            || *S == '?' || *S == '=' || *S == '`' )

            {
              char b[3] = {'#',0,0};
              Unsigned_To_Hex2(*S,b+1);
              R_count += __Elm_Append_Npl(&R,R_count,b,3,1,&R_capacity);
            }
          else R_count += __Elm_Append_Npl(&R,R_count,S,1,1,&R_capacity);
        }
        
    return __Pool(R);
  }
#endif
  ;

char *Str_Escape(char *S)
#ifdef _YO_STRING_BUILTIN  
  {
    int S_len = S? strlen(S):0;
    int R_count = 0;
    int R_capacity = S_len+1;
    char *R = 0;

    if ( S )
      for ( ; *S; ++S )
        {
          if ( 0 ) ;
          else if ( *(signed char*)S < 30
            || *S == '"' || *S == '\'' ||*S == '\\' )

            {
              char b[5] = {0,};
              b[0] = '\\';
              b[1] = ((*S>>6)%8) + '0';
              b[2] = ((*S>>3)%8) + '0';            
              b[3] = (*S%8) + '0';          
              //Str_Hex_Byte(*S,'\\',b);
              R_count += __Elm_Append_Npl(&R,R_count,b,4,1,&R_capacity);
            }
          else R_count += __Elm_Append_Npl(&R,R_count,S,1,1,&R_capacity);
        }
        
    return __Pool(R);
  }
#endif
  ;
    
#endif /* C_once_0ED387CD_668B_44C3_9D91_A6336A2F5F48 */

Changes to tasque.hc.

312
313
314
315
316
317
318






















319
320
321
322
323
324
325
...
332
333
334
335
336
337
338


339
340
341
342
343
344
345
...
358
359
360
361
362
363
364


365


366



367
368
          if ( t->processor )
            Thread_Terminate(t->processor->thr);
        t->update(t->monitor,t->obj,status);
      }
  }
#endif
  ;






















  
void Tasque_Terminate()
#ifdef _YO_TASQUE_BUILTIN
  {
    YO_TASQUE_TASK *t;
    Tasque_MAX = 0;
    Tasque_RESERVE = 0;
................................................................................
          
    __Thr_Lock(&Tasque_Lock)
      {
        Tasque_Finish_Task_List(&Tasque_Task_Care,TASQUE_FAIL);
        Tasque_Finish_Task_List(&Tasque_Task_In,TASQUE_FAIL);
        Tasque_Finish_Task_List(&Tasque_Task_Out,TASQUE_FAIL);
      }


  }
#endif
  ;

void Tasque_Stop(long ms)
#ifdef _YO_TASQUE_BUILTIN
  {
................................................................................
      Tasque_Finish_Task_List(&Tasque_Task_Out,TASQUE_COMPLETE);
    
    Tasque_Terminate();
  }
#endif
  ;










#endif /* C_once_FDCDEF27_5EA4_4C1D_99AB_1CD0A992A18A */








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
>







 







>
>
|
>
>
|
>
>
>


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
341
342
343
344
345
346
347
...
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
...
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
          if ( t->processor )
            Thread_Terminate(t->processor->thr);
        t->update(t->monitor,t->obj,status);
      }
  }
#endif
  ;
  
void Tasque_Terminate_Alerts()
#ifdef _YO_TASQUE_BUILTIN
  {
    YO_TASQUE_ALERT **a; 
    YO_TASQUE_ALERT *k;
        
    if ( Tasque_Alerts_List )
      {
        a = &Tasque_Alerts_List;
        do __Auto_Release 
          {
            k = __Pool_RefPtr(*a);
            *a = k->next;
            k->next = 0;
            k->callback(k->obj,TASQUE_FAIL);
          }
        while ( *a );
      }
  }
#endif
  ;
  
void Tasque_Terminate()
#ifdef _YO_TASQUE_BUILTIN
  {
    YO_TASQUE_TASK *t;
    Tasque_MAX = 0;
    Tasque_RESERVE = 0;
................................................................................
          
    __Thr_Lock(&Tasque_Lock)
      {
        Tasque_Finish_Task_List(&Tasque_Task_Care,TASQUE_FAIL);
        Tasque_Finish_Task_List(&Tasque_Task_In,TASQUE_FAIL);
        Tasque_Finish_Task_List(&Tasque_Task_Out,TASQUE_FAIL);
      }
      
    Tasque_Terminate_Alerts();
  }
#endif
  ;

void Tasque_Stop(long ms)
#ifdef _YO_TASQUE_BUILTIN
  {
................................................................................
      Tasque_Finish_Task_List(&Tasque_Task_Out,TASQUE_COMPLETE);
    
    Tasque_Terminate();
  }
#endif
  ;

void Tasque_Finish(int finish_in_ms, int wait_ms)
#ifdef _YO_TASQUE_BUILTIN
  {
    quad_t deadline = System_Millis() + finish_in_ms;
    while ( Tasque_Perform_Update(wait_ms,0) && System_Millis() < deadline );
  }
#endif
  ;  
  
#endif /* C_once_FDCDEF27_5EA4_4C1D_99AB_1CD0A992A18A */

Changes to tcpip.hc.

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
524
525
526
527
528
    int cc = count;
    iot->err = 0;
    while ( cc )
      {
        int q = recv(iot->skt,b,cc,0);
        if ( q < 0 )
          {
            iot->count = count-cc;
            iot->err = Tcp_Errno();
            return;

          }
        if ( !q )
          {
            if ( count-cc < iot->mincount )
              iot->err = -1;
            iot->count = count-cc;
            return;
          }
        STRICT_REQUIRE( q <= cc );
        cc -= q;
        b += q;
        if ( count-cc >= iot->mincount )
          break;
      }

    iot->count = count-cc;








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







<

<
>





|
<







>

>
>
>
>
>
>
>
>







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
524
525
526
527
528
529
530
531
532
533
534
535
    int cc = count;
    iot->err = 0;
    while ( cc )
      {
        int q = recv(iot->skt,b,cc,0);
        if ( q < 0 )
          {

            iot->err = Tcp_Errno();

            break;
          }
        if ( !q )
          {
            if ( count-cc < iot->mincount )
              iot->err = -1;
            break;

          }
        STRICT_REQUIRE( q <= cc );
        cc -= q;
        b += q;
        if ( count-cc >= iot->mincount )
          break;
      }
    
    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
  {

Changes to xdata.hc.

158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
...
291
292
293
294
295
296
297
298
299


300
301



302
303
304
305
306
307
308
          case XVALUE_OPT_VALTYPE_FLT:          
            return Str_From_Flt(val->flt);
          case XVALUE_OPT_VALTYPE_STR:
            return Str_Copy(val->txt);
          case XVALUE_OPT_VALTYPE_LIT:
            return Str_Copy((char*)&val->down);
          case XVALUE_OPT_VALTYPE_NONE:
            return Str_Copy("");
          case XVALUE_OPT_VALTYPE_BOOL:
            return Str_From_Bool(val->bval);
          default:
            __Raise(YO_ERROR_UNEXPECTED_VALUE,0);
        }
    return dfltval?Str_Copy(dfltval):0;
  }
................................................................................
char *Xvalue_Get_Str(YO_XVALUE *val, char *dfltval)
#ifdef _YO_XDATA_BUILTIN
  {
    if ( val )
      switch (val->opt&XVALUE_OPT_VALTYPE_MASK) 
        {
          case XVALUE_OPT_VALTYPE_STR:
            return ( val->txt[0] ) ? val->txt : dfltval;
          case XVALUE_OPT_VALTYPE_LIT:
            return (char*)&val->down;
          case XVALUE_OPT_VALTYPE_NONE:
            return "";
          case XVALUE_OPT_VALTYPE_BOOL:
            if ( val->bval )
              return "yes";
            else
              return "no";
          default:
            __Raise(YO_ERROR_UNEXPECTED_VALUE,0);
................................................................................
  ;
  
void Xvalue_Set_Str(YO_XVALUE *val, char *S, int L)
#ifdef _YO_XDATA_BUILTIN
  {
    Xvalue_Purge(val);
    if ( L < 0 ) L = S?strlen(S):0;
    if ( L >= sizeof(val->down)+sizeof(val->holder) )
      {


        val->txt = Str_Copy_Npl(S,L);
        val->opt = XVALUE_OPT_VALTYPE_STR;



      }
    else
      {
        if (L) memcpy((char*)&val->down,S,L);
        /* already filled by 0 in Xvalue_Purge //((char*)&val->down)[L] = 0; */
        val->opt = XVALUE_OPT_VALTYPE_LIT;
      }







|







 







|



|







 







|

>
>
|
|
>
>
>







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
...
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
...
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
          case XVALUE_OPT_VALTYPE_FLT:          
            return Str_From_Flt(val->flt);
          case XVALUE_OPT_VALTYPE_STR:
            return Str_Copy(val->txt);
          case XVALUE_OPT_VALTYPE_LIT:
            return Str_Copy((char*)&val->down);
          case XVALUE_OPT_VALTYPE_NONE:
            return Str_Copy(dfltval);
          case XVALUE_OPT_VALTYPE_BOOL:
            return Str_From_Bool(val->bval);
          default:
            __Raise(YO_ERROR_UNEXPECTED_VALUE,0);
        }
    return dfltval?Str_Copy(dfltval):0;
  }
................................................................................
char *Xvalue_Get_Str(YO_XVALUE *val, char *dfltval)
#ifdef _YO_XDATA_BUILTIN
  {
    if ( val )
      switch (val->opt&XVALUE_OPT_VALTYPE_MASK) 
        {
          case XVALUE_OPT_VALTYPE_STR:
            return ( val->txt && val->txt[0] ) ? val->txt : dfltval;
          case XVALUE_OPT_VALTYPE_LIT:
            return (char*)&val->down;
          case XVALUE_OPT_VALTYPE_NONE:
            return dfltval;
          case XVALUE_OPT_VALTYPE_BOOL:
            if ( val->bval )
              return "yes";
            else
              return "no";
          default:
            __Raise(YO_ERROR_UNEXPECTED_VALUE,0);
................................................................................
  ;
  
void Xvalue_Set_Str(YO_XVALUE *val, char *S, int L)
#ifdef _YO_XDATA_BUILTIN
  {
    Xvalue_Purge(val);
    if ( L < 0 ) L = S?strlen(S):0;
    if ( L >= sizeof(val->down)+sizeof(val->holder) /*|| !S*/ )
      {
        //if ( S )
          {
            val->txt = Str_Copy_Npl(S,L);
            val->opt = XVALUE_OPT_VALTYPE_STR;
          }
        //else
        //  val->opt = XVALUE_OPT_VALTYPE_NONE;
      }
    else
      {
        if (L) memcpy((char*)&val->down,S,L);
        /* already filled by 0 in Xvalue_Purge //((char*)&val->down)[L] = 0; */
        val->opt = XVALUE_OPT_VALTYPE_LIT;
      }

Changes to yoyo.hc.

2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
#define __Unrefe(Ptr)                   Yo_Unrefe(Ptr)
#define __Raise(Err,Msg)                Yo_Raise(Err,Msg,__Yo_FILE__,__LINE__)
#define __Raise_User_Error(Msg_)        Yo_Raise(YO_ERROR_USER,Msg_,__Yo_FILE__,__LINE__)
#define __Raise_Format(Err,Fmt)         Yo_Raise(Err,(Yo_Format Fmt),__Yo_FILE__,__LINE__)
#define __Raise_Occured()               Yo_Raise_Occured()
#define __Raise_System_Error()          Yo_Raise(YO_ERROR_SYSTEM,Yo_Format_System_Error(),__Yo_FILE__,__LINE__)
#define __Fatal(Ctx)                    Yo_Fatal(YO_FATAL_ERROR,Ctx,__Yo_FILE__,__LINE__)
#define __Fatal_Format(x)               Yo_Fatal(YO_FATAL_ERROR,Yo_Format_Npl x,__Yo_FILE__,__LINE__)
#define __Format                        Yo_Format
#define __Format_Npl                    Yo_Format_Npl
#define __Format_Error()                Yo_Error_Format()
#define __Format_Btrace()               Yo_Btrace()
#define __Format_Error_Btrace()         Yo_Error_Format_Btrace()
#define __Format_System_Error()         Yo_Format_System_Error()








|







2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
#define __Unrefe(Ptr)                   Yo_Unrefe(Ptr)
#define __Raise(Err,Msg)                Yo_Raise(Err,Msg,__Yo_FILE__,__LINE__)
#define __Raise_User_Error(Msg_)        Yo_Raise(YO_ERROR_USER,Msg_,__Yo_FILE__,__LINE__)
#define __Raise_Format(Err,Fmt)         Yo_Raise(Err,(Yo_Format Fmt),__Yo_FILE__,__LINE__)
#define __Raise_Occured()               Yo_Raise_Occured()
#define __Raise_System_Error()          Yo_Raise(YO_ERROR_SYSTEM,Yo_Format_System_Error(),__Yo_FILE__,__LINE__)
#define __Fatal(Ctx)                    Yo_Fatal(YO_FATAL_ERROR,Ctx,__Yo_FILE__,__LINE__)
#define __Fatal_Format(x)               Yo_Fatal(YO_FATAL_ERROR,(Yo_Format_Npl x),__Yo_FILE__,__LINE__)
#define __Format                        Yo_Format
#define __Format_Npl                    Yo_Format_Npl
#define __Format_Error()                Yo_Error_Format()
#define __Format_Btrace()               Yo_Btrace()
#define __Format_Error_Btrace()         Yo_Error_Format_Btrace()
#define __Format_System_Error()         Yo_Format_System_Error()