taskrambler  0.1.9
Web server and task management solution.
application/controller/version/read.c File Reference
#include <sys/types.h>
#include <stdio.h>
#include "application/application.h"
#include "hash.h"
#include "session.h"
#include "utils/memory.h"
+ Include dependency graph for application/controller/version/read.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 
#define VERSION_JSON   "{\"version\":\"%s\"}"
 

Functions

char * controllerVersionRead (Application app, Session sess, Hash args)
 

Detailed Description

Author
Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file application/controller/version/read.c.

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 23 of file application/controller/version/read.c.

#define VERSION_JSON   "{\"version\":\"%s\"}"

Definition at line 34 of file application/controller/version/read.c.

Referenced by controllerVersionRead().

Function Documentation

char* controllerVersionRead ( Application  app,
Session  sess,
Hash  args 
)

Definition at line 37 of file application/controller/version/read.c.

References memMalloc(), and VERSION_JSON.

38 {
39  char * buffer;
40  size_t nbuffer;
41 
42  nbuffer = snprintf(NULL, 0, VERSION_JSON, app->version? app->version : "");
43  buffer = memMalloc(nbuffer);
44  sprintf(buffer, VERSION_JSON, app->version? app->version : "");
45 
46  return buffer;
47 }
void * memMalloc(size_t)
Definition: memory.c:783

+ Here is the call graph for this function: