Ignore:
Timestamp:
09/19/08 07:30:59 (5 years ago)
Author:
reyalp
Message:

lua iolib and oslib. See http://chdk.setepontos.com/index.php/topic,2267.msg21479.html#msg21479

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/platform/generic/wrappers.c

    r515 r517  
    231231} 
    232232 
     233int errnoOfTaskGet(int tid) { 
     234#if !CAM_DRYOS 
     235    return _errnoOfTaskGet(tid); 
     236#else 
     237    return 0; 
     238#endif 
     239} 
     240 
    233241int isdigit(int c) { 
    234242#if !CAM_DRYOS 
     
    326334} 
    327335 
     336// strerror exists on vxworks cams,  
     337// but it does about the same thing as this 
     338const char *strerror(int en) { 
     339#if !CAM_DRYOS 
     340    static char msg[20]; 
     341    sprintf(msg,"errno 0x%X",en); 
     342    return msg; 
     343#else 
     344    return "error"; 
     345#endif 
     346} 
     347 
    328348unsigned long time(unsigned long *timer) { 
    329349    return _time(timer); 
     
    341361  static int x[9]; 
    342362  return _LocalTime(_tod, &x);    
     363#endif 
     364} 
     365 
     366long strftime(char *s, unsigned long maxsize, const char *format, /*const struct tm*/ void *timp) { 
     367        return _strftime(s,maxsize,format,timp); 
     368} 
     369 
     370/*time_t*/ long mktime(/*struct tm*/ void *timp) { 
     371#if !CAM_DRYOS 
     372        return _mktime(timp); 
     373#else 
     374        int timp_ext[10]; // struct tm + a ptr 
     375        _memcpy(timp_ext,timp,9*sizeof(int)); 
     376        timp_ext[9]=0; 
     377        long retval = _mktime_ext(&timp_ext); 
     378        _memcpy(timp,timp_ext,9*sizeof(int)); 
     379        return retval; 
    343380#endif 
    344381} 
     
    449486//#endif 
    450487} 
     488long MakeDirectory_Fut(const char *dirname) { 
     489 return _MakeDirectory_Fut(dirname,-1); // meaning of second arg is not clear, firmware seems to use -1 
     490} 
     491 
    451492long Fopen_Fut(const char *filename, const char *mode){ 
    452493 return _Fopen_Fut(filename,mode); 
    453494} 
    454495 
    455 void Fclose_Fut(long file){ 
    456  _Fclose_Fut(file); 
     496long Fclose_Fut(long file){ 
     497 return _Fclose_Fut(file); 
    457498} 
    458499 
     
    469510} 
    470511 
     512long Feof_Fut(long file) { 
     513 return _Feof_Fut(file); 
     514} 
     515 
     516long Fflush_Fut(long file) { 
     517 return _Fflush_Fut(file); 
     518} 
     519 
     520char *Fgets_Fut(char *buf, int n, long f) { 
     521 return _Fgets_Fut(buf,n,f); 
     522} 
     523 
     524long RenameFile_Fut(const char *oldname, const char *newname) { 
     525 return _RenameFile_Fut(oldname, newname); 
     526} 
     527 
    471528int rename(const char *oldname, const char *newname){ 
     529 // doesn't appear to work on a540 
    472530 return _rename(oldname, newname); 
     531} 
     532 
     533long DeleteFile_Fut(const char *name) { 
     534 return _DeleteFile_Fut(name); 
    473535} 
    474536 
Note: See TracChangeset for help on using the changeset viewer.