~ubuntu-branches/ubuntu/saucy/sflphone/saucy

« back to all changes in this revision

Viewing changes to sflphone-common/libs/pjproject/pjlib/src/pj/os_error_symbian.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2010-12-24 16:33:55 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20101224163355-tkvvikqxbrbav6up
Tags: 0.9.11-1
* New upstream release
* Add new build dependencies on libwebkit-dev and libyaml-dev

* Bump Standards-Version up to 3.9.1
* Bump debhelper compatibility to 8
* Patch another typo in the upstream code (lintian notice)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* $Id: os_error_symbian.cpp 2394 2008-12-23 17:27:53Z bennylp $ */
2
 
/* 
 
2
/*
3
3
 * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
4
4
 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5
5
 *
15
15
 *
16
16
 * You should have received a copy of the GNU General Public License
17
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 
 
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
19
 *
20
20
 *  Additional permission under GNU GPL version 3 section 7:
21
21
 *
46
46
    /*
47
47
     * Generic error -1 to -46
48
48
     */
49
 
    PJ_BUILD_ERR( KErrNotFound,     "Unable to find the specified object"),
50
 
    PJ_BUILD_ERR( KErrGeneral,      "General (unspecified) error"),
51
 
    PJ_BUILD_ERR( KErrCancel,       "The operation was cancelled"),
52
 
    PJ_BUILD_ERR( KErrNoMemory,     "Not enough memory"),
53
 
    PJ_BUILD_ERR( KErrNotSupported, "The operation requested is not supported"),
54
 
    PJ_BUILD_ERR( KErrArgument,     "Bad request"),
55
 
    PJ_BUILD_ERR( KErrTotalLossOfPrecision, "Total loss of precision"),
56
 
    PJ_BUILD_ERR( KErrBadHandle,    "Bad object"),
57
 
    PJ_BUILD_ERR( KErrOverflow,     "Overflow"),
58
 
    PJ_BUILD_ERR( KErrUnderflow,    "Underflow"),
59
 
    PJ_BUILD_ERR( KErrAlreadyExists,"Already exists"),
60
 
    PJ_BUILD_ERR( KErrPathNotFound, "Unable to find the specified folder"),
61
 
    PJ_BUILD_ERR( KErrDied,         "Closed"),
62
 
    PJ_BUILD_ERR( KErrInUse,        "The specified object is currently in use by another program"),
63
 
    PJ_BUILD_ERR( KErrServerTerminated,     "Server has closed"),
64
 
    PJ_BUILD_ERR( KErrServerBusy,   "Server busy"),
65
 
    PJ_BUILD_ERR( KErrCompletion,   "Completion error"),
66
 
    PJ_BUILD_ERR( KErrNotReady,     "Not ready"),
67
 
    PJ_BUILD_ERR( KErrUnknown,      "Unknown error"),
68
 
    PJ_BUILD_ERR( KErrCorrupt,      "Corrupt"),
69
 
    PJ_BUILD_ERR( KErrAccessDenied, "Access denied"),
70
 
    PJ_BUILD_ERR( KErrLocked,       "Locked"),
71
 
    PJ_BUILD_ERR( KErrWrite,        "Failed to write"),
72
 
    PJ_BUILD_ERR( KErrDisMounted,   "Wrong disk present"),
73
 
    PJ_BUILD_ERR( KErrEof,          "Unexpected end of file"),
74
 
    PJ_BUILD_ERR( KErrDiskFull,     "Disk full"),
75
 
    PJ_BUILD_ERR( KErrBadDriver,    "Bad device driver"),
76
 
    PJ_BUILD_ERR( KErrBadName,      "Bad name"),
77
 
    PJ_BUILD_ERR( KErrCommsLineFail,"Comms line failed"),
78
 
    PJ_BUILD_ERR( KErrCommsFrame,   "Comms frame error"),
79
 
    PJ_BUILD_ERR( KErrCommsOverrun, "Comms overrun error"),
80
 
    PJ_BUILD_ERR( KErrCommsParity,  "Comms parity error"),
81
 
    PJ_BUILD_ERR( KErrTimedOut,     "Timed out"),
82
 
    PJ_BUILD_ERR( KErrCouldNotConnect, "Failed to connect"),
83
 
    PJ_BUILD_ERR( KErrCouldNotDisconnect, "Failed to disconnect"),
84
 
    PJ_BUILD_ERR( KErrDisconnected, "Disconnected"),
85
 
    PJ_BUILD_ERR( KErrBadLibraryEntryPoint, "Bad library entry point"),
86
 
    PJ_BUILD_ERR( KErrBadDescriptor,"Bad descriptor"),
87
 
    PJ_BUILD_ERR( KErrAbort,        "Interrupted"),
88
 
    PJ_BUILD_ERR( KErrTooBig,       "Too big"),
89
 
    PJ_BUILD_ERR( KErrDivideByZero, "Divide by zero"),
90
 
    PJ_BUILD_ERR( KErrBadPower,     "Batteries too low"),
91
 
    PJ_BUILD_ERR( KErrDirFull,      "Folder full"),
