Author: sandervanderburg
Date: Thu Nov 11 11:39:03 2010
New Revision: 24657
URL: https://svn.nixos.org/websvn/nix/?rev=24657&sc=1

Log:
- Replaced some fprintf into g_printerr for consistency
- Changed some char* into gchar*
- Misc cleanups

Modified:
   disnix/disnix/trunk/src/libdistderivation/derivationmapping.c
   disnix/disnix/trunk/src/libdistderivation/derivationmapping.h
   disnix/disnix/trunk/src/libinfrastructure/infrastructure.c
   disnix/disnix/trunk/src/libmanifest/activationmapping.c
   disnix/disnix/trunk/src/libmanifest/activationmapping.h
   disnix/disnix/trunk/src/libmanifest/distributionmapping.c
   disnix/disnix/trunk/src/libmanifest/distributionmapping.h

Modified: disnix/disnix/trunk/src/libdistderivation/derivationmapping.c
==============================================================================
--- disnix/disnix/trunk/src/libdistderivation/derivationmapping.c       Thu Nov 
11 11:03:50 2010        (r24656)
+++ disnix/disnix/trunk/src/libdistderivation/derivationmapping.c       Thu Nov 
11 11:39:03 2010        (r24657)
@@ -20,7 +20,7 @@
 #include "derivationmapping.h"
 #include <xmlutil.h>
 
