ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

makepath.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:     ReactOS CRT library
00003  * LICENSE:     See COPYING in the top level directory
00004  * FILE:        lib/sdk/crt/stdlib/makepath.c
00005  * PURPOSE:     Creates a path
00006  * PROGRAMMERS: Wine team
00007  *              Copyright 1996,1998 Marcus Meissner
00008  *              Copyright 1996 Jukka Iivonen
00009  *              Copyright 1997,2000 Uwe Bonnes
00010  *              Copyright 2000 Jon Griffiths
00011  *
00012  */
00013 
00014 /* $Id: makepath.c 53713 2011-09-15 17:11:53Z tkreuzer $
00015  */
00016 #include <precomp.h>
00017 #include <stdlib.h>
00018 #include <string.h>
00019 
00020 /*
00021  * @implemented
00022  */
00023 void _makepath(char* path, const char* drive, const char* dir, const char* fname, const char* ext)
00024 {
00025     char *p = path;
00026 
00027     if ( !path )
00028         return;
00029 
00030     if (drive && drive[0])
00031     {
00032         *p++ = drive[0];
00033         *p++ = ':';
00034     }
00035     if (dir && dir[0])
00036     {
00037         size_t len = strlen(dir);
00038         memmove(p, dir, len);
00039         p += len;
00040         if (p[-1] != '/' && p[-1] != '\\')
00041             *p++ = '\\';
00042     }
00043     if (fname && fname[0])
00044     {
00045         size_t len = strlen(fname);
00046         memmove(p, fname, len);
00047         p += len;
00048     }
00049     if (ext && ext[0])
00050     {
00051         if (ext[0] != '.')
00052             *p++ = '.';
00053         strcpy(p, ext);
00054     }
00055     else
00056         *p = '\0';
00057 }

Generated on Sat May 26 2012 04:35:35 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.