コード例 #1
1
ファイル: nopeutils.c プロジェクト: jimpoulakos/nope.c
char *_hscan(int client, const char *reqStr, const char *msg, const char *inputstr)
{
    char *qpath = getQueryPath(reqStr);
    char *qparam = getQueryParam(reqStr, "q");
    FDPRINTF(client, OTAGA(form, action = "%s")
             "%s%s" STAG(input, type = "submit") CTAG(form), qpath, msg, inputstr);
    free(qpath);
    return qparam;
}
コード例 #2
0
ファイル: gzipwrapper.c プロジェクト: riolet/grumpy
void gzw_sendHeadersFromString(gzwRequest gzwr,const char *headerString) {
	int client=gzwr.request.client;
	if (gzwr.gzenabled) {
		FDPRINTF(client, "Content-Encoding: %s\r\n", ENCODING_GZIP,0);
	}
	FDPRINTF(client, "%s", headerString,0);
	STATIC_SEND(client, "\r\n", 0);
}
コード例 #3
0
ファイル: nopeutils.c プロジェクト: hackmeister/nope.c
void sendHeadersTypeEncoding(Request request,const char *type, const char * encoding)
{
	int client=request.client;
	STATIC_SEND(client, "HTTP/1.0 200 OK\r\n", 0);
	STATIC_SEND(client, SERVER_STRING, 0);
	FDPRINTF(client, "Content-Type: %s\r\n", type,0);
	if (encoding!=NULL) {
		FDPRINTF(client, "Content-Encoding: %s\r\n", encoding,0);
	}

	STATIC_SEND(client, "\r\n", 0);
}
コード例 #4
0
ファイル: gzipwrapper.c プロジェクト: riolet/grumpy
void gzw_sendHeadersType(gzwRequest gzwr,const char *type)
{
	int client=gzwr.request.client;
	STATIC_SEND(client, "HTTP/1.0 200 OK\r\n", 0);
	STATIC_SEND(client, SERVER_STRING, 0);
	FDPRINTF(client, "Content-Type: %s\r\n", type,0);
	if (gzwr.gzenabled) {
		FDPRINTF(client, "Content-Encoding: %s\r\n", ENCODING_GZIP,0);
	}
	STATIC_SEND(client, "Vary: Accept-Encoding\r\n", 0);
	STATIC_SEND(client, "\r\n", 0);
}
コード例 #5
0
ファイル: bob4_setup.c プロジェクト: mantauav/paparazzi
void SetupOSD()
{
  //put in startup screen string
  FDPRINTF(TTY,"\033X");

  PrintOSD();

  FDPRINTF(TTY,"\033\\");

  //set boot script and flash
  FDPRINTF(TTY,"\033[8v");
  FDPRINTF(TTY,"\033[1v");

}
コード例 #6
0
ファイル: bob4_setup.c プロジェクト: mantauav/paparazzi
void PrintOSD()
{
  //Clear Screen
  FDPRINTF(TTY,"\033[2J");

  //Set Aurora Splash Screen
  FDPRINTF(TTY,"\033[0z");  
  FDPRINTF(TTY,"\033[5;7H");
  FDPRINTF(TTY,"AURORA FLIGHT SCIENCES\r\n");
  FDPRINTF(TTY,"\033[6z");
  FDPRINTF(TTY,"      Skate UAS");

  FDPRINTF(TTY,"\033[0z");
  FDPRINTF(TTY,"\033[10,0H");
  FDPRINTF(TTY,"     Waiting for GCS connection");

  //Wait 1 second or until keypress
  FDPRINTF(TTY,"\033[1;2|");
}
コード例 #7
0
ファイル: nopeutils.c プロジェクト: hackmeister/nope.c
/* Serve downloadable file. */
void serveDownloadableFile(int client, const char *filename, const char *displayFilename, const char * type)
{
	FILE *resource = NULL;

	STATIC_SEND(client, "HTTP/1.0 200 OK\r\n", 0);
	STATIC_SEND(client, SERVER_STRING, 0);

	FDPRINTF(client, "Content-Type: %s\r\n",type);
	FDPRINTF(client, "Content-Disposition: attachment; filename=\"%s\"\r\n",displayFilename);

	STATIC_SEND(client, "\r\n", 0);

	resource = fopen(filename, "r");
	if (resource == NULL) {
		not_found(client);
	} else {
		cat(client, resource);
	}
	fclose(resource);
}
コード例 #8
0
ファイル: nopeutils.c プロジェクト: jimpoulakos/nope.c
char *_hscanIfEmpty(int client, const char *reqStr, const char *msg, const char *inputstr)
{
    char *qpath = getQueryPath(reqStr);
    char *qparam = getQueryParam(reqStr, "q");
    if (strcmp(qparam, UNDEFINED) == 0) {
        FDPRINTF(client, OTAGA(form, action = "%s")
                 "%s%s" STAG(input, type = "submit") CTAG(form), qpath, msg, inputstr);
    }
    free(qpath);
    return qparam;
}
コード例 #9
0
ファイル: nopeutils.c プロジェクト: hackmeister/nope.c
/* Serve and entire file. */
void serveFile(int client, const char *filename, const char * type)
{
	FILE *resource = NULL;

	FDPRINT(client, "HTTP/1.0 200 OK\r\n");
	FDPRINT(client, SERVER_STRING);

	FDPRINTF(client, "Content-Type: %s\r\n",type);

	FDPRINT(client, "\r\n");

	resource = fopen(filename, "r");
	if (resource == NULL) {
		not_found(client);
	} else {
		cat(client, resource);
	}
	fclose(resource);
}
コード例 #10
0
ファイル: nopeutils.c プロジェクト: jimpoulakos/nope.c
void sendHeadersFromString(Request request, const char *headerString)
{
    int client = request.client;
    FDPRINTF(client, "%s", headerString, 0);
    STATIC_SEND(client, "\r\n", 0);
}