~ubuntu-branches/debian/sid/ember/sid

« back to all changes in this revision

Viewing changes to src/components/ogre/SceneManagers/EmberPagingSceneManager/src/filetutils.cpp

  • Committer: Package Import Robot
  • Author(s): Olek Wojnar, Stephen M. Webb, Olek Wojnar
  • Date: 2016-08-06 18:39:19 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20160806183919-4g72j3flj7xe2stj
Tags: 0.7.2+dfsg-1
[ Stephen M. Webb ]
* debian/control: updated build-depends to newer minimum versions
  (closes: #704786)
* debian/control: updated Standards-Version to 3.9.4 (updated VCS-* fields)
* debian/patches/0001-ember.in-test-expr.patch: removed (fixed upstream)
* debian/patches/0002-add-update_lua_bindings.patch: removed (fixed upstream)
* debian/patches/0003-add-atlas-pkg.patch: removed (fixed upstream)
* debian/patches/0004-domain-bindings-lua-makefile.patch: refreshed
* debian/patches/0005-ember.in-prefix.patch: removed (fixed upstream)
* debian/patches/0006-spellcheck-similiar.patch: removed (fixed upstream)
* debian/patches/0007-revert-libwfut-version.patch: refreshed
* debian/patches/0008-replace-fastdeletegate-with-sigc++.patch: removed
 (fixed upstream)
* debian/patches/0009-spelling-bach.patch: removed (fixed upstream)
* debian/patches/0010-fix-ember-script-args.patch: removed (fixed upstream)
* debian/patches/0011-qualify-template-functions.patch: removed (fixed
  upstream)
* debian/patches/0012-fix-osdir-headers.patch: removed (fixed upstream)
* debian/patches/0013-remove-invalid-linker-flags.patch: removed (fixed
  upstream)
* debian/patches/0014-add-missing-ogrelodstrategy.patch: new
* debian/control: fixed Vcs-Browser URL
* debian/patches/0015-verbose-configure-errors.patch: new
* debian/patches/0016-boost-1.53.patch: new
* debian/control: bump boost build dependeny to 1.53

[ Olek Wojnar ]
* New upstream release (Closes: #799748)
* Add myself as new uploader
  - Remove Stephen Webb per his request
  - Thanks for all the contributions, Stephen!
* d/patches/0007-revert-libwfut-version.patch: removed (unnecessary)
* d/control
  - Remove pre-dependency on dpkg
  - Update standards to 3.9.8 (no changes)
  - Update Vcs lines for secure URIs
* Import patch from the wfmath package to replace MersenneTwister.h
  -- Avoids problems from ambiguous copyright of the original file
* Update dependencies for version 0.7.2
* Enable all hardening options
* Add three lintian overrides
  -- Ignore install into usr/bin (binary)
  -- Ignore .rc files needed for WIN32 build (source)
  -- Ignore false positive of spelling error (binary)
* d/copyright: Update contributors and dates
* d/rules
  -- Do not remove "sounddefinitions" directory
  -- Enable parallel build
  -- Do not install into games directories
  -- Remove dh_builddeb override since xz is now the default
* d/watch: update file extensions
* Remove three patches, add eight patches, update remaining patches
  -- 0004-domain-bindings-lua-makefile.patch (implemented upstream)
  -- 0014-add-missing-ogrelodstrategy.patch (implemented upstream)
  -- 0016-boost-1.53.patch (patch target file removed upstream)
  -- 0018-enable-subdir-objects.patch (Fix automake 1.14 warnings)
  -- 0019-update-boost-m4.patch (Fix invalid boost_major_version)
  -- 0020-remove-obsolete-includes.patch (Fix obsolete includes)
  -- 0021-GraphicalChangeAdapter-fix-for-newer-compilers.patch (Added)
  -- 0022-fix-typos.patch (Fix typos identified by lintian)
  -- 0023-add-keywords-to-desktop-file.patch (Add Keywords to .desktop file)
  -- 0024-fix-icon-location (Make icon location Icon Theme Spec-compliant)
  -- 0025-fix-duplicate-script-install.patch (Was causing build failures)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/***************************************************************************
2
 
*                                                                         *
3
 
*   This program is free software; you can redistribute it and/or modify  *
4
 
*   it under the terms of the GNU Lesser General Public License as        *
5
 
*   published by the Free Software Foundation; either version 2 of the    *
6
 
*   License, or (at your option) any later version.                       *
7
 
*                                                                         *
8
 
***************************************************************************/
9
 
 
10
 
#include "OgrePagingLandScapePrecompiledHeaders.h"
11
 
 
12
 
// #include "OgreNoMemoryMacros.h"
13
 
 
14
 
 
15
 
#include <sys/types.h>
16
 
#include <sys/stat.h>
17
 
 
18
 
#ifdef _WIN32
19
 
#   include <windows.h>
20
 
#   include <direct.h>
21
 
#   include <io.h>
22
 
#   ifndef S_ISDIR
23
 
        //newer mingw has this defined in sys/stat.h
24
 
#      define S_ISDIR(mode) (mode&S_IFDIR)
25
 
#   endif
26
 
#   define STRUCT_STAT  struct _stat
27
 
#   define CHDIR        _chdir
28
 
#   define GETCWD       _getcwd
29
 
#   define MKDIR(A)     _mkdir(A)
30
 
#   define STAT(A,S)    _stat(A,S)
31
 
#else //_LINUX _APPLE
32
 
 
33
 
#ifdef _APPLE
34
 
#   include <malloc/malloc.h>
35
 
#else 
36
 
#   include <stdlib.h>
37
 
#endif
38
 
#   include <unistd.h>
39
 
#   include <sys/param.h>
40
 
 
41
 
#   define MAX_PATH MAXPATHLEN
42
 
#   define STRUCT_STAT  struct stat
43
 
#   define CHDIR        chdir
44
 
#   define GETCWD       getcwd
45
 
#   define MKDIR(A)     mkdir(A, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)// set mode of directory to drwxr-xr-x.
46
 
#   define STAT(A,S)    stat(A,S)
47
 
#endif  //_LINUX _APPLE
48
 
 
49
 
//-----------------------------------------------------------------------
50
 
static char* GetCurrDir()
51
 
{
52
 
    // GETCWD MALLOCS A BUFFER. REMEMBER TO FREE IT.
53
 
    return GETCWD(0,0);;
54
 
}
55
 
 
56
 
#ifdef __cplusplus
57
 
extern "C" { 
58
 
#endif
59
 
 
60
 
//-----------------------------------------------------------------------
61
 
bool DirExists(const char *Dirname)
62
 
{
63
 
    STRUCT_STAT st; 
64
 
 
65
 
    if (STAT(Dirname, &st)) 
66
 
    {
67
 
        // doesn't exist; must create it
68
 
        return false;
69
 
    }
70
 
    if (S_ISDIR(st.st_mode) == 0) 
71
 
    {
72
 
        // it's not a dir, must create a dir        
73
 
        return false;
74
 
    }
75
 
    return true;
76
 
}
77
 
//-----------------------------------------------------------------------
78
 
char * ChangeToDir (const char *Dirname)
79
 
{
80
 
    STRUCT_STAT st;
81
 
 
82
 
    if (STAT(Dirname, &st))
83
 
        {
84
 
        // doen't exist; must create it
85
 
        MKDIR (Dirname);
86
 
        }
87
 
    if (S_ISDIR(st.st_mode) == 0) 
88
 
        {
89
 
        // it's not a dir, must create a dir
90
 
        MKDIR (Dirname);
91
 
        }
92
 
    char *oldDirname = GetCurrDir ();
93
 
    if (CHDIR(Dirname)) {
94
 
        return oldDirname;
95
 
    }
96
 
    return oldDirname;
97
 
}
98
 
 
99
 
 
100
 
void RetablishDir(char *oldDirname)
101
 
{
102
 
    if (oldDirname != NULL) 
103
 
     {
104
 
        ChangeToDir (oldDirname);
105
 
        // FREE MALLOC'ED GETCWD BUFFER.
106
 
        free (oldDirname);
107
 
    }
108
 
}
109
 
 
110
 
#ifdef __cplusplus
111
 
}/* end extern C definitions */ 
112
 
#endif