| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/include/gpilotd/ |
Upload File : |
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- *//*
* Copyright (C) 1998-2000 Free Software Foundation
*
* 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.
*
* Authors: Eskil Heyn Olsen
* Manish Vachharajani
* Dave Camp
*
*/
#ifndef _GPILOT_STRUCTURES_H_
#define _GPILOT_STRUCTURES_H_
#include <glib.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
typedef enum {
/* WARNING: If adding to the SyncTypes, you will need
* to update code in gnome-pilot-structures.c
* and in gnome-pilot-conduit-config.gob.
*/
GnomePilotConduitSyncTypeCustom,
GnomePilotConduitSyncTypeSynchronize,
GnomePilotConduitSyncTypeCopyFromPilot,
GnomePilotConduitSyncTypeCopyToPilot,
GnomePilotConduitSyncTypeMergeFromPilot,
GnomePilotConduitSyncTypeMergeToPilot,
GnomePilotConduitSyncTypeNotSet
} GnomePilotConduitSyncType;
#define GnomePilotConduitSyncTypeCustomStr "custom"
#define GnomePilotConduitSyncTypeSynchronizeStr "synchronize"
#define GnomePilotConduitSyncTypeCopyFromPilotStr "copy_from_pilot"
#define GnomePilotConduitSyncTypeCopyToPilotStr "copy_to_pilot"
#define GnomePilotConduitSyncTypeMergeFromPilotStr "merge_from_pilot"
#define GnomePilotConduitSyncTypeMergeToPilotStr "merge_to_pilot"
#define GnomePilotConduitSyncTypeNotSetStr "not_set"
#define GPILOT_DEFAULT_CHARSET "CP1252"
gint gnome_pilot_conduit_sync_type_str_to_int(const gchar *s);
const gchar* gnome_pilot_conduit_sync_type_int_to_str(GnomePilotConduitSyncType e);
struct _GPilotSyncOpt {
GnomePilotConduitSyncType default_sync_action; /* Unused, but exists for bin compat */
gchar *basedir;
};
typedef struct _GPilotSyncOpt GPilotSyncOpt;
struct GPilotUser {
gchar *username; /* We can get the real name from getpwent */
};
typedef struct GPilotUser GPilotUser;
GPilotUser *gpilot_user_new (void);
void gpilot_user_free (GPilotUser *user);
struct _GPilotContext {
gboolean paused;
GList *devices;
GList *pilots;
GPilotUser *user; /* Null in master global gpilotd */
guint32 sync_PC_Id; /* Different for every gpilotd instance */
gint progress_stepping;
#ifdef WITH_USB_VISOR
/* For checking for visor devices */
int visor_fd;
GIOChannel *visor_io;
guint visor_in_handle;
guint visor_err_handle;
#endif
};
typedef struct _GPilotContext GPilotContext;
GPilotContext *gpilot_context_new (void);
void gpilot_context_init_user (GPilotContext *context);
void gpilot_context_free (GPilotContext *context);
typedef enum GPilotDeviceType {
PILOT_DEVICE_SERIAL=0,
PILOT_DEVICE_USB_VISOR=1,
PILOT_DEVICE_IRDA=2,
PILOT_DEVICE_NETWORK=4,
PILOT_DEVICE_BLUETOOTH=5
} GPilotDeviceType;
struct _GPilotDevice {
gchar *name; /* symbolic name */
gchar *port; /* device */
guint speed; /* speed (for serial) */
/* These are used for network (man c++ is soo much cooler) */
gchar *ip;
/* host and netmask are not used at present, but they're left
* here to avoid unnecessary change to ABI. Plus, we may want
* to allow these to be configured at some point in the future (?).
*/
gchar *host;
gchar *netmask;
/* These are used at runtime, to associate
an opened file with the device */
int fd;
GIOChannel *io; /* the g_io_channel is used for the polling */
guint in_handle; /* these two handles are used to be able to */
guint err_handle; /* pause the daemon's polling by g_source_remove */
gchar *lock_file;
gint timeout;
GPilotDeviceType type;
gboolean device_exists : 1; /* whether the usb cradle is active */
};
typedef struct _GPilotDevice GPilotDevice;
GPilotDevice *gpilot_device_new (void);
void gpilot_device_free (GPilotDevice *device);
gint gpilot_device_init (GPilotDevice *device);
void gpilot_device_deinit (GPilotDevice *device);
gint gpilot_device_load (GPilotDevice *device, gint i);
#define GPILOT_DEVICE(s) ((GPilotDevice*)(s))
struct _GPilotPilot {
/* The pilots name */
gchar *name;
/* The userspecified password for the pilot */
gchar *passwd;
/* To look up conduits file */
int number;
/* Pilot owners name */
gchar *pilot_username;
/* Pilots ID number */
guint32 pilot_id;
/* Majick numbers to id when restoring a pilot with id = 0 */
unsigned long creation, romversion;
gchar *pilot_charset; /* used to be unused 'trusted users' pointer,
pressed into service for charset, to
preserve binary compatibility */
GPilotSyncOpt sync_options;
};
typedef struct _GPilotPilot GPilotPilot;
GPilotPilot *gpilot_pilot_new (void);
void gpilot_pilot_init (GPilotPilot *pilot, gint i);
void gpilot_pilot_free (GPilotPilot *pilot);
GPilotPilot* gpilot_find_pilot_by_name(gchar*,GList*);
GPilotPilot* gpilot_find_pilot_by_id(guint32, GList*);
#define GPILOT_PILOT(s) ((GPilotPilot*)(s))
#define GPILOT_USER(s) ((GPilotUser*)(s))
#endif /* _GPILOT_STRUCTURES_H_ */