• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Pause函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Pause函数的典型用法代码示例。如果您正苦于以下问题:C++ Pause函数的具体用法?C++ Pause怎么用?C++ Pause使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了Pause函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ViewFile

/*
 * View a file in the current area, menu 103.
 * If a file name is given, display direct,
 * else ask for filename to view.
 */
void ViewFile(char *name)
{
    char    *File, *temp, *arc;
    int	    count, total, rc, found = FALSE;
    FILE    *fp;
    struct _fdbarea *fdb_area = NULL;

    Syslog('+', "ViewFile(%s)", printable(name, 0));

    if (Access(exitinfo.Security, area.LTSec) == FALSE) {
	Enter(1);
	/* You don't have enough security to list this area */
	pout(YELLOW, BLACK, (char *) Language(236));
	Enter(2);
	Pause();
	return;
    }

    File = calloc(PATH_MAX, sizeof(char));

    if ((name != NULL) && strlen(name)) {
	strcpy(File, name);
    } else {
	Enter(2);
	/* Please enter filename: */
	pout(YELLOW, BLACK, (char *) Language(245));
	colour(CFG.InputColourF, CFG.InputColourB);
	GetstrC(File, 80);

	if ((strcmp(File, "")) == 0) {
	    free(File);
	    return;
	}
	
	if (*(File) == '.' || *(File) == '*' || *(File) == ' ' || *(File) == '/') {
	    Enter(1);
	    /* Illegal Filename! */
	    pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
	    Enter(2);
	    Pause();
	    free(File);
	    return;
	}

	Strlen = strlen(File);
	Strlen--;

	if (*(File + Strlen) == '.' || *(File + Strlen) == '/' || *(File + Strlen) == ' ') {
	    Enter(1);
	    /* Illegal Filename! */
	    pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
	    Enter(2);
	    Pause();
	    free(File);
	    return;
	}

	if ((!strcmp(File, "files.bbs")) || (!strcmp(File, "00index")) || (strstr(File, (char *)".html"))) {
	    Enter(1);
	    /* Illegal Filename! */
	    pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(247));
	    Enter(2);
	    Pause();
	    free(File);
	    return;
	}
    }

    /*
     * Now check if this file is present
     */
    if ((fdb_area = mbsedb_OpenFDB(iAreaNumber, 30)) == NULL) {
	free(File);
	return;
    }

    while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
	if (((strcasecmp(File, fdb.Name) == 0) || (strcasecmp(File, fdb.LName) == 0)) && (!fdb.Deleted)) {
	    found = TRUE;
	    break;
	}
    }
    mbsedb_CloseFDB(fdb_area);

    if (!found) {
	Enter(1);
	/* File does not exist, please try again ... */
	pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(296));
	Enter(2);
	free(File);
	Pause();
	return;
    }

    snprintf(File, PATH_MAX, "%s/%s", sAreaPath, fdb.LName);
//.........这里部分代码省略.........
开发者ID:bbs-io,项目名称:mbse,代码行数:101,代码来源:file.c


示例2: GetWindowInfo

void CRenderDevice::End		(void)
{
#ifndef DEDICATED_SERVER

	//	Moved to m_pRenderEnd()
	//VERIFY	(HW.pDevice);

	//if (HW.Caps.SceneMode)	overdrawEnd		();

	// 
#ifdef INGAME_EDITOR
	bool							load_finished = false;
#endif // #ifdef INGAME_EDITOR
	if (dwPrecacheFrame)
	{
		::Sound->set_master_volume	(0.f);
		dwPrecacheFrame	--;
		pApp->load_draw_internal	();
		if (0==dwPrecacheFrame)
		{

#ifdef INGAME_EDITOR
			load_finished			= true;
#endif // #ifdef INGAME_EDITOR
			//Gamma.Update		();
			m_pRender->updateGamma();

			if(precache_light) precache_light->set_active	(false);
			if(precache_light) precache_light.destroy		();
			::Sound->set_master_volume						(1.f);
			pApp->destroy_loading_shaders					();

			m_pRender->ResourcesDestroyNecessaryTextures	();
			Memory.mem_compact								();
			Msg												("* MEMORY USAGE: %d K",Memory.mem_usage()/1024);
			Msg												("* End of synchronization A[%d] R[%d]",b_is_Active, b_is_Ready);

#ifdef FIND_CHUNK_BENCHMARK_ENABLE
			g_find_chunk_counter.flush();
#endif // FIND_CHUNK_BENCHMARK_ENABLE

			CheckPrivilegySlowdown							();
			
			if(g_pGamePersistent->GameType()==1)//haCk
			{
				WINDOWINFO	wi;
				GetWindowInfo(m_hWnd,&wi);
				if(wi.dwWindowStatus!=WS_ACTIVECAPTION)
					Pause(TRUE,TRUE,TRUE,"application start");
			}
		}
	}

	g_bRendering		= FALSE;
	// end scene
	//	Present goes here, so call OA Frame end.
	if (g_SASH.IsBenchmarkRunning())
		g_SASH.DisplayFrame(Device.fTimeGlobal);
	m_pRender->End();
	//RCache.OnFrameEnd	();
	//Memory.dbg_check		();
    //CHK_DX				(HW.pDevice->EndScene());

	//HRESULT _hr		= HW.pDevice->Present( NULL, NULL, NULL, NULL );
	//if				(D3DERR_DEVICELOST==_hr)	return;			// we will handle this later
	//R_ASSERT2		(SUCCEEDED(_hr),	"Presentation failed. Driver upgrade needed?");
#	ifdef INGAME_EDITOR
		if (load_finished && m_editor)
			m_editor->on_load_finished	();
#	endif // #ifdef INGAME_EDITOR
#endif
}
开发者ID:Charsi82,项目名称:xray-1.5.10-2015-,代码行数:72,代码来源:device.cpp


示例3: StreamPause

