Beispiel #1
0
	void Generator::CopyFramePart(const wchar_t* stop, bool generateOutput) {
		wchar_t startCh = 0;
		int endOfStopString = 0;
		wchar_t ch = 0;

		if (stop != NULL) {
			startCh = stop[0];
			endOfStopString = coco_string_length(stop)-1;
		}

		fwscanf(fram, L"%lc", &ch); //	fram.ReadByte();
		while (!feof(fram)) { // ch != EOF
			if (stop != NULL && ch == startCh) {
				int i = 0;
				do {
					if (i == endOfStopString) return; // stop[0..i] found
					fwscanf(fram, L"%lc", &ch); i++;
				} while (ch == stop[i]);
				// stop[0..i-1] found; continue with last read character
				if (generateOutput) {
					wchar_t *subStop = coco_string_create(stop, 0, i);
					fwprintf(gen, L"%ls", subStop);
					coco_string_delete(subStop);
				}
			} else {
				if (generateOutput) { fwprintf(gen, L"%lc", ch); }
				fwscanf(fram, L"%lc", &ch);
			}
		}
		if (stop != NULL) {
			wchar_t *message = coco_string_create_append(L" -- Incomplete or corrupt frame file: ", frameFile);
			errors->Exception(message);
			delete [] message;
		}
	}
static void good1()
{
    {
        wchar_t oldPassword[256];
        wchar_t newPassword[256];
        NET_API_STATUS status;
        printWLine(L"Enter old password: "******"%255s", oldPassword) != 1)
        {
            oldPassword[0] = L'\0';
        }
        printWLine(L"Enter new password: "******"%255s", newPassword) != 1)
        {
            newPassword[0] = L'\0';
        }
        /* FIX: Verify the old password when setting the new password */
        status = NetUserChangePassword(NULL, USERNAME, oldPassword, newPassword);
        if(status == NERR_Success)
        {
            printWLine(L"Success!");
        }
        else
        {
            wprintf(L"NetUserChangePassword failed.  Status = %u = 0x%x\n", status, status);
        }
    }
}
int main(){
	FILE *fin=fopen("phone.cin","r");
	FILE *fout;
	
	char file[100];
	wchar_t str[100];
	
	for(int i=0;i<26045;i++){
		fwscanf(fin,L"%S",str);
		sprintf(file,"_%s_",str);
		
		for(int i=0;file[i];i++)
			if(file[i]=='/')
				file[i]='=';

		fwscanf(fin,L"%s",str);
		
		fout=fopen(file,"a");
		fwprintf(fout,L"%s",str);
		fclose(fout);
	}
	
	fclose(fin);
	
	return 0;
}
Beispiel #4
0
void find_unique_chars()
	{
	wchar_t s[1024];

	wprintf(L"Finding unique characters...\n");

	FILE *fp1;
	if((fp1 = fopen("/home/yky/NetBeansProjects/conceptual-keyboard/training-set.txt", "r")) == NULL)
		{ printf("cannot open training-set.txt\n"); exit(1); }

	while (fwscanf(fp1, L"%S", s) > 0) {
		wprintf(s);
		wprintf(L"\n");
		addInChars(s);

		fwscanf(fp1, L"%S", s);
		wprintf(s);
		wprintf(L"\n");
		addOutChars(s);
		}

	fclose(fp1);

	wprintf(inChars);
	wprintf(L"\n");
	wprintf(outChars);
	wprintf(L"\n");
	}
Beispiel #5
0
/**
 * 从文件读取数据
 */
