Changeset 551 for trunk/dll/fsopen.c


Ignore:
Timestamp:
Feb 28, 2007, 2:33:51 AM (19 years ago)
Author:
Gregg Young
Message:

Indentation cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/fsopen.c

    r2 r551  
    1313#pragma alloc_text(FSOPEN,_fsopen)
    1414
    15 FILE * _fsopen (CHAR *filename,CHAR *mode,INT sharemode,...) {
     15FILE *_fsopen(CHAR * filename, CHAR * mode, INT sharemode, ...)
     16{
    1617
    17   ULONG openflag = OPEN_ACTION_OPEN_IF_EXISTS,openmode = 0,action = 0;
     18  ULONG openflag = OPEN_ACTION_OPEN_IF_EXISTS, openmode = 0, action = 0;
    1819  HFILE handle;
    1920  FILE *fp;
    20   BOOL  text = TRUE;
     21  BOOL text = TRUE;
    2122
    22   if(!stristr(mode,"b"))
     23  if (!stristr(mode, "b"))
    2324    text = FALSE;
    24   if(stristr(mode,"r"))
     25  if (stristr(mode, "r"))
    2526    openmode |= OPEN_ACCESS_READONLY;
    26   else if(stristr(mode,"w")) {
     27  else if (stristr(mode, "w")) {
    2728    openmode |= OPEN_ACCESS_WRITEONLY;
    2829    openflag |= (OPEN_ACTION_REPLACE_IF_EXISTS | OPEN_ACTION_CREATE_IF_NEW);
    2930  }
    30   if(stristr(mode,"a"))
     31  if (stristr(mode, "a"))
    3132    openmode |= OPEN_ACCESS_WRITEONLY;
    32   if(stristr(mode,"+")) {
     33  if (stristr(mode, "+")) {
    3334    openmode &= (~(OPEN_ACCESS_READONLY | OPEN_ACCESS_WRITEONLY));
    3435    openmode |= OPEN_ACCESS_READWRITE;
    3536    openflag |= OPEN_ACTION_CREATE_IF_NEW;
    3637  }
    37   if(sharemode == SH_DENYRW)
     38  if (sharemode == SH_DENYRW)
    3839    openmode |= OPEN_SHARE_DENYREADWRITE;
    39   else if(sharemode == SH_DENYWR)
     40  else if (sharemode == SH_DENYWR)
    4041    openmode |= OPEN_SHARE_DENYWRITE;
    41   else if(sharemode == SH_DENYRD)
     42  else if (sharemode == SH_DENYRD)
    4243    openmode |= OPEN_SHARE_DENYREAD;
    4344  else
    4445    openmode |= OPEN_SHARE_DENYNONE;
    4546  openmode |= OPEN_FLAGS_FAIL_ON_ERROR;
    46   if(text)
     47  if (text)
    4748    openmode |= OPEN_FLAGS_SEQUENTIAL;
    4849  else
    4950    openmode |= OPEN_FLAGS_RANDOMSEQUENTIAL;
    50   if(DosOpen(filename,&handle,&action,0L,FILE_NORMAL,openflag,openmode,
    51              (PEAOP2)0))
     51  if (DosOpen(filename, &handle, &action, 0L, FILE_NORMAL, openflag, openmode,
     52              (PEAOP2) 0))
    5253    return NULL;
    53   if(mode[strlen(mode) - 1] == 't')
    54     mode[strlen(mode) - 1] = 0; /* bug bug bug */
    55   fp = fdopen(handle,mode);
    56   if(!fp) {
     54  if (mode[strlen(mode) - 1] == 't')
     55    mode[strlen(mode) - 1] = 0;         /* bug bug bug */
     56  fp = fdopen(handle, mode);
     57  if (!fp) {
    5758    DosClose(handle);
    58     fp = fopen(filename,mode);  /* last ditch effort */
     59    fp = fopen(filename, mode);         /* last ditch effort */
    5960  }
    60   if(fp) {
    61     if(text)   /* line buffer text files */
    62       setvbuf(fp,NULL,_IOLBF,BUFSIZ * 2);
     61  if (fp) {
     62    if (text)                           /* line buffer text files */
     63      setvbuf(fp, NULL, _IOLBF, BUFSIZ * 2);
    6364    else
    64       setvbuf(fp,NULL,_IOFBF,BUFSIZ * 8);
    65     if(stristr(mode,"a"))
    66       fseek(fp,0L,SEEK_END);
     65      setvbuf(fp, NULL, _IOFBF, BUFSIZ * 8);
     66    if (stristr(mode, "a"))
     67      fseek(fp, 0L, SEEK_END);
    6768  }
    6869  return fp;
    6970}
    70 
Note: See TracChangeset for help on using the changeset viewer.