27 |
*/ |
*/ |
28 |
|
|
29 |
#include <stdio.h> |
#include <stdio.h> |
30 |
|
#include <stdlib.h> |
31 |
#include <string.h> |
#include <string.h> |
32 |
|
|
33 |
#include "part.h" |
#include "part.h" |
59 |
/* |
/* |
60 |
* Close and free 'part'. |
* Close and free 'part'. |
61 |
*/ |
*/ |
62 |
int part_close(struct part *part) |
void part_close(struct part *part) |
63 |
{ |
{ |
64 |
fclose(part->infile); |
fclose(part->infile); |
65 |
if (part->buf) free(part->buf); |
if (part->buf) free(part->buf); |
78 |
/* |
/* |
79 |
* Add to 'part' the multipart boundary 'boundary'. |
* Add to 'part' the multipart boundary 'boundary'. |
80 |
*/ |
*/ |
81 |
int |
void part_addboundary(struct part *part, char *boundary) |
|
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 |
int |
void part_ungets(char *s, struct part *part) |
|
part_ungets(char *s, struct part *part) |
|
169 |
{ |
{ |
170 |
int len = strlen(s); |
int len = strlen(s); |
171 |
int i; |
int i; |