void readFile()
{
	FILE *fp = _wfopen(FILE_PATH, L"r,ccs=UNICODE");
	if(!fp)
		return;
	for (int courseIndex = 0; courseIndex < Course_LENGTH; ++courseIndex)
	{
		if(feof(fp))
			break;
		Char buffer[16];
		for (int dayIndex = 0; dayIndex < DAY_LENGTH; ++dayIndex)
		{
			Course* &course = courses[courseIndex][dayIndex];
			fwscanf(fp, L"%s", buffer);
			if (*buffer != Course::Null)
			{
				if(!course)
					course = new Course;
				course->setTitle(buffer);
				fwscanf(fp, L"%s%s%d%d", course->classRoom, course->teacher, 
					&course->startWeek, &course->endWeek);
				updateCell(course, courseIndex, dayIndex);
			}
		}
	}
	fclose(fp);
}
Beispiel #6
0
vec2Di::vec2Di(const wchar_t* file) : m_width(0), m_height(0)
{
        int val;

        FILE* fp = _wfopen(file, L"rt");
        if (fp) {
                if (fwscanf(fp, L"%d %d", &m_height, &m_width) != 2) {
                        fclose(fp);
                        init(1, 1);
                        return;
                }

                init(m_height, m_width);

                for (unsigned int y = 0; y < height(); y++) {
                        for (unsigned int x = 0; x < width(); x++) {
                                if (fwscanf(fp, L"%d", &val) != 1) {
                                        m_data[y][x] = 0;
                                } else
                                        m_data[y][x] = val;
                        }
                }

                fclose(fp);
        } else {
                init(1, 1);
                set(0);
        }
}
Beispiel #7
0
static int
do_test (void)
{
  FILE *fptr;
  char arg1;
  char arg2;
  int ret1, ret2, result, num;

  ret1 = 0;
  ret2 = 0;

  fptr = fdopen (fd, "w+");
  if (fptr == NULL)
    {
      printf ("Unable to open file.\n");
      return 1;
    }

  if (fwprintf (fptr, L"cderf") <= 0)
    {
      printf ("Unable to write to file with fwprintf().\n");
      fclose (fptr);
      return 2;
    }

  rewind (fptr);
  ret1 = fwscanf (fptr, L"%c%c", &arg1, &arg2);
  if (ret1 != 2)
    {
      printf ("first fwscanf returned %d, expected 2\n", ret1);
      return 3;
    }

  rewind (fptr);
  ret2 = fwscanf (fptr, L"%c%n%c", &arg1, &num, &arg2);
  if (ret2 != 2)
    {
      printf ("second fwscanf returned %d, expected 2\n", ret2);
      return 4;
    }

  if (arg2 != 'd')
    {
      result = FAILED;
      printf ("rewind after first fwscanf failed\n");
    }
  else
    {
      printf ("Passed\n");
      result = PASSED;
    }


  fclose (fptr);
  return result;
}
//readfromfile modifies the given board to make it like board stored in file, and returns a char indicating the player to play
char readfromfile(board *b, char *filename) {
	int i, j;
	FILE *fp = fopen(filename, "r+");
	if (fp == NULL)
		return -1;
	char player;
	fwscanf(fp, L"%d", &player);
	for(i = c_8; i <= c_1; i++)
		for(j = c_a; j <= c_h; j++) 
			fwscanf(fp, L"%lc%d",&b->sq[i][j].piece, &b->sq[i][j].info);
	fclose(fp);
	return player;
}
Beispiel #9
0
int _CRTAPI1  Zfwscanf (FILE* Arg1,const wchar_t* Arg2, DWORD64ARGS)
{

    int RetVal;

    SHORT sTimerHandle;
    ULONG ulElapsedTime;

    if (fInitDone == FALSE) {
        ApfInitDll();
    }
    TimerOpen(&sTimerHandle, MICROSECONDS);
    TimerInit(sTimerHandle);
    //
    // Call the api
    //
    RetVal = fwscanf(Arg1,Arg2, ARGS64);
    //
    // Get the elapsed time
    //
    ulElapsedTime = TimerRead(sTimerHandle);
    ApfRecordInfo(I_fwscanf, ulElapsedTime - ApfData[I_CALIBRATE].ulFirstTime);
    TimerClose(sTimerHandle);

    return(RetVal);
}
Beispiel #10
0
int main()
{
    int c,i;
    wchar_t s[100];
    FILE *fil = fopen("hi.txt","w+");
    printf("%d\n",fwide(fil,0));
    fputwc(L'c',fil);
    fputws(L"hi dave\n",fil);
    fwprintf(fil,L"%ls\n",L"geez");
    printf("%d\n",fwide(fil,0));
    printf("%d\n",fputc('z',fil));
    printf("%d\n",fwide(fil,-1));
    printf("%d\n",fputc('y',fil));
    printf("%d\n",fputc('y',fil));
    rewind(fil);
    printf("%d\n",fwide(fil,1));
    printf("%04x\n",fgetwc(fil));
    printf("%04x\n",fgetwc(fil));
    printf(":%x: ",fgetws(s,100,fil));
    for (i=0; i <wcslen(s); i++)
        printf("%04x ",s[i]);
    printf("\n");
    fwscanf(fil,L"%ls ",s);
    for (i=0; i <wcslen(s); i++)
        printf("%04x ",s[i]);
    printf("\n");
    printf("%d\n",fwide(fil,-1));
    printf("%02x\n",fgetc(fil));
    fclose(fil);
}
void CWE620_Unverified_Password_Change__w32_05_bad()
{
    if(staticTrue)
    {
        {
            wchar_t newPassword[256];
            USER_INFO_1003 myUserInfo;
            NET_API_STATUS status;
            myUserInfo.usri1003_password = newPassword;
            printWLine(L"Enter new password: "******"%255s", myUserInfo.usri1003_password) != 1)
            {
                myUserInfo.usri1003_password[0] = L'\0';
            }
            /* FLAW: Set password without verifying the old one */
            status = NetUserSetInfo(NULL, USERNAME, 1003, (LPBYTE)&myUserInfo, NULL);
            if(status == NERR_Success)
            {
                printWLine(L"Success!");
            }
            else
            {
                wprintf(L"NetUserSetInfo failed.  Status = %u = 0x%x\n", status, status);
            }
        }
    }
}
Beispiel #12
0
acr_index* TextParser::Parse()
{
	fseek(fin, 2, SEEK_SET); //pass BOM

	ulong offset;
	ulong num;
	char *str;
	static wchar_t text[512] = {0};

	acr_index cur;
	ulong pos = 0;
	//重写此处以适应不同格式文本
	while (fwscanf(fin, L"○%08X○%08d●\r\n%s\r\n\r\n", &offset, &num, text) == 3)
	{
		int len = wstrlen(text);

		memcpy(real_data + pos, text, len);
		memset(real_data + pos + len, 0, 2); //其他游戏需要根据情况适当修改

		cur.hash = offset;
		cur.new_str_len = len;
		cur.new_str_off = (ulong)real_data + pos;
		cur.old_str_len = len; //这两个暂时先这样
		cur.old_str_off = (ulong)real_data + pos; //这两个暂时先这样

		index.push_back(cur);
		pos += (len+2);
	}

	return (acr_index*)&index[0];
}
Beispiel #13
0
int wscanf(const wchar_t* format, ... ) {
  va_list args;
  va_start (args, format);
  int result = fwscanf(stdout, format, args );
  va_end (args);
  return result;
}
Beispiel #14
0
int main(int argc, char **argv) {
  setlocale(LC_CTYPE, "en_US.utf8");
  int glyphCounts = 0, j = 0, k = 0, i = 0;
  const wchar_t letters[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

  FILE *fp = fopen ("cj5_ergonomic.cin", "r");
  wchar_t glyph = L' ';  
  wchar_t *cangjie = malloc(sizeof(wchar_t));
  wchar_t *cangjie_old = malloc(sizeof(wchar_t));;
  
  while (fwscanf(fp, L"%ls %lc\n", cangjie, &glyph) != WEOF) {
    if (wcscmp(cangjie_old, cangjie)) {
      printf("\n%ls %lc", cangjie, glyph);
    } else {
      printf(" %lc", glyph);
    }
    wcscpy(cangjie_old, cangjie);
    /* cangjie_counts = realloc(cangjie_counts, dataCounts*sizeof(int)); */
    /* cangjie_counts[dataCounts-1] = wcslen(cangjie);  */
    /* glyphs = (wchar_t *) realloc(glyphs, dataCounts*sizeof(wchar_t)); */
    /* cangjies = realloc(cangjies, dataCounts*sizeof(wchar_t*));  */
    /* cangjies[dataCounts-1] = malloc((wcslen(cangjie))*sizeof(wchar_t)); */
    /* glyphs[dataCounts-1] = str4; */
  }
  fclose(fp);
  return 0;
}
Beispiel #15
0
static int uread_number (lua_State *L, FILE *f) {
  lua_Number d;
  if (fwscanf(f, LUA_NUMBER_WSCAN, &d) == 1) {
    lua_pushnumber(L, d);
    return 1;
  }
  else return 0;  /* read fails */
}
Beispiel #16
0
int							isNodeChangedFileExists(cluster_group_t *pGroupClust)
{
	FILE					*fp;
	
	if ((fp = _wfopen(pGroupClust->nodeChangedFilePath, L"r")) == NULL)
		return I_FALSE;
	fwscanf(fp, L"%512s", pGroupClust->oldNodeName);
	fclose(fp);
	return I_TRUE;
}
Beispiel #17
0
void adaugareCuvinte(){
	FILE *fin = fopen("date.txt", "r");
	while (!feof(fin)){
		fwscanf(fin, L"%ls", obiecte);
		adaugaretree(obiecte);
	}
	fclose(fin);
	
	
	
}
void smbtree_search(BTree* tree, FILE* file)
{
  wchar_t* entryWord = malloc(STRING_SIZE * sizeof(wchar_t));

  while (fwscanf(file, L"%ls", entryWord) != EOF)
  {
    if (entryWord[0] == L'\"')
      searchMultipleWord(file, tree, entryWord);
    else
      searchSingleWord(tree, entryWord);
  }

  free(entryWord);
}
/* good1() uses if(staticFalse) instead of if(staticTrue) */
static void good1()
{
    if(staticFalse)
    {
        /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
        printLine("Benign, fixed string");
    }
    else
    {
        {
            wchar_t oldPassword[256];
            wchar_t newPassword[256];
            NET_API_STATUS status;
            printWLine(L"Enter old password: "******"%255s", oldPassword) != 1)
            {
                oldPassword[0] = L'\0';
            }
            printWLine(L"Enter new password: "******"%255s", newPassword) != 1)
            {
                newPassword[0] = L'\0';
            }
            /* FIX: Verify the old password when setting the new password */
            status = NetUserChangePassword(NULL, USERNAME, oldPassword, newPassword);
            if(status == NERR_Success)
            {
                printWLine(L"Success!");
            }
            else
            {
                wprintf(L"NetUserChangePassword failed.  Status = %u = 0x%x\n", status, status);
            }
        }
    }
}
/* good2() reverses the bodies in the if statement */
static void good2()
{
    if(STATIC_CONST_FIVE==5)
    {
        {
            /* By initializing dataBuffer, we ensure this will not be the
             * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgetws() and other variants */
            wchar_t dataBuffer[100] = L"";
            wchar_t * data = dataBuffer;
            /* FIX: check for the correct return value */
            if (fwscanf(stdin, L"%99s\0", data) == EOF)
            {
                printLine("fwscanf failed!");
            }
        }
    }
}
void CWE253_Incorrect_Check_of_Function_Return_Value__wchar_t_fscanf_06_bad()
{
    if(STATIC_CONST_FIVE==5)
    {
        {
            /* By initializing dataBuffer, we ensure this will not be the
             * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgetws() and other variants */
            wchar_t dataBuffer[100] = L"";
            wchar_t * data = dataBuffer;
            /* FLAW: fwscanf() might fail, in which case the return value will be EOF (-1), but
             * we are checking to see if the return value is 0 */
            if (fwscanf(stdin, L"%99s\0", data) == 0)
            {
                printLine("fwscanf failed!");
            }
        }
    }
}
Beispiel #22
0
int								loadNodeName(LPWSTR nodeName, LPWSTR groupName)
{
	FILE						*fp;
	static TCHAR				lpPath[BUFFER_SIZE];
	
	if (getTempPath((LPWSTR)lpPath) == 0)
		fatalError(ERROR_GETTING_TEMP_PATH);		
	wcscat((LPWSTR)lpPath, SAVE_NODE_FILENAME);
	wcscat((LPWSTR)lpPath, groupName);
	wcscat((LPWSTR)lpPath, SAVE_NODE_FILENAME_EXTENSION);
	if ((fp = _wfopen(lpPath, L"r")) == NULL)
	{
		warnError(L"Warning : can't open %s.", lpPath);
		return 0;
	}
	fwscanf(fp, L"%512s", nodeName );
	fclose(fp);
	return 1;
}
Beispiel #23
0
INT_PTR CALLBACK Raspuns(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	//HBITMAP bmp1;///////////
	//HBITMAP bmp2;
	UNREFERENCED_PARAMETER(lParam);
	switch (message)
	{


	case WM_INITDIALOG:{
						   ////GetDlgItem(hDlg, IDC_EDIT1)
						   
						   //HBITMAP hImage = (HBITMAP)LoadImage(NULL, L"cumsejoaca.bmp", IMAGE_BITMAP, 500, 460, LR_LOADFROMFILE);
						   //HWND hImageView = CreateWindowEx(NULL, L"STATIC", NULL, SS_BITMAP | WS_VISIBLE | WS_CHILD, 0, 0, 500, 600, hDlg, (HMENU)IMAGE_VIEW, GetModuleHandle(NULL), NULL);
						   //SendMessage(hImageView, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hImage);
						  // SendMessage(GetDlgItem(hDlg, IDC_LIST3), LB_ADDSTRING, 0, (LPARAM)string2);
					//lista de cuvinte corecte
						   FILE *fin = fopen("date.txt", "r");
						   while (!feof(fin)){
							   fwscanf(fin, L"%ls", string2);
							   SendMessage(GetDlgItem(hDlg, IDC_LIST3), LB_ADDSTRING, 0, (LPARAM)string2);
						   }
						   fclose(fin);
					//lista de cuvinte corecte_end
						   return (INT_PTR)TRUE;

	}break;



	case WM_COMMAND:
		if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
		{
			//SetFocus(HWND(IDOK1))
			//SetWindowText(GetDlgItem(hDlg, IDC_EDIT1), L"MIHAI");
			//SetWindowText(GetDlgItem(hDlg, IDC_EDIT3), L"MIHAI noifacnonuac uiea u avuohouc houa \\n petre midhaifean ofieanoifnaoincofa oinceaonf ocuanuoeacwonu iu bciua icgeiag ieagiyb diya ydivayvdiyaw vdyiaw vyidva wyivdywie vyiawdv yiwv yid waviyvd ayis vyid vayid vweiy vyidav siydv aiywev aiywe v");
			EndDialog(hDlg, LOWORD(wParam));
			return (INT_PTR)TRUE;
		}
		break;
	}
	return (INT_PTR)FALSE;
}
void smbtree_fscanf(BTree* tree, FILE* file, char* url)
{
  wchar_t* entryWord = malloc(STRING_SIZE * sizeof(wchar_t));
  int pos=1;

  while(fwscanf(file,L"%ls",entryWord) != EOF)
  {
    preprocessador(entryWord);

    if(wcslen(entryWord)!=0)
    {
      char* word = malloc(STRING_SIZE * sizeof(char));
      wcstombs(word, entryWord, STRING_SIZE);
      updateTree(tree, word, pos, url);//INSERIR PALAVRA NA ARVORE
    }
      pos++;
  }

  free(entryWord);
}
int main (int argc, char** argv) {
  setlocale(LC_CTYPE, "en_US.utf8");
  wchar_t k1 = L' ';
  wchar_t k2 = L' ';
  wchar_t *s1 = malloc (sizeof(wchar_t));
  wchar_t *s2 = malloc (sizeof(wchar_t)); 
  FILE *fp = fopen ("cj5_ergonomic.cin", "r");
  FILE *fpw = fopen ("cj5input_dvorak_ergonomic.el", "w");
  printf("(\"");
  while(fwscanf (fp, L"%ls %lc\n", s1, &k1) != WEOF) {    
    if (wcscmp (s1, s2) == 0) {
      fprintf(fpw, "%lc", k1);
    } else {
      fprintf(fpw, "\")\n(\"%ls\" \"%lc", s1, k1);
      wcscpy (s2, s1);
    }
  }
  fclose (fp);
  fclose (fpw);
  return 0;
}
/* good1() uses if(STATIC_CONST_FIVE!=5) instead of if(STATIC_CONST_FIVE==5) */
static void good1()
{
    if(STATIC_CONST_FIVE!=5)
    {
        /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
        printLine("Benign, fixed string");
    }
    else
    {
        {
            /* By initializing dataBuffer, we ensure this will not be the
             * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgetws() and other variants */
            wchar_t dataBuffer[100] = L"";
            wchar_t * data = dataBuffer;
            /* FIX: check for the correct return value */
            if (fwscanf(stdin, L"%99s\0", data) == EOF)
            {
                printLine("fwscanf failed!");
            }
        }
    }
}
Beispiel #27
0
static int
do_test (void)
{
  wchar_t dummy[10];
  int ret = 0;
  FILE *fp;
  int result = 0;

  fp = fdopen (fd, "w+");
  if (fp == NULL)
    {
      puts ("fopen(""testfile"", ""w+"") returned NULL.");
      return 1;
    }
  else
    {
      fwprintf (fp, L"abcd");
      printf ("current pos = %ld\n", ftell (fp));
      if (ftell (fp) != 4)
	result = 1;

      rewind (fp);
      ret = fwscanf (fp, L"%c", dummy);

      printf ("current pos = %ld\n", ftell (fp));
      if (ftell (fp) != 1)
	result = 1;

      rewind (fp);
      printf ("current pos = %ld\n", ftell (fp));
      if (ftell (fp) != 0)
	result = 1;

      fclose (fp);
    }

  return result;
}
void CWE253_Incorrect_Check_of_Function_Return_Value__wchar_t_fscanf_15_bad()
{
    switch(6)
    {
    case 6:
    {
        /* By initializing dataBuffer, we ensure this will not be the
         * CWE 690 (Unchecked Return Value To NULL Pointer) flaw for fgetws() and other variants */
        wchar_t dataBuffer[100] = L"";
        wchar_t * data = dataBuffer;
        /* FLAW: fwscanf() might fail, in which case the return value will be EOF (-1), but
         * we are checking to see if the return value is 0 */
        if (fwscanf(stdin, L"%99s\0", data) == 0)
        {
            printLine("fwscanf failed!");
        }
    }
    break;
    default:
        /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
        printLine("Benign, fixed string");
        break;
    }
}
Beispiel #29
0
/////////////////////////constructors/destructors////////////////////////////////////////////////////
SVMachine::SVMachine(const wchar_t* fname): m_status(-1),
                m_svmParam(0), m_bias(0), m_dimension(0), m_svsNum(0),
                m_scalar(0), m_xInput(0), m_rbfSub(0)
{
        wchar_t type[TYPESIZE];
        int res = 0;

        FILE* fp = _wfopen(fname, L"rt");
        if (fp) {
                if ((res = fwscanf(fp, L"%d %d %256s", &m_dimension, &m_svsNum, type)) != 3) {
                        m_status = -2;
                        fclose(fp);
                        return;
                }

                if (wcscmp(type, L"linear") == 0) {
                        m_svmType = LINEAR;
                } else if (wcscmp(type, L"rbf") == 0) {
                        m_svmType = RBF;

                        if ((res = fwscanf(fp, L"%lg", &m_svmParam)) != 1) {
                                m_status = -3;
                                fclose(fp);
                                return;
                        }
                } else if (wcscmp(type, L"polynomial") == 0) {
                        m_svmType = POLY;

                        if ((res = fwscanf(fp, L"%lg", &m_svmParam)) != 1) {
                                m_status = -3;
                                fclose(fp);
                                return;
                        }
                }
                else {
                        m_status = -4;
                        return;
                }

                if ((res = fwscanf(fp, L"%lg", &m_bias)) != 1) {
                        m_status = -5;
                        fclose(fp);
                        return;
                }

                m_weights.resize(m_svsNum);

                //read support vectors
                for (unsigned int s = 0; s < m_svsNum; s++) {
                        //read w
                        if ((res = fwscanf(fp, L"%lg", &m_weights[s])) != 1) {
                                m_status = -6;
                                fclose(fp);
                                return;
                        }

                        class vec2D* sv = new vec2D(1, m_dimension);
                        m_svs.push_back(sv);
                        for (unsigned int i = 0; i < m_dimension; i++) {
                                if ((res = fwscanf(fp, L"%g", &(*sv)(0, i))) != 1) {
                                        m_status = -7;
                                        fclose(fp);
                                        return;
                                }
                        }
                }

                m_scalar = new vec2D(1, 1);
                m_xInput = new vec2D(1, m_dimension);
                m_rbfSub = new vec2D(1, m_dimension);

                m_status = 0;
                fclose(fp);
        }
}
Beispiel #30
0
int main()
{
    mbstate_t mb = {0};
    size_t s = 0;
    tm tm = {0};
    wint_t w = 0;
    ::FILE* fp = 0;
    __darwin_va_list va;
    char* ns = 0;
    wchar_t* ws = 0;
    static_assert((std::is_same<decltype(fwprintf(fp, L"")), int>::value), "");
    static_assert((std::is_same<decltype(fwscanf(fp, L"")), int>::value), "");
    static_assert((std::is_same<decltype(swprintf(ws, s, L"")), int>::value), "");
    static_assert((std::is_same<decltype(swscanf(L"", L"")), int>::value), "");
    static_assert((std::is_same<decltype(vfwprintf(fp, L"", va)), int>::value), "");
    static_assert((std::is_same<decltype(vfwscanf(fp, L"", va)), int>::value), "");
    static_assert((std::is_same<decltype(vswprintf(ws, s, L"", va)), int>::value), "");
    static_assert((std::is_same<decltype(vswscanf(L"", L"", va)), int>::value), "");
    static_assert((std::is_same<decltype(vwprintf(L"", va)), int>::value), "");
    static_assert((std::is_same<decltype(vwscanf(L"", va)), int>::value), "");
    static_assert((std::is_same<decltype(wprintf(L"")), int>::value), "");
    static_assert((std::is_same<decltype(wscanf(L"")), int>::value), "");
    static_assert((std::is_same<decltype(fgetwc(fp)), wint_t>::value), "");
    static_assert((std::is_same<decltype(fgetws(ws, 0, fp)), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(fputwc(L' ', fp)), wint_t>::value), "");
    static_assert((std::is_same<decltype(fputws(L"", fp)), int>::value), "");
    static_assert((std::is_same<decltype(fwide(fp, 0)), int>::value), "");
    static_assert((std::is_same<decltype(getwc(fp)), wint_t>::value), "");
    static_assert((std::is_same<decltype(getwchar()), wint_t>::value), "");
    static_assert((std::is_same<decltype(putwc(L' ', fp)), wint_t>::value), "");
    static_assert((std::is_same<decltype(putwchar(L' ')), wint_t>::value), "");
    static_assert((std::is_same<decltype(ungetwc(L' ', fp)), wint_t>::value), "");
    static_assert((std::is_same<decltype(wcstod(L"", (wchar_t**)0)), double>::value), "");
    static_assert((std::is_same<decltype(wcstof(L"", (wchar_t**)0)), float>::value), "");
    static_assert((std::is_same<decltype(wcstold(L"", (wchar_t**)0)), long double>::value), "");
    static_assert((std::is_same<decltype(wcstol(L"", (wchar_t**)0, 0)), long>::value), "");
    static_assert((std::is_same<decltype(wcstoll(L"", (wchar_t**)0, 0)), long long>::value), "");
    static_assert((std::is_same<decltype(wcstoul(L"", (wchar_t**)0, 0)), unsigned long>::value), "");
    static_assert((std::is_same<decltype(wcstoull(L"", (wchar_t**)0, 0)), unsigned long long>::value), "");
    static_assert((std::is_same<decltype(wcscpy(ws, L"")), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wcsncpy(ws, L"", s)), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wcscat(ws, L"")), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wcsncat(ws, L"", s)), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wcscmp(L"", L"")), int>::value), "");
    static_assert((std::is_same<decltype(wcscoll(L"", L"")), int>::value), "");
    static_assert((std::is_same<decltype(wcsncmp(L"", L"", s)), int>::value), "");
    static_assert((std::is_same<decltype(wcsxfrm(ws, L"", s)), size_t>::value), "");
    static_assert((std::is_same<decltype(wcschr((wchar_t*)0, L' ')), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wcscspn(L"", L"")), size_t>::value), "");
    static_assert((std::is_same<decltype(wcslen(L"")), size_t>::value), "");
    static_assert((std::is_same<decltype(wcspbrk((wchar_t*)0, L"")), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wcsrchr((wchar_t*)0, L' ')), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wcsspn(L"", L"")), size_t>::value), "");
    static_assert((std::is_same<decltype(wcsstr((wchar_t*)0, L"")), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wcstok(ws, L"", (wchar_t**)0)), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wmemchr((wchar_t*)0, L' ', s)), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wmemcmp(L"", L"", s)), int>::value), "");
    static_assert((std::is_same<decltype(wmemcpy(ws, L"", s)), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wmemmove(ws, L"", s)), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wmemset(ws, L' ', s)), wchar_t*>::value), "");
    static_assert((std::is_same<decltype(wcsftime(ws, s, L"", &tm)), size_t>::value), "");
    static_assert((std::is_same<decltype(btowc(0)), wint_t>::value), "");
    static_assert((std::is_same<decltype(wctob(w)), int>::value), "");
    static_assert((std::is_same<decltype(mbsinit(&mb)), int>::value), "");
    static_assert((std::is_same<decltype(mbrlen("", s, &mb)), size_t>::value), "");
    static_assert((std::is_same<decltype(mbrtowc(ws, "", s, &mb)), size_t>::value), "");
    static_assert((std::is_same<decltype(wcrtomb(ns, L' ', &mb)), size_t>::value), "");
    static_assert((std::is_same<decltype(mbsrtowcs(ws, (const char**)0, s, &mb)), size_t>::value), "");
    static_assert((std::is_same<decltype(wcsrtombs(ns, (const wchar_t**)0, s, &mb)), size_t>::value), "");
}