Logo Search packages:      
Sourcecode: pan version File versions  Download package

nntp.h

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
 * Pan - A Newsreader for Gtk+
 * Copyright (C) 2002  Charles Kerr <charles@rebelbase.com>
 *
 * 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; version 2 of the License.
 *
 * 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 __NNTP_H__
#define __NNTP_H__

#include <glib.h>

#include <pan/base/article.h>
#include <pan/base/group.h>
#include <pan/base/message-identifier.h>
#include <pan/base/pstring.h>
#include <pan/base/server.h>
#include <pan/base/status-item.h>

#include <pan/sockets.h>

enum
{
      NNTP_VERBOSE_TEXT       = 1<<0,
      NNTP_VERBOSE_INIT_STEPS       = 1<<1,
      NNTP_VERBOSE_NEXT_STEP        = 1<<2,
      NNTP_VERBOSE                  = ~0
};

TaskStateEnum    nntp_command              (StatusItem           * status,
                                            PanSocket            * sock,
                                            const char          ** setme_response,
                                            int                  * setme_response_number,
                                            const char           * command);
 
TaskStateEnum    nntp_command_va           (StatusItem           * status,
                                            PanSocket            * sock,
                                            const char          ** setme_response,
                                            int                  * setme_response_number,
                                            const char           * command_va,
                                            ...);

TaskStateEnum    nntp_handshake            (StatusItem           * status,
                                            PanSocket            * socket,
                                            gboolean             * setme_posting_ok);

TaskStateEnum    nntp_authenticate         (StatusItem           * status,
                                            PanSocket            * socket);

TaskStateEnum    nntp_authenticate_types   (StatusItem           * status,
                                            PanSocket            * socket,
                                            gboolean              check_auth_types);

TaskStateEnum    nntp_noop                 (StatusItem           * status,
                                            PanSocket            * socket);

TaskStateEnum    nntp_set_group            (StatusItem           * status,
                                            PanSocket            * socket,
                                            const PString        * groupname);

TaskStateEnum    nntp_can_post             (StatusItem           * status,
                                            PanSocket            * sock,
                                            gboolean             * setme_can_post);

TaskStateEnum    nntp_post                 (StatusItem           * status,
                                            PanSocket            * socket,
                                            const char           * message);

TaskStateEnum    nntp_get_group_info       (StatusItem           * status,
                                            PanSocket            * sock,
                                            const PString        * group_name,
                                            gulong               * setme_article_qty,
                                            gulong               * setme_low_num,
                                            gulong               * setme_high_num,
                                            const gboolean       * abort);

TaskStateEnum    nntp_article_download     (StatusItem           * status,
                                            PanSocket            * sock,
                                            MessageIdentifier    * mid,
                                            const gboolean       * abort_download,
                                            int                    nntp_verbosity);

void             nntp_disconnect           (StatusItem           * status,
                                            PanSocket            * socket);

/**
 * This will try to get headers for articles [low-high] from the specified
 * server/group and store them as Article objects in the setme array.
 *
 * If verbose is true and the operation is successful,  the StatusItem will
 * emit low-high status_item_next_step signals.
 */
TaskStateEnum    nntp_download_headers     (StatusItem           * item,
                                            PanSocket            * sock,
                                            Group                * group,
                                            gulong                 low,
                                            gulong                 high,
                                            const gboolean       * abort,
                                            const char           * progress_fmt,
                                            gulong               * setme_retrieved_high,
                                            GPtrArray            * setme);

TaskStateEnum    nntp_download_bodies      (StatusItem           * item,
                                            PanSocket            * sock,
                                            const gboolean       * abort,
                                            MessageIdentifier   ** identifiers,
                                            int                    identifier_qty,
                                            int                  * index,
                                            gboolean               abort_if_one_fails);

TaskStateEnum    nntp_cancel               (StatusItem           * item,
                                            const PString        * message_id,
                                            PanSocket            * sock);

#endif /* __NNTP_H__ */

Generated by  Doxygen 1.6.0   Back to index