92
 
    PJ_BUILD_ERR( KErrHardwareNotAvailable, ""),
93
 
    PJ_BUILD_ERR( KErrSessionClosed,        ""),
94
 
    PJ_BUILD_ERR( KErrPermissionDenied,     ""),
 
49
    PJ_BUILD_ERR (KErrNotFound,     "Unable to find the specified object"),
 
50
    PJ_BUILD_ERR (KErrGeneral,      "General (unspecified) error"),
 
51
    PJ_BUILD_ERR (KErrCancel,       "The operation was cancelled"),
 
52
    PJ_BUILD_ERR (KErrNoMemory,     "Not enough memory"),
 
53
    PJ_BUILD_ERR (KErrNotSupported, "The operation requested is not supported"),
 
54
    PJ_BUILD_ERR (KErrArgument,     "Bad request"),
 
55
    PJ_BUILD_ERR (KErrTotalLossOfPrecision, "Total loss of precision"),
 
56
    PJ_BUILD_ERR (KErrBadHandle,    "Bad object"),
 
57
    PJ_BUILD_ERR (KErrOverflow,     "Overflow"),
 
58
    PJ_BUILD_ERR (KErrUnderflow,    "Underflow"),
 
59
    PJ_BUILD_ERR (KErrAlreadyExists,"Already exists"),
 
60
    PJ_BUILD_ERR (KErrPathNotFound, "Unable to find the specified folder"),
 
61
    PJ_BUILD_ERR (KErrDied,         "Closed"),
 
62
    PJ_BUILD_ERR (KErrInUse,        "The specified object is currently in use by another program"),
 
63
    PJ_BUILD_ERR (KErrServerTerminated,     "Server has closed"),
 
64
    PJ_BUILD_ERR (KErrServerBusy,   "Server busy"),
 
65
    PJ_BUILD_ERR (KErrCompletion,   "Completion error"),
 
66
    PJ_BUILD_ERR (KErrNotReady,     "Not ready"),
 
67
    PJ_BUILD_ERR (KErrUnknown,      "Unknown error"),
 
68
    PJ_BUILD_ERR (KErrCorrupt,      "Corrupt"),
 
69
    PJ_BUILD_ERR (KErrAccessDenied, "Access denied"),
 
70
    PJ_BUILD_ERR (KErrLocked,       "Locked"),
 
71
    PJ_BUILD_ERR (KErrWrite,        "Failed to write"),
 
72
    PJ_BUILD_ERR (KErrDisMounted,   "Wrong disk present"),
 
73
    PJ_BUILD_ERR (KErrEof,          "Unexpected end of file"),
 
74
    PJ_BUILD_ERR (KErrDiskFull,     "Disk full"),
 
75
    PJ_BUILD_ERR (KErrBadDriver,    "Bad device driver"),
 
76
    PJ_BUILD_ERR (KErrBadName,      "Bad name"),
 
77
    PJ_BUILD_ERR (KErrCommsLineFail,"Comms line failed"),
 
78
    PJ_BUILD_ERR (KErrCommsFrame,   "Comms frame error"),
 
79
    PJ_BUILD_ERR (KErrCommsOverrun, "Comms overrun error"),
 
80
    PJ_BUILD_ERR (KErrCommsParity,  "Comms parity error"),
 
81
    PJ_BUILD_ERR (KErrTimedOut,     "Timed out"),
 
82
    PJ_BUILD_ERR (KErrCouldNotConnect, "Failed to connect"),
 
83
    PJ_BUILD_ERR (KErrCouldNotDisconnect, "Failed to disconnect"),
 
84
    PJ_BUILD_ERR (KErrDisconnected, "Disconnected"),
 
85
    PJ_BUILD_ERR (KErrBadLibraryEntryPoint, "Bad library entry point"),
 
86
    PJ_BUILD_ERR (KErrBadDescriptor,"Bad descriptor"),
 
87
    PJ_BUILD_ERR (KErrAbort,        "Interrupted"),
 
88
    PJ_BUILD_ERR (KErrTooBig,       "Too big"),
 
89
    PJ_BUILD_ERR (KErrDivideByZero, "Divide by zero"),
 
90
    PJ_BUILD_ERR (KErrBadPower,     "Batteries too low"),
 
91
    PJ_BUILD_ERR (KErrDirFull,      "Folder full"),
 
92
    PJ_BUILD_ERR (KErrHardwareNotAvailable, ""),
 
93
    PJ_BUILD_ERR (KErrSessionClosed,        ""),
 
94
    PJ_BUILD_ERR (KErrPermissionDenied,     ""),
95
95
 
96
96
    /*
97
97
     * Socket errors (-190 - -1000)
98
98
     */
99
 
    PJ_BUILD_ERR( KErrNetUnreach,   "Could not connect to the network. Currently unreachable"),
100
 
    PJ_BUILD_ERR( KErrHostUnreach,  "Could not connect to the specified server"),
101
 
    PJ_BUILD_ERR( KErrNoProtocolOpt,"The specified server refuses the selected protocol"),
102
 
    PJ_BUILD_ERR( KErrUrgentData,   ""),
