home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / gnuc / library / rcs / symlink.c,v < prev    next >
Encoding:
Text File  |  1992-07-04  |  2.1 KB  |  105 lines

  1. head    1.2;
  2. access;
  3. symbols
  4.     version39-41:1.2;
  5. locks;
  6. comment    @ *  @;
  7.  
  8.  
  9. 1.2
  10. date    92.07.04.19.21.58;    author mwild;    state Exp;
  11. branches;
  12. next    1.1;
  13.  
  14. 1.1
  15. date    92.05.14.19.55.40;    author mwild;    state Exp;
  16. branches;
  17. next    ;
  18.  
  19.  
  20. desc
  21. @symbolic link creator
  22. @
  23.  
  24.  
  25. 1.2
  26. log
  27. @cut a possibly leading `./' in symlink contents. This is a kludge, but it's
  28. the only way to get `configure' working without changes.
  29. @
  30. text
  31. @/*
  32.  *  This file is part of ixemul.library for the Amiga.
  33.  *  Copyright (C) 1991, 1992  Markus M. Wild
  34.  *
  35.  *  This library is free software; you can redistribute it and/or
  36.  *  modify it under the terms of the GNU Library General Public
  37.  *  License as published by the Free Software Foundation; either
  38.  *  version 2 of the License, or (at your option) any later version.
  39.  *
  40.  *  This library is distributed in the hope that it will be useful,
  41.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  42.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  43.  *  Library General Public License for more details.
  44.  *
  45.  *  You should have received a copy of the GNU Library General Public
  46.  *  License along with this library; if not, write to the Free
  47.  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  48.  *
  49.  *  $Id: symlink.c,v 1.1 1992/05/14 19:55:40 mwild Exp $
  50.  *
  51.  *  $Log: symlink.c,v $
  52.  * Revision 1.1  1992/05/14  19:55:40  mwild
  53.  * Initial revision
  54.  *
  55.  */
  56.  
  57. #define KERNEL
  58. #include "ixemul.h"
  59.  
  60. #if __GNUC__ != 2
  61. #define alloca __builtin_alloca
  62. #endif
  63.  
  64. #ifndef LINK_SOFT
  65. #define LINK_SOFT 1
  66. #endif
  67.  
  68. int
  69. symlink (char *old, char *new)
  70. {
  71.   char *lstr;
  72.   int len;
  73.  
  74.   /* is long-alignment needed here? This is DOS, isn't it... */
  75.   lstr = alloca (strlen (old) + 3);
  76.   lstr = LONG_ALIGN (lstr);
  77.  
  78.   /* this is a kludge.. but it's the easiest way to get GNU configure
  79.      scripts running without too many changes. */
  80.   if (! strncmp (old, "./", 2))
  81.     strcpy (lstr, old + 2);
  82.   else
  83.     strcpy (lstr, old);
  84.  
  85.   return __make_link (new, lstr, LINK_SOFT) == -1 ? 0 : -1;
  86. }
  87. @
  88.  
  89.  
  90. 1.1
  91. log
  92. @Initial revision
  93. @
  94. text
  95. @d19 1
  96. a19 1
  97.  *  $Id$
  98. d21 4
  99. a24 1
  100.  *  $Log$
  101. d47 7
  102. a53 1
  103.   strcpy (lstr, old);
  104. @
  105.