Parse PGP data packets. More...
#include "config.h"#include <stdbool.h>#include <stdio.h>#include "mutt/lib.h"#include "pgppacket.h"
Include dependency graph for pgppacket.c:Go to the source code of this file.
Macros | |
| #define | CHUNK_SIZE 1024 |
| Amount of data to read at once. | |
Functions | |
| static int | read_material (size_t material, size_t *used, FILE *fp) |
| Read PGP data into a buffer. | |
| unsigned char * | pgp_read_packet (FILE *fp, size_t *len) |
| Read a PGP packet from a file. | |
| void | pgp_release_packet (void) |
| Free the cached PGP packet. | |
Variables | |
| static unsigned char * | PacketBuf = NULL |
| Cached PGP data packet. | |
| static size_t | PacketBufLen = 0 |
| Length of cached packet. | |
Parse PGP data packets.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file pgppacket.c.
| #define CHUNK_SIZE 1024 |
Amount of data to read at once.
Definition at line 36 of file pgppacket.c.
|
static |
Read PGP data into a buffer.
| [in] | material | Number of bytes to read |
| [in,out] | used | Number of bytes already read |
| [in] | fp | File to read from |
| 0 | Success |
| -1 | Failure (see errno) |
This function uses a cache to store the data: PacketBuf, PacketBufLen.
Definition at line 51 of file pgppacket.c.
Here is the caller graph for this function:| unsigned char * pgp_read_packet | ( | FILE * | fp, |
| size_t * | len ) |
Read a PGP packet from a file.
| [in] | fp | File to read from |
| [out] | len | Number of bytes read |
| ptr | PGP data packet |
This function uses a cache to store the data: PacketBuf, PacketBufLen.
Definition at line 78 of file pgppacket.c.
Here is the call graph for this function:
Here is the caller graph for this function:| void pgp_release_packet | ( | void | ) |
Free the cached PGP packet.
Free the data stored in PacketBuf.
Definition at line 231 of file pgppacket.c.
Here is the caller graph for this function:
|
static |
Cached PGP data packet.
Definition at line 38 of file pgppacket.c.
|
static |
Length of cached packet.
Definition at line 39 of file pgppacket.c.