メインページ   クラス階層   構成   ファイル一覧   構成メンバ   ファイルメンバ  

kpse-xfns.c

解説を見る。
00001 /*
00002 
00003 Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
00004 Copyright (C) 1993, 94, 95, 96, 97, 98 Karl Berry.
00005 Copyright (C) 1994, 95, 96, 97 Karl Berry & Olaf Weber.
00006 
00007 This library is free software; you can redistribute it and/or
00008 modify it under the terms of the GNU Library General Public
00009 License as published by the Free Software Foundation; either
00010 version 2 of the License, or (at your option) any later version.
00011 
00012 This library is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015 Library General Public License for more details.
00016 
00017 You should have received a copy of the GNU Library General Public
00018 License along with this library; if not, write to the Free Software
00019 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00020 
00021 #if defined (HAVE_CONFIG_H)
00022 #include <config.h>
00023 #endif
00024 
00025 #include <string.h>
00026 
00027 #include "kpse-xfns.h"
00028 
00029 /* Return the last element in a path.  */
00030 
00031 #ifndef HAVE_BASENAME
00032 
00033 /* Return NAME with any leading path stripped off.  This returns a
00034    pointer into NAME.  For example, `basename ("/foo/bar.baz")'
00035    returns "bar.baz".  */
00036 
00037 static const char *
00038 basename (const char *name)
00039 {
00040   const char *base = NULL;
00041   unsigned len = strlen (name);
00042   
00043   for (len = strlen (name); len > 0; len--) {
00044     if (IS_DIR_SEP (name[len - 1]) || IS_DEVICE_SEP (name[len - 1])) {
00045       base = name + len;
00046       break;
00047     }
00048   }
00049 
00050   if (!base)
00051     base = name;
00052   
00053   return base;
00054 }
00055 
00056 #endif
00057 
00058 const char *
00059 octave_basename (const char *name)
00060 {
00061   return (const char *) basename (name);
00062 }

Wed Dec 29 11:51:37 2004に生成されました。 doxygen1.2.18
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送