fetch.c : Change the indentation.
Showing
1 changed file
with
22 additions
and
16 deletions
... | @@ -73,11 +73,11 @@ struct imap4d_command fetch_command_table [] = | ... | @@ -73,11 +73,11 @@ struct imap4d_command fetch_command_table [] = |
73 | {"RFC822", fetch_rfc822}, | 73 | {"RFC822", fetch_rfc822}, |
74 | #define F_BODYSTRUCTURE 10 | 74 | #define F_BODYSTRUCTURE 10 |
75 | {"BODYSTRUCTURE", fetch_bodystructure}, | 75 | {"BODYSTRUCTURE", fetch_bodystructure}, |
76 | #define F_BODY_PEEK 12 | 76 | #define F_BODY_PEEK 11 |
77 | {"BODY.PEEK", fetch_body_peek}, | 77 | {"BODY.PEEK", fetch_body_peek}, |
78 | #define F_BODY 13 | 78 | #define F_BODY 12 |
79 | {"BODY", fetch_body}, | 79 | {"BODY", fetch_body}, |
80 | #define F_UID 14 | 80 | #define F_UID 13 |
81 | {"UID", fetch_uid}, | 81 | {"UID", fetch_uid}, |
82 | { 0, 0}, | 82 | { 0, 0}, |
83 | }; | 83 | }; |
... | @@ -133,6 +133,7 @@ fetch_all (struct imap4d_command *command, char *arg) | ... | @@ -133,6 +133,7 @@ fetch_all (struct imap4d_command *command, char *arg) |
133 | { | 133 | { |
134 | struct imap4d_command c_env = fetch_command_table[F_ENVELOPE]; | 134 | struct imap4d_command c_env = fetch_command_table[F_ENVELOPE]; |
135 | fetch_fast (command, arg); | 135 | fetch_fast (command, arg); |
136 | util_send (" "); | ||
136 | c_env.states = command->states; | 137 | c_env.states = command->states; |
137 | fetch_envelope (&c_env, arg); | 138 | fetch_envelope (&c_env, arg); |
138 | return 0; | 139 | return 0; |
... | @@ -144,6 +145,7 @@ fetch_full (struct imap4d_command *command, char *arg) | ... | @@ -144,6 +145,7 @@ fetch_full (struct imap4d_command *command, char *arg) |
144 | { | 145 | { |
145 | struct imap4d_command c_body = fetch_command_table[F_BODY]; | 146 | struct imap4d_command c_body = fetch_command_table[F_BODY]; |
146 | fetch_all (command, arg); | 147 | fetch_all (command, arg); |
148 | util_send (" "); | ||
147 | c_body.states = command->states; | 149 | c_body.states = command->states; |
148 | fetch_body (&c_body, arg); | 150 | fetch_body (&c_body, arg); |
149 | return 0; | 151 | return 0; |
... | @@ -158,8 +160,10 @@ fetch_fast (struct imap4d_command *command, char *arg) | ... | @@ -158,8 +160,10 @@ fetch_fast (struct imap4d_command *command, char *arg) |
158 | struct imap4d_command c_flags = fetch_command_table[F_FLAGS]; | 160 | struct imap4d_command c_flags = fetch_command_table[F_FLAGS]; |
159 | c_flags.states = command->states; | 161 | c_flags.states = command->states; |
160 | fetch_flags (&c_flags, arg); | 162 | fetch_flags (&c_flags, arg); |
163 | util_send (" "); | ||
161 | c_idate.states = command->states; | 164 | c_idate.states = command->states; |
162 | fetch_internaldate (&c_idate, arg); | 165 | fetch_internaldate (&c_idate, arg); |
166 | util_send (" "); | ||
163 | c_rfc.states = command->states; | 167 | c_rfc.states = command->states; |
164 | fetch_rfc822_size (&c_rfc, arg); | 168 | fetch_rfc822_size (&c_rfc, arg); |
165 | return 0; | 169 | return 0; |
... | @@ -236,7 +240,7 @@ fetch_envelope (struct imap4d_command *command, char *arg) | ... | @@ -236,7 +240,7 @@ fetch_envelope (struct imap4d_command *command, char *arg) |
236 | not permitted. Even AIX xlc use to choke. */ | 240 | not permitted. Even AIX xlc use to choke. */ |
237 | mailbox_get_message (mbox, command->states, &msg); | 241 | mailbox_get_message (mbox, command->states, &msg); |
238 | message_get_header (msg, &header); | 242 | message_get_header (msg, &header); |
239 | util_send (" %s(", command->name); | 243 | util_send ("%s(", command->name); |
240 | 244 | ||
241 | /* FIXME: Incorrect Date. */ | 245 | /* FIXME: Incorrect Date. */ |
242 | *buffer = '\0'; | 246 | *buffer = '\0'; |
... | @@ -314,8 +318,7 @@ fetch_flags (struct imap4d_command *command, char *arg) | ... | @@ -314,8 +318,7 @@ fetch_flags (struct imap4d_command *command, char *arg) |
314 | message_t msg = NULL; | 318 | message_t msg = NULL; |
315 | mailbox_get_message (mbox, command->states, &msg); | 319 | mailbox_get_message (mbox, command->states, &msg); |
316 | message_get_attribute (msg, &attr); | 320 | message_get_attribute (msg, &attr); |
317 | util_send (" %s", command->name); | 321 | util_send ("%s (", command->name); |
318 | util_send (" ("); | ||
319 | if (attribute_is_deleted (attr)) | 322 | if (attribute_is_deleted (attr)) |
320 | util_send (" \\Deleted"); | 323 | util_send (" \\Deleted"); |
321 | if (attribute_is_read (attr)) | 324 | if (attribute_is_read (attr)) |
... | @@ -340,7 +343,7 @@ fetch_internaldate (struct imap4d_command *command, char *arg) | ... | @@ -340,7 +343,7 @@ fetch_internaldate (struct imap4d_command *command, char *arg) |
340 | message_get_envelope (msg, &env); | 343 | message_get_envelope (msg, &env); |
341 | date[0] = '\0'; | 344 | date[0] = '\0'; |
342 | envelope_date (env, date, sizeof (date), NULL); | 345 | envelope_date (env, date, sizeof (date), NULL); |
343 | util_send (" %s", command->name); | 346 | util_send ("%s", command->name); |
344 | if (date[strlen (date) - 1] == '\n') | 347 | if (date[strlen (date) - 1] == '\n') |
345 | date[strlen (date) - 1] = '\0'; | 348 | date[strlen (date) - 1] = '\0'; |
346 | util_send (" \"%s\"", date); | 349 | util_send (" \"%s\"", date); |
... | @@ -352,7 +355,7 @@ static int | ... | @@ -352,7 +355,7 @@ static int |
352 | fetch_rfc822_header (struct imap4d_command *command, char *arg) | 355 | fetch_rfc822_header (struct imap4d_command *command, char *arg) |
353 | { | 356 | { |
354 | char buffer[16]; | 357 | char buffer[16]; |
355 | util_send (" %s", command->name); | 358 | util_send ("%s ", command->name); |
356 | strcpy (buffer, "[HEADER]"); | 359 | strcpy (buffer, "[HEADER]"); |
357 | fetch_operation (command->states, buffer); | 360 | fetch_operation (command->states, buffer); |
358 | return 0; | 361 | return 0; |
... | @@ -369,7 +372,7 @@ fetch_rfc822_text (struct imap4d_command *command, char *arg) | ... | @@ -369,7 +372,7 @@ fetch_rfc822_text (struct imap4d_command *command, char *arg) |
369 | mailbox_get_message (mbox, command->states, &msg); | 372 | mailbox_get_message (mbox, command->states, &msg); |
370 | message_get_attribute (msg, &attr); | 373 | message_get_attribute (msg, &attr); |
371 | attribute_set_read (attr); | 374 | attribute_set_read (attr); |
372 | util_send (" %s", command->name); | 375 | util_send ("%s ", command->name); |
373 | strcpy (buffer, "[TEXT]"); | 376 | strcpy (buffer, "[TEXT]"); |
374 | fetch_operation (command->states, buffer); | 377 | fetch_operation (command->states, buffer); |
375 | return 0; | 378 | return 0; |
... | @@ -385,7 +388,7 @@ fetch_rfc822_size (struct imap4d_command *command, char *arg) | ... | @@ -385,7 +388,7 @@ fetch_rfc822_size (struct imap4d_command *command, char *arg) |
385 | mailbox_get_message (mbox, command->states, &msg); | 388 | mailbox_get_message (mbox, command->states, &msg); |
386 | message_size (msg, &size); | 389 | message_size (msg, &size); |
387 | message_lines (msg, &lines); | 390 | message_lines (msg, &lines); |
388 | util_send (" %s %u", command->name, size + lines); | 391 | util_send ("%s %u", command->name, size + lines); |
389 | return 0; | 392 | return 0; |
390 | } | 393 | } |
391 | 394 | ||
... | @@ -423,7 +426,7 @@ fetch_rfc822 (struct imap4d_command *command, char *arg) | ... | @@ -423,7 +426,7 @@ fetch_rfc822 (struct imap4d_command *command, char *arg) |
423 | mailbox_get_message (mbox, command->states, &msg); | 426 | mailbox_get_message (mbox, command->states, &msg); |
424 | message_get_attribute (msg, &attr); | 427 | message_get_attribute (msg, &attr); |
425 | attribute_set_read (attr); | 428 | attribute_set_read (attr); |
426 | util_send (" %s", command->name); | 429 | util_send ("%s ", command->name); |
427 | strcpy (buffer, "[]"); | 430 | strcpy (buffer, "[]"); |
428 | fetch_operation (command->states, buffer); | 431 | fetch_operation (command->states, buffer); |
429 | } | 432 | } |
... | @@ -438,7 +441,7 @@ fetch_uid (struct imap4d_command *command, char *arg) | ... | @@ -438,7 +441,7 @@ fetch_uid (struct imap4d_command *command, char *arg) |
438 | message_t msg = NULL; | 441 | message_t msg = NULL; |
439 | mailbox_get_message (mbox, command->states, &msg); | 442 | mailbox_get_message (mbox, command->states, &msg); |
440 | message_get_uid (msg, &uid); | 443 | message_get_uid (msg, &uid); |
441 | util_send (" %s %d", command->name, uid); | 444 | util_send ("%s %d", command->name, uid); |
442 | return 0; | 445 | return 0; |
443 | } | 446 | } |
444 | 447 | ||
... | @@ -446,7 +449,7 @@ fetch_uid (struct imap4d_command *command, char *arg) | ... | @@ -446,7 +449,7 @@ fetch_uid (struct imap4d_command *command, char *arg) |
446 | static int | 449 | static int |
447 | fetch_bodystructure (struct imap4d_command *command, char *arg) | 450 | fetch_bodystructure (struct imap4d_command *command, char *arg) |
448 | { | 451 | { |
449 | util_send (" %s ()", command->name); | 452 | util_send ("%s ()", command->name); |
450 | return 0; | 453 | return 0; |
451 | } | 454 | } |
452 | 455 | ||
... | @@ -467,8 +470,8 @@ static int | ... | @@ -467,8 +470,8 @@ static int |
467 | fetch_body (struct imap4d_command *command, char *arg) | 470 | fetch_body (struct imap4d_command *command, char *arg) |
468 | { | 471 | { |
469 | struct imap4d_command c_body_p = fetch_command_table[F_BODY_PEEK]; | 472 | struct imap4d_command c_body_p = fetch_command_table[F_BODY_PEEK]; |
470 | util_send (" %s", command->name); | 473 | util_send ("%s ", command->name); |
471 | if (strcasecmp (arg, ".PEEK") == 0) | 474 | if (strncasecmp (arg, ".PEEK", 5) == 0) |
472 | { | 475 | { |
473 | arg += strlen (".PEEK"); | 476 | arg += strlen (".PEEK"); |
474 | } | 477 | } |
... | @@ -484,7 +487,10 @@ fetch_body (struct imap4d_command *command, char *arg) | ... | @@ -484,7 +487,10 @@ fetch_body (struct imap4d_command *command, char *arg) |
484 | { | 487 | { |
485 | struct imap4d_command c_bs = fetch_command_table[F_BODYSTRUCTURE]; | 488 | struct imap4d_command c_bs = fetch_command_table[F_BODYSTRUCTURE]; |
486 | c_bs.states = command->states; | 489 | c_bs.states = command->states; |
487 | return fetch_bodystructure (&c_bs, arg); | 490 | /* FIXME: Call body structure without the extension. */ |
491 | /* return fetch_bodystructure (&c_bs, arg); */ | ||
492 | util_send (" ()"); | ||
493 | return 0; | ||
488 | } | 494 | } |
489 | 495 | ||
490 | fetch_operation (command->states, arg); | 496 | fetch_operation (command->states, arg); | ... | ... |
-
Please register or sign in to post a comment