aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/local/camel-spool-folder.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers/local/camel-spool-folder.c')
-rw-r--r--camel/providers/local/camel-spool-folder.c187
1 files changed, 0 insertions, 187 deletions
diff --git a/camel/providers/local/camel-spool-folder.c b/camel/providers/local/camel-spool-folder.c
deleted file mode 100644
index d667310090..0000000000
--- a/camel/providers/local/camel-spool-folder.c
+++ /dev/null
@@ -1,187 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; fill-column: 160 -*-
- *
- * Authors: Michael Zucchi <notzed@ximian.com>
- *
- * Copyright (C) 2001 Ximian Inc (www.ximian.com/)
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * 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
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <fcntl.h>
-
-#include "camel-spool-folder.h"
-#include "camel-spool-store.h"
-#include "string-utils.h"
-#include "camel-stream-fs.h"
-#include "camel-spool-summary.h"
-#include "camel-data-wrapper.h"
-#include "camel-mime-message.h"
-#include "camel-stream-filter.h"
-#include "camel-mime-filter-from.h"
-#include "camel-exception.h"
-
-#include "camel-lock-client.h"
-
-#include "camel-local-private.h"
-
-#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
-
-static CamelFolderClass *parent_class = NULL;
-
-/* Returns the class for a CamelSpoolFolder */
-#define CSPOOLF_CLASS(so) CAMEL_SPOOL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CF_CLASS(so) CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-#define CSPOOLS_CLASS(so) CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS(so))
-
-static CamelLocalSummary *spool_create_summary(const char *path, const char *folder, CamelIndex *index);
-
-static int spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex);
-static void spool_unlock(CamelLocalFolder *lf);
-
-static void spool_finalize(CamelObject * object);
-
-static void
-camel_spool_folder_class_init(CamelSpoolFolderClass *klass)
-{
- CamelLocalFolderClass *lklass = (CamelLocalFolderClass *)klass;
-
- parent_class = (CamelFolderClass *)camel_mbox_folder_get_type();
-
- /* virtual method overload */
- lklass->create_summary = spool_create_summary;
- lklass->lock = spool_lock;
- lklass->unlock = spool_unlock;
-}
-
-static void
-spool_init(gpointer object, gpointer klass)
-{
- CamelSpoolFolder *spool_folder = object;
-
- spool_folder->lockid = -1;
-}
-
-static void
-spool_finalize(CamelObject * object)
-{
- /*CamelSpoolFolder *spool_folder = CAMEL_SPOOL_FOLDER(object);*/
-}
-
-CamelType camel_spool_folder_get_type(void)
-{
- static CamelType camel_spool_folder_type = CAMEL_INVALID_TYPE;
-
- if (camel_spool_folder_type == CAMEL_INVALID_TYPE) {
- camel_spool_folder_type = camel_type_register(camel_mbox_folder_get_type(), "CamelSpoolFolder",
- sizeof(CamelSpoolFolder),
- sizeof(CamelSpoolFolderClass),
- (CamelObjectClassInitFunc) camel_spool_folder_class_init,
- NULL,
- (CamelObjectInitFunc) spool_init,
- (CamelObjectFinalizeFunc) spool_finalize);
- }
-
- return camel_spool_folder_type;
-}
-
-CamelFolder *
-camel_spool_folder_new(CamelStore *parent_store, const char *full_name, guint32 flags, CamelException *ex)
-{
- CamelFolder *folder;
-
- d(printf("Creating spool folder: %s in %s\n", full_name, camel_local_store_get_toplevel_dir((CamelLocalStore *)parent_store)));
-
- folder = (CamelFolder *)camel_object_new(CAMEL_SPOOL_FOLDER_TYPE);
-
- if (parent_store->flags & CAMEL_STORE_FILTER_INBOX
- && strcmp(full_name, "INBOX") == 0)
- folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
- flags &= CAMEL_STORE_FOLDER_BODY_INDEX;
-
- folder = (CamelFolder *)camel_local_folder_construct((CamelLocalFolder *)folder, parent_store, full_name, flags, ex);
- if (folder) {
- if (camel_url_get_param(((CamelService *)parent_store)->url, "xstatus"))
- camel_mbox_summary_xstatus((CamelMboxSummary *)folder->summary, TRUE);
- }
-
- return folder;
-}
-
-static CamelLocalSummary *
-spool_create_summary(const char *path, const char *folder, CamelIndex *index)
-{
- return (CamelLocalSummary *)camel_spool_summary_new(folder);
-}
-
-static int
-spool_lock(CamelLocalFolder *lf, CamelLockType type, CamelException *ex)
-{
- int retry = 0;
- CamelMboxFolder *mf = (CamelMboxFolder *)lf;
- CamelSpoolFolder *sf = (CamelSpoolFolder *)lf;
-
- mf->lockfd = open(lf->folder_path, O_RDWR, 0);
- if (mf->lockfd == -1) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Cannot create folder lock on %s: %s"),
- lf->folder_path, g_strerror (errno));
- return -1;
- }
-
- while (retry < CAMEL_LOCK_RETRY) {
- if (retry > 0)
- sleep(CAMEL_LOCK_DELAY);
-
- camel_exception_clear(ex);
-
- if (camel_lock_fcntl(mf->lockfd, type, ex) == 0) {
- if (camel_lock_flock(mf->lockfd, type, ex) == 0) {
- if ((sf->lockid = camel_lock_helper_lock(lf->folder_path, ex)) != -1)
- return 0;
- camel_unlock_flock(mf->lockfd);
- }
- camel_unlock_fcntl(mf->lockfd);
- }
- retry++;
- }
-
- return -1;
-}
-
-static void
-spool_unlock(CamelLocalFolder *lf)
-{
- CamelMboxFolder *mf = (CamelMboxFolder *)lf;
- CamelSpoolFolder *sf = (CamelSpoolFolder *)lf;
-
- camel_lock_helper_unlock(sf->lockid);
- sf->lockid = -1;
- camel_unlock_flock(mf->lockfd);
- camel_unlock_fcntl(mf->lockfd);
-
- close(mf->lockfd);
- mf->lockfd = -1;
-}
581cd508d5d4d63'>Take maintainership.mandree2013-01-201-1/+1 * - Update to 1.5.5wen2013-01-203-12/+8 * - Use DOC instead of NOPORTDOCSehaupt2013-01-151-6/+6 * - Update to 0.7.9swills2013-01-093-10/+5 * - Upgrade to slrn 1.0.1johans2012-12-233-23/+17 * Update PCRE to 8.32mm2012-12-113-5/+5 * Revert Chris Petrik's ports to the pool. Thank you for all your work so far,...eadler2012-12-101-1/+1 * - Update to 0.7.6swills2012-11-282-3/+3 * - Update to 0.7.5swills2012-11-242-4/+4 * - drop obsolte WWW:dinoex2012-11-161-2/+0 * Update CONFLICTS. [1]mandree2012-11-161-2/+2 * Update CONFLICTS.mandree2012-11-161-0/+2 * - cleanup commentsdinoex2012-10-136-29/+0 * Force numerous ports that fail to build with clang over to instead alwayslinimon2012-10-101-0/+2 * Finish converting perl@ ports to new Options Frameworkbapt2012-10-051-9/+7 * Welcome back Chris Petrik <c.petrik.sosa@gmail.com>eadler2012-09-091-1/+1 * - Fix build with OpenSSL >= 1.0 [1]pawel2012-09-082-0/+33 * - Fix innd/nnrpd semget failuresfluffy2012-09-022-1/+74 * - Fix compilation error when building trn without NNTP supportjohans2012-09-021-0/+45 * - Update to 0.7.3swills2012-08-272-3/+3 * news/inn: fix plaintext command injection, CVE-2012-3523rea2012-08-272-1/+62 * Move the rc.d scripts of the form *.sh.in to *.indougb2012-08-064-2/+2 * - Fix typos in COMMENTcs2012-08-021-1/+1 * - Update to 0.7.2swills2012-07-303-16/+17 * - Remove CONFLICTS as shared-mime-info is an indirect build dependencybeat2012-07-271-1/+2 * Register CONFLICTScs2012-07-181-2/+3 * - fix build after inn has moved includes.dinoex2012-07-171-1/+1 * - Fix typofluffy2012-07-081-1/+1 * - Add options for OpenSSL (for those who don't need) and GnuPG (pgpverify)fluffy2012-07-072-50/+68 * - Remove SITE_PERL from *_DEPENDSaz2012-06-303-9/+9 * - Remove SITE_PERL from *_DEPENDSaz2012-06-301-2/+2 * - Remove SITE_PERL from *_DEPENDSaz2012-06-292-6/+6 * Convert to new options frameworkjohans2012-06-282-5/+5 * - Update INN to 2.5.2 releasefluffy2012-06-277-102/+108 * - reset MAINTAINERdinoex2012-06-261-1/+1 * - Update to 0.7.0scheidell2012-06-175-34/+105 * - Add conflictsjohans2012-06-151-8/+9 * - Register conflicts for trnjohans2012-06-152-4/+8 * Convert to new OPTIONS style (no functional changes)johans2012-06-151-18/+17 * Update CONFLICTS (1).thierry2012-06-131-1/+3 * - Update to 12.1.0sunpoet2012-06-122-5/+5 * - Convert all remaining instances of BUILD_DEPENDS=${RUN_DEPENDS} orswills2012-06-111-1/+1 * - Remove SITE_PERL from *_DEPENDSaz2012-06-042-7/+7 * Set maintainership back to ports@cs2012-06-031-1/+1 * - update png to 1.5.10dinoex2012-06-0110-16/+36 * - Update to 0.8.0miwi2012-05-162-4/+3 * - Assign clsung's p5- ports to perl@swills2012-05-011-1/+1 * - Update to 12.0.0sunpoet2012-03-293-4/+5 * - Set / Update Portscout flagsmiwi2012-03-171-1/+3 * - Remove conditional checks for FreeBSD 6.Xpav2012-03-021-6/+1 * Fix rc script.thierry2012-02-263-4/+4 * - replace `YES' with `yes' in USE_PYTHON/USE_PYDISTUTILS (mostly)rm2012-02-191-1/+1 * Use PORTREVISION?= instead of = to avoid overriding revision of chinese/tinjohans2012-02-151-1/+1 * Bump pcre library dependency due to 8.30 updatemm2012-02-143-3/+6 * - Update to 0.6.15jgh2012-02-143-39/+72 * - Fix plist.avilla2012-01-242-2/+28 * - fix runtime with decent Twisted [1]rm2012-01-234-8/+42 * At the moment 1385 ports use BUILD_DEPENDS= ${RUN_DEPENDS} and 450eadler2012-01-221-1/+1 * In the rc.d scripts, change assignments to rcvar to use thedougb2012-01-144-12/+7 * - Remove explicit par2 dependency, it is conflicting with different flavour ofpav2011-12-291-1/+0 * Update to tin 2.0.1johans2011-12-293-4/+3 * End WWW CPAN URL with a "/"ehaupt2011-12-281-1/+1