/* Copyright (c) 1984-98 by The MathWorks, Inc. */
/* $Revision: 1.3 $ */

/* 
 *	Getprofl.c 
 * 
 *	Get a Windows private profile string 
 */ 
#include <windows.h> 
#include "mex.h" 
 
void mexFunction(nlhs,plhs,nrhs,prhs) 
int nlhs, nrhs; 
mxArray *plhs[], *prhs[]; 
{ 
	mxArray *pmat; 
	char	szIniFile[256],szSection[256],szEntry[256],szDefault[256]; 
	char	szResult[256]; 
 
	if (nrhs == 4 && nlhs == 1) 
	{ 
		mxGetString	(prhs[0], szSection, 255L); 
		mxGetString	(prhs[1], szEntry, 255L); 
		mxGetString	(prhs[2], szDefault, 255L); 
		mxGetString	(prhs[3], szIniFile, 255L); 
 
		GetPrivateProfileString(szSection, szEntry, szDefault, szResult, 255,
szIniFile); 
 
		pmat = mxCreateString(szResult); 
		plhs[0] = pmat; 
	} 
	else 
		mexErrMsgTxt("Getprofl requires 4 inputs and 1 output."); 
} 