static HRESULT StreamPause( aout_stream_t *s, bool pause )
{
    return Pause( s->sys, pause );
}
开发者ID:etix,项目名称:vlc,代码行数:4,代码来源:directsound.c


示例4: PlayLaserGame


//.........这里部分代码省略.........
		/* Draw cities: */
      
		if (frame%2 == 0) NEXT_FRAME(shield);
		for (i = 0; i < NUM_CITIES; i++) {

			/* Decide which image to display: */
	 
			if (cities[i].alive) {
				if (cities[i].expl == 0)
					img = IMG_CITY_BLUE;
				else
					img = (IMG_CITY_BLUE_EXPL5 - (cities[i].expl / (CITY_EXPL_START / 5)));
			} else 
				img = IMG_CITY_BLUE_DEAD;
	  
	  
			/* Change image to appropriate color: */
	  
			img += ((wave % MAX_CITY_COLORS) * (IMG_CITY_GREEN - IMG_CITY_BLUE));
	  
	  
			/* Draw it! */
	  
			dest.x = cities[i].x - (images[img]->w / 2);
			dest.y = (screen->h) - (images[img]->h);
			dest.w = (images[img]->w);
			dest.h = (images[img]->h);
	  
			SDL_BlitSurface(images[img], NULL, screen, &dest);

			/* Draw sheilds: */

			if (cities[i].shields) {

				dest.x = cities[i].x - (shield->frame[shield->cur]->w / 2);
				dest.h = (screen->h) - (shield->frame[shield->cur]->h);
				dest.w = src.w;
				dest.h = src.h;
				SDL_BlitSurface( shield->frame[shield->cur], NULL, screen, &dest);

			}
		}


		/* Draw laser: */

		if (laser.alive)
			laser_draw_line(laser.x1, laser.y1, laser.x2, laser.y2, 255 / (LASER_START - laser.alive),
			                192 / (LASER_START - laser.alive), 64);

		laser_draw_console_image(IMG_CONSOLE);

		if (gameover > 0)
			tux_img = IMG_TUX_FIST1 + ((frame / 2) % 2);

		laser_draw_console_image(tux_img);


		/* Draw "Game Over" */

		if (gameover > 0) {

			dest.x = (screen->w - images[IMG_GAMEOVER]->w) / 2;
			dest.y = (screen->h - images[IMG_GAMEOVER]->h) / 2;
			dest.w = images[IMG_GAMEOVER]->w;
			dest.h = images[IMG_GAMEOVER]->h;
	
			SDL_BlitSurface(images[IMG_GAMEOVER], NULL, screen, &dest);
		}
      
      
		/* Swap buffers: */
      
		SDL_Flip(screen);


		/* If we're in "PAUSE" mode, pause! */

		if (paused) {
			quit = Pause();
			paused = 0;
		}

      
		/* Keep playing music: */
      
		if (settings.sys_sound && !Mix_PlayingMusic())
			MusicPlay(musics[MUS_GAME + (rand() % NUM_MUSICS)], 0);
      
		/* Pause (keep frame-rate event) */
                DEBUGCODE
                {
                  fprintf(stderr, "now_time = %d\tlast_time = %d, elapsed time = %d\n",
                          now_time, last_time, now_time - last_time);
                }

		now_time = SDL_GetTicks();
		if (now_time < last_time + FPS)
			SDL_Delay(last_time + FPS - now_time);
	}
开发者ID:aarshkshah1992,项目名称:tuxtype,代码行数:101,代码来源:laser.c


示例5: Pause

void
AnimationPlayer::PauseFromJS()
{
  Pause(eUpdateStyle);
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:5,代码来源:AnimationPlayer.cpp


示例6: TEST_F

TEST_F(BoundedQueueTest, EnqueuePauseProducerWhenQueueIsFull){
  EXPECT_CALL(producer, Pause());
  q.enqueue(4);
  q.enqueue(4);
  q.enqueue(4);
}
开发者ID:yohei1126,项目名称:boundedqueue,代码行数:6,代码来源:BoundedQueueTest.cpp


示例7: File_List

/*
 * Show filelist from current area, called from the menu.
 */
void File_List()
{
    int		    FileCount = 0;
    unsigned	    FileBytes = 0;
    _Tag	    T;
    struct _fdbarea *fdb_area = NULL;
    char	    temp[81];

    iLineCount = 0;
    WhosDoingWhat(FILELIST, NULL);

    Syslog('+', "Listing File Area # %d", iAreaNumber);

    if (Access(exitinfo.Security, area.LTSec) == FALSE) {
	Enter(1);
	/* You don't have enough security to list this area */
	pout(YELLOW, BLACK, (char *) Language(236));
	Enter(2);
	Pause();
	return;
    }

    InitTag();

    if ((fdb_area = mbsedb_OpenFDB(iAreaNumber, 30)) == NULL)
	return;

    if (utf8)
	chartran_init((char *)"CP437", (char *)"UTF-8", 'b');

    clear();
    Header();
    if (iLC(2) == 1) {
	mbsedb_CloseFDB(fdb_area);
	chartran_close();
	return;
    }

    while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
	memset(&T, 0, sizeof(T));
	T.Area   = iAreaNumber;
	T.Active = FALSE;
	T.Size   = fdb.Size;
	strncpy(T.SFile, fdb.Name, 12);
	strncpy(T.LFile, chartran(fdb.LName), 80);
	SetTag(T);

	if (ShowOneFile() == 1) {
	    mbsedb_CloseFDB(fdb_area);
	    chartran_close();
	    return;
	}

	if (fdb.Deleted) {
	    /* D E L E T E D */ /* Uploaded by: */
	    snprintf(temp, 81, " -- %-12s     %s     [%4d] %s%s\n", fdb.Name, (char *) Language(239), 
				fdb.TimesDL, (char *) Language(238), fdb.Uploader);
	    PUTSTR(temp);
	}

	FileCount++;			/* Increase File Counter by 1 */
	FileBytes += fdb.Size;		/* Increase File Byte Count   */
    }

    Mark();
	
    Enter(1);
    /* Total Files: */
    snprintf(temp, 81, "%s%d / %d bytes", (char *) Language(242), FileCount, FileBytes);
    pout(LIGHTCYAN, BLACK, temp);
    Enter(2);
    chartran_close();

    iLineCount = 0;
    mbsedb_CloseFDB(fdb_area);
    Pause();
}
开发者ID:bbs-io,项目名称:mbse,代码行数:80,代码来源:file.c


示例8: NewfileScan


//.........这里部分代码省略.........
    Date[5] = temp[4];	/* because when you convert  */
    Date[6] = temp[0];	/* a string to an int you    */
    Date[7] = temp[1];	/* loose the front Zero      */
    Date[8] = '\0';   	/* making the number smaller */
    itDate = atol(Date);

    InitTag();

    if ((pAreas = OpenFareas(FALSE)) == NULL)
	return 0;

    while (fread(&area, areahdr.recsize, 1, pAreas) == 1) {

	if ((Access(exitinfo.Security, area.LTSec)) && (area.Available) && (strlen(area.Password) == 0) && (area.New)) {

	    if ((fdb_area = mbsedb_OpenFDB(arecno, 30))) {
		Sheader();
		Found = FALSE;
		Nopper();

		while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
		    strcpy(temp, StrDateDMY(fdb.UploadDate));	/* Realloc Space for Date */
		    Date[0] = temp[6];	    /* Swap the date around      */
		    Date[1] = temp[7];	    /* Instead of   DD-MM-YYYY   */
		    Date[2] = temp[8];	    /* Let it equal YYYYMMDD     */
		    Date[3] = temp[9];	    /* Swap the date around      */
		    Date[4] = temp[3];	    /* Swap the date around      */
		    Date[5] = temp[4];	    /* because when you convert  */
		    Date[6] = temp[0];	    /* a string to an int you    */
		    Date[7] = temp[1];	    /* loose the front Zero      */
		    Date[8] = '\0';	    /* making the number smaller */
					    /* and invalid to this cause */
		    ifDate = atol(Date);

		    if (ifDate >= itDate) {
			if (!Found) {
			    Enter(2);
			    if (iLC(2) == 1) {
				free(Date);
				free(temp);
				mbsedb_CloseFDB(fdb_area);
				fclose(pAreas);
				return 1;
			    }
			    Found = TRUE;
			}

			memset(&T, 0, sizeof(T));
			T.Area   = arecno;
			T.Active = FALSE;
			T.Size   = fdb.Size;
			strncpy(T.SFile, fdb.Name, 12);
			strncpy(T.LFile, fdb.LName, 80);
			SetTag(T);

			Count++;
			if (ShowOneFile() == 1) {
			    free(Date);
			    free(temp);
			    mbsedb_CloseFDB(fdb_area);
			    fclose(pAreas);
			    return 1;
			}
		    } /* End of if */
		} /* End of while */

		mbsedb_CloseFDB(fdb_area);
		
		/*
		 * Add 2 blank lines after found files.
		 */
		if (Found) {
		    Enter(2);
		    if (iLC(2) == 1) {
			free(Date);
			free(temp);
			fclose(pAreas);
			return 1;
		    }
		}

	    } /* End of open filebase */

	} /* End of check new files scan */
	arecno++; /* Go to next file area */
    } /* End of Main */

    if (Count)
	Syslog('+', "Found %d new files", Count);
    fclose(pAreas);
    Enter(1);
    if (Count)
	Mark();
    else
	Pause();

    free(temp);
    free(Date);
    return 1;
}
开发者ID:bbs-io,项目名称:mbse,代码行数:101,代码来源:file.c


示例9: Upload

/*
 * Upload a file.
 */
int Upload()
{
    int		    Area, rc;
    unsigned int    OldArea;
    char	    *arc, *temp;
    up_list	    *up = NULL, *tmpf;

    WhosDoingWhat(UPLOAD, NULL); 
    Enter(1);
    Area = OldArea = iAreaNumber;

    /*
     * If there is a special upload area for the current area
     * then select it.
     */
    if (area.Upload)
	Area = area.Upload;
    SetFileArea(Area);
    Syslog('+', "Upload area is %d %s", Area, area.Name);

    /*
     * Check upload access for the real upload directory.
     */
    if (!Access(exitinfo.Security, area.UPSec)) {
	Enter(1);
	/* You do not have enough access to upload to this area */
	pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(278));
	Enter(2);
	SetFileArea(OldArea);
	Pause();
	return 0;
    }

    clear();
    Enter(2);

    rc = upload(&up);

    if (rc) {
	Syslog('+', "Upload failed, rc=%d", rc);
	SetFileArea(OldArea);
	return 0;
    }
    Syslog('b', "upload done, start checks");

    Enter(2);
    pout(CFG.UnderlineColourF, CFG.UnderlineColourB, (char *)"Checking your upload(s)");
    Enter(1);

    temp = calloc(PATH_MAX, sizeof(char));
    for (tmpf = up; tmpf; tmpf = tmpf->next) {
	snprintf(temp, PATH_MAX, "%s/%s/upl", CFG.bbs_usersdir, exitinfo.Name);
	chdir(temp);

	Syslog('b', "Checking upload %s", tmpf->filename);
	if ((arc = GetFileType(tmpf->filename)) == NULL) {
	    /*
	     * If the filetype is unknown, it is probably 
	     * a textfile or so. Import it direct.
	     */
	    Syslog('b', "Unknown file type");
	    if (!ScanDirect(basename(tmpf->filename)))
		ImportFile(tmpf->filename, Area, FALSE, tmpf->size);
	} else {
	    /*
	     * We figured out the type of the uploaded file.
	     */
	    Syslog('b', "File type is %s", arc);

	    /*
	     * MS-DOS executables are handled direct.
	     */
	    if ((strcmp("EXE", arc) == 0) || (strcmp("COM", arc) == 0)) {
	        if (!ScanDirect(basename(tmpf->filename))) 
		   ImportFile(tmpf->filename, Area, FALSE, tmpf->size);
	    } else {
		switch (ScanArchive(basename(tmpf->filename), arc)) {
		    case 0: ImportFile(tmpf->filename, Area, TRUE, tmpf->size);
			    break;
		    case 1: break;
		    case 2: break;
		    case 3: /*
			     * No valid unarchiver found, just import after scanning,
			     * may catch macro viri.
			     */
			    if (!ScanDirect(basename(tmpf->filename)))
				ImportFile(tmpf->filename, Area, FALSE, tmpf->size);
			    break;
		}
	    }
	}
    }

    tidy_upload(&up);
    free(temp);
    Home();
    SetFileArea(OldArea);
//.........这里部分代码省略.........
开发者ID:bbs-io,项目名称:mbse,代码行数:101,代码来源:file.c


示例10: FilenameScan


//.........这里部分代码省略.........
    _Tag	    T;
    unsigned int    OldArea;
    struct _fdbarea *fdb_area = NULL;

    Name     = calloc(81, sizeof(char));
    OldArea  = iAreaNumber;

    iLineCount = 2; /* Reset Line Counter to Zero */
    arecno     = 1; /* Reset Area Number to One  */

    Enter(2);
    /* Accepts wildcards such as : *.zip, *.gz, *.* */
    pout(WHITE, BLACK, (char *) Language(269));

    Enter(2);
    /* Enter filename to search for : */
    pout(LIGHTCYAN, BLACK, (char *) Language(271));

    colour(CFG.InputColourF, CFG.InputColourB);
    GetstrC(Name, 80);

    if ((strcmp(Name, "")) == 0) {
	free(Name);
	return 0;
    }

    strcpy(mask, re_mask(Name, TRUE));
    Syslog('+', "FilenameScan(): \"%s\" -> \"%s\"", Name, mask);
    free(Name);
    re_comp(mask);

    clear();
    /* File Search by Filename */
    pout(WHITE, BLACK, (char *) Language(272));
    Enter(1);
    InitTag();

    if ((pAreas = OpenFareas(FALSE)) == NULL)
	return 0;

    while (fread(&area, areahdr.recsize, 1, pAreas) == 1) {
	if ((Access(exitinfo.Security, area.LTSec)) && (area.Available) && (strlen(area.Password) == 0)) {

	    if ((fdb_area = mbsedb_OpenFDB(arecno, 30))) {
		Found = FALSE;
		Sheader();
		Nopper();

		while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
		    if (re_exec(fdb.Name) || re_exec(fdb.LName)) {
			if (!Found) {
			    Enter(2);
			    if (iLC(2) == 1) {
				SetFileArea(OldArea);
				return 1;
			    }
			    Found = TRUE;
			}

			memset(&T, 0, sizeof(T));
			T.Area   = arecno;
			T.Active = FALSE;
			T.Size   = fdb.Size;
			strncpy(T.SFile, fdb.Name, 12);
			strncpy(T.LFile, fdb.LName, 81);
			SetTag(T);
			Count++;
			if (ShowOneFile() == 1) {
			    SetFileArea(OldArea);
			    return 1;
			}
		    }

		} /* End of while */

		mbsedb_CloseFDB(fdb_area);
		if (Found) {
		    Enter(2);
		    if (iLC(2) == 1) {
			SetFileArea(OldArea);
			return 1;
		    }
		}

	    } /* End Check for LTSec */
	} /* if access */
	arecno++; /* Go to next file area */

    } /* End of Main */

    Syslog('+', "Found %d files", Count);
    fclose(pAreas);
    Enter(1);
    if (Count)
	Mark();
    else
	Pause();
    SetFileArea(OldArea);
    return 1;
}
开发者ID:bbs-io,项目名称:mbse,代码行数:101,代码来源:file.c


示例11: KeywordScan


//.........这里部分代码省略.........
    if ((strcmp(Name, "")) == 0)
	return 0;

    strcpy(tmpname, tl(Name));
    strcpy(Name, "");
    y = strlen(tmpname);
    for (z = 0; z <  y; z++) {
	if (tmpname[z] != '*') {
	    snprintf(temp, 81, "%c", tmpname[z]);
	    strcat(Name, temp);
	}
    }
    Syslog('+', "KeywordScan(): \"%s\"", Name);

    clear();
    /* File search by keyword */
    pout(WHITE, BLACK, (char *) Language(268));
    Enter(1);
    InitTag();

    if ((pAreas = OpenFareas(FALSE)) == NULL)
	return 0;

    while (fread(&area, areahdr.recsize, 1, pAreas) == 1) {

	if ((Access(exitinfo.Security, area.LTSec)) && (area.Available) && (strlen(area.Password) == 0)) {

	    if ((fdb_area = mbsedb_OpenFDB(arecno, 30))) {
		Nopper();
		Found = FALSE;
		Sheader();

		while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
		    for (i = 0; i < 25; i++)
			snprintf(BigDesc, 1230, "%s%s", BigDesc, *(fdb.Desc + i));

		    if ((strstr(fdb.Name,Name) != NULL) || (strstr(tl(BigDesc), Name) != NULL)) {

			if (!Found) {
			    Enter(2);
			    if (iLC(2) == 1) {
				free(BigDesc);
				free(Name);
				free(tmpname);
				SetFileArea(OldArea);
				return 1;
			    }
			    Found = TRUE;
			}

			memset(&T, 0, sizeof(T));
			T.Area   = arecno;
			T.Active = FALSE;
			T.Size   = fdb.Size;
			strncpy(T.SFile, fdb.Name, 12);
			strncpy(T.LFile, fdb.LName, 80);
			SetTag(T);
			Count++;
			if (ShowOneFile() == 1) {
			    free(BigDesc);
			    free(Name);
			    free(tmpname);
			    SetFileArea(OldArea);
			    return 1;
			}
		    }
		    strcpy(BigDesc, "");  /* Clear BigDesc */

		} /* while */

		mbsedb_CloseFDB(fdb_area);
		if (Found) {
		    Enter(2);
		    if (iLC(2) == 1) {
			free(BigDesc);
			free(Name);
			free(tmpname);
			SetFileArea(OldArea);
			return 1;
		    }
		}

	    } /* End check for LTSec */
	} /* if access */
	arecno++; /* Go to next file area */
    } /* End of Main */

    Syslog('+', "Found %d files", Count);
    free(BigDesc);
    free(Name);
    free(tmpname);
    fclose(pAreas);
    Enter(1);
    if (Count)
	Mark();
    else
	Pause();
    SetFileArea(OldArea);
    return 1;
}
开发者ID:bbs-io,项目名称:mbse,代码行数:101,代码来源:file.c


示例12: File_RawDir

/*
 * Show Raw directory
 */
void File_RawDir(char *OpData)
{
    DIR		    *dirp;
    char	    *FileName, *temp, temp2[81];
    int		    iFileCount = 0, LineCount = 2, iBytes = 0;
    struct dirent   *dp;
    struct stat	    statfile;

    FileName = calloc(PATH_MAX, sizeof(char));
    temp     = calloc(PATH_MAX, sizeof(char));

    if ((strcmp(OpData, "/F")) == 0)
	strcpy(temp, sAreaPath);
    else
	strcpy(temp, OpData);

    if ((dirp = opendir(temp)) == NULL) {
	clear();
	WriteError("$RawDir: Can't open dir: %s", temp);
	Enter(1);
	pout(LIGHTRED, BLACK, (char *)"Can't open directory for raw listing!");
	Enter(2);
	Pause();
    } else {
	if (utf8)
	    chartran_init((char *)"CP437", (char *)"UTF-8", 'b');

	clear();
	/* Filename                                   Size        Date */
	pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(261));
	Enter(1);
	PUTSTR(chartran(fLine_str(78)));

	while ((dp = readdir( dirp )) != NULL ) {
	    snprintf(FileName, PATH_MAX, "%s/%s", temp, dp->d_name);

	    if (*(dp->d_name) != '.') {
		iFileCount++;
		if (stat(FileName, &statfile) != 0) {
		    pout(LIGHTRED, BLACK, (char *)"Can't stat file ");
		    PUTSTR(FileName);
		} else {
		    iBytes += statfile.st_size;

		    snprintf(temp2, 81, "%-54s " , dp->d_name);
		    pout(YELLOW, BLACK, temp2);

		    snprintf(temp2, 81, "%-12d", (int)(statfile.st_size));
		    pout(LIGHTMAGENTA, BLACK, temp2);

		    snprintf(temp2, 81, "%-10s", StrDateDMY(statfile.st_mtime));
		    pout(LIGHTGREEN, BLACK, temp2);
		}
		Enter(1);

		LineCount++;
		if (LineCount == rows) {
		    Pause();
		    LineCount = 0;
		}
	    }
	}

	colour(CFG.HiliteF, CFG.HiliteB);
	PUTSTR(chartran(fLine_str(78)));
	/* Total Files: */ /* Bytes */
	snprintf(temp2, 81, "%s %d, %d %s", (char *) Language(242), iFileCount, iBytes, (char *) Language(354));
	pout(LIGHTGREEN, BLACK, temp2);
	Enter(2);

	Pause();
	closedir(dirp);
	chartran_close();
    }

    free(temp);
    free(FileName);
}
开发者ID:bbs-io,项目名称:mbse,代码行数:81,代码来源:file.c


示例13: WndProc

/**
 * The window procedure which handles the application events.
 */
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch (message)
	{
		case WM_SETFOCUS:
		{
			GetCursorPos(&gLastMousePos);
			gFocused = true;
			break;
		}
		case WM_KILLFOCUS:
		{
		  gFocused = false;
		  break;
		}
		// An explicit paint message
		case WM_PAINT:
		{
			if (!gReinitializeRequired)
			{
				// This is only really called when something is dragged over top of the window
				RenderScene();
			}

			ValidateRect(hWnd, nullptr);
			break;
		}
		// Handle window size changes and pause streaming when minimized since the back buffer might not be available
		case WM_SIZE:
		{
			// Update the pause state
			int wmEvent = LOWORD(wParam);
			if (wmEvent == SIZE_MINIMIZED)
			{
				gPaused = true;
				Pause();
			}
			else if (wmEvent == SIZE_RESTORED)
			{
				gPaused = false;
			}

			break;
		}
		case WM_CHAR:
		{
			if ( AcceptingChatInput() )
			{
				unsigned char ch = static_cast<unsigned char>(wParam);

				// backspace or visible character
				if ( ch == 8 || (ch >= 32 && ch < 127) )
				{
					AppendChatInput(ch);
				}
			}
			break;
		}
		// Handle key presses
		case WM_KEYDOWN:
		{
			if ( AcceptingChatInput() )
			{
				switch (wParam)
				{
					case VK_RETURN:
					{
						EndChatInput(true);
						break;
					}
					case VK_ESCAPE:
					{
						EndChatInput(false);
						break;
					}
				}
			}
			else
			{
				switch (wParam)
				{
					// begin chat input
					case VK_RETURN:
					{
						BeginChatInput();
						break;
					}
					// Toggle streaming
					case VK_F5:
					{
						if (IsStreaming())
						{
							gStreamingDesired = false;
							StopStreaming();
						}
						else
						{
//.........这里部分代码省略.........
开发者ID:BillVee,项目名称:sdk-dist,代码行数:101,代码来源:main_d3d.cpp


示例14: while


//.........这里部分代码省略.........
			break;
		}
		case MSG_DAMAGE_STEP_START: {
			DuelClient::ClientAnalyze(offset, pbuf - offset);
			ReplayRefresh();
			pauseable = false;
			break;
		}
		case MSG_DAMAGE_STEP_END: {
			DuelClient::ClientAnalyze(offset, pbuf - offset);
			ReplayRefresh();
			pauseable = false;
			break;
		}
		case MSG_MISSED_EFFECT: {
			pbuf += 8;
			DuelClient::ClientAnalyze(offset, pbuf - offset);
			break;
		}
		case MSG_TOSS_COIN: {
			player = BufferIO::ReadInt8(pbuf);
			count = BufferIO::ReadInt8(pbuf);
			pbuf += count;
			DuelClient::ClientAnalyze(offset, pbuf - offset);
			break;
		}
		case MSG_TOSS_DICE: {
			player = BufferIO::ReadInt8(pbuf);
			count = BufferIO::ReadInt8(pbuf);
			pbuf += count;
			DuelClient::ClientAnalyze(offset, pbuf - offset);
			break;
		}
		case MSG_ANNOUNCE_RACE: {
			player = BufferIO::ReadInt8(pbuf);
			pbuf += 5;
			return ReadReplayResponse();
		}
		case MSG_ANNOUNCE_ATTRIB: {
			player = BufferIO::ReadInt8(pbuf);
			pbuf += 5;
			return ReadReplayResponse();
		}
		case MSG_ANNOUNCE_CARD: {
			player = BufferIO::ReadInt8(pbuf);
			pbuf += 4;
			return ReadReplayResponse();
		}
		case MSG_ANNOUNCE_NUMBER:
		case MSG_ANNOUNCE_CARD_FILTER: {
			player = BufferIO::ReadInt8(pbuf);
			count = BufferIO::ReadInt8(pbuf);
			pbuf += 4 * count;
			return ReadReplayResponse();
		}
		case MSG_CARD_HINT: {
			pbuf += 9;
			DuelClient::ClientAnalyze(offset, pbuf - offset);
			break;
		}
		case MSG_PLAYER_HINT: {
			pbuf += 6;
			DuelClient::ClientAnalyze(offset, pbuf - offset);
			break;
		}
		case MSG_MATCH_KILL: {
			pbuf += 4;
			break;
		}
		case MSG_TAG_SWAP: {
			player = pbuf[0];
			pbuf += pbuf[2] * 4 + pbuf[4] * 4 + 9;
			DuelClient::ClientAnalyze(offset, pbuf - offset);
			ReplayRefreshDeck(player);
			ReplayRefreshExtra(player);
			break;
		}
		}
		if(pauseable) {
			if(skip_step) {
				skip_step--;
				if(skip_step == 0) {
					Pause(true, false);
					mainGame->dInfo.isStarted = true;
					mainGame->dInfo.isReplaySkiping = false;
					mainGame->dField.RefreshAllCards();
					mainGame->gMutex.Unlock();
				}
			}
			if(is_pausing) {
				is_paused = true;
				mainGame->actionSignal.Reset();
				mainGame->actionSignal.Wait();
				is_paused = false;
			}
			current_step++;
		}
	}
	return true;
}
开发者ID:jiaoy06,项目名称:ygopro,代码行数:101,代码来源:replay_mode.cpp


示例15: lock


//.........这里部分代码省略.........
  pa_stream_set_latency_update_callback(m_Stream, StreamLatencyUpdateCallback, m_MainLoop);

  // default buffer construction
  // align with AE's max buffer
  unsigned int latency = m_BytesPerSecond / 2.5; // 400 ms
  unsigned int process_time = latency / 4; // 100 ms
  if(sinkStruct.isHWDevice)
  {
    // on hw devices buffers can be further reduced
    // 200ms max latency
    // 50ms min packet size
    latency = m_BytesPerSecond / 5;
    process_time = latency / 4;
  }

  pa_buffer_attr buffer_attr;
  buffer_attr.fragsize = latency;
  buffer_attr.maxlength = (uint32_t) -1;
  buffer_attr.minreq = process_time;
  buffer_attr.prebuf = (uint32_t) -1;
  buffer_attr.tlength = latency;

  if (pa_stream_connect_playback(m_Stream, isDefaultDevice ? NULL : device.c_str(), &buffer_attr, ((pa_stream_flags)(PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_ADJUST_LATENCY)), NULL, NULL) < 0)
  {
    CLog::Log(LOGERROR, "PulseAudio: Failed to connect stream to output");
    pa_threaded_mainloop_unlock(m_MainLoop);
    Deinitialize();
    return false;
  }

  /* Wait until the stream is ready */
  do
  {
    pa_threaded_mainloop_wait(m_MainLoop);
    CLog::Log(LOGDEBUG, "PulseAudio: Stream %s", StreamStateToString(pa_stream_get_state(m_Stream)));
  }
  while (pa_stream_get_state(m_Stream) != PA_STREAM_READY && pa_stream_get_state(m_Stream) != PA_STREAM_FAILED);

  if (pa_stream_get_state(m_Stream) == PA_STREAM_FAILED)
  {
    CLog::Log(LOGERROR, "PulseAudio: Waited for the stream but it failed");
    pa_threaded_mainloop_unlock(m_MainLoop);
    Deinitialize();
    return false;
  }

  const pa_buffer_attr *a;

  if (!(a = pa_stream_get_buffer_attr(m_Stream)))
  {
    CLog::Log(LOGERROR, "PulseAudio: %s", pa_strerror(pa_context_errno(m_Context)));
    pa_threaded_mainloop_unlock(m_MainLoop);
    Deinitialize();
    return false;
  }
  else
  {
    unsigned int packetSize = a->minreq;
    m_BufferSize = a->tlength;
    m_periodSize = a->minreq;

    format.m_frames = packetSize / frameSize;
  }

  {
    CSingleLock lock(m_sec);
    // Register Callback for Sink changes
    pa_context_set_subscribe_callback(m_Context, SinkChangedCallback, this);
    const pa_subscription_mask_t mask = PA_SUBSCRIPTION_MASK_SINK;
    pa_operation *op = pa_context_subscribe(m_Context, mask, NULL, this);
    if (op != NULL)
      pa_operation_unref(op);

    // Register Callback for Sink Info changes - this handles volume
    pa_context_set_subscribe_callback(m_Context, SinkInputInfoChangedCallback, this);
    const pa_subscription_mask_t mask_input = PA_SUBSCRIPTION_MASK_SINK_INPUT;
    pa_operation* op_sinfo = pa_context_subscribe(m_Context, mask_input, NULL, this);
    if (op_sinfo != NULL)
      pa_operation_unref(op_sinfo);
  }

  pa_threaded_mainloop_unlock(m_MainLoop);
  
  format.m_frameSize = frameSize;
  m_format = format;
  format.m_dataFormat = m_passthrough ? AE_FMT_S16NE : format.m_dataFormat;

  CLog::Log(LOGNOTICE, "PulseAudio: Opened device %s in %s mode with Buffersize %u ms",
                      device.c_str(), m_passthrough ? "passthrough" : "pcm",
                      (unsigned int) ((m_BufferSize / (float) m_BytesPerSecond) * 1000));

  // Cork stream will resume when adding first package
  Pause(true);
  {
    CSingleLock lock(m_sec);
    m_IsAllocated = true;
  }

  return true;
}
开发者ID:Almarefa,项目名称:xbmc,代码行数:101,代码来源:AESinkPULSE.cpp


示例16: sfMusic_Pause

////////////////////////////////////////////////////////////
/// Pause a music
////////////////////////////////////////////////////////////
void sfMusic_Pause(sfMusic* Music)
{
    CSFML_CALL(Music, Pause());
}
开发者ID:freemaul,项目名称:SFML,代码行数:7,代码来源:Music.cpp


示例17: Chg_Archiver

/*
 * Change default archiver.
 */
void Chg_Archiver()
{
    FILE    *fp;
    int	    Found = FALSE;
    char    *temp;

    temp = calloc(PATH_MAX, sizeof(char));
    ReadExitinfo();
    Syslog('+', "Old archiver %s", exitinfo.Archiver);

    while(TRUE) {
	snprintf(temp, PATH_MAX, "%s/etc/archiver.data", getenv("MBSE_ROOT"));

	if ((fp = fopen(temp, "r")) == NULL) {
	    WriteError("$Can't open %s", temp);
	    /* Can't open archiver file. */
	    Enter(1);
	    PUTSTR((char *) Language(86));
	    Enter(2);
	    Pause();
	    free(temp);
	    return;
	}
	fread(&archiverhdr, sizeof(archiverhdr), 1, fp);

	Enter(1);
	/* Select your preferred archiver */
	pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(87));
	Enter(2);
	while (fread(&archiver, archiverhdr.recsize, 1, fp) == 1) {
	    if (archiver.available && strlen(archiver.marc) && strlen(archiver.farc)) {
		colour(LIGHTBLUE, BLACK);
		snprintf(temp, 81, "%-6s", archiver.name);
		PUTSTR(temp);
		colour(WHITE, BLACK);
		snprintf(temp, 81, "%s\r\n", archiver.comment);
		PUTSTR(temp);
	    }
	}

	Enter(1);
	/* Select Archiver (Enter to Quit): */
	pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(88));

	alarm_on();
	memset(temp, 0, PATH_MAX);
	GetstrC(temp, 5);
	if (strlen(temp) == 0) {
	    free(temp);
	    return;
	}

	Found = FALSE;
	fseek(fp, archiverhdr.hdrsize, SEEK_SET);
	while (fread(&archiver, archiverhdr.recsize, 1, fp) == 1) {
	    if (archiver.available && strlen(archiver.marc) && strlen(archiver.farc)) {
		if (strcasecmp(archiver.name, temp) == 0) {
		    /* Valid input, set new archiver */
		    Found = TRUE;
		    break;
		}
	    }
	}
	fclose(fp);

	if (Found)
	    break;

	Enter(2);
	/* Invalid selection, please try again! */
	pout(LIGHTGREEN, BLACK, (char *) Language(265));
	Enter(2);
	/* Loop for new attempt */
    }

    strncpy(exitinfo.Archiver, archiver.name, 6);
    /* Archiver now set to: */
    snprintf(temp, 81, "%s %s", Language(89), exitinfo.Archiver);
    colour(WHITE, BLACK);
    PUTSTR(temp);
    Syslog('+', "New archiver %s", exitinfo.Archiver);
    WriteExitinfo();
    free(temp);
    Enter(2);
    Pause();
}
开发者ID:bbs-io,项目名称:mbse,代码行数:89,代码来源:change.c