-GArray *create_derivation_array(char *distributed_derivation_file)
+GArray *create_derivation_array(gchar *distributed_derivation_file)
 {
     /* Declarations */    
     xmlDocPtr doc;
@@ -32,7 +32,7 @@
     
     if((doc = xmlParseFile(distributed_derivation_file)) == NULL)
     {
-       fprintf(stderr, "Error with parsing the distributed derivation XML 
file!\n");
+       g_printerr("Error with parsing the distributed derivation XML file!\n");
        xmlCleanupParser();
        return NULL;
     }
@@ -42,7 +42,7 @@
     
     if(node_root == NULL)
     {
-        fprintf(stderr, "The distributed derivation XML file is empty!\n");
+        g_printerr("The distributed derivation XML file is empty!\n");
        xmlFreeDoc(doc);
        xmlCleanupParser();
        return NULL;

Modified: disnix/disnix/trunk/src/libdistderivation/derivationmapping.h
==============================================================================
--- disnix/disnix/trunk/src/libdistderivation/derivationmapping.h       Thu Nov 
11 11:03:50 2010        (r24656)
+++ disnix/disnix/trunk/src/libdistderivation/derivationmapping.h       Thu Nov 
11 11:39:03 2010        (r24657)
@@ -41,7 +41,7 @@
  * @param distributed_derivation_file Path to the distributed derivation XML 
file
  * @return GArray with DerivationItems
  */ 
-GArray *create_derivation_array(char *distributed_derivation_file);
+GArray *create_derivation_array(gchar *distributed_derivation_file);
 
 /**
  * Deletes an array with derivation items

Modified: disnix/disnix/trunk/src/libinfrastructure/infrastructure.c
==============================================================================
--- disnix/disnix/trunk/src/libinfrastructure/infrastructure.c  Thu Nov 11 
11:03:50 2010        (r24656)
+++ disnix/disnix/trunk/src/libinfrastructure/infrastructure.c  Thu Nov 11 
11:39:03 2010        (r24657)
@@ -41,7 +41,7 @@
     
     if(doc == NULL)
     {
-       fprintf(stderr, "Error with parsing infrastructure XML file!\n");
+       g_printerr("Error with parsing infrastructure XML file!\n");
        return NULL;
     }
     
@@ -50,7 +50,7 @@
     
     if(root_node == NULL)
     {
-        fprintf(stderr, "The infrastructure XML file is empty!\n");
+        g_printerr("The infrastructure XML file is empty!\n");
        xmlFreeDoc(doc);
        return NULL;
     }
@@ -69,7 +69,7 @@
     return transform_doc;
 }
 
-static gchar *create_infrastructure_xml(char *infrastructure_expr)
+static gchar *create_infrastructure_xml(gchar *infrastructure_expr)
 {
     int pipefd[2];
         
@@ -84,7 +84,7 @@
     
        if(status == -1)
        {
-           fprintf(stderr, "Error with forking nix-instantiate process!\n");
+           g_printerr("Error with forking nix-instantiate process!\n");
            close(pipefd[0]);
            close(pipefd[1]);   
            return NULL;
@@ -108,8 +108,9 @@
                
            while((line_size = read(pipefd[0], line, BUFFER_SIZE - 1)) > 0)
            {
-               line[line_size] = '\0';
                gchar *old_infrastructureXML = infrastructureXML;
+
+               line[line_size] = '\0';
                infrastructureXML = g_strconcat(old_infrastructureXML, line, 
NULL);
                g_free(old_infrastructureXML);
            }
@@ -122,7 +123,7 @@
                return infrastructureXML;
            else
            {
-               fprintf(stderr, "Error with executing nix-instantiate!\n");
+               g_printerr("Error with executing nix-instantiate!\n");
                g_free(infrastructureXML);
                return NULL;
            }
@@ -130,7 +131,7 @@
     }
     else
     {
-       fprintf(stderr, "Error with creating pipe!\n");
+       g_printerr("Error with creating pipe!\n");
        return NULL;
     }    
 }
@@ -148,7 +149,7 @@
     
     if(infrastructureXML == NULL)
     {
-        fprintf(stderr, "Error opening infrastructure XML file!\n");
+        g_printerr("Error opening infrastructure XML file!\n");
         return NULL;
     }
     
@@ -158,7 +159,7 @@
        
     if(doc == NULL)
     {
-        fprintf(stderr, "Error with parsing infrastructure XML file!\n");    
+        g_printerr("Error with parsing infrastructure XML file!\n");    
         return NULL;
     }
 
@@ -185,7 +186,7 @@
        xmlXPathFreeObject(result);
     }
     else
-        fprintf(stderr, "No targets found!\n");
+        g_printerr("No targets found!\n");
 
     /* Cleanup */
     xmlFreeDoc(doc);

Modified: disnix/disnix/trunk/src/libmanifest/activationmapping.c
==============================================================================
--- disnix/disnix/trunk/src/libmanifest/activationmapping.c     Thu Nov 11 
11:03:50 2010        (r24656)
+++ disnix/disnix/trunk/src/libmanifest/activationmapping.c     Thu Nov 11 
11:39:03 2010        (r24657)
@@ -131,7 +131,7 @@
     }
 }
 
-GArray *create_activation_array(char *manifest_file)
+GArray *create_activation_array(gchar *manifest_file)
 {
     xmlDocPtr doc;
     xmlNodePtr node_root;

Modified: disnix/disnix/trunk/src/libmanifest/activationmapping.h
==============================================================================
--- disnix/disnix/trunk/src/libmanifest/activationmapping.h     Thu Nov 11 
11:03:50 2010        (r24656)
+++ disnix/disnix/trunk/src/libmanifest/activationmapping.h     Thu Nov 11 
11:39:03 2010        (r24657)
@@ -73,7 +73,7 @@
  * @param manifest_file Path to the manifest XML file
  * @return GArray containing activation mappings
  */
-GArray *create_activation_array(char *manifest_file);
+GArray *create_activation_array(gchar *manifest_file);
 
 /**
  * Deletes an array with activation mappings including its contents.

Modified: disnix/disnix/trunk/src/libmanifest/distributionmapping.c
==============================================================================
--- disnix/disnix/trunk/src/libmanifest/distributionmapping.c   Thu Nov 11 
11:03:50 2010        (r24656)
+++ disnix/disnix/trunk/src/libmanifest/distributionmapping.c   Thu Nov 11 
11:39:03 2010        (r24657)
@@ -20,7 +20,7 @@
 #include "distributionmapping.h"
 #include <xmlutil.h>
 
-GArray *generate_distribution_array(char *manifest_file)
+GArray *generate_distribution_array(gchar *manifest_file)
 {
     /* Declarations */
     xmlDocPtr doc;
@@ -32,7 +32,7 @@
     
     if((doc = xmlParseFile(manifest_file)) == NULL)
     {
-       fprintf(stderr, "Error with parsing the manifest XML file!\n");
+       g_printerr("Error with parsing the manifest XML file!\n");
        xmlCleanupParser();
        return NULL;
     }
@@ -42,7 +42,7 @@
     
     if(node_root == NULL)
     {
-        fprintf(stderr, "The manifest XML file is empty!\n");
+        g_printerr("The manifest XML file is empty!\n");
        xmlFreeDoc(doc);
        xmlCleanupParser();
        return NULL;

Modified: disnix/disnix/trunk/src/libmanifest/distributionmapping.h
==============================================================================
--- disnix/disnix/trunk/src/libmanifest/distributionmapping.h   Thu Nov 11 
11:03:50 2010        (r24656)
+++ disnix/disnix/trunk/src/libmanifest/distributionmapping.h   Thu Nov 11 
11:39:03 2010        (r24657)
@@ -39,7 +39,7 @@
  * @param manifest_file Path to the manifest XML file
  * @return GArray with DistributionItems
  */
-GArray *generate_distribution_array(char *manifest_file);
+GArray *generate_distribution_array(gchar *manifest_file);
 
 /**
  * Deletes an array with distribution items.
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to