#include <unistd.h>
#include <string.h>
#include <signal.h>
+#ifdef HAVE_ALLOCA_H
+#include <alloca.h>
+#endif
#include "camel-movemail.h"
#include "camel-exception.h"
#endif
/* these could probably be exposed as a utility? (but only mbox needs it) */
+#if 0
static int camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, CamelMimeFilter *filter);
static int camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes);
+#endif
/**
* camel_movemail: Copy an mbox file from a shared spool directory to a
if (stat (source, &st) == -1) {
if (errno != ENOENT) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Could not check mail file "
- "%s: %s", source,
+ _("Could not check mail file "
+ "%s: %s"), source,
g_strerror (errno));
}
return;
}
#endif
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Could not create lock file "
- "for %s: %s", source, g_strerror (errno));
+ _("Could not create lock file "
+ "for %s: %s"), source,
+ g_strerror (errno));
return;
}
close (tmpfd);
sfd = open (source, O_RDWR);
if (sfd == -1) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Could not open mail file %s: %s",
+ _("Could not open mail file %s: %s"),
source, g_strerror (errno));
unlink (locktmpfile);
g_free (locktmpfile);
dfd = open (dest, O_WRONLY | O_CREAT | O_APPEND, S_IRUSR | S_IWUSR);
if (dfd == -1) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Could not open temporary mail "
- "file %s: %s", dest, g_strerror (errno));
+ _("Could not open temporary mail "
+ "file %s: %s"), dest,
+ g_strerror (errno));
close (sfd);
unlink (locktmpfile);
g_free (locktmpfile);
*/
if (errno != EEXIST) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Could not create lock "
- "file for %s: %s", source,
+ _("Could not create lock "
+ "file for %s: %s"), source,
g_strerror (errno));
break;
}
/* Some other error. Abort. */
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Could not test lock "
- "file for %s: %s", source,
+ _("Could not test lock "
+ "file for %s: %s"), source,
g_strerror (errno));
break;
}
/* Something has gone awry. */
if (now >= timeout) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Timed out trying to get "
- "lock file on %s. Try again "
- "later.", source);
+ _("Timed out trying to get "
+ "lock file on %s. Try again "
+ "later."), source);
}
g_free (lockfile);
unlink (locktmpfile);
if (errno == EINTR)
continue;
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Error reading mail file: %s",
+ _("Error reading mail file: %s"),
g_strerror (errno));
break;
}
if (errno == EINTR)
continue; /* continues inner loop */
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Error writing "
- "mail temp file: %s",
+ _("Error writing "
+ "mail temp file: %s"),
g_strerror (errno));
break;
}
ftruncate (sfd, 0);
else {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Failed to store mail in "
- "temp file %s: %s", dest,
+ _("Failed to store mail in "
+ "temp file %s: %s"), dest,
g_strerror (errno));
}
} else
if (pipe (fd) == -1) {
sigprocmask (SIG_SETMASK, &omask, NULL);
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Could not create pipe: %s",
+ _("Could not create pipe: %s"),
g_strerror (errno));
return;
}
close (fd[1]);
sigprocmask (SIG_SETMASK, &omask, NULL);
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Could not fork: %s",
+ _("Could not fork: %s"),
g_strerror (errno));
return;
if (!WIFEXITED (status) || WEXITSTATUS (status) != 0) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- "Movemail program failed: %s",
- output ? output : "(Unknown error)");
+ _("Movemail program failed: %s"),
+ output ? output : _("(Unknown error)"));
}
g_free (output);
}
#endif
+#if 0
static int
camel_movemail_copy(int fromfd, int tofd, off_t start, size_t bytes)
{
return written;
}
+#endif
#define PRE_SIZE (32)
+#if 0
static int
camel_movemail_copy_filter(int fromfd, int tofd, off_t start, size_t bytes, CamelMimeFilter *filter)
{
}
}
- gtk_object_unref((GtkObject *)mp);
- gtk_object_unref((GtkObject *)ffrom);
+ camel_object_unref((CamelObject *)mp);
+ camel_object_unref((CamelObject *)ffrom);
return ret;
g_strerror (errno));
- gtk_object_unref((GtkObject *)mp);
- gtk_object_unref((GtkObject *)ffrom);
+ camel_object_unref((CamelObject *)mp);
+ camel_object_unref((CamelObject *)ffrom);
return -1;
}
+#endif