ScummVM API documentation
forbidden.h File Reference
#include "common/scummsys.h"

Go to the source code of this file.

Macros

#define printf   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fprintf   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define vprintf   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define vfprintf   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define FILE   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define stdin   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define stdout   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define stderr   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fopen(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fclose(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fread(a, b, c, d)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fwrite(a, b, c, d)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fseek(a, b, c)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define ftell(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define feof(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fgetc(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fputc(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fgets(a, b, c)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fputs(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define getc(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define putc(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define gets(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define puts(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define getchar()   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define putchar(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define setjmp(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define longjmp(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define system(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define exit(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define abort()   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define getenv(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define putenv(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define setenv(a, b, c)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define unsetenv(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define asctime(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define clock()   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define ctime(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define difftime(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define getdate(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define gmtime(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define localtime(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define mktime(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define time(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define chdir(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define getcwd(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define getwd(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define unlink(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isalnum(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isalpha(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define iscntrl(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isdigit(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isgraph(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isnumber(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define islower(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isprint(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define ispunct(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isspace(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isupper(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isxdigit(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define isblank(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fmin(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fminf(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fmax(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fmaxf(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define itoa(a, b, c)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define uitoa(a, b, c)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define mkdir(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define setvbuf(a, b, c, d)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define tmpfile()   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define tmpnam(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define tempnam(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define rand()   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define srand(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define random()   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define srandom(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define strcat(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define strcpy(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define vsprintf(a, b, c)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define sprintf(a, b, ...)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define stricmp(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define strnicmp(a, b, c)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define strcasecmp(a, b)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define strncasecmp(a, b, c)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define strdup(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define strlwr(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define strupr(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define strncpy_s(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define sscanf_s(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define fscanf_s(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 
#define scanf_s(a)   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*
 

Detailed Description

This header file is meant to help ensure that engines and infrastructure code do not make use of certain "forbidden" APIs, such as fopen(), setjmp(), etc. This is achieved by re-#defining various symbols to a "garbage" string which then triggers a compiler error.

Backend files may #define FORBIDDEN_SYMBOL_ALLOW_ALL if they have to access functions like fopen, fread etc. Regular code, esp. code in engines/, should never do that. To ease transition, though, we allow re-enabling selected symbols in frontend code. However, this should only be used as a temporary measure. Especially new code should avoid this at all costs.

Macro Definition Documentation

◆ printf

#define printf   FORBIDDEN_look_at_common_forbidden_h_for_more_info SYMBOL !%*

The garbage string to use as replacement for forbidden symbols.

The reason for this particular string is the following: By including a space and some non-alphanumeric symbols we trigger a compiler error. By including the words "forbidden symbol" (which the compiler will hopefully print along with its own error message), we try to make clear what is causing the error.