C 網絡應用開發平臺:nope.c

jopen 10年前發布 | 15K 次閱讀 nope.c 網絡工具包

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);
        }
    }
}

}</pre>

項目主頁:http://www.baiduhome.net/lib/view/home/1406382256585

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!