Advertisement
Guest User

Untitled

a guest
Aug 30th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.92 KB | None | 0 0
  1. diff --git a/target/libc/wrappers.c b/target/libc/wrappers.c
  2. new file mode 100644
  3. index 0000000..f6df6e7
  4. --- /dev/null
  5. +++ b/target/libc/wrappers.c
  6. @@ -0,0 +1,565 @@
  7. +#include <sys/types.h>
  8. +#include <time.h>
  9. +#include <stdlib.h>
  10. +#include <string.h>
  11. +#include <stdio.h>
  12. +#include <ctype.h>
  13. +#include <wchar.h>
  14. +#include <uchar.h>
  15. +#include <math.h>
  16. +#include <setjmp.h>
  17. +#include "wrappers.h"
  18. +
  19. +struct my_ptr* generate_str(){
  20. + char format[] = "%qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_-0987654321^#";
  21. +
  22. + char* r;
  23. + struct my_ptr* ptr = malloc(sizeof(struct my_ptr));
  24. + size_t i;
  25. + size_t max = rand() % 300;
  26. + r = calloc(max+1,sizeof(*r));
  27. + if(r==NULL)
  28. + goto exit;
  29. + for(i=0;i<max;i++)
  30. + r[i] = format[rand() % sizeof(format)];
  31. + r[max] = '\0';
  32. +
  33. + exit:
  34. + ptr->ptr = r;
  35. + ptr->len = max;
  36. + ptr->writeable =1;
  37. + return ptr;
  38. +}
  39. +struct my_wide_ptr* generate_wide_str()
  40. +{
  41. + wchar_t format[] = L"%qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_-0987654321^#";
  42. +
  43. + wchar_t * r;
  44. + struct my_wide_ptr* ptr = malloc(sizeof(struct my_ptr));
  45. + size_t i;
  46. + size_t max = rand() % 300;
  47. + r = calloc(max+1,sizeof(*r));
  48. + if(r==NULL)
  49. + goto exit;
  50. + for(i=0;i<max;i++)
  51. + r[i] = format[rand() % sizeof(format)];
  52. + r[max] = L'\0';
  53. +
  54. + exit:
  55. + ptr->ptr = r;
  56. + ptr->len = max;
  57. + return ptr;
  58. +}
  59. +struct my_ptr* asctime_wrapper()
  60. +{
  61. + struct my_ptr* ptr = malloc(sizeof(struct my_ptr));
  62. + char* temp;
  63. + time_t czas;
  64. + time( & czas );
  65. + temp = asctime( localtime( & czas ) ) ;
  66. + ptr->ptr = calloc(strlen(temp)+1,1);
  67. + memcpy(ptr->ptr,temp,strlen(temp));
  68. + ptr->len = strlen(temp);
  69. + return ptr;
  70. +}
  71. +void memcpy_wrapper (struct my_ptr* ptr,int num)
  72. +{
  73. +
  74. + if(ptr->ptr!=NULL && num>0 && ptr->len>num)
  75. + {
  76. + void* destination = malloc(ptr->len+1);
  77. + memcpy(destination,ptr->ptr,num);
  78. + free(destination);
  79. + }
  80. +}
  81. +struct my_ptr * memmove_wrapper(struct my_ptr* ptr, int num)
  82. +{
  83. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  84. + if(ptr && ptr->ptr!=NULL && num>0 && ptr->len>num)
  85. + {
  86. + void* destination = calloc(ptr->len+1,1);
  87. + memcpy(destination,ptr->ptr,num);
  88. + ret->ptr = destination;
  89. + ret->len = num;
  90. + ret->writeable = 1;
  91. + memmove(ret->ptr,ptr->ptr,num);
  92. + return ret;
  93. + }
  94. + return NULL;
  95. +}
  96. +void strcpy_wrapper (struct my_ptr* ptr )
  97. +{
  98. + if(ptr->ptr!=NULL && ptr->len > 0){
  99. + char* destination = malloc(ptr->len+1);
  100. + ((char*)ptr->ptr)[ptr->len] = '\0';
  101. + strcpy(destination,ptr->ptr);
  102. + free(destination);
  103. + }
  104. +}
  105. +void strncpy_wrapper(const char * source, size_t num )
  106. +{
  107. + if(source!=NULL && num>0){
  108. + char* destination = malloc(num);
  109. + if(!destination)
  110. + return;
  111. + strncpy(destination,source,num);
  112. + free(destination);
  113. + }
  114. +}
  115. +
  116. +struct my_ptr * strcat_wrapper ( struct my_ptr * dst, struct my_ptr * src )
  117. +{
  118. + if(dst->ptr != src->ptr && src->ptr!=NULL && dst->ptr !=NULL ){
  119. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  120. + ret->ptr = malloc(dst->len+src->len+2);
  121. + ret->len = dst->len+src->len;
  122. + memcpy(ret->ptr,dst->ptr,dst->len);
  123. + strcat(ret->ptr,src->ptr);
  124. + return ret;
  125. + }
  126. + return NULL;
  127. +}
  128. +struct my_ptr *strncat_wrapper ( struct my_ptr * dst, struct my_ptr * src, size_t num )
  129. +{
  130. + //num is maximium, so is not a requirement
  131. + if(dst->ptr != src->ptr && src->ptr!=NULL && dst->ptr !=NULL){
  132. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  133. + ret->ptr = malloc(dst->len+num+2);
  134. + ret->len = dst->len+num;
  135. + memcpy(ret->ptr,dst->ptr,dst->len);
  136. + strncat(ret->ptr,src->ptr,num);
  137. + return ret;
  138. + }
  139. + return NULL;
  140. +}
  141. +int memcmp_wrapper ( struct my_ptr * ptr1, struct my_ptr * ptr2, size_t num )
  142. +{
  143. + if(ptr1->ptr!=NULL && ptr2->ptr!=NULL)
  144. + return memcmp(ptr1->ptr,ptr2->ptr,num);
  145. + return 0;
  146. +}
  147. +int strcmp_wrapper ( struct my_ptr * ptr1, struct my_ptr * ptr2 )
  148. +{
  149. + if(ptr1->ptr!=NULL && ptr2->ptr!=NULL)
  150. + return strcmp(ptr1->ptr,ptr2->ptr);
  151. + return 0;
  152. +}
  153. +int strcoll_wrapper ( struct my_ptr * ptr1, struct my_ptr * ptr2 )
  154. +{
  155. + if(ptr1->ptr!=NULL && ptr2->ptr!=NULL)
  156. + return strcoll(ptr1->ptr,ptr2->ptr);
  157. + return 0;
  158. +}
  159. +int strncmp_wrapper ( struct my_ptr * ptr1, struct my_ptr * ptr2, size_t num )
  160. +{
  161. + if(ptr1->ptr!=NULL && ptr2->ptr!=NULL)
  162. + return strncmp(ptr1->ptr,ptr2->ptr,num);
  163. + return 0;
  164. +}
  165. +void strxfrm_wrapper (struct my_ptr * src)
  166. +{
  167. + if(src->ptr !=NULL)
  168. + {
  169. + strxfrm(NULL,src->ptr,0);
  170. + }
  171. +}
  172. +void memchr_wrapper ( struct my_ptr * src, int val, int num)
  173. +{
  174. + if(src->ptr != NULL)
  175. + {
  176. + int len = num;
  177. + if(num>src->len)
  178. + len = src->len;
  179. + memchr(src->ptr,val,len);
  180. + }
  181. +}
  182. +void strchr_wrapper ( struct my_ptr * src, int character)
  183. +{
  184. + if(src->ptr!=NULL)
  185. + strchr(src->ptr,character);
  186. +}
  187. +void strcspn_wrapper ( struct my_ptr * str1, struct my_ptr * str2 )
  188. +{
  189. + if(str1->ptr!=NULL && str2->ptr!=NULL)
  190. + strcspn(str1->ptr,str2->ptr);
  191. +}
  192. +void strpbrk_wrapper ( struct my_ptr * str1, struct my_ptr * str2)
  193. +{
  194. + if(str1->ptr!=NULL && str2->ptr!=NULL)
  195. + strpbrk(str1->ptr,str2->ptr);
  196. +}
  197. +void strrchr_wrapper ( struct my_ptr * str, int character)
  198. +{
  199. + if(str->ptr!=NULL)
  200. + strrchr(str->ptr,character);
  201. +}
  202. +void strspn_wrapper ( struct my_ptr * str1, struct my_ptr * str2 )
  203. +{
  204. + if(str1->ptr!=NULL && str2->ptr!=NULL)
  205. + strspn(str1->ptr,str2->ptr);
  206. +}
  207. +void strstr_wrapper ( struct my_ptr * str1, struct my_ptr * str2)
  208. +{
  209. + if(str1->ptr!=NULL && str2->ptr!=NULL)
  210. + strstr(str1->ptr,str2->ptr);
  211. +}
  212. +void strtok_wrapper ( struct my_ptr * str, struct my_ptr * delimiters )
  213. +{
  214. + if(str->ptr!=NULL && delimiters->ptr!=NULL)
  215. + {
  216. + char* new_str = malloc(str->len);
  217. + memcpy(new_str,str->ptr,str->len);
  218. + strtok(new_str,delimiters->ptr);
  219. + free(new_str);
  220. + }
  221. +}
  222. +void strlen_wrapper ( struct my_ptr * str )
  223. +{
  224. + if(str->ptr!=NULL)
  225. + strlen(str);
  226. +}
  227. +struct my_ptr* memset_wrapper (int value, size_t num )
  228. +{
  229. + if(num >1){
  230. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  231. + ret->ptr = malloc(num+1);
  232. + memset(ret->ptr,value,num);
  233. + ((char*)ret->ptr)[num] = '\0';
  234. + ret->len = num;
  235. + return ret;
  236. + }
  237. + return NULL;
  238. +}
  239. +struct my_ptr* strerror_wrapper(int errnum)
  240. +{
  241. + char* src = strerror(errnum);
  242. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  243. + ret->len = strlen(src);
  244. + ret->ptr = calloc(ret->len+1,1);
  245. + memcpy(ret->ptr,src,ret->len);
  246. + return ret;
  247. +}
  248. +
  249. +struct my_ptr* ctime_wrapper(time_t * a)
  250. +{
  251. + if(a)
  252. + {
  253. + char* src = ctime(a);
  254. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  255. + ret->len = strlen(src);
  256. + ret->ptr = calloc(ret->len+1,1);
  257. + memcpy(ret->ptr,src,ret->len);
  258. + return ret;
  259. + }
  260. + return NULL;
  261. +}
  262. + struct my_ptr* ctime_r_wrapper(time_t * a)
  263. + {
  264. + if(a)
  265. + {
  266. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  267. + ret->len = 64;
  268. + ret->ptr = calloc(64,1);
  269. + ctime_r(a,ret->ptr);
  270. + }
  271. + return NULL;
  272. + }
  273. +struct tm *localtime_r_wrapper(const time_t * timep)
  274. +{
  275. + if(timep!=NULL )
  276. + {
  277. + struct tm* ret = malloc(sizeof(struct tm));
  278. + localtime_r(timep,ret);
  279. + }
  280. + return NULL;
  281. +}
  282. +struct my_ptr* strptime_wrapper(const char * format,struct tm * tm)
  283. +{
  284. + if(format && tm)
  285. + {
  286. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  287. + ret->len = 64;
  288. + ret->ptr = calloc(64,1);
  289. + strptime(ret->ptr,format,tm);
  290. + return ret;
  291. + }
  292. + return NULL;
  293. +}
  294. +time_t mktime_wrapper(struct tm * tm)
  295. +{
  296. + time_t ret_zero; // TODO: How to declare an empty time_t ?
  297. + if(tm)
  298. + return mktime(tm);
  299. + else
  300. + return ret_zero;
  301. +}
  302. +struct my_ptr* asctime_r_wrapper(const struct tm * tm)
  303. +{
  304. + if(tm)
  305. + {
  306. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  307. + ret->len = 64;
  308. + ret->ptr = calloc(64,1);
  309. + asctime_r(tm,ret->ptr);
  310. + return ret;
  311. + }
  312. + return NULL;
  313. +}
  314. +
  315. +struct tm *localtime_wrapper(const time_t * t)
  316. +{
  317. + if(t)
  318. + return localtime(t);
  319. + return NULL;
  320. +}
  321. +
  322. +struct my_ptr* strftime_wrapper(struct my_ptr* format,struct tm* timeptr )
  323. +{
  324. + if(timeptr && format->ptr)
  325. + {
  326. + struct my_ptr* ret = malloc(sizeof(struct my_ptr));
  327. + ret->len = 64;
  328. + ret->ptr = calloc(64,1);
  329. + strftime(ret->ptr,ret->len,format->ptr, timeptr);
  330. + return ret;
  331. + }
  332. + return NULL;
  333. +}
  334. +struct tm *gmtime_r_wrapper(const time_t *timep)
  335. +{
  336. + if(timep)
  337. + {
  338. + struct tm* ret = malloc(sizeof(struct tm));
  339. + gmtime_r(timep,ret);
  340. + return ret;
  341. + }
  342. + return NULL;
  343. +}
  344. +struct tm *getdate_wrapper(struct my_ptr* ptr)
  345. +{
  346. + if(ptr->ptr)
  347. + return getdate(ptr->ptr);
  348. + return NULL;
  349. +}
  350. +struct tm *gmtime_wrapper(const time_t * t)
  351. +{
  352. + if(t)
  353. + return gmtime(t);
  354. + return NULL;
  355. +}
  356. +double atof_wrapper (struct my_ptr* str)
  357. +{
  358. + if(str->ptr)
  359. + return atof(str->ptr);
  360. + return 0;
  361. +}
  362. +int atoi_wrapper(struct my_ptr* str)
  363. +{
  364. + if(str->ptr)
  365. + return atoi(str->ptr);
  366. + return 0;
  367. +}
  368. +long int atol_wrapper ( struct my_ptr* str )
  369. +{
  370. + if(str->ptr)
  371. + return atol(str->ptr);
  372. + return 0;
  373. +}
  374. +double strtod_wrapper (struct my_ptr* str)
  375. +{
  376. + if(str->ptr)
  377. + return strtod(str->ptr,NULL);
  378. + return 0;
  379. +}
  380. +long int strtol_wrapper (struct my_ptr* str)
  381. +{
  382. + if(str->ptr)
  383. + return strtol(str->ptr,NULL,0);
  384. + return 0;
  385. +}
  386. +unsigned long int strtoul_wrapper (struct my_ptr* str)
  387. +{
  388. + if(str->ptr)
  389. + return strtoul(str->ptr,NULL,0);
  390. + return 0;
  391. +}
  392. +struct my_ptr* getenv_wrapper (struct my_ptr* str)
  393. +{
  394. + if(str->ptr)
  395. + {
  396. + char* temp = getenv(str->ptr);
  397. + struct my_ptr* ret = calloc(sizeof(struct my_ptr),1);
  398. + ret->len = 64;
  399. + ret->ptr = calloc(64,1);
  400. + if(!temp)
  401. + return NULL;
  402. + if(strlen(temp) > 64)
  403. + memcpy(ret->ptr, temp, 64);
  404. + else
  405. + {
  406. + memcpy(ret->ptr, temp, strlen(temp));
  407. + ret->len = strlen(temp);
  408. + }
  409. + return ret;
  410. + }
  411. + return NULL;
  412. +}
  413. +div_t div_wrapper (int numer, int denom)
  414. +{
  415. + if(denom==0)
  416. + return div(numer,1);
  417. + return div(numer,denom);
  418. +}
  419. +ldiv_t ldiv_wrapper (long int numer, long int denom)
  420. +{
  421. + if(denom==0)
  422. + return ldiv(numer,1);
  423. + return ldiv(numer,denom);
  424. +}
  425. +int mblen_wrapper (struct my_ptr* str)
  426. +{
  427. + if(str->ptr)
  428. + return mblen(str->ptr,str->len);
  429. + return 0;
  430. +}
  431. +int mbtowc_wrapper (struct my_ptr* str)
  432. +{
  433. + if(str->ptr)
  434. + {
  435. + return mbtowc(NULL,str->ptr,str->len);
  436. + }
  437. + return 0;
  438. +}
  439. +
  440. +int wctomb_wrapper (struct my_ptr* str)
  441. +{
  442. + if(str->ptr)
  443. + {
  444. + return wctomb(str->ptr,NULL);
  445. + }
  446. + return 0;
  447. +}
  448. +
  449. +struct my_ptr* mbstowcs_wrapper(struct my_ptr* src)
  450. +{
  451. + if(src->ptr)
  452. + {
  453. + struct my_ptr* ret = calloc(sizeof(struct my_ptr),1);
  454. + ret->len = 64;
  455. + ret->ptr = calloc(64,1);
  456. + int max_len = 64;
  457. + if(src->len < 64)
  458. + max_len = src->len;
  459. + mbstowcs(ret->ptr,src->ptr,max_len);
  460. + }
  461. +}
  462. +
  463. +double frexp_wrapper(double x , int* exp)
  464. +{
  465. + if(exp)
  466. + return frexp(x,exp);
  467. + return 0;
  468. +}
  469. +float frexpf_wrapper(float x, int* exp)
  470. +{
  471. + if(exp)
  472. + return frexpf(x,exp);
  473. + return 0;
  474. +}
  475. +long double frexpl_wrapper (long double x, int* exp)
  476. +{
  477. + if(exp)
  478. + return frexpl(x,exp);
  479. + return 0;
  480. +}
  481. +double modf_wrapper(double x, double* intpart)
  482. +{
  483. + if(intpart)
  484. + return modf(x,intpart);
  485. + return 0;
  486. +}
  487. +float modff_wrapper(float x, float* intpart)
  488. +{
  489. + if(intpart)
  490. + return modff(x,intpart);
  491. + return 0;
  492. +}
  493. +long double modfl_wrapper(long double x, long double* intpart)
  494. +{
  495. + if(intpart)
  496. + return modfl(x,intpart);
  497. + return 0;
  498. +}
  499. +void c16rtomb_wrapper ( struct my_ptr* str )
  500. +{
  501. + char buffer [MB_CUR_MAX];
  502. + mbstate_t mbs;
  503. + char* pt = str->ptr;
  504. + size_t length;
  505. +
  506. + mbrlen (NULL,0,&mbs); /* initialize mbs */
  507. + while (*pt) {
  508. + length = c16rtomb(buffer,*pt,&mbs);
  509. + if ((length==0)||(length>MB_CUR_MAX)) break;
  510. + ++pt;
  511. + }
  512. +}
  513. +
  514. +double wcstod_wrapper (struct my_wide_ptr* str)
  515. +{
  516. + if(str->ptr)
  517. + return wcstod(str->ptr,NULL);
  518. + return 0;
  519. +}
  520. +
  521. +long int wcstol_wrapper (struct my_wide_ptr* str)
  522. +{
  523. + if(str->ptr)
  524. + {
  525. + return wcstol(str->ptr,NULL,10);
  526. + }
  527. + return 0;
  528. +}
  529. +
  530. +unsigned long int wcstoul_wrapper (struct my_wide_ptr* str)
  531. +{
  532. + if(str->ptr)
  533. + {
  534. + return wcstoul(str->ptr,NULL,10);
  535. + }
  536. + return 0;
  537. +}
  538. +
  539. +void mbrlen_wrapper(struct my_ptr* str)
  540. +{
  541. + mbstate_t mbs;
  542. + if ( !mbsinit(&mbs) )
  543. + memset (&mbs,0,sizeof(mbs));
  544. + mbrlen (NULL,0,&mbs);
  545. + if(str->ptr!=NULL && str->len>0)
  546. + {
  547. + mbrlen(str->ptr,str->len,&mbs);
  548. + }
  549. +}
  550. +
  551. +void mbrtowc_wrapper (struct my_ptr* str)
  552. +{
  553. + if(str->ptr && str->len > 0){
  554. + mbstate_t mbs;
  555. + if ( !mbsinit(&mbs) )
  556. + memset (&mbs,0,sizeof(mbs));
  557. + mbrlen (NULL,0,&mbs);
  558. + mbrtowc(NULL,str->ptr,str->len,&mbs);
  559. + }
  560. +}
  561. +
  562. +void mbsrtowcs_wrapper (struct my_ptr* str)
  563. +{
  564. + if(str->ptr && str->len>0){
  565. + mbstate_t mbs;
  566. + if ( !mbsinit(&mbs) )
  567. + memset (&mbs,0,sizeof(mbs));
  568. + mbrlen (NULL,0,&mbs);
  569. + mbsrtowcs(NULL,&str->ptr,0,&mbs);
  570. + }
  571. +}
  572. \ No newline at end of file
  573. diff --git a/target/libc/wrappers.h b/target/libc/wrappers.h
  574. new file mode 100644
  575. index 0000000..cae6ddd
  576. --- /dev/null
  577. +++ b/target/libc/wrappers.h
  578. @@ -0,0 +1,97 @@
  579. +#ifndef _WRAPPERS_H_
  580. +#define _WRAPPERS_H_
  581. +
  582. +struct my_ptr{
  583. + void* ptr;
  584. + int len;
  585. + int writeable; // 0 or 1
  586. +};
  587. +
  588. +/* STRING.H */
  589. +
  590. +struct my_ptr* generate_str();
  591. +
  592. +void memcpy_wrapper (struct my_ptr* ptr,int num);
  593. +struct my_ptr * memmove_wrapper(struct my_ptr* ptr, int num);
  594. +void strcpy_wrapper (struct my_ptr* ptr );
  595. +void strncpy_wrapper(const char * source, size_t num );
  596. +
  597. +
  598. +struct my_ptr * strcat_wrapper ( struct my_ptr * dst, struct my_ptr * src );
  599. +struct my_ptr *strncat_wrapper ( struct my_ptr * dst, struct my_ptr * src, size_t num );
  600. +
  601. +int memcmp_wrapper ( struct my_ptr * ptr1, struct my_ptr * ptr2, size_t num );
  602. +int strcmp_wrapper ( struct my_ptr * ptr1, struct my_ptr * ptr2 );
  603. +int strcoll_wrapper ( struct my_ptr * ptr1, struct my_ptr * ptr2 );
  604. +int strncmp_wrapper ( struct my_ptr * ptr1, struct my_ptr * ptr2, size_t num );
  605. +void strxfrm_wrapper (struct my_ptr * src);
  606. +
  607. +void memchr_wrapper ( struct my_ptr * src, int val, int num);
  608. +void strchr_wrapper ( struct my_ptr * src, int character);
  609. +void strcspn_wrapper ( struct my_ptr * str1, struct my_ptr * str2 );
  610. +void strpbrk_wrapper ( struct my_ptr * str1, struct my_ptr * str2);
  611. +void strrchr_wrapper ( struct my_ptr * str, int character);
  612. +void strspn_wrapper ( struct my_ptr * str1, struct my_ptr * str2 );
  613. +void strstr_wrapper ( struct my_ptr * str1, struct my_ptr * str2);
  614. +void strtok_wrapper ( struct my_ptr * str, struct my_ptr * delimiters );
  615. +
  616. +void strlen_wrapper ( struct my_ptr * str );
  617. +
  618. +struct my_ptr* asctime_wrapper();
  619. +struct my_ptr* memset_wrapper (int value, size_t num );
  620. +struct my_ptr* strerror_wrapper(int errnum);
  621. +
  622. +/* TIME.H */
  623. +
  624. +struct my_ptr* ctime_wrapper(time_t * a);
  625. +struct my_ptr* ctime_r_wrapper(time_t * a);
  626. +struct tm *localtime_r_wrapper(const time_t * timep);
  627. +struct my_ptr* strptime_wrapper(const char * format,struct tm * tm);
  628. +time_t mktime_wrapper(struct tm * tm);
  629. +struct my_ptr* asctime_r_wrapper(const struct tm * tm);
  630. +struct tm *localtime_wrapper(const time_t * t);
  631. +struct my_ptr* strftime_wrapper(struct my_ptr* format,struct tm* timeptr );
  632. +struct tm *gmtime_r_wrapper(const time_t *timep);
  633. +struct tm *getdate_wrapper(struct my_ptr* ptr);
  634. +struct tm *gmtime_wrapper(const time_t * t);
  635. +
  636. +/* STDLIB.H */
  637. +double atof_wrapper (struct my_ptr* str);
  638. +int atoi_wrapper(struct my_ptr* str);
  639. +long int atol_wrapper ( struct my_ptr* str );
  640. +double strtod_wrapper (struct my_ptr* str);
  641. +long int strtol_wrapper(struct my_ptr* str);
  642. +unsigned long int strtoul_wrapper (struct my_ptr* str);
  643. +struct my_ptr* getenv_wrapper (struct my_ptr* str);
  644. +
  645. +div_t div_wrapper (int numer, int denom);
  646. +ldiv_t ldiv_wrapper (long int numer, long int denom);
  647. +int mblen_wrapper (struct my_ptr* str);
  648. +int mbtowc_wrapper (struct my_ptr* str);
  649. +int wctomb_wrapper (struct my_ptr* str);
  650. +struct my_ptr* mbstowcs_wrapper(struct my_ptr* src);
  651. +
  652. +/* MATH.H */
  653. +double frexp_wrapper (double x , int* exp);
  654. +float frexpf_wrapper (float x , int* exp);
  655. +long double frexpl_wrapper (long double x, int* exp);
  656. +double modf_wrapper (double x , double* intpart);
  657. +float modff_wrapper (float x , float* intpart);
  658. +long double modfl_wrapper (long double x, long double* intpart);
  659. +
  660. +/* wchar.h */
  661. +struct my_wide_ptr{
  662. + void* ptr;
  663. + int len;
  664. +};
  665. +struct my_wide_ptr* generate_wide_str();
  666. +double wcstod_wrapper (struct my_wide_ptr* str);
  667. +long int wcstol_wrapper (struct my_wide_ptr* str);
  668. +unsigned long int wcstoul_wrapper (struct my_wide_ptr* str);
  669. +void mbrlen_wrapper();
  670. +void mbrtowc_wrapper (struct my_ptr* str);
  671. +void mbsrtowcs_wrapper (struct my_ptr* str);
  672. +
  673. +void c16rtomb_wrapper ( struct my_ptr* str );
  674. +
  675. +#endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement