//added 05/17/99 Matt Mueller - checker stubs for various functions. /* Needed for CHKR_PREFIX. */ #include #include "checker_api.h" #include #include #include #include #include #include "gr.h" void chcksetwritable(char * p, int size)__asm__(CHKR_PREFIX ("chcksetwritable")); void chcksetwritable(char * p, int size){ stubs_chkr_set_right (p,size,CHKR_RW); } void chcksetunwritable(char * p, int size)__asm__(CHKR_PREFIX ("chcksetunwritable")); void chcksetunwritable(char * p, int size){ stubs_chkr_set_right (p,size,CHKR_RO); } int chkr_stub_glob(const char *pattern, int flags,int errfunc(const char * epath, int eerrno),glob_t *pglob)__asm__ (CHKR_PREFIX ("glob")); int chkr_stub_glob(const char *pattern, int flags,int errfunc(const char * epath, int eerrno),glob_t *pglob) { int g; stubs_chkr_check_str(pattern,CHKR_RO,"pattern"); stubs_chkr_check_addr(pglob,sizeof(glob_t),CHKR_WO,"pglob"); g=glob(pattern,flags,errfunc,pglob); if (g==0){ int i; stubs_chkr_set_right (pglob, sizeof(glob_t), CHKR_RW); stubs_chkr_set_right (pglob->gl_pathv, sizeof(char*) * pglob->gl_pathc, CHKR_RW); for (i=0;igl_pathc;i++) stubs_chkr_set_right (pglob->gl_pathv[i], strlen(pglob->gl_pathv[i])+1, CHKR_RW); } return g; } int chkr_stub_SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags)__asm__(CHKR_PREFIX ("SDL_VideoModeOK")); int chkr_stub_SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags) { return SDL_VideoModeOK(width,height,bpp,flags); } SDL_Surface * chkr_stub_SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags)__asm__(CHKR_PREFIX ("SDL_SetVideoMode")); SDL_Surface * chkr_stub_SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags) { SDL_Surface * s; s=SDL_SetVideoMode(width,height,bpp,flags); stubs_chkr_set_right (s,sizeof(SDL_Surface),CHKR_RO); stubs_chkr_set_right (s->format,sizeof(SDL_PixelFormat),CHKR_RO); stubs_chkr_set_right (s->format->palette,256*3,CHKR_RO); #ifdef TEST_GR_LOCK stubs_chkr_set_right (s->pixels,s->w*s->h*s->format->BytesPerPixel,CHKR_RO); #else stubs_chkr_set_right (s->pixels,s->w*s->h*s->format->BytesPerPixel,CHKR_RW); #endif return s; } int chkr_stub_SDL_SetColors (SDL_Surface *surface,SDL_Color *colors, int firstcolor, int ncolors)__asm__ (CHKR_PREFIX ("SDL_SetColors")); int chkr_stub_SDL_SetColors (SDL_Surface *surface,SDL_Color *colors, int firstcolor, int ncolors){ int i; stubs_chkr_check_addr(surface,sizeof(SDL_Surface),CHKR_RO,"surface"); // for (i=firstcolor;i