File: sync.h

package info (click to toggle)
jpilot 0.97-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,244 kB
  • ctags: 957
  • sloc: ansic: 13,558; makefile: 192; sh: 153
file content (52 lines) | stat: -rw-r--r-- 1,586 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* sync.h
 * 
 * Copyright (C) 1999 by Judd Montgomery
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef _SYNC_H__
#define _SYNC_H__

#include <pi-dlp.h>

/* Bitmasks for backup */
#define SYNC_FULL_BACKUP   1
#define SYNC_NO_PLUGINS    2
#define SYNC_OVERRIDE_USER 4

#define SYNC_ERROR_BIND            -10
#define SYNC_ERROR_LISTEN          -11
#define SYNC_ERROR_OPEN_CONDUIT    -12
#define SYNC_ERROR_PI_ACCEPT       -13
#define SYNC_ERROR_NOT_SAME_USER   -20
#define SYNC_ERROR_NOT_SAME_USERID -21
#define SYNC_ERROR_NULL_USERID     -22

struct my_sync_info {
   unsigned int sync_over_ride;
   char port[128];
   unsigned int flags;
   unsigned int num_backups;

   unsigned long userID;
   unsigned long viewerID;
   unsigned long lastSyncPC;
   char username[128];
};

int sync_once(struct my_sync_info *sync_info);
int sync_loop(const char *port, unsigned int flags, const int num_backups);

#endif