103
 
    PJ_BUILD_ERR( KErrWouldBlock,   "Conflicts with KErrExtended, but cannot occur in practice"),
 
99
    PJ_BUILD_ERR (KErrNetUnreach,   "Could not connect to the network. Currently unreachable"),
 
100
    PJ_BUILD_ERR (KErrHostUnreach,  "Could not connect to the specified server"),
 
101
    PJ_BUILD_ERR (KErrNoProtocolOpt,"The specified server refuses the selected protocol"),
 
102
    PJ_BUILD_ERR (KErrUrgentData,   ""),
 
103
    PJ_BUILD_ERR (KErrWouldBlock,   "Conflicts with KErrExtended, but cannot occur in practice"),
104
104
 
105
105
    {0, NULL}
106
106
};
108
108
#endif  /* PJ_HAS_ERROR_STRING */
109
109
 
110
110
 
111
 
PJ_DEF(pj_status_t) pj_get_os_error(void)
112
 
{
113
 
    return -1;
114
 
}
115
 
 
116
 
PJ_DEF(void) pj_set_os_error(pj_status_t code)
117
 
{
118
 
    PJ_UNUSED_ARG(code);
119
 
}
120
 
 
121
 
PJ_DEF(pj_status_t) pj_get_netos_error(void)
122
 
{
123
 
    return -1;
124
 
}
125
 
 
126
 
PJ_DEF(void) pj_set_netos_error(pj_status_t code)
127
 
{
128
 
    PJ_UNUSED_ARG(code);
 
111
PJ_DEF (pj_status_t) pj_get_os_error (void)
 
112
{
 
113
    return -1;
 
114
}
 
115
 
 
116
PJ_DEF (void) pj_set_os_error (pj_status_t code)
 
117
{
 
118
    PJ_UNUSED_ARG (code);
 
119
}
 
120
 
 
121
PJ_DEF (pj_status_t) pj_get_netos_error (void)
 
122
{
 
123
    return -1;
 
124
}
 
125
 
 
126
PJ_DEF (void) pj_set_netos_error (pj_status_t code)
 
127
{
 
128
    PJ_UNUSED_ARG (code);
129
129
}
130
130
 
131
131
PJ_BEGIN_DECL
132
132
 
133
 
    PJ_DECL(int) platform_strerror( pj_os_err_type os_errcode, 
134
 
                                    char *buf, pj_size_t bufsize);
 
133
PJ_DECL (int) platform_strerror (pj_os_err_type os_errcode,
 
134
                                 char *buf, pj_size_t bufsize);
135
135
PJ_END_DECL
136
136
 
137
 
/* 
 
137
/*
138
138
 * platform_strerror()
139
139
 *
140
 
 * Platform specific error message. This file is called by pj_strerror() 
141
 
 * in errno.c 
 
140
 * Platform specific error message. This file is called by pj_strerror()
 
141
 * in errno.c
142
142
 */
143
 
PJ_DEF(int) platform_strerror( pj_os_err_type os_errcode, 
144
 
                               char *buf, pj_size_t bufsize)
 
143
PJ_DEF (int) platform_strerror (pj_os_err_type os_errcode,
 
144
                                char *buf, pj_size_t bufsize)
145
145
{
146
146
    int len = 0;
147
147
 
148
 
    pj_assert(buf != NULL);
149
 
    pj_assert(bufsize >= 0);
 
148
    pj_assert (buf != NULL);
 
149
    pj_assert (bufsize >= 0);
150
150
 
151
151
    /*
152
152
     * MUST NOT check stack here.
156
156
 
157
157
    if (!len) {
158
158
#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING!=0)
159
 
        int i;
 
159
        int i;
 
160
 
160
161
        for (i = 0; gaErrorList[i].msg; ++i) {
161
162
            if (gaErrorList[i].code == os_errcode) {
162
 
                len = strlen(gaErrorList[i].msg);
163
 
                if ((pj_size_t)len >= bufsize) {
164
 
                    len = bufsize-1;
165
 
                }
166
 
                pj_memcpy(buf, gaErrorList[i].msg, len);
167
 
                buf[len] = '\0';
 
163
                len = strlen (gaErrorList[i].msg);
 
164
 
 
165
                if ( (pj_size_t) len >= bufsize) {
 
166
                    len = bufsize-1;
 
167
                }
 
168
 
 
169
                pj_memcpy (buf, gaErrorList[i].msg, len);
 
170
                buf[len] = '\0';
168
171
                break;
169
172
            }
170
173
        }
 
174
 
171
175
#endif  /* PJ_HAS_ERROR_STRING */
172
176
 
173
177
    }
174
178
 
175
179
    if (!len) {
176
 
        len = pj_ansi_snprintf( buf, bufsize, "Symbian native error %d", 
177
 
                                os_errcode);
178
 
        buf[len] = '\0';
 
180
        len = pj_ansi_snprintf (buf, bufsize, "Symbian native error %d",
 
181
                                os_errcode);
 
182
        buf[len] = '\0';
179
183
    }
180
184
 
181
185
    return len;