newlib/winsup/cygwin/dll_init.h

93 lines
1.6 KiB
C
Raw Normal View History

2000-02-17 20:38:33 +01:00
/* dll_init.h
2001-09-11 22:01:02 +02:00
Copyright 1998, 1999, 2000, 2001 Red Hat, Inc.
2000-02-17 20:38:33 +01:00
This file is part of Cygwin.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
struct per_module
2000-02-17 20:38:33 +01:00
{
char ***envptr;
void (**ctors)(void);
void (**dtors)(void);
void *data_start;
void *data_end;
void *bss_start;
void *bss_end;
int (*main)(int, char **, char **);
per_module &operator = (per_process *p)
{
envptr = p->envptr;
ctors = p->ctors;
dtors = p->dtors;
data_start = p->data_start;
data_end = p->data_end;
bss_start = p->bss_start;
bss_end = p->bss_end;
main = p->main;
return *this;
}
void run_ctors ();
void run_dtors ();
2000-02-17 20:38:33 +01:00
};
typedef enum
2000-02-17 20:38:33 +01:00
{
DLL_NONE,
DLL_LINK,
DLL_LOAD,
DLL_ANY
} dll_type;
2000-02-17 20:38:33 +01:00
struct dll
2000-02-17 20:38:33 +01:00
{
struct dll *next, *prev;
per_module p;
HMODULE handle;
int count;
dll_type type;
int namelen;
* dcrt0.cc: Include string.h. (initial_env): Use small_printf's %P specifier. * dll_init.cc (dll_list::alloc): Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. * dll_init.h (struct dll): Ditto. * environ.cc: Include string.h. (win_env::add_cache): Use temporary local buffer for path conversion. (posify): Ditto. * exceptions.cc (try_to_debug): Use CreateProcessW to allow long path names. * miscfuncs.cc: Drop unused implementations of strcasematch and strncasematch. (ch_case_eq): Drop. (strcasestr): Drop. (cygwin_wcscasecmp): New function. (cygwin_wcsncasecmp): New function. (cygwin_strcasecmp): New function. (cygwin_strncasecmp): New function. (cygwin_wcslwr): New function. (cygwin_wcsupr): New function. (cygwin_strlwr): New function. (cygwin_strupr): New function. * ntdll.h (RtlDowncaseUnicodeString): Declare. (RtlUpcaseUnicodeString): Declare. (RtlInt64ToHexUnicodeString): Fix typo in comment. * string.h: Disable not NLS aware implementations of strcasematch and strncasematch. (cygwin_strcasecmp): Declare. (strcasecmp): Define as cygwin_strcasecmp. (cygwin_strncasecmp): Declare. (strncasecmp): Define as cygwin_strncasecmp. (strcasematch):Define using cygwin_strcasecmp. (strncasematch):Define using cygwin_strncasecmp. (cygwin_strlwr): Declare. (strlwr): Define as cygwin_strlwr. (cygwin_strupr): Declare. (strupr): Define as cygwin_strupr. * wchar.h: New file. * wincap.cc (wincapc::init): Use "NT" as fix OS string. * winsup.h (strcasematch): Drop declaration. (strncasematch): Ditto. (strcasestr): Ditto.
2007-12-12 13:12:24 +01:00
char name[PATH_MAX];
void detach ();
int init ();
2000-02-17 20:38:33 +01:00
};
#define MAX_DLL_BEFORE_INIT 100
2000-02-17 20:38:33 +01:00
class dll_list
2000-02-17 20:38:33 +01:00
{
dll *end;
dll *hold;
dll_type hold_type;
2000-02-17 20:38:33 +01:00
public:
dll start;
int tot;
int loaded_dlls;
int reload_on_fork;
dll *operator [] (const char *name);
dll *alloc (HINSTANCE, per_process *, dll_type);
void detach (void *);
void init ();
void load_after_fork (HANDLE, dll *);
dll *inext ()
{
while ((hold = hold->next))
if (hold_type == DLL_ANY || hold->type == hold_type)
break;
return hold;
}
dll *istart (dll_type t)
{
hold_type = t;
hold = &start;
return inext ();
}
2000-02-17 20:38:33 +01:00
};
extern dll_list dlls;
void dll_global_dtors ();