Postfix3.3.1
データ構造 | マクロ定義 | 型定義 | 関数
mime_state.c ファイル
#include <sys_defs.h>
#include <stdarg.h>
#include <ctype.h>
#include <string.h>
#include <mymalloc.h>
#include <msg.h>
#include <vstring.h>
#include <rec_type.h>
#include <is_header.h>
#include <header_opts.h>
#include <mail_params.h>
#include <header_token.h>
#include <lex_822.h>
#include <mime_state.h>

[ソースコード]

データ構造

struct  MIME_STACK
 
struct  MIME_STATE
 
struct  MIME_ENCODING
 

マクロ定義

#define MIME_MAX_TOKEN   3 /* tokens per attribute */
 
#define MIME_CTYPE_OTHER   0
 
#define MIME_CTYPE_TEXT   1
 
#define MIME_CTYPE_MESSAGE   2
 
#define MIME_CTYPE_MULTIPART   3
 
#define MIME_STYPE_OTHER   0
 
#define MIME_STYPE_PLAIN   1
 
#define MIME_STYPE_RFC822   2
 
#define MIME_STYPE_PARTIAL   3
 
#define MIME_STYPE_EXTERN_BODY   4
 
#define MIME_STYPE_GLOBAL   5
 
#define MIME_STATE_PRIMARY   MIME_HDR_PRIMARY /* primary headers */
 
#define MIME_STATE_MULTIPART   MIME_HDR_MULTIPART /* after --boundary */
 
#define MIME_STATE_NESTED   MIME_HDR_NESTED /* message/rfc822 */
 
#define MIME_STATE_BODY   (MIME_HDR_NESTED + 1)
 
#define SET_MIME_STATE(ptr, state, ctype, stype, encoding, domain)
 
#define SET_CURR_STATE(ptr, state)
 
#define MIME_ENC_QP   1 /* encoding + domain */
 
#define MIME_ENC_BASE64   2 /* encoding + domain */
 
#define MIME_ENC_7BIT   7 /* domain only */
 
#define MIME_ENC_8BIT   8 /* domain only */
 
#define MIME_ENC_BINARY   9 /* domain only */
 
#define STR(x)   vstring_str(x)
 
#define LEN(x)   VSTRING_LEN(x)
 
#define END(x)   vstring_end(x)
 
#define CU_CHAR_PTR(x)   ((const unsigned char *) (x))
 
#define REPORT_ERROR_LEN(state, err_type, text, len)
 
#define REPORT_ERROR(state, err_type, text)
 
#define REPORT_ERROR_BUF(state, err_type, buf)   REPORT_ERROR_LEN(state, err_type, STR(buf), LEN(buf))
 
#define HEAD_OUT(ptr, info, len)
 
#define BODY_OUT(ptr, rec_type, text, len)
 
#define TOKEN_MATCH(tok, text)   ((tok).type == HEADER_TOK_TOKEN && strcasecmp((tok).u.value, (text)) == 0)
 
#define RFC2045_TSPECIALS   "()<>@,;:\\\"/[]?="
 
#define PARSE_CONTENT_TYPE_HEADER(state, ptr)
 
#define PARSE_CONTENT_ENCODING_HEADER(state, ptr)   header_token(state->token, 1, state->token_buffer, ptr, (char *) 0, 0)
 
#define QP_ENCODE(buffer, ch)
 
#define SAVE_PREV_REC_TYPE_AND_RETURN_ERR_FLAGS(state, rec_type)
 

型定義

typedef struct MIME_STACK MIME_STACK
 
typedef struct MIME_ENCODING MIME_ENCODING
 

関数

MIME_STATEmime_state_alloc (int flags, MIME_STATE_HEAD_OUT head_out, MIME_STATE_ANY_END head_end, MIME_STATE_BODY_OUT body_out, MIME_STATE_ANY_END body_end, MIME_STATE_ERR_PRINT err_print, void *context)
 
MIME_STATEmime_state_free (MIME_STATE *state)
 
