Added initial Doxygen config file for generating documentation.
[wsti_so.git] / src / process3.c
index d5be26a12c2088dfe48748cb46ed1785757e5ae1..4568d97d1e3c4ee1280221fbf7f23ef1cd7f57e2 100644 (file)
@@ -1,33 +1,30 @@
 #include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 
 /* open/read/write/close */
 #include <fcntl.h>
 
-/** If buffer is too small to hold entire string, it is incremented by this value */
-#define BUFFER_STEP 16
-
 /**
- * Program grabs data from process1, calculates number of characters in each line
- * and pass the value to process3.
+ * Program grabs data (calculated number of characters) from process2 and prints
+ * grabbed data to the standard output.
  */
 int main(void) {
-       /** Named pipe used to communicate with process1 */
+       /** Named pipe used to communicate with process2 */
        char * read_pipe = "/tmp/process2pipe";
 
+       /** Descriptor of input pipe */
        int read_descriptor;
-       
+
+       /** Buffer used for storing data from input pipe */
        int buffer = 0;
        
-       int i = 0;
+       /** Stores number of bytes read from input pipe in current iteration */
        ssize_t count = 0;
 
        /* Reading from process2 */
        read_descriptor = open(read_pipe, O_RDONLY);
 
-       int number_of_characters = 0;
-       
+       fprintf(stderr, "[%s] Init!\n", "process3");
+
        while(1) {
                /* Read data from input pipe */
                count = read(read_descriptor, &buffer, sizeof(int));