Skip to content
Snippets Groups Projects
Commit 58011f08 authored by rds's avatar rds
Browse files

libcurlobject initial commit.

New files.... bootstrap....
parent 03725a00
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
/* File: libcurlobj.h
* Author: Roy Storey (rds@sanger.ac.uk)
* Copyright (c) 2008: Genome Research Ltd.
*-------------------------------------------------------------------
* ZMap 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.
* or see the on-line version at http://www.gnu.org/copyleft/gpl.txt
*-------------------------------------------------------------------
* This file is part of the ZMap genome database package
* originally written by:
*
* Ed Griffiths (Sanger Institute, UK) edgrif@sanger.ac.uk,
* Roy Storey (Sanger Institute, UK) rds@sanger.ac.uk
*
* Description:
*
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited: Jun 5 09:40 2008 (rds)
* Created: Thu May 1 17:06:07 2008 (rds)
* CVS info: $Id: libcurlobject.h,v 1.1 2008-06-05 09:50:18 rds Exp $
*-------------------------------------------------------------------
*/
#ifndef CURL_OBJ_H
#define CURL_OBJ_H
#include <glib.h>
#include <glib-object.h>
#include <curl/curl.h>
#define CURL_TYPE_OBJECT (CURLObjectGetType())
#define CURL_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CURL_TYPE_OBJECT, curlObject))
#define CURL_OBJECT_CONST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CURL_TYPE_OBJECT, curlObject const))
#define CURL_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), CURL_TYPE_OBJECT, curlObjectClass))
#define CURL_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), CURL_TYPE_OBJECT))
#define CURL_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), CURL_TYPE_OBJECT))
#define CURL_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), CURL_TYPE_OBJECT, curlObjectClass))
typedef enum
{
CURL_STATUS_OK,
CURL_STATUS_FAILED
} CURLObjectStatus;
/* */
typedef struct _curlObjectStruct *CURLObject;
typedef struct _curlObjectStruct curlObject;
/* */
typedef struct _curlObjectClassStruct *CURLObjectClass;
typedef struct _curlObjectClassStruct curlObjectClass;
GType CURLObjectGetType(void);
CURLObject CURLObjectNew (void);
CURLObjectStatus CURLObjectSet (CURLObject curlobject, const gchar *first_arg_name, ...);
CURLObjectStatus CURLObjectPerform (CURLObject curlobject, gboolean use_multi);
char *CURLObjectErrorMessage(CURLObject curlobject);
CURLObject CURLObjectDestroy (CURLObject curlobject);
#endif /* CURL_OBJ_H */
/* File: libcurlobj_I.h
* Author: Roy Storey (rds@sanger.ac.uk)
* Copyright (c) 2008: Genome Research Ltd.
*-------------------------------------------------------------------
* ZMap 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.
* or see the on-line version at http://www.gnu.org/copyleft/gpl.txt
*-------------------------------------------------------------------
* This file is part of the ZMap genome database package
* originally written by:
*
* Ed Griffiths (Sanger Institute, UK) edgrif@sanger.ac.uk,
* Roy Storey (Sanger Institute, UK) rds@sanger.ac.uk
*
* Description:
*
* Exported functions: See XXXXXXXXXXXXX.h
* HISTORY:
* Last edited: Jun 5 10:31 2008 (rds)
* Created: Thu Jun 5 09:18:29 2008 (rds)
* CVS info: $Id: libcurlobject_I.h,v 1.1 2008-06-05 09:50:18 rds Exp $
*-------------------------------------------------------------------
*/
#include <libcurlobject/libcurlobject.h>
#define CURL_PARAM_STATIC (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB)
#define CURL_PARAM_STATIC_RO (CURL_PARAM_STATIC | G_PARAM_READABLE)
#define CURL_PARAM_STATIC_RW (CURL_PARAM_STATIC | G_PARAM_READWRITE)
#define CURL_PARAM_STATIC_WO (CURL_PARAM_STATIC | G_PARAM_WRITABLE)
enum
{
CONNECTION_CLOSED_SIGNAL,
LAST_SIGNAL
};
typedef struct _curlObjectStruct
{
GObject __parent__;
CURL *easy;
CURLM *multi;
CURLcode last_easy_status;
CURLMcode last_multi_status;
GQueue *perform_queue;
gpointer settings_to_destroy;
gpointer post_data_2_free;
char error_message[CURL_ERROR_SIZE];
curl_version_info_data *curl_version;
GList *pre717strings;
unsigned int allow_queue : 1;
unsigned int transfer_in_progress : 1;
unsigned int manage_post_data : 1;
} curlObjectStruct;
typedef struct _curlObjectClassStruct
{
GObjectClass parent_class;
CURLcode global_init;
void (* connection_closed)(CURLObject object);
guint signals[LAST_SIGNAL];
} curlObjectClassStruct;
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment