Zhenkai Zhu | e25def9 | 2012-03-12 16:39:25 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2012 University of California, Los Angeles |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License version 2 as |
| 7 | * published by the Free Software Foundation; |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | * |
| 18 | * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu> |
Chaoyi Bian | 3e1eb16 | 2012-04-03 16:59:32 -0700 | [diff] [blame] | 19 | * Chaoyi Bian <bcy@pku.edu.cn> |
Zhenkai Zhu | e25def9 | 2012-03-12 16:39:25 -0700 | [diff] [blame] | 20 | * Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 21 | */ |
| 22 | |
| 23 | #ifndef SYNC_APP_SOCKET_C_H |
| 24 | #define SYNC_APP_SOCKET_C_H |
| 25 | |
Chaoyi Bian | 9d8768a | 2012-03-14 17:23:36 -0700 | [diff] [blame] | 26 | #ifdef __cplusplus |
Zhenkai Zhu | e25def9 | 2012-03-12 16:39:25 -0700 | [diff] [blame] | 27 | extern "C" { |
Chaoyi Bian | 9d8768a | 2012-03-14 17:23:36 -0700 | [diff] [blame] | 28 | #endif |
| 29 | typedef struct SyncAppSocketStruct SyncAppSocketStruct; |
Zhenkai Zhu | e25def9 | 2012-03-12 16:39:25 -0700 | [diff] [blame] | 30 | |
Alexander Afanasyev | 03a58b7 | 2012-03-12 18:11:56 -0700 | [diff] [blame] | 31 | SyncAppSocketStruct *create_sync_app_socket(const char *prefix, void (*callback)(const char *, const char *)); |
| 32 | void delete_sync_app_socket(SyncAppSocketStruct **sock); |
Chaoyi Bian | 9d8768a | 2012-03-14 17:23:36 -0700 | [diff] [blame] | 33 | int sync_app_socket_publish(SyncAppSocketStruct *sock, const char *prefix, int session, const char *buf, int freshness); |
Alexander Afanasyev | 03a58b7 | 2012-03-12 18:11:56 -0700 | [diff] [blame] | 34 | void sync_app_socket_remove(SyncAppSocketStruct *sock, const char *prefix); |
Chaoyi Bian | 9d8768a | 2012-03-14 17:23:36 -0700 | [diff] [blame] | 35 | #ifdef __cplusplus |
Zhenkai Zhu | e25def9 | 2012-03-12 16:39:25 -0700 | [diff] [blame] | 36 | } |
Chaoyi Bian | 9d8768a | 2012-03-14 17:23:36 -0700 | [diff] [blame] | 37 | #endif |
Zhenkai Zhu | e25def9 | 2012-03-12 16:39:25 -0700 | [diff] [blame] | 38 | |
| 39 | #endif // SYNC_APP_SOCKET_C_H |