diff -crBN orlibredwg/examples/dwg_ps.c libredwg/examples/dwg_ps.c
*** orlibredwg/examples/dwg_ps.c	2013-04-30 19:00:51.766015177 +0530
--- libredwg/examples/dwg_ps.c	2013-04-30 19:02:13.734015254 +0530
***************
*** 21,27 ****
  #include <stdio.h>
  #include <dwg.h>
  #include <libps/pslib.h>
! #include "suffix.c"
  
  void
  create_postscript(Dwg_Data *dwg, char *output)
--- 21,27 ----
  #include <stdio.h>
  #include <dwg.h>
  #include <libps/pslib.h>
! #include "suffix.h"
  
  void
  create_postscript(Dwg_Data *dwg, char *output)
diff -crBN orlibredwg/examples/get_bmp.c libredwg/examples/get_bmp.c
*** orlibredwg/examples/get_bmp.c	2013-04-30 19:00:51.766015177 +0530
--- libredwg/examples/get_bmp.c	2013-04-30 19:02:23.846015263 +0530
***************
*** 21,27 ****
  #include <stdio.h>
  #include <string.h>
  #include <dwg.h>
! #include "suffix.c"
  
  int
  get_bmp(char *filename)
--- 21,27 ----
  #include <stdio.h>
  #include <string.h>
  #include <dwg.h>
! #include "suffix.h"
  
  int
  get_bmp(char *filename)
diff -crBN orlibredwg/examples/load_dwg.c libredwg/examples/load_dwg.c
*** orlibredwg/examples/load_dwg.c	2013-04-30 19:00:51.766015177 +0530
--- libredwg/examples/load_dwg.c	2013-04-30 19:01:47.266015229 +0530
***************
*** 19,25 ****
   */
  
  #include <dwg.h>
! #include "suffix.c"
  
  void
  add_line(double x1, double y1, double x2, double y2)
--- 19,25 ----
   */
  
  #include <dwg.h>
! #include "suffix.h"
  
  void
  add_line(double x1, double y1, double x2, double y2)
diff -crBN orlibredwg/examples/rewrite.c libredwg/examples/rewrite.c
*** orlibredwg/examples/rewrite.c	2013-04-30 19:00:51.766015177 +0530
--- libredwg/examples/rewrite.c	2013-04-30 19:02:36.042015275 +0530
***************
*** 17,23 ****
  
  #include <stdio.h>
  #include <dwg.h>
! #include "suffix.c"
  #include "../src/common.h"
  #include <string.h>
  
--- 17,23 ----
  
  #include <stdio.h>
  #include <dwg.h>
! #include "suffix.h"
  #include "../src/common.h"
  #include <string.h>
  
diff -crBN orlibredwg/examples/suffix.c libredwg/examples/suffix.c
*** orlibredwg/examples/suffix.c	2013-04-30 19:00:51.766015177 +0530
--- libredwg/examples/suffix.c	1970-01-01 05:30:00.000000000 +0530
***************
*** 1,57 ****
- /*****************************************************************************/
- /*  LibreDWG - free implementation of the DWG file format                    */
- /*                                                                           */
- /*  Copyright (C) 2010 Thien-Thi Nguyen                                      */
- /*                                                                           */
- /*  This library is free software, licensed 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.  */
- /*  You should have received a copy of the GNU General Public License        */
- /*  along with this program.  If not, see <http://www.gnu.org/licenses/>.    */
- /*****************************************************************************/
- 
- /*
-  * suffix.c: avoid hardcoded input/output filenames
-  * written by Thien-Thi Nguyen
-  */
- 
- #include <stdio.h>
- #include <string.h>
- #include <libgen.h>
- #include <stdlib.h>
- 
- /* Return a newly `malloc'ed string made from "re-suffixing" FILENAME with
-    ".EXT" (note dot).  That is, when FILENAME has the form "STEM.dwg" the
-    value is "STEM.EXT", otherwise the value is "FILENAME.EXT".
- 
-    Caller should `free' the returned string when done using it.  */
- char *
- suffix (const char *filename, const char *ext)
- {
-   char *copy = strdup (filename);
-   char *base = basename (copy);
-   int len = strlen (base) + 1 + strlen (ext) + 1;
-   char *rv = malloc (len);
-   char *dot;
- 
-   if ((dot = strrchr (base, '.'))
-       && dot + 4 < base + len
-       && !strncmp (1 + dot, "dwg", 3))
-     *dot = '\0';
-   snprintf (rv, len, "%s.%s", base, ext);
-   free (copy);
-   return rv;
- }
- 
- #define REQUIRE_INPUT_FILE_ARG(argc)            \
-   do                                            \
-     {                                           \
-       if (1 == argc)                            \
-         {                                       \
-           puts ("No input file specified");     \
-           return 1;                             \
-         }                                       \
-     }                                           \
-   while (0)
- 
- /* suffix.c ends here */
--- 0 ----
diff -crBN orlibredwg/examples/suffix.h libredwg/examples/suffix.h
*** orlibredwg/examples/suffix.h	1970-01-01 05:30:00.000000000 +0530
--- libredwg/examples/suffix.h	2013-04-30 19:06:43.450015513 +0530
***************
*** 0 ****
--- 1,62 ----
+ /*****************************************************************************/
+ /*  LibreDWG - free implementation of the DWG file format                    */
+ /*                                                                           */
+ /*  Copyright (C) 2010 Thien-Thi Nguyen                                      */
+ /*                                                                           */
+ /*  This library is free software, licensed 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.  */
+ /*  You should have received a copy of the GNU General Public License        */
+ /*  along with this program.  If not, see <http://www.gnu.org/licenses/>.    */
+ /*****************************************************************************/
+ 
+ /*
+  * suffix.c: avoid hardcoded input/output filenames
+  * written by Thien-Thi Nguyen
+  * Modified by Gaganjyot
+  */
+ #ifndef SUFFIX_H
+ #define SUFFIX_H
+ 
+ #include <stdio.h>
+ #include <string.h>
+ #include <libgen.h>
+ #include <stdlib.h>
+ 
+ /* Return a newly `malloc'ed string made from "re-suffixing" FILENAME with
+    ".EXT" (note dot).  That is, when FILENAME has the form "STEM.dwg" the
+    value is "STEM.EXT", otherwise the value is "FILENAME.EXT".
+ 
+    Caller should `free' the returned string when done using it.  */
+ char *
+ suffix (const char *filename, const char *ext)
+ {
+   char *copy = strdup (filename);
+   char *base = basename (copy);
+   int len = strlen (base) + 1 + strlen (ext) + 1;
+   char *rv = (char*)malloc (len);
+   char *dot;
+ 
+   if ((dot = strrchr (base, '.'))
+       && dot + 4 < base + len
+       && !strncmp (1 + dot, "dwg", 3))
+     *dot = '\0';
+   snprintf (rv, len, "%s.%s", base, ext);
+   free (copy);
+   return rv;
+ }
+ 
+ #define REQUIRE_INPUT_FILE_ARG(argc)            \
+   do                                            \
+     {                                           \
+       if (1 == argc)                            \
+         {                                       \
+           puts ("No input file specified");     \
+           return 1;                             \
+         }                                       \
+     }                                           \
+   while (0)
+ 
+ 
+ #endif
+ /* suffix.c ends here */
diff -crBN orlibredwg/examples/test.c libredwg/examples/test.c
*** orlibredwg/examples/test.c	2013-04-30 19:00:51.766015177 +0530
--- libredwg/examples/test.c	2013-04-30 19:02:01.134015242 +0530
***************
*** 20,26 ****
  
  #include <stdio.h>
  #include <dwg.h>
! #include "suffix.c"
  
  int
  test_dwg_c(char *filename);
--- 20,26 ----
  
  #include <stdio.h>
  #include <dwg.h>
! #include "suffix.h"
  
  int
  test_dwg_c(char *filename);
diff -crBN orlibredwg/examples/testSVG.c libredwg/examples/testSVG.c
*** orlibredwg/examples/testSVG.c	2013-04-30 19:00:51.766015177 +0530
--- libredwg/examples/testSVG.c	2013-04-30 19:02:49.978015286 +0530
***************
*** 24,30 ****
  #include <math.h>
  #include <dwg.h>
  #include "../src/bits.h"
! #include "suffix.c"
  
  double model_xmin, model_ymin;
  double page_width, page_height, scale;
--- 24,30 ----
  #include <math.h>
  #include <dwg.h>
  #include "../src/bits.h"
! #include "suffix.h"
  
  double model_xmin, model_ymin;
  double page_width, page_height, scale;
