Changeset 3142:b253e272baf9 in roaraudio


Ignore:
Timestamp:
01/15/10 12:22:10 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

call _open_file() within open(), added dummy _open_file()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroaross/libroaross.c

    r3141 r3142  
    238238 
    239239// ------------------------------------- 
     240// central open function: 
     241// ------------------------------------- 
     242 
     243static int _open_file (const char *pathname, int flags) { 
     244 return -1; 
     245} 
     246 
     247// ------------------------------------- 
    240248// emulated functions follow: 
    241249// ------------------------------------- 
    242250 
    243251int     open(const char *pathname, int flags, ...) { 
    244  mode_t mode = 0; 
     252 int     ret; 
     253 mode_t  mode = 0; 
    245254 va_list args; 
    246255 
    247256 _init(); 
     257 
     258 _os.write(1, "DOOF!\n", 6); 
     259 
     260 ret = _open_file(pathname, flags); 
     261 
     262 switch (ret) { 
     263  case -2:       // continue as normal, use _op.open() 
     264   break; 
     265  case -1:       // pass error to caller 
     266    return -1; 
     267   break; 
     268  default:       // return successfully opened pointer to caller 
     269    return ret; 
     270   break; 
     271 } 
    248272 
    249273 if (flags & O_CREAT) { 
Note: See TracChangeset for help on using the changeset viewer.