~ubuntu-branches/debian/sid/sflphone/sid

« back to all changes in this revision

Viewing changes to daemon/libs/pjproject-2.0.1/pjlib/include/pj/file_access.h

  • Committer: Package Import Robot
  • Author(s): Mark Purcell
  • Date: 2013-06-02 18:04:11 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130602180411-3rcpy8c1zdlo8y0s
Tags: 1.2.2-1
* New upstream release
* changeset_rb68857a4b485b7d43f92714cd5792595ff895f82.diff - fix QTest
* pjproject ./configure --disable-sound --disable-video

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: file_access.h 3553 2011-05-05 06:14:19Z nanang $ */
 
2
/*
 
3
 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
 
4
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 */
 
20
#ifndef __PJ_FILE_ACCESS_H__
 
21
#define __PJ_FILE_ACCESS_H__
 
22
 
 
23
/**
 
24
 * @file file_access.h
 
25
 * @brief File manipulation and access.
 
26
 */
 
27
#include <pj/types.h>
 
28
 
 
29
PJ_BEGIN_DECL
 
30
 
 
31
/**
 
32
 * @defgroup PJ_FILE_ACCESS File Access
 
33
 * @ingroup PJ_IO
 
34
 * @{
 
35
 *
 
36
 */
 
37
 
 
38
/**
 
39
 * This structure describes file information, to be obtained by
 
40
 * calling #pj_file_getstat(). The time information in this structure
 
41
 * is in local time.
 
42
 */
 
43
typedef struct pj_file_stat
 
44
{
 
45
    pj_off_t        size;   /**< Total file size.               */
 
46
    pj_time_val     atime;  /**< Time of last access.           */
 
47
    pj_time_val     mtime;  /**< Time of last modification.     */
 
48
    pj_time_val     ctime;  /**< Time of last creation.         */
 
49
} pj_file_stat;
 
50
 
 
51
 
 
52
/**
 
53
 * Returns non-zero if the specified file exists.
 
54
 *
 
55
 * @param filename      The file name.
 
56
 *
 
57
 * @return              Non-zero if the file exists.
 
58
 */
 
59
PJ_DECL(pj_bool_t) pj_file_exists(const char *filename);
 
60
 
 
61
/**
 
62
 * Returns the size of the file.
 
63
 *
 
64
 * @param filename      The file name.
 
65
 *
 
66
 * @return              The file size in bytes or -1 on error.
 
67
 */
 
68
PJ_DECL(pj_off_t) pj_file_size(const char *filename);
 
69
 
 
70
/**
 
71
 * Delete a file.
 
72
 *
 
73
 * @param filename      The filename.
 
74
 *
 
75
 * @return              PJ_SUCCESS on success or the appropriate error code.
 
76
 */
 
77
PJ_DECL(pj_status_t) pj_file_delete(const char *filename);
 
78
 
 
79
/**
 
80
 * Move a \c oldname to \c newname. If \c newname already exists,
 
81
 * it will be overwritten.
 
82
 *
 
83
 * @param oldname       The file to rename.
 
84
 * @param newname       New filename to assign.
 
85
 *
 
86
 * @return              PJ_SUCCESS on success or the appropriate error code.
 
87
 */
 
88
PJ_DECL(pj_status_t) pj_file_move( const char *oldname,
 
89
                                   const char *newname);
 
90
 
 
91
 
 
92
/**
 
93
 * Return information about the specified file. The time information in
 
94
 * the \c stat structure will be in local time.
 
95
 *
 
96
 * @param filename      The filename.
 
97
 * @param stat          Pointer to variable to receive file information.
 
98
 *
 
99
 * @return              PJ_SUCCESS on success or the appropriate error code.
 
100
 */
 
101
PJ_DECL(pj_status_t) pj_file_getstat(const char *filename, pj_file_stat *stat);
 
102
 
 
103
 
 
104
/** @} */
 
105
 
 
106
PJ_END_DECL
 
107
 
 
108
 
 
109
#endif  /* __PJ_FILE_ACCESS_H__ */