зеркало из https://github.com/mozilla/pjs.git
adding ifdefs that should be harmless
This commit is contained in:
Родитель
6d35ba3ed6
Коммит
cce33f60db
|
@ -29,6 +29,7 @@ typedef enum mime_encoding {
|
|||
mime_Base64, mime_QuotedPrintable, mime_uuencode
|
||||
} mime_encoding;
|
||||
|
||||
|
||||
typedef enum mime_uue_state {
|
||||
UUE_BEGIN, UUE_BODY, UUE_END
|
||||
} mime_uue_state;
|
||||
|
@ -49,6 +50,7 @@ struct MimeDecoderData {
|
|||
void *closure;
|
||||
};
|
||||
|
||||
#ifndef MOZ_ENDER_MIME
|
||||
|
||||
static int
|
||||
mime_decode_qp_buffer (MimeDecoderData *data, const char *buffer, int32 length)
|
||||
|
@ -175,7 +177,7 @@ mime_decode_qp_buffer (MimeDecoderData *data, const char *buffer, int32 length)
|
|||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif /*MOZ_ENDER_MIME*/
|
||||
|
||||
static int
|
||||
mime_decode_base64_token (const char *in, char *out)
|
||||
|
@ -302,6 +304,7 @@ mime_decode_base64_buffer (MimeDecoderData *data,
|
|||
}
|
||||
|
||||
|
||||
#ifndef MOZ_ENDER_MIME
|
||||
static int
|
||||
mime_decode_uue_buffer (MimeDecoderData *data,
|
||||
const char *input_buffer, int32 input_length)
|
||||
|
@ -526,6 +529,7 @@ mime_decode_uue_buffer (MimeDecoderData *data,
|
|||
return status;
|
||||
}
|
||||
|
||||
#endif /*MOZ_ENDER_MIME*/
|
||||
|
||||
int
|
||||
MimeDecoderDestroy (MimeDecoderData *data, XP_Bool abort_p)
|
||||
|
@ -570,6 +574,7 @@ MimeB64DecoderInit (int (*output_fn) (const char *, int32, void *),
|
|||
return mime_decoder_init (mime_Base64, output_fn, closure);
|
||||
}
|
||||
|
||||
#ifndef MOZ_ENDER_MIME
|
||||
MimeDecoderData *
|
||||
MimeQPDecoderInit (int (*output_fn) (const char *, int32, void *),
|
||||
void *closure)
|
||||
|
@ -583,7 +588,7 @@ MimeUUDecoderInit (int (*output_fn) (const char *, int32, void *),
|
|||
{
|
||||
return mime_decoder_init (mime_uuencode, output_fn, closure);
|
||||
}
|
||||
|
||||
#endif /*MOZ_ENDER_MIME*/
|
||||
int
|
||||
MimeDecoderWrite (MimeDecoderData *data, const char *buffer, int32 size)
|
||||
{
|
||||
|
@ -593,10 +598,12 @@ MimeDecoderWrite (MimeDecoderData *data, const char *buffer, int32 size)
|
|||
{
|
||||
case mime_Base64:
|
||||
return mime_decode_base64_buffer (data, buffer, size);
|
||||
case mime_QuotedPrintable:
|
||||
#ifndef MOZ_ENDER_MIME
|
||||
case mime_QuotedPrintable:
|
||||
return mime_decode_qp_buffer (data, buffer, size);
|
||||
case mime_uuencode:
|
||||
return mime_decode_uue_buffer (data, buffer, size);
|
||||
#endif
|
||||
default:
|
||||
XP_ASSERT(0);
|
||||
return -1;
|
||||
|
@ -628,6 +635,7 @@ struct MimeEncoderData {
|
|||
void *closure;
|
||||
};
|
||||
|
||||
#ifndef MOZ_ENDER_MIME
|
||||
/* Use what looks like a nice, safe value for a standard uue line length */
|
||||
#define UUENCODE_LINE_LIMIT 60
|
||||
|
||||
|
@ -750,7 +758,7 @@ mime_uuencode_finish(MimeEncoderData *data)
|
|||
/* Write 'end' on a line by itself. */
|
||||
return data->write_buffer(endStr, strlen(endStr), data->closure);
|
||||
}
|
||||
|
||||
#endif /*MOZ_ENDER_MIME*/
|
||||
#undef ENC
|
||||
|
||||
int
|
||||
|
@ -857,7 +865,7 @@ mime_encode_base64_buffer (MimeEncoderData *data,
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#ifndef MOZ_ENDER_MIME
|
||||
int
|
||||
mime_encode_qp_buffer (MimeEncoderData *data, const char *buffer, int32 size)
|
||||
{
|
||||
|
@ -990,6 +998,7 @@ mime_encode_qp_buffer (MimeEncoderData *data, const char *buffer, int32 size)
|
|||
|
||||
return 0;
|
||||
}
|
||||
#endif /*MOZ_ENDER_MIME*/
|
||||
|
||||
|
||||
|
||||
|
@ -999,8 +1008,10 @@ MimeEncoderDestroy (MimeEncoderData *data, XP_Bool abort_p)
|
|||
int status = 0;
|
||||
|
||||
/* If we're uuencoding, we have our own finishing routine. */
|
||||
#ifndef MOZ_ENDER_MIME
|
||||
if (data->encoding == mime_uuencode)
|
||||
mime_uuencode_finish(data);
|
||||
#endif /*MOZ_ENDER_MIME*/
|
||||
|
||||
/* Since Base64 (and uuencode) output needs to do some buffering to get
|
||||
a multiple of three bytes on each block, there may be a few bytes
|
||||
|
@ -1077,6 +1088,7 @@ MimeB64EncoderInit (int (*output_fn) (const char *, int32, void *),
|
|||
return mime_encoder_init (mime_Base64, output_fn, closure);
|
||||
}
|
||||
|
||||
#ifndef MOZ_ENDER_MIME
|
||||
MimeEncoderData *
|
||||
MimeQPEncoderInit (int (*output_fn) (const char *, int32, void *),
|
||||
void *closure)
|
||||
|
@ -1096,6 +1108,7 @@ MimeUUEncoderInit (char *filename,
|
|||
|
||||
return enc;
|
||||
}
|
||||
#endif /*MOZ_ENDER_MIME*/
|
||||
|
||||
int
|
||||
MimeEncoderWrite (MimeEncoderData *data, const char *buffer, int32 size)
|
||||
|
@ -1106,10 +1119,12 @@ MimeEncoderWrite (MimeEncoderData *data, const char *buffer, int32 size)
|
|||
{
|
||||
case mime_Base64:
|
||||
return mime_encode_base64_buffer (data, buffer, size);
|
||||
case mime_QuotedPrintable:
|
||||
#ifndef MOZ_ENDER_MIME
|
||||
case mime_QuotedPrintable:
|
||||
return mime_encode_qp_buffer (data, buffer, size);
|
||||
case mime_uuencode:
|
||||
return mime_uuencode_buffer(data, buffer, size);
|
||||
#endif
|
||||
default:
|
||||
XP_ASSERT(0);
|
||||
return -1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче