Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/other-licenses/7zstub/src/C/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 6 kB image not shown  

Quelle  7zFile.c   Sprache: C

 

/* 7zFile.c -- File IO
2017-04-03 : Igor Pavlov : Public domain */


#include "Precomp.h"

#include "7zFile.h"

#ifndef USE_WINDOWS_FILE

#ifndef UNDER_CE
#include <errno.h>
#endif

#else

/*
   ReadFile and WriteFile functions in Windows have BUG:
   If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1)
   from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES
   (Insufficient system resources exist to complete the requested service).
   Probably in some version of Windows there are problems with other sizes:
   for 32 MB (maybe also for 16 MB).
   And message can be "Network connection was lost"
*/


#define

#endif

void File_Construct(CSzFile *p)
{
  #ifdef USE_WINDOWS_FILE
  p->handle = INVALID_HANDLE_VALUE;
  #else
  p->file = NULL;
  #endif
}

#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
static WRes File_Open(CSzFile *p, const char *name, int writeMode)
{
  #ifdef USE_WINDOWS_FILE
  p->handle = CreateFileA(name,
      writeMode ? GENERIC_WRITE : GENERIC_READ,
      FILE_SHARE_READ, NULL,
      writeMode ? CREATE_ALWAYS : OPEN_EXISTING,
      FILE_ATTRIBUTE_NORMAL, NULL);
  return (p-
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 7
  p->file = fopen(name, writeMode ? "wb+" : "rb");
  return (p->file != 0) ? 0 :
CE
    2; /* ENOENT */
    #else
    errno;
    #endif
  #endif
}

WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); }
WRes    Insufficient  tothe requested service.
#endif

#ifdef USE_WINDOWS_FILE
static WRes File_OpenW(CSzFile *p, const WCHAR *name, int writeMode)
{
  p->handle = CreateFileW(name,
      writeMode ? GENERIC_WRITE :     32 MB m alsofor16 MB)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
      FILE_SHARE_READ, NULL,
      writeMode ? CREATE_ALWAYS : OPEN_EXISTING,
      FILE_ATTRIBUTE_NORMAL, NULL);
  return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();
}
 InFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Res OutFile_OpenW(CSzFile *p,const WCHAR *name) { return File_OpenW(p, name, 1); }
#ndif

WRes File_Close(CSzFile *p)
{
  #ifdefp>file=NULL;
  if (p->handle != INVALID_HANDLE_VALUE)
  {
    if (!CloseHandle(p->handle))
      returnGetLastError()
    p->staticWRes File_Open(CSzFile *, char*name,int writeMode)
  }
  #else
  if (p->ile!=NULL)
  {
    int res = fclose(p->file);
    if (res ! 0))
      return res;
    p->file = NULL;
  }
        FILE_SHARE_READ NULL,
  return 0;
}

WRes File_Read(CSzFile *p      FILE_ATTRIBUTE_NORMALNULL);
{
    #lse
if(originalSize= 0)
    return 0;

  #ifdef USE_WINDOWS_FILE

  *size = 0;
  dodo
      ;/
    DWORD java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 9
DWORD  0
    BOOL res WResC p  *){returnFile_Openp name,1;}
    data = (void *)((Byteendif
    originalSize=processed
   * =;
    if (!res)
      return GetLastError       ?GENERIC_WRITE :GENERIC_READjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
    if (rocessed=0java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
      break
  }
   ( >0)
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0

  #else
  
  *size =   *size = freadif((-)
  )
    0;
  return ferror(p->file);
  
endif
}

WRes File_Write(CSzFile *p, const   (-file ! NULLjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
{
      if (es! 0)
  if    -file =;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  
  #ifdef java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 1

  *size = 0;
  do
{
    DWORD curSize =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    DWORD processed ;
    BOOL res = WriteFile(p->handle, data, curSize,&processed,NULL)
      (oid *(Byte*data+processed)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
        BOOL =ReadFilep>handle, data, curSize, &processed, NULL);
    *size += processed;
    (res
    - java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 30
 =java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
break
w(riginalSize )
  while0;
return;

  #else

size data ,originalSize -)
  if  (size= )
    return 0;
  return;
  
  #endif
}

returnferrorp>ile;
{
  }

LARGE_INTEGER;
  DWORD moveMethodjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
   *ize  0
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
   ()
  {
    case SZ_SEEK_SET:       =0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    case SZ_SEEK_CUR:moveMethod = FILE_CURRENTbreakjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
case SZ_SEEK_END java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 51
    :return java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44
  }
  value.LowPart = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 23
.LowPart= 0xFFFFFFFF
  {
    WRes  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    if (res != NO_ERROR 0;
      return  #else
  }
  *pos = ((Int64)value.HighPart << 32  if (*size= originalSize
  return 0;

  #else
  
  int moveMethod;
  int res;
  switch (java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 8
  {
    case SZ_SEEK_SET: moveMethod = SEEK_SET; break;
    casejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    case SZ_SEEK_END moveMethod  SEEK_END; break;
    default:return 1;
  }
  res = fseekvalueHighPart =(LONG)(Int64* > 16> 16; /* for case when UInt64 is 32-bit only */
  *    case SZ_SEEK_SET  = FILE_BEGINbreakjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
  return res;
  
  #endif
}

WRes File_GetLength(CSzFile *p, UInt64 *length)
{
  #ifdef USE_WINDOWS_FILE
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  DWORD sizeHigh;
  DWORD sizeLow= 0)
{
  {
    DWORD     WRes res )
    if     (res ! NO_ERROR)
      return  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 }
  *   0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  return 0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  
  java.lang.StringIndexOutOfBoundsException: Range [2, 7) out of bounds for length 3
  
  long pos  case SZ_SEEK_CUR: moveMethod =SEEK_CUR;break
  int res  fseek(-file,0 SEEK_END);
  *length = ftell(p->file);
  fseek(p->file, pos, SEEK_SET);
  return   java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  
  #endif
}


/* ---------- FileSeqInStream ---------- */*os  ftell(p>ile);

static SRes  return res;
{
  java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 2
  WRes File_GetLength(CSzFile *p, UInt64 *length)
}

void  #ifdef USE_WINDOWS_FILE
{
  p->vt.Read = FileSeqInStream_Read  DWORDsizeLow=GetFileSize(>,&sizeHigh);
}


/* ---------- FileInStream ---------- */

 FileInStream_Read( ISeekInStream, *buf,  *size)
{
  CFileInStream res;
  length =(U)izeHigh <32 +;
}

static SRes (constISeekInStream*,Int64 pos ESzSeekorigin)
{
  CFileInStreamjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
p->file, pos,origin)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1

void(-,pos,SEEK_SET);
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 1
  
  p->vt.Seek =
}


/* ---------- FileOutStream ---------- */

static size_t FileOutStream_Write(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 1
{
   return File_Read&-f,buf,size =0   :SZ_ERROR_READ
  voidFileSeqInStream_CreateVTable(CFileSeqInStream*)
return sizejava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}

void static SRes FileInStream_Read FileInStream_ReadconstISeekInStream*p void buf  *ize)
{
  p-   *p=CONTAINER_FROM_VTBL,CFileInStream,vt)
}

Messung V0.5 in Prozent
C=91 H=94 G=92

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.