示例18: Chg_Protocol

/*
 * Change default protocol.
 */
void Chg_Protocol()
{
    FILE    *pProtConfig;
    int	    iProt, iFoundProt = FALSE, precno = 0;
    char    *temp, Prot[2];

    temp = calloc(PATH_MAX, sizeof(char));
    ReadExitinfo();
    Set_Protocol(exitinfo.sProtocol);
    Syslog('+', "Old protocol %s", sProtName);

    while(TRUE) {
	snprintf(temp, PATH_MAX, "%s/etc/protocol.data", getenv("MBSE_ROOT"));
	
	if ((pProtConfig = fopen(temp, "r")) == NULL) {
	    WriteError("$Can't open %s", temp);
	    /* Protocol: Can't open protocol file. */
	    Enter(1);
	    PUTSTR((char *) Language(262));
	    Enter(2);
	    Pause();
	    free(temp);
	    fclose(pProtConfig);
	    return;
	}
	fread(&PROThdr, sizeof(PROThdr), 1, pProtConfig);

	Enter(1);
	/* Select your preferred protocol */
	pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(263));
	Enter(2);

	while (fread(&PROT, PROThdr.recsize, 1, pProtConfig) == 1) {
	    if (PROT.Available && Access(exitinfo.Security, PROT.Level)) {
		colour(LIGHTBLUE, BLACK);
		PUTCHAR('(');
		colour(WHITE, BLACK);
		PUTSTR(PROT.ProtKey);
		colour(LIGHTBLUE, BLACK);
		snprintf(temp, 81, ")  %-20s Efficiency %3d %%\r\n", PROT.ProtName, PROT.Efficiency);
		PUTSTR(temp);
	    }
	}
	
	Enter(1);
        pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(264));

        alarm_on();
        iProt = toupper(Readkey());

        PUTCHAR(iProt);
        snprintf(Prot, 2, "%c", iProt);

        fseek(pProtConfig, PROThdr.hdrsize, 0);
        while (fread(&PROT, PROThdr.recsize, 1, pProtConfig) == 1) {
	    if ((strncmp(PROT.ProtKey, Prot, 1) == 0) && PROT.Available && Access(exitinfo.Security, PROT.Level)) {
	        strcpy(sProtName, PROT.ProtName);
	        strcpy(sProtUp, PROT.ProtUp);
	        strcpy(sProtDn, PROT.ProtDn);
	        strcpy(sProtAdvice, PROT.Advice);
	        uProtInternal = PROT.Internal;
	        iProtEfficiency = PROT.Efficiency;
	        iFoundProt = TRUE;
	    } else
	        precno++;
	}

        fclose(pProtConfig);

        if (iProt == 13) {
	    free(temp);
	    return;
	} else {
	    if (!iFoundProt) {
	        Enter(2);
	        pout(LIGHTGREEN, BLACK, (char *) Language(265));
	        Enter(2);
	        /* Loop for new attempt */
	    } else {
	        Setup(exitinfo.sProtocol, sProtName);
	        Enter(1);
	        /* Protocol now set to: */
	        pout(LIGHTGREEN, BLACK, (char *) Language(266));
		PUTSTR(sProtName);
	        Enter(2);
	        Pause();
	        break;
	    }
	}
    }

    Syslog('+', "New protocol %s", sProtName);
    WriteExitinfo();
    free(temp);
}
开发者ID:bbs-io,项目名称:mbse,代码行数:98,代码来源:change.c


