G:/ScriptBasic/source/extensions/ux/interface.c

Go to the documentation of this file.
00001 /* FILE: ux.c
00002 
00003 This file is a ScriptBasic interface to UNIX system calls
00004 that are not available under Windows NT and thus are not
00005 implemented in the core of ScriptBasic.
00006 
00007 UXLIBS:
00008 DWLIBS:
00009 
00010 */
00011 #include <stdio.h>
00012 #include "../../basext.h"
00013 
00014 besVERSION_NEGOTIATE
00015 
00016   return (int)INTERFACE_VERSION;
00017 
00018 besEND
00019 
00020 besSUB_START
00021 
00022 besEND
00023 
00024 besSUB_FINISH
00025 
00026 besEND
00027 
00057 besFUNCTION(uxfork)
00058   int i;
00059 
00060   besALLOC_RETURN_LONG;
00061   i = fork();
00062   LONGVALUE(besRETURNVALUE) = i;
00063 
00064 besEND
00065 
00075 besFUNCTION(uxchmod)
00076   VARIABLE Argument;
00077   char *pszFileName;
00078 
00079   besRETURNVALUE = NULL;
00080 
00081   if( besARGNR < 2 )return COMMAND_ERROR_FEW_ARGS;
00082 
00083   Argument = besARGUMENT(1);
00084   besDEREFERENCE(Argument);
00085   if( Argument == NULL )return EX_ERROR_TOO_FEW_ARGUMENTS;
00086   Argument = besCONVERT2STRING(Argument);
00087   besCONVERT2ZCHAR(Argument,pszFileName);
00088 
00089   Argument = besARGUMENT(2);
00090   besDEREFERENCE(Argument);
00091   if( Argument == NULL )return EX_ERROR_TOO_FEW_ARGUMENTS;
00092   Argument = besCONVERT2LONG(Argument);
00093   chmod(pszFileName,(mode_t)LONGVALUE(Argument));
00094 besEND

Generated on Sun Mar 12 23:56:29 2006 for ScriptBasic by  doxygen 1.4.6-NO