Crypt-MatrixSSL

 view release on metacpan or  search on metacpan

matrixssl-1-8-6-open/examples/httpsReflector.c  view on Meta::CPAN

	FILE	*fp;
	struct	stat	fstat;
	size_t	tmp = 0;

	*binLen = 0;
	*bin = NULL;

	if (fileName == NULL) {
		return -1;
	}
	if ((stat(fileName, &fstat) != 0) || (fp = fopen(fileName, "rb")) == NULL) {
		return -7; /* FILE_NOT_FOUND */
	}

	*bin = malloc(fstat.st_size);
	if (*bin == NULL) {
		return -8; /* SSL_MEM_ERROR */
	}
	while (((tmp = fread(*bin + *binLen, sizeof(char), 512, fp)) > 0) &&
			(*binLen < fstat.st_size)) { 
		*binLen += (int32)tmp;

matrixssl-1-8-6-open/src/os/osLayer.h  view on Meta::CPAN

		long usec;
	} sslTime_t;
#endif

/******************************************************************************/
/*
	We define our own stat for CE.
*/
#if WINCE

extern int32 stat(char *filename, struct stat *sbuf);

struct stat {
	unsigned long st_size;	/* file size in bytes				*/
	unsigned long st_mode;
	time_t st_atime;		/* time of last access				*/
	time_t st_mtime;		/* time of last data modification	*/
	time_t st_ctime;		/* time of last file status change	*/
};

#define			S_IFREG 0100000

matrixssl-1-8-6-open/src/os/win/win.c  view on Meta::CPAN

}

#ifdef WINCE
/******************************************************************************/
/*
 	Our implementation of wide character stat: get file information.
 
 	NOTES:
 		only gets the file size currently
 */
int32 stat(char *filename, struct stat *sbuf)
{
	DWORD	dwAttributes;
	HANDLE	hFile;
	int32		rc, size;

	unsigned short uniFile[512];

	rc = 0;
	memset(sbuf, 0, sizeof(struct stat));

matrixssl-1-8-6-open/src/pki/rsaPki.c  view on Meta::CPAN

	FILE	*fp;
	struct	stat	fstat;
	size_t	tmp = 0;

	*binLen = 0;
	*bin = NULL;

	if (fileName == NULL) {
		return -1;
	}
	if ((stat(fileName, &fstat) != 0) || (fp = fopen(fileName, "r")) == NULL) {
		return -7; /* FILE_NOT_FOUND */
	}

	*bin = psMalloc(pool, fstat.st_size + 1);
	if (*bin == NULL) {
		return -8; /* SSL_MEM_ERROR */
	}
	memset(*bin, 0x0, fstat.st_size + 1);
	while (((tmp = fread(*bin + *binLen, sizeof(char), 512, fp)) > 0) &&
			(*binLen < fstat.st_size)) { 



( run in 1.122 second using v1.01-cache-2.11-cpan-49f99fa48dc )