示例19: OutputPause

static void OutputPause( audio_output_t *aout, bool pause, mtime_t date )
{
    Pause( &aout->sys->s, pause );
    (void) date;
}
开发者ID:etix,项目名称:vlc,代码行数:5,代码来源:directsound.c


示例20: main

int main(int argc, char** argv){
   FILE* input;
   if(argc == 1){
     input = stdin;
   } 
   else if(argc == 2){
     input = fopen(argv[1],"r");
   }
   else{
     perror("Usage");
     exit(1);
   }  
   int numtok=0, numtokens=0, lsize=0;
   char p;
   char** newargv;
   static bool REDSO = FALSE, REDSI = FALSE, EXIT = FALSE;

   char* line = malloc(MAX_CANON);
   char** toklin;
   char* newl = NULL;
   char* opf = NULL;
   char* ipf = NULL;
   int i = 0;

   static int fd;
   static int fdi;
   static int fdr;

   void* x = NULL;
   fprintf(stderr, "Zshell $: "); 
   x = fgets (line, MAX_CANON, input);
   if (x) {
      if((strlen(line)-1)!=0){
        line[strlen(line)-1] = '\0';
      }
   }
   while((x != NULL)&&((strcmp(line, "quit")) != 0)) {
       newl = malloc(MAX_CANON);
       opf = malloc(MAX_CANON);
       ipf = malloc(MAX_CANON);
       stripIO(&line,&toklin,&newl,&opf,&ipf,&numtok);
       if((numtokens = makeargv(newl, DELIMITERS, &newargv))==-1){
          perror("makeargv error");
          return 1;
       }
       RedIO(&toklin,&opf,&ipf,&REDSI,&REDSO,&numtok,&fd,&fdi,&fdr,&EXIT);
       if((strstr(newargv[0],"cd"))){
         if(newargv[1]){
           cd(&newargv);
         }
         else{
           perror("Need to Include a directory");
         }
         EXIT=TRUE;
       }
       else if((strstr(newargv[0],"environ"))){
         env();
         EXIT=TRUE;
       }
       else if((strstr(newargv[0],"echo"))){
         Echo(&newargv,&numtokens);
         EXIT=TRUE;
       }
       else if((strstr(newargv[0],"pause"))){
         Pause();
         EXIT=TRUE;
       }
       else if(!EXIT && !(strstr(newargv[0],"\n"))){
        execproc(&newargv,&line,&REDSO,&REDSI,&fdr,&x,&input);
       }
       if(EXIT && (strcmp(newargv[0],"\n")!=-1)){
         EXIT = FALSE;
         fprintf(stderr, "Zshell $: "); 
         if(REDSO){
            freopen("/dev/tty", "w", input);
            REDSO = FALSE;
          }
         if(REDSI){
            dup2(fdr, STDIN_FILENO);
            close(fdr);
            REDSI = FALSE;
         }
         x = fgets (line, MAX_CANON, input);
         if (x) {
           if((strlen(line)-1)!=0){
             line[strlen(line)-1] = '\0';
           }
         }
       } 
   }   
   return 0;
}
开发者ID:paladizm,项目名称:Operating-Systems,代码行数:92,代码来源:myshell.c



注:本文中的Pause函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PcdGet16函数代码示例发布时间:2022-05-30
下一篇:
C++ PathType函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap