~ubuntu-branches/ubuntu/maverick/wxwidgets2.8/maverick-proposed

« back to all changes in this revision

Viewing changes to src/msw/wince/filefnwce.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Devid Filoni
  • Date: 2008-06-30 22:02:17 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080630220217-vag3tkfp91t0453d
Tags: 2.8.8.0-0ubuntu1
* New upstream version, based on the upstream tarball
  wxPython-src-2.8.8.0.tar.bz2, remove upstream debian dir (LP: #244355).
* Add debian/watch file, LP: #242164.
* Edit get-orig-source target to provide a .orig.tar.gz with the same md5 for
  each .orig.tar.gz generated.
* debian/rules: remove get-orig-source from .PHONY target.
* debian/control.in: add python-wxtools in python-wxgtk=V=U Suggests field.
* Do not apply fix_from_upstream_svn_r52465 patch, not needed.
* Regenerate octave_oct, tcl_tk_tcl patches for the new version.
* Fix spelling-error-in-description lintian warning.
* Fix depends-on-obsolete-package lintian error.
* Fix executable-not-elf-or-script lintian warnings.
* Fix script-not-executable lintian warnings.
* Fix missing-dependency-on-libc lintian error.
* Fix dbg-package-missing-depends lintian warnings.
* Fix package-contains-empty-directory lintian warnings.
* Fix manpage-has-errors-from-man lintian warning.
* Fix image-file-in-usr-lib lintian warnings:
  - add editra_pixmaps patch
  - add xrced_bitmaps patch
* Fix unused-override lintian info.
* Fix malformed-override lintian errors.
* Fix extra-license-file lintian warnings.
* Install upstream wx.pth instead of generated file links (LP: #211553).
* Add editra.png, pyshell.png (encoded using uuencode) icons, LP: #236876:
  - debian/rules: use uudecode to decode .png icons.
* Add a new pyshell.xpm icon.
* Fix doc-base-file-references-missing-file lintian error.
* Fix doc-base-unknown-section lintian warning.
* Fix ruby-script-but-no-ruby-dep lintian errors.
* Fix wish-script-but-no-wish-dep lintian errors.
* Fix missing-dep-for-interpreter errors.
* Bump Standards-Version to 3.8.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
// Author:      Julian Smart
5
5
// Modified by:
6
6
// Created:     29/01/98
7
 
// RCS-ID:      $Id: filefnwce.cpp 38791 2006-04-18 09:56:17Z ABX $
 
7
// RCS-ID:      $Id: filefnwce.cpp 52111 2008-02-26 14:15:12Z JS $
8
8
// Copyright:   (c) 1998 Julian Smart
9
9
// Licence:     wxWindows licence
10
10
/////////////////////////////////////////////////////////////////////////////
44
44
    {
45
45
        access = GENERIC_READ;
46
46
        shareMode = FILE_SHARE_READ|FILE_SHARE_WRITE;
47
 
        disposition |= OPEN_EXISTING;
 
47
        disposition = OPEN_EXISTING;
48
48
    }
49
49
    else if ((oflag & (O_RDONLY | O_WRONLY | O_RDWR)) == O_WRONLY)
50
50
    {
51
51
        access = GENERIC_WRITE;
 
52
        disposition = OPEN_ALWAYS;
52
53
    }
53
54
    else if ((oflag & (O_RDONLY | O_WRONLY | O_RDWR)) == O_RDWR)
54
55
    {
55
56
        access = GENERIC_READ|GENERIC_WRITE;
 
57
        disposition = OPEN_ALWAYS;
56
58
    }
 
59
 
57
60
    if (oflag & O_APPEND)
58
61
    {
59
62
        if ( wxFile::Exists(filename) )
62
65
            shareMode = FILE_SHARE_READ;
63
66
            disposition = OPEN_EXISTING;
64
67
        }
65
 
        //else: fall through as write_append is the same as write if the
66
 
        //      file doesn't exist
67
68
        else
 
69
        {
68
70
            oflag |= O_TRUNC;
 
71
        }
69
72
    }
70
73
    if (oflag & O_TRUNC)
71
74
    {
72
75
        access |= GENERIC_WRITE;
73
76
        shareMode = 0;
74
 
        disposition = (oflag & O_CREAT) ? CREATE_ALWAYS : TRUNCATE_EXISTING;
 
77
        disposition = oflag & O_CREAT ? CREATE_ALWAYS : TRUNCATE_EXISTING;
75
78
    }
76
79
    else if (oflag & O_CREAT)
77
80
    {
119
122
 
120
123
int wxEof(int fd)
121
124
{
122
 
    LONG high0 = 0;
123
 
    DWORD off0 = SetFilePointer((HANDLE) fd, 0, &high0, FILE_CURRENT);
 
125
    DWORD off0 = SetFilePointer((HANDLE) fd, 0, NULL, FILE_CURRENT);
124
126
    if (off0 == 0xFFFFFFFF && GetLastError() != NO_ERROR)
125
127
        return -1;
126
128
 
127
 
    LONG high1 = 0;
128
 
    DWORD off1 = SetFilePointer((HANDLE) fd, 0, &high0, FILE_END);
 
129
    DWORD off1 = SetFilePointer((HANDLE) fd, 0, NULL, FILE_END);
129
130
    if (off1 == 0xFFFFFFFF && GetLastError() != NO_ERROR)
130
131
        return -1;
131
132
 
132
 
    if (off0 == off1 && high0 == high1)
 
133
    if (off0 == off1)
133
134
        return 1;
134
135
    else
135
136
    {
136
 
        SetFilePointer((HANDLE) fd, off0, &high0, FILE_BEGIN);
 
137
        SetFilePointer((HANDLE) fd, off0, NULL, FILE_BEGIN);
137
138
        return 0;
138
139
    }
139
140
}
178
179
            break;
179
180
    }
180
181
 
181
 
    LONG high = 0;
182
 
    DWORD res = SetFilePointer((HANDLE) fd, offset, &high, method) ;
 
182
    DWORD res = SetFilePointer((HANDLE) fd, offset, NULL, method) ;
183
183
    if (res == 0xFFFFFFFF && GetLastError() != NO_ERROR)
184
184
    {
185
185
        wxLogSysError(_("can't seek on file descriptor %d"), fd);
191
191
 
192
192
__int64 wxTell(int fd)
193
193
{
194
 
    LONG high = 0;
195
 
    DWORD res = SetFilePointer((HANDLE) fd, 0, &high, FILE_CURRENT) ;
 
194
    // WinCE apparently doesn't support lpDistanceToMoveHigh.
 
195
    // LONG high = 0;
 
196
    DWORD res = SetFilePointer((HANDLE) fd, 0, NULL, FILE_CURRENT) ;
196
197
    if (res == 0xFFFFFFFF && GetLastError() != NO_ERROR)
197
198
    {
198
199
        wxLogSysError(_("can't get seek position on file descriptor %d"), fd);
199
200
        return wxInvalidOffset;
200
201
    }
201
202
    else
202
 
        return res + (((__int64)high) << 32);
 
203
        return res ; // + (((__int64)high) << 32);
203
204
}
204
205
 
205
206
int wxFsync(int WXUNUSED(fd))