nope.c —— 超轻量级 C 网络应用开发平台

nope.c 详细介绍
nope.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);
            }
        }
    }
}
上一篇:国产CPU 申威1621 异数OS基础组件理论性能测试报告


下一篇:自建CDN Xnign产品指标