#ifndef __CGI_CHH__ #define __CGI_CHH__ #include files.chh \ %define(translateCRLF,str, %sgsub([%schr(13)][%schr(10)],%str,%'\n') )\ \ %define(cgiGetParameters, %locals(result,lst,contype,conparm,line,regs,value,name,qstring, %\ %if(%hcontains(%env,CONTENT_TYPE), %\ %\ %ldelete(%&lst,0)\ %\ %foreach(str,%lst, %\ %if(%[%llength(%lst)==2], % ) ) , % )\ %case(%contype, %list(application/x-www-form-urlencoded), %if(%[%slength(%env{QUERY_STRING}) > 0], % , % )\ %foreach(str,%ssplit(&,%qstring), %\ %if(%[%llength(%lst)==2], % ) ), %list(multipart/form-data), %\ %\ %while(%and(%not(%feof(%stdin)),%equal(%line,--%conparm{boundary}%'\n')), %\ %if(%[%smatch(%'^Content-Disposition: form-data; name=\"([^\"]+)\"(; filename=\"([^\"]+)\")?',%line,%®s) != -1], %\ %if(%slength(%regs[2]), %\ %\ %if(%not(%smatch(%'^Content-Type: (.+)',%line,%®s)), %\ % )\ %\ %)>\ % , %\ %\ %)>\ % )\ % ) ) )\ %&result ))\ #endif