2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include "sdbd_plugin.h"
22 #define PLUGIN_PATH "/usr/lib/libsdbd_plugin.so"
24 int default_plugin_init ( eventfunc event_cb, registerfunc register_func );
25 int default_plugin_sync_proc ( int cmd, parameters* in, parameters* out );
26 int default_plugin_async_proc ( int cmd, parameters* in, int out_fd );
28 void load_sdbd_plugin();
29 void unload_sdbd_plugin();
31 // return 1 if plugin support given command
32 // return 0 if plugin does not support given command
33 int is_supported_by_plugin ( int cmd );
35 // return 1 if succeed to get capability from plugin
37 int request_capability_to_plugin ( int cap, char* out_buf, unsigned int out_len );
39 // return 1 if allowed by plugin (valid)
40 // return 0 if disallowed by plugin (invalid)
41 int request_validity_to_plugin ( int cmd, const char* in_buf );
43 // return 1 if succeed to convert
45 int request_conversion_to_plugin ( int cmd, const char* in_buf, char* out_buf, unsigned int out_len );
48 // return 0 if unlocked
49 // return -1 if request failed
50 int request_lock_state_to_plugin ( int lock_type );
52 // return nonnegative integer that is a socket descriptor for communication
53 // with async proc thread if success to create async proc thread
54 // return -1 if failed to create async proc thread
55 int request_appcmd_to_plugin ( const char* in_buf );