int mime_state_update (MIME_STATE *state, int rec_type, const char *text, ssize_t len)
 
const char * mime_state_error (int error_code)
 
const MIME_STATE_DETAILmime_state_detail (int error_code)
 

マクロ定義詳解

#define BODY_OUT (   ptr,
  rec_type,
  text,
  len 
)
値:
do { \
if ((ptr)->body_out) { \
(ptr)->body_out((ptr)->app_context, (rec_type), \
(text), (len), (ptr)->body_offset); \
(ptr)->body_offset += (len) + 1; \
} \
} while(0)

mime_state.c436 行目に定義があります。

#define CU_CHAR_PTR (   x)    ((const unsigned char *) (x))

mime_state.c404 行目に定義があります。

#define END (   x)    vstring_end(x)

mime_state.c403 行目に定義があります。

#define HEAD_OUT (   ptr,
  info,
  len 
)
値:
do { \
if ((ptr)->head_out) { \
(ptr)->head_out((ptr)->app_context, (ptr)->curr_state, \
(info), (ptr)->output_buffer, (ptr)->head_offset); \
(ptr)->head_offset += (len) + 1; \
} \
} while(0)

mime_state.c428 行目に定義があります。

#define LEN (   x)    VSTRING_LEN(x)

mime_state.c402 行目に定義があります。

#define MIME_CTYPE_MESSAGE   2

mime_state.c330 行目に定義があります。

#define MIME_CTYPE_MULTIPART   3

mime_state.c331 行目に定義があります。

#define MIME_CTYPE_OTHER   0

mime_state.c328 行目に定義があります。

#define MIME_CTYPE_TEXT   1

mime_state.c329 行目に定義があります。

#define MIME_ENC_7BIT   7 /* domain only */

mime_state.c384 行目に定義があります。

#define MIME_ENC_8BIT   8 /* domain only */

mime_state.c385 行目に定義があります。

#define MIME_ENC_BASE64   2 /* encoding + domain */

mime_state.c381 行目に定義があります。

#define MIME_ENC_BINARY   9 /* domain only */

mime_state.c386 行目に定義があります。

#define MIME_ENC_QP   1 /* encoding + domain */

mime_state.c380 行目に定義があります。

#define MIME_MAX_TOKEN   3 /* tokens per attribute */

mime_state.c290 行目に定義があります。

#define MIME_STATE_BODY   (MIME_HDR_NESTED + 1)

mime_state.c346 行目に定義があります。

#define MIME_STATE_MULTIPART   MIME_HDR_MULTIPART /* after --boundary */

mime_state.c344 行目に定義があります。

#define MIME_STATE_NESTED   MIME_HDR_NESTED /* message/rfc822 */

mime_state.c345 行目に定義があります。

#define MIME_STATE_PRIMARY   MIME_HDR_PRIMARY /* primary headers */

mime_state.c343 行目に定義があります。

#define MIME_STYPE_EXTERN_BODY   4

mime_state.c337 行目に定義があります。

#define MIME_STYPE_GLOBAL   5

mime_state.c338 行目に定義があります。

#define MIME_STYPE_OTHER   0

mime_state.c333 行目に定義があります。

#define MIME_STYPE_PARTIAL   3

mime_state.c336 行目に定義があります。

#define MIME_STYPE_PLAIN   1

mime_state.c334 行目に定義があります。

#define MIME_STYPE_RFC822   2

mime_state.c335 行目に定義があります。

