Apply tizen coding rules.
[platform/core/appfw/message-port.git] / src / message_port_internal.c
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #include "message_port.h"
17 #include "message_port_internal.h"
18
19 int convert_to_tizen_error(messageport_error_e error)
20 {
21         switch (error) {
22         case MESSAGEPORT_ERROR_NONE:
23                 return MESSAGE_PORT_ERROR_NONE;
24         case MESSAGEPORT_ERROR_IO_ERROR:
25                 return MESSAGE_PORT_ERROR_IO_ERROR;
26         case MESSAGEPORT_ERROR_OUT_OF_MEMORY:
27                 return MESSAGE_PORT_ERROR_OUT_OF_MEMORY;
28         case MESSAGEPORT_ERROR_INVALID_PARAMETER:
29                 return MESSAGE_PORT_ERROR_INVALID_PARAMETER;
30         case MESSAGEPORT_ERROR_MESSAGEPORT_NOT_FOUND:
31                 return MESSAGE_PORT_ERROR_PORT_NOT_FOUND;
32         case MESSAGEPORT_ERROR_CERTIFICATE_NOT_MATCH:
33                 return MESSAGE_PORT_ERROR_CERTIFICATE_NOT_MATCH;
34         case MESSAGEPORT_ERROR_MAX_EXCEEDED:
35                 return MESSAGE_PORT_ERROR_MAX_EXCEEDED;
36         case MESSAGEPORT_ERROR_RESOURCE_UNAVAILABLE:
37                 return MESSAGE_PORT_ERROR_RESOURCE_UNAVAILABLE;
38         default:
39                 return error;
40         }
41 }