##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 EVALUATION    14/Jan/2011  23:28:03 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  D:\pasha\elf\googlecode\MySMSYS\Mss3\AFile.cpp       #
#    Command line    =  D:\pasha\elf\googlecode\MySMSYS\Mss3\AFile.cpp -D    #
#                       NEWSGOLD -D ELKA -D LANG_EN -lcN                     #
#                       D:\pasha\elf\googlecode\MySMSYS\Mss3\Release_ELKA_EN #
#                       \List\ -o D:\pasha\elf\googlecode\MySMSYS\Mss3\Relea #
#                       se_ELKA_EN\Obj\ -s9 --no_unroll --cpu_mode arm       #
#                       --endian little --cpu ARM926EJ-S --stack_align 4     #
#                       --interwork -e --fpu None --eec++ --dlib_config      #
#                       "D:\pasha\Embedded Workbench 4.0                     #
#                       Evaluation2\ARM\LIB\dl5tpainl8n.h" -I                #
#                       "D:\pasha\Embedded Workbench 4.0                     #
#                       Evaluation2\ARM\INC\" --inline_threshold=2           #
#    List file       =  D:\pasha\elf\googlecode\MySMSYS\Mss3\Release_ELKA_EN #
#                       \List\AFile.lst                                      #
#    Object file     =  D:\pasha\elf\googlecode\MySMSYS\Mss3\Release_ELKA_EN #
#                       \Obj\AFile.r79                                       #
#                                                                            #
#                                                                            #
##############################################################################

D:\pasha\elf\googlecode\MySMSYS\Mss3\AFile.cpp
      1          // AFile.cpp: implementation of the AFile class.
      2          //
      3          //////////////////////////////////////////////////////////////////////
      4          #include "include.h"
      5          #include "AFile.h"
      6          
      7          //////////////////////////////////////////////////////////////////////
      8          // Construction/Destruction
      9          //////////////////////////////////////////////////////////////////////
     10          
     11          AFile::AFile()
     12          {
     13            this->fin=-1;
     14          }
     15          
     16          AFile::AFile(const char *cFileName, unsigned int iFileFlags, unsigned int iFileMode)
     17          {
     18            this->fin=fopen(cFileName, iFileFlags, iFileMode, &this->ferr);
     19          }
     20          
     21          AFile::~AFile()
     22          {
     23            if(this->fin!=-1)
     24            {
     25              fclose(this->fin, &this->ferr);
     26              this->fin=-1;
     27            }
     28          }
     29          
     30          void AFile::FClose()
     31          {
     32            if(this->fin!=-1)
     33            {
     34              fclose(this->fin, &this->ferr);
     35              this->fin=-1;
     36            }
     37          }
     38          
     39          int AFile::FOpen(const char *cFileName, unsigned int iFileFlags, unsigned int iFileMode)
     40          {
     41            if(this->fin!=-1)
     42              FClose();
     43            return (this->fin=fopen(cFileName, iFileFlags, iFileMode, &this->ferr));
     44          }
     45          
     46          int AFile::FRead(void *cBuffer, int iByteCount)
     47          {
     48            if(this->fin==-1)
     49              return 0; //-1 ?
     50            return (fread(this->fin, cBuffer, iByteCount, &this->ferr));
     51          }
     52          
     53          int AFile::FWrite(const void *cBuffer, int iByteCount)
     54          {
     55            if(this->fin==-1)
     56              return 0; //-1 ?
     57            return (fwrite(this->fin, cBuffer, iByteCount, &this->ferr));
     58          }
     59          
     60          int AFile::LSeek(unsigned int offset, unsigned int origin)
     61          {
     62            if(this->fin==-1)
     63              return 0; //-1 ?
     64            return (lseek(this->fin, offset, origin, &this->ferr, &this->ferr));
     65          }

   Maximum stack usage in bytes:

     Function                       CSTACK
     --------                       ------
     AFile::AFile()                     0
     AFile::AFile(char const *, unsigned int, unsigned int)
                                        8
     AFile::FClose()                   12
     AFile::FOpen(char const *, unsigned int, unsigned int)
                                       20
     AFile::FRead(void *, int)          4
     AFile::FWrite(void const *, int)
                                        4
     AFile::LSeek(unsigned int, unsigned int)
                                        8
     AFile::delete ~AFile(AFile *)      8
     AFile::new AFile()                 4
     AFile::new AFile(char const *, unsigned int, unsigned int)
                                       20
     AFile::~AFile()                   12


   Segment part sizes:

     Function/Label                 Bytes
     --------------                 -----
     AFile::AFile()                   12
     AFile::AFile(char const *, unsigned int, unsigned int)
                                      40
     AFile::~AFile()                  40
     AFile::FClose()                  40
     AFile::FOpen(char const *, unsigned int, unsigned int)
                                      68
     AFile::FRead(void *, int)        36
     AFile::FWrite(void const *, int)
                                      36
     AFile::LSeek(unsigned int, unsigned int)
                                      44
     AFile::new AFile(char const *, unsigned int, unsigned int)
                                      64
     AFile::new AFile()               28
     AFile::delete ~AFile(AFile *)    28
      Others                          68

 
 504 bytes in segment CODE
 
 436 bytes of CODE memory (+ 68 bytes shared)

Errors: none
Warnings: none
