13.08.2012, 19:59
Quote:
No, PAWN is open-source and is publically available, hence it is used in SA:MP. The compiler has been modified with use with SA:MP and although the open source modifications were lost I believe they have been recovered.
|
Код:
/* doinclude * * Gets the name of an include file, pushes the old file on the stack and * sets some options. This routine doesn't use lex(), since lex() doesn't * recognize file names (and directories). * * Global references: inpf (altered) * inpfname (altered) * lptr (altered) */ static void doinclude(int silent) { char name[_MAX_PATH]; char symname[sNAMEMAX]; char *ptr; char c; int i, result; while (*lptr<=' ' && *lptr!='\0') /* skip leading whitespace */ lptr++; if (*lptr=='<' || *lptr=='\"') { c=(char)((*lptr=='\"') ? '\"' : '>'); /* termination character */ lptr++; while (*lptr<=' ' && *lptr!='\0') /* skip whitespace after quote */ lptr++; } else { c='\0'; } /* if */ i=0; while (*lptr!=c && *lptr!='\0' && i<sizearray(name)-1) /* find the end of the string */ name[i++]=*lptr++; while (i>0 && name[i-1]<=' ') i--; /* strip trailing whitespace */ assert(i>=0 && i<sizearray(name)); name[i]='\0'; /* zero-terminate the string */ if (*lptr!=c) { /* verify correct string termination */ error(37); /* invalid string */ return; } /* if */ if (c!='\0') check_empty(lptr+1); /* verify that the rest of the line is whitespace */ /* create a symbol from the name of the include file; this allows the system * to test for multiple inclusions */ strcpy(symname,"_inc_"); if ((ptr=strrchr(name,DIRSEP_CHAR))!=NULL) strlcat(symname,ptr+1,sizearray(symname)); else strlcat(symname,name,sizearray(symname)); /* replace invalid characters by '_' (anything not a digit, character or * underscore) */ for (i=0; symname[i]!='\0'; i++) if (!alphanum(symname[i])) symname[i]='_'; #if defined __WIN32__ || defined _WIN32 || defined _Windows || defined __MSDOS__ /* on systems with case-insentive filenames, force the symbol for the file * to lower case */ strlwr(symname); #endif if (find_symbol(&glbtab,symname,fcurrent,-1)==NULL) { /* constant is not present, so this file has not been included yet */ /* Include files between "..." or without quotes are read from the same * relative path as the current file, from the active directory, or from * a list of "include directories". Include files between <...> are only * read from the list of include directories. */ result=plungefile(name,(c!='>'),TRUE); if (result) add_constant(symname,1,sGLOBAL,0); else if (!silent) error(100,name); /* cannot read from ... (fatal error) */ } /* if */ }