C 网络应用开发平台:nope.c

jopen 10年前

nope.c是一个采用C语言开发的可伸缩的服务器端和网络应用程序的为基础的软件平台。示例代码:

#include "server.h"  #include "nopeutils.h"     void factor(int client,const char * reqStr, const char * method);     void server(Request request)  {       routefh(request,"/factor",&factor);  }     void factor(int client,const char * reqStr, const char * method) {      char *nStr=HSCANIT(client,reqStr,"Number to factor:");         if (strcmp(nStr,UNDEFINED)!=0) {          long n = strtol(nStr,NULL,10);          nprintf(client,"Factors of %li are: ", n);          long l;          for(l=2;l<=n;++l) {              if(n%l==0) {                  nprintf (client,"%li ",l);              }          }      }  }

项目主页:http://www.open-open.com/lib/view/home/1406382256585