27 |
*/ |
*/ |
28 |
|
|
29 |
#include <stdio.h> |
#include <stdio.h> |
|
#include <stdlib.h> |
|
30 |
#include <string.h> |
#include <string.h> |
31 |
|
|
32 |
#include "part.h" |
#include "part.h" |
58 |
/* |
/* |
59 |
* Close and free 'part'. |
* Close and free 'part'. |
60 |
*/ |
*/ |
61 |
void part_close(struct part *part) |
int part_close(struct part *part) |
62 |
{ |
{ |
63 |
fclose(part->infile); |
fclose(part->infile); |
64 |
if (part->buf) free(part->buf); |
if (part->buf) free(part->buf); |
77 |
/* |
/* |
78 |
* Add to 'part' the multipart boundary 'boundary'. |
* Add to 'part' the multipart boundary 'boundary'. |
79 |
*/ |
*/ |
80 |
void part_addboundary(struct part *part, char *boundary) |
int |
81 |
|
part_addboundary(struct part *part, char *boundary) |
82 |
{ |
{ |
83 |
/* Grow boundary array if necessary */ |
/* Grow boundary array if necessary */ |
84 |
if (part->boundary_num == part->boundary_alloc) { |
if (part->boundary_num == part->boundary_alloc) { |
165 |
* Leaves room in the input buffer to push back an additional single |
* Leaves room in the input buffer to push back an additional single |
166 |
* character using the prot_ungetc() macro. |
* character using the prot_ungetc() macro. |
167 |
*/ |
*/ |
168 |
void part_ungets(char *s, struct part *part) |
int |
169 |
|
part_ungets(char *s, struct part *part) |
170 |
{ |
{ |
171 |
int len = strlen(s); |
int len = strlen(s); |
172 |
int i; |
int i; |