#define PARSE_CONTENT_ENCODING_HEADER (   state,
  ptr 
)    header_token(state->token, 1, state->token_buffer, ptr, (char *) 0, 0)
#define PARSE_CONTENT_TYPE_HEADER (   state,
  ptr 
)
値:
header_token(state->token, MIME_MAX_TOKEN, \
state->token_buffer, ptr, RFC2045_TSPECIALS, ';')
#define MIME_MAX_TOKEN
Definition: mime_state.c:290
ssize_t header_token(HEADER_TOKEN *token, ssize_t token_len, VSTRING *token_buffer, const char **ptr, const char *user_specials, int user_terminator)
Definition: header_token.c:107
#define RFC2045_TSPECIALS
#define QP_ENCODE (   buffer,
  ch 
)
値:
{ \
VSTRING_ADDCH(buffer, '='); \
VSTRING_ADDCH(buffer, hexchars[(ch >> 4) & 0xff]); \
VSTRING_ADDCH(buffer, hexchars[ch & 0xf]); \
}
#define VSTRING_ADDCH(vp, ch)
Definition: vstring.h:81
#define REPORT_ERROR (   state,
  err_type,
  text 
)
値:
do { \
const char *_text = text; \
ssize_t _len = strlen(text); \
REPORT_ERROR_LEN(state, err_type, _text, _len); \
} while (0)
#define REPORT_ERROR_LEN(state, err_type, text, len)
Definition: mime_state.c:406

mime_state.c414 行目に定義があります。

#define REPORT_ERROR_BUF (   state,
  err_type,
  buf 
)    REPORT_ERROR_LEN(state, err_type, STR(buf), LEN(buf))

mime_state.c420 行目に定義があります。

#define REPORT_ERROR_LEN (   state,
  err_type,
  text,
  len 
)
値:
do { \
if ((state->err_flags & err_type) == 0) { \
if (state->err_print != 0) \
state->err_print(state->app_context, err_type, text, len); \
state->err_flags |= err_type; \
} \
} while (0)

mime_state.c406 行目に定義があります。

#define RFC2045_TSPECIALS   "()<>@,;:\\\"/[]?="
#define SAVE_PREV_REC_TYPE_AND_RETURN_ERR_FLAGS (   state,
  rec_type 
)
値:
do { \
state->prev_rec_type = rec_type; \
return (state->err_flags); \
} while (0)
#define SET_CURR_STATE (   ptr,
  state 
)
値:
do { \
(ptr)->curr_state = (state); \
if ((state) == MIME_STATE_BODY) \
(ptr)->body_offset = 0; \
else \
(ptr)->head_offset = 0; \
} while (0)
#define MIME_STATE_BODY
Definition: mime_state.c:346

mime_state.c360 行目に定義があります。

#define SET_MIME_STATE (   ptr,
  state,
  ctype,
  stype,
  encoding,
  domain 
)
値:
do { \
(ptr)->curr_state = (state); \
(ptr)->curr_ctype = (ctype); \
(ptr)->curr_stype = (stype); \
(ptr)->curr_encoding = (encoding); \
(ptr)->curr_domain = (domain); \
if ((state) == MIME_STATE_BODY) \
(ptr)->body_offset = 0; \
else \
(ptr)->head_offset = 0; \
} while (0)
#define MIME_STATE_BODY
Definition: mime_state.c:346

mime_state.c348 行目に定義があります。

#define STR (   x)    vstring_str(x)

mime_state.c401 行目に定義があります。

#define TOKEN_MATCH (   tok,
  text 
)    ((tok).type == HEADER_TOK_TOKEN && strcasecmp((tok).u.value, (text)) == 0)

型定義詳解

typedef struct MIME_ENCODING MIME_ENCODING
typedef struct MIME_STACK MIME_STACK

関数詳解

MIME_STATE* mime_state_alloc ( int  flags,
MIME_STATE_HEAD_OUT  head_out,
MIME_STATE_ANY_END  head_end,
MIME_STATE_BODY_OUT  body_out,
MIME_STATE_ANY_END  body_end,
MIME_STATE_ERR_PRINT  err_print,
void *  context 
)

mime_state.c493 行目に定義があります。

const MIME_STATE_DETAIL* mime_state_detail ( int  error_code)

mime_state.c1163 行目に定義があります。

const char* mime_state_error ( int  error_code)

mime_state.c1149 行目に定義があります。

MIME_STATE* mime_state_free ( MIME_STATE state)

mime_state.c530 行目に定義があります。

int mime_state_update ( MIME_STATE state,
int  rec_type,
const char *  text,
ssize_t  len 
)

mime_state.c755 行目に定義があります。