Ignore:
Timestamp:
Jul 13, 2017, 9:01:05 AM (22 months ago)
Author:
Juanma
Message:

Initial release

File:
1 edited

Legend:

Unmodified
Added
Removed
  • squid-ssl/trunk/fuentes/libltdl/ltdl.c

    r5495 r5496  
    11/* ltdl.c -- system independent dlopen wrapper
    22
    3    Copyright (C) 1998-2000, 2004-2008, 2011-2015 Free Software
    4   Foundation, Inc.
     3   Copyright (C) 1998, 1999, 2000, 2004, 2005, 2006,
     4                 2007, 2008, 2011 Free Software Foundation, Inc.
    55   Written by Thomas Tanner, 1998
    66
     
    4747
    4848/* max. filename length */
    49 #if !defined LT_FILENAME_MAX
     49#if !defined(LT_FILENAME_MAX)
    5050#  define LT_FILENAME_MAX       1024
    5151#endif
    5252
    53 #if !defined LT_LIBEXT
     53#if !defined(LT_LIBEXT)
    5454#  define LT_LIBEXT "a"
    5555#endif
    5656
    57 #if !defined LT_LIBPREFIX
     57#if !defined(LT_LIBPREFIX)
    5858#  define LT_LIBPREFIX "lib"
    5959#endif
     
    7878static  const char      libext[]                = LT_LIBEXT;
    7979static  const char      libprefix[]             = LT_LIBPREFIX;
    80 #if defined LT_MODULE_EXT
     80#if defined(LT_MODULE_EXT)
    8181static  const char      shlib_ext[]             = LT_MODULE_EXT;
    8282#endif
    8383/* If the loadable module suffix is not the same as the linkable
    8484 * shared library suffix, this will be defined. */
    85 #if defined LT_SHARED_EXT
     85#if defined(LT_SHARED_EXT)
    8686static  const char      shared_ext[]            = LT_SHARED_EXT;
    8787#endif
    88 #if defined LT_DLSEARCH_PATH
     88#if defined(LT_DLSEARCH_PATH)
    8989static  const char      sys_dlsearch_path[]     = LT_DLSEARCH_PATH;
    9090#endif
     
    308308                        }
    309309                      /* Make sure that the handle pointed to by 'cur' still exists.
    310                          lt_dlclose recursively closes dependent libraries, which removes
     310                         lt_dlclose recursively closes dependent libraries which removes
    311311                         them from the linked list.  One of these might be the one
    312312                         pointed to by 'cur'.  */
     
    387387      if ((handle->info.filename == filename) /* dlopen self: 0 == 0 */
    388388          || (handle->info.filename && filename
    389               && STREQ (handle->info.filename, filename)))
     389              && streq (handle->info.filename, filename)))
    390390        {
    391391          break;
     
    446446                                                        filename, advise);
    447447#ifdef LT_DEBUG_LOADERS
    448         if (!handle->module) {
    449                 char *error;
    450                 LT__GETERROR(error);
    451                 fprintf (stderr, "  Result: Failed\n"
    452                                 "  Error message << %s >>\n",
    453                                 error ? error : "(null)");
    454         } else {
    455                 fprintf (stderr, "  Result: Success\n");
    456         }
     448        fprintf (stderr, "  Result: %s\n",
     449                 handle->module ? "Success" : "Failed");
    457450#endif
    458451
     
    504497  assert (dirname);
    505498  assert (dlname);
    506 #if defined LT_DIRSEP_CHAR
     499#if defined(LT_DIRSEP_CHAR)
    507500  /* Only canonicalized names (i.e. with DIRSEP chars already converted)
    508501     should make it into this function:  */
     
    615608        /* Anything other than a directory separator is copied verbatim.  */
    616609        if ((path[src] != '/')
    617 #if defined LT_DIRSEP_CHAR
     610#if defined(LT_DIRSEP_CHAR)
    618611            && (path[src] != LT_DIRSEP_CHAR)
    619612#endif
     
    627620        else if ((path[1+ src] != LT_PATHSEP_CHAR)
    628621                 && (path[1+ src] != LT_EOS_CHAR)
    629 #if defined LT_DIRSEP_CHAR
     622#if defined(LT_DIRSEP_CHAR)
    630623                 && (path[1+ src] != LT_DIRSEP_CHAR)
    631624#endif
     
    815808}
    816809
    817 #if !defined LTDL_DLOPEN_DEPLIBS
     810#if !defined(LTDL_DLOPEN_DEPLIBS)
    818811static int
    819 load_deplibs (lt_dlhandle handle, char * deplibs LT__UNUSED)
     812load_deplibs (lt_dlhandle handle, char * LT__UNUSED deplibs)
    820813{
    821814  handle->depcount = 0;
     
    823816}
    824817
    825 #else /* defined LTDL_DLOPEN_DEPLIBS */
     818#else /* defined(LTDL_DLOPEN_DEPLIBS) */
    826819static int
    827820load_deplibs (lt_dlhandle handle, char *deplibs)
     
    978971  return errors;
    979972}
    980 #endif /* defined LTDL_DLOPEN_DEPLIBS */
     973#endif /* defined(LTDL_DLOPEN_DEPLIBS) */
    981974
    982975static int
     
    11171110          errors += trim (deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]);
    11181111        }
    1119       else if (STREQ (line, "installed=yes\n"))
     1112      else if (streq (line, "installed=yes\n"))
    11201113        {
    11211114          *installed = 1;
    11221115        }
    1123       else if (STREQ (line, "installed=no\n"))
     1116      else if (streq (line, "installed=no\n"))
    11241117        {
    11251118          *installed = 0;
     
    12421235        }
    12431236
    1244       strlcpy (dir, canonical, dirlen);
     1237      strncpy (dir, canonical, dirlen);
    12451238      dir[dirlen] = LT_EOS_CHAR;
    12461239
     
    12831276  }
    12841277
    1285   /* Before trawling through the file system in search of a module,
     1278  /* Before trawling through the filesystem in search of a module,
    12861279     check whether we are opening a preloaded module.  */
    12871280  if (!dir)
     
    13331326
    13341327  /* Check whether we are opening a libtool module (.la extension).  */
    1335   if (ext && STREQ (ext, archive_ext))
     1328  if (ext && streq (ext, archive_ext))
    13361329    {
    13371330      /* this seems to be a libtool module */
     
    13651358            }
    13661359
    1367 #if defined LT_MODULE_PATH_VAR
     1360#if defined(LT_MODULE_PATH_VAR)
    13681361          if (!file)
    13691362            {
     
    13731366            }
    13741367#endif
    1375 #if defined LT_DLSEARCH_PATH
     1368#if defined(LT_DLSEARCH_PATH)
    13761369          if (!file && *sys_dlsearch_path)
    13771370            {
     
    14701463                   && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name,
    14711464                                    &newhandle, advise)
    1472 #if defined LT_MODULE_PATH_VAR
     1465#if defined(LT_MODULE_PATH_VAR)
    14731466                   && !find_handle (getenv (LT_MODULE_PATH_VAR), base_name,
    14741467                                    &newhandle, advise)
    14751468#endif
    1476 #if defined LT_DLSEARCH_PATH
     1469#if defined(LT_DLSEARCH_PATH)
    14771470                   && !find_handle (sys_dlsearch_path, base_name,
    14781471                                    &newhandle, advise)
     
    15211514
    15221515
    1523 /* If the last error message stored was 'FILE_NOT_FOUND', then return
     1516/* If the last error message stored was `FILE_NOT_FOUND', then return
    15241517   non-zero.  */
    15251518static int
     
    15471540  ext = strrchr (filename, '.');
    15481541
    1549   if (ext && ((STREQ (ext, archive_ext))
    1550 #if defined LT_MODULE_EXT
    1551              || (STREQ (ext, shlib_ext))
    1552 #endif
    1553 #if defined LT_SHARED_EXT
    1554              || (STREQ (ext, shared_ext))
     1542  if (ext && ((streq (ext, archive_ext))
     1543#if defined(LT_MODULE_EXT)
     1544             || (streq (ext, shlib_ext))
     1545#endif
     1546#if defined(LT_SHARED_EXT)
     1547             || (streq (ext, shared_ext))
    15551548#endif
    15561549    ))
     
    16891682        return handle;
    16901683
    1691 #if defined LT_MODULE_EXT
     1684#if defined(LT_MODULE_EXT)
    16921685      /* Try appending SHLIB_EXT.   */
    16931686      LT__SETERRORSTR (saved_error);
     
    17001693#endif
    17011694
    1702 #if defined LT_SHARED_EXT
     1695#if defined(LT_SHARED_EXT)
    17031696      /* Try appending SHARED_EXT.   */
    17041697      LT__SETERRORSTR (saved_error);
     
    19281921        }
    19291922
    1930 #if defined LT_MODULE_PATH_VAR
     1923#if defined(LT_MODULE_PATH_VAR)
    19311924      if (!is_done)
    19321925        {
     
    19351928        }
    19361929#endif
    1937 #if defined LT_DLSEARCH_PATH
     1930#if defined(LT_DLSEARCH_PATH)
    19381931      if (!is_done && *sys_dlsearch_path)
    19391932        {
     
    22902283
    22912284typedef struct {
    2292   char *id_string;
     2285  const char *id_string;
    22932286  lt_dlhandle_interface *iface;
    22942287} lt__interface_id;
     
    24372430    {
    24382431      lt_dlhandle cur = handle;
    2439       if (cur && cur->info.name && STREQ (cur->info.name, module_name))
     2432      if (cur && cur->info.name && streq (cur->info.name, module_name))
    24402433        break;
    24412434    }
Note: See TracChangeset for help on using the changeset viewer.