mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-01 12:00:35 +08:00
Add miscfuncs.h to files as needed throughout.
* mount.cc: New file. * path.cc: Move mount-specific stuff into mount.cc. Move common stuff into miscfuncs.cc. Remove unneeded includes. * miscfuncs.cc: Move some common path functions here. * miscfuncs.h: New file. * winsup.h: Move miscelleneous functions to miscfuncs.h. * dcrt0.cc: Remove unneeded includes. * Makefile.in (DLL_OFILES): Add mount.o. * include/cygwin/config.h: Fix a minor typo.
This commit is contained in:
parent
6c74e7d7fc
commit
ade47a3430
@ -1,3 +1,17 @@
|
||||
2008-04-07 Christopher Faylor <me+cygwin@cgf.cx>
|
||||
|
||||
Add miscfuncs.h to files as needed throughout.
|
||||
* mount.cc: New file.
|
||||
* path.cc: Move mount-specific stuff into mount.cc. Move common stuff
|
||||
into miscfuncs.cc. Remove unneeded includes.
|
||||
* miscfuncs.cc: Move some common path functions here.
|
||||
* miscfuncs.h: New file.
|
||||
* winsup.h: Move miscelleneous functions to miscfuncs.h.
|
||||
* dcrt0.cc: Remove unneeded includes.
|
||||
* Makefile.in (DLL_OFILES): Add mount.o.
|
||||
|
||||
* include/cygwin/config.h: Fix a minor typo.
|
||||
|
||||
2008-04-07 Corinna Vinschen <corinna@vinschen.de>
|
||||
|
||||
* postinstall: Set IFS to LF only. Change while loop in subshell to
|
||||
|
@ -136,8 +136,8 @@ DLL_OFILES:=assert.o autoload.o bsdlib.o ctype.o cxx.o cygheap.o cygthread.o \
|
||||
fhandler_termios.o fhandler_tty.o fhandler_virtual.o fhandler_windows.o \
|
||||
fhandler_zero.o flock.o fnmatch.o fork.o fts.o ftw.o getopt.o glob.o \
|
||||
grp.o heap.o hookapi.o inet_addr.o inet_network.o init.o ioctl.o ipc.o \
|
||||
localtime.o lsearch.o malloc_wrapper.o minires-os-if.o \
|
||||
minires.o miscfuncs.o mktemp.o mmap.o msg.o net.o netdb.o nftw.o ntea.o \
|
||||
localtime.o lsearch.o malloc_wrapper.o minires-os-if.o minires.o \
|
||||
miscfuncs.o mktemp.o mmap.o msg.o mount.o net.o netdb.o nftw.o ntea.o \
|
||||
passwd.o path.o pinfo.o pipe.o poll.o posix_ipc.o pthread.o random.o \
|
||||
regcomp.o regerror.o regexec.o regfree.o registry.o resource.o rexec.o \
|
||||
rcmd.o scandir.o sched.o sec_acl.o sec_auth.o sec_helper.o security.o \
|
||||
|
@ -9,9 +9,12 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#define USE_SYS_TYPES_FD_SET
|
||||
#include <winsock2.h>
|
||||
|
||||
bool NO_COPY wsock_started;
|
||||
|
||||
/* Macro for defining "auto-load" functions.
|
||||
* Note that this is self-modifying code *gasp*.
|
||||
* The first invocation of a routine will trigger the loading of
|
||||
@ -243,7 +246,6 @@ std_dll_init ()
|
||||
}
|
||||
|
||||
/* Initialization function for winsock stuff. */
|
||||
bool NO_COPY wsock_started = 0;
|
||||
WSADATA NO_COPY wsadata;
|
||||
__attribute__ ((used, noinline, regparm(1))) static long long
|
||||
wsock_init ()
|
||||
|
@ -7,6 +7,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include "exceptions.h"
|
||||
|
@ -10,23 +10,16 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "glob.h"
|
||||
#include "exceptions.h"
|
||||
#include <ctype.h>
|
||||
#include <limits.h>
|
||||
#include <winnls.h>
|
||||
#include <wingdi.h>
|
||||
#include <winuser.h>
|
||||
#include "sigproc.h"
|
||||
#include "pinfo.h"
|
||||
#include "cygerrno.h"
|
||||
#define NEED_VFORK
|
||||
#include "perprocess.h"
|
||||
#include "security.h"
|
||||
#include "path.h"
|
||||
#include "fhandler.h"
|
||||
#include "dtable.h"
|
||||
@ -36,9 +29,7 @@ details. */
|
||||
#include "shared_info.h"
|
||||
#include "cygwin_version.h"
|
||||
#include "dll_init.h"
|
||||
#include "sync.h"
|
||||
#include "heap.h"
|
||||
#include "environ.h"
|
||||
#include "tls_pbuf.h"
|
||||
|
||||
#define MAX_AT_FILE_LEVEL 10
|
||||
@ -116,9 +107,9 @@ extern "C"
|
||||
#ifdef DEBUGGING
|
||||
int pinger;
|
||||
#endif
|
||||
int NO_COPY __api_fatal_exit_val = 1;
|
||||
};
|
||||
|
||||
int NO_COPY __api_fatal_exit_val = 1;
|
||||
char *old_title;
|
||||
char title_buf[TITLESIZE + 1];
|
||||
|
||||
|
@ -40,7 +40,7 @@ char * __stdcall getwinenveq (const char *name, size_t len, int)
|
||||
__attribute__ ((regparm (3)));
|
||||
|
||||
void __stdcall update_envptrs ();
|
||||
extern char **__cygwin_environ, ***main_environ;
|
||||
extern "C" char **__cygwin_environ, ***main_environ;
|
||||
extern "C" char __stdcall **cur_environ ();
|
||||
char ** __stdcall build_env (const char * const *envp, PWCHAR &envblock,
|
||||
int &envc, bool need_envblock)
|
||||
|
@ -10,6 +10,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <wingdi.h>
|
||||
#include <winuser.h>
|
||||
#include <imagehlp.h>
|
||||
|
@ -10,6 +10,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <sys/termios.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -9,6 +9,7 @@
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -9,6 +9,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/cygwin.h>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* cygwin/config.h header file for Cygwin.
|
||||
|
||||
This wraps Cygwin configuration setting which were in newlib's
|
||||
sys/config.h before. THis way we can manaage our configuration
|
||||
sys/config.h before. This way we can manaage our configuration
|
||||
setting without bothering newlib.
|
||||
|
||||
Copyright 2003 Red Hat, Inc.
|
||||
|
@ -10,8 +10,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "cygerrno.h"
|
||||
#include <sys/errno.h>
|
||||
#include "miscfuncs.h"
|
||||
#include <sys/uio.h>
|
||||
#include <assert.h>
|
||||
#include <alloca.h>
|
||||
@ -20,7 +19,6 @@ details. */
|
||||
#include <wingdi.h>
|
||||
#include <winuser.h>
|
||||
#include <winnls.h>
|
||||
#include "cygthread.h"
|
||||
#include "cygtls.h"
|
||||
#include "ntdll.h"
|
||||
|
||||
@ -500,3 +498,51 @@ create_pipe (PHANDLE hr,PHANDLE hw, LPSECURITY_ATTRIBUTES sa, DWORD n)
|
||||
break;
|
||||
return false;
|
||||
}
|
||||
|
||||
/* backslashify: Convert all forward slashes in src path to back slashes
|
||||
in dst path. Add a trailing slash to dst when trailing_slash_p arg
|
||||
is set to 1. */
|
||||
|
||||
void
|
||||
backslashify (const char *src, char *dst, bool trailing_slash_p)
|
||||
{
|
||||
const char *start = src;
|
||||
|
||||
while (*src)
|
||||
{
|
||||
if (*src == '/')
|
||||
*dst++ = '\\';
|
||||
else
|
||||
*dst++ = *src;
|
||||
++src;
|
||||
}
|
||||
if (trailing_slash_p
|
||||
&& src > start
|
||||
&& !isdirsep (src[-1]))
|
||||
*dst++ = '\\';
|
||||
*dst++ = 0;
|
||||
}
|
||||
|
||||
/* slashify: Convert all back slashes in src path to forward slashes
|
||||
in dst path. Add a trailing slash to dst when trailing_slash_p arg
|
||||
is set to 1. */
|
||||
|
||||
void
|
||||
slashify (const char *src, char *dst, bool trailing_slash_p)
|
||||
{
|
||||
const char *start = src;
|
||||
|
||||
while (*src)
|
||||
{
|
||||
if (*src == '\\')
|
||||
*dst++ = '/';
|
||||
else
|
||||
*dst++ = *src;
|
||||
++src;
|
||||
}
|
||||
if (trailing_slash_p
|
||||
&& src > start
|
||||
&& !isdirsep (src[-1]))
|
||||
*dst++ = '/';
|
||||
*dst++ = 0;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
|
1610
winsup/cygwin/mount.cc
Normal file
1610
winsup/cygwin/mount.cc
Normal file
File diff suppressed because it is too large
Load Diff
@ -14,6 +14,7 @@ details. */
|
||||
#define __INSIDE_CYGWIN_NET__
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <ctype.h>
|
||||
#include <wchar.h>
|
||||
#include <sys/socket.h>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -331,6 +331,9 @@ bool fnunmunge (char *, const char *) __attribute__ ((regparm (2)));
|
||||
int path_prefix_p (const char *path1, const char *path2, int len1) __attribute__ ((regparm (3)));
|
||||
|
||||
bool is_floppy (const char *);
|
||||
int normalize_win32_path (const char *, char *, char *&);
|
||||
int normalize_posix_path (const char *, char *, char *&);
|
||||
PUNICODE_STRING get_nt_native_path (const char *, UNICODE_STRING&, bool);
|
||||
|
||||
/* FIXME: Move to own include file eventually */
|
||||
|
||||
|
@ -10,6 +10,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <limits.h>
|
||||
|
@ -15,6 +15,7 @@
|
||||
#endif
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <limits.h>
|
||||
#include "cygerrno.h"
|
||||
#include <assert.h>
|
||||
|
@ -10,6 +10,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -12,6 +12,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <sys/wait.h>
|
||||
|
@ -15,6 +15,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <sys/wait.h>
|
||||
|
@ -24,6 +24,7 @@ details. */
|
||||
#define pwrite __FOO_pwrite
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <sys/stat.h>
|
||||
#include <sys/vfs.h> /* needed for statfs */
|
||||
#include <sys/statvfs.h> /* needed for statvfs */
|
||||
|
@ -28,6 +28,7 @@ details. */
|
||||
#endif
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <limits.h>
|
||||
#include "path.h"
|
||||
#include "cygerrno.h"
|
||||
|
@ -10,6 +10,7 @@ Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
details. */
|
||||
|
||||
#include "winsup.h"
|
||||
#include "miscfuncs.h"
|
||||
#include <unistd.h>
|
||||
#include <utmp.h>
|
||||
#include <wingdi.h>
|
||||
|
@ -45,8 +45,8 @@ details. */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern __uid32_t getuid32 (void);
|
||||
extern __uid32_t geteuid32 (void);
|
||||
extern __uid32_t getuid32 ();
|
||||
extern __uid32_t geteuid32 ();
|
||||
extern int seteuid32 (__uid32_t);
|
||||
extern __gid32_t getegid32 (void);
|
||||
extern struct passwd *getpwuid32 (__uid32_t);
|
||||
@ -119,9 +119,6 @@ extern UINT active_codepage;
|
||||
|
||||
void codepage_init (const char *buf);
|
||||
UINT get_cp ();
|
||||
bool is_cp_multibyte (UINT cp);
|
||||
const unsigned char *next_char (UINT cp, const unsigned char *str,
|
||||
const unsigned char *end);
|
||||
|
||||
/* Used as type by sys_wcstombs_alloc and sys_mbstowcs_alloc. For a
|
||||
description see there. */
|
||||
@ -296,14 +293,8 @@ void init_console_handler (bool);
|
||||
|
||||
void init_global_security ();
|
||||
|
||||
int __stdcall check_invalid_virtual_addr (const void *s, unsigned sz) __attribute__ ((regparm(2)));
|
||||
|
||||
ssize_t check_iovec (const struct iovec *, int, bool) __attribute__ ((regparm(3)));
|
||||
#define check_iovec_for_read(a, b) check_iovec ((a), (b), false)
|
||||
#define check_iovec_for_write(a, b) check_iovec ((a), (b), true)
|
||||
|
||||
#define set_winsock_errno() __set_winsock_errno (__FUNCTION__, __LINE__)
|
||||
void __set_winsock_errno (const char *fn, int ln) __attribute__ ((regparm(2)));
|
||||
#define set_winsock_errno() __set_winsock_errno (__FUNCTION__, __LINE__)
|
||||
|
||||
extern bool wsock_started;
|
||||
|
||||
@ -328,9 +319,6 @@ int __stdcall stat_worker (path_conv &pc, struct __stat64 *buf) __attribute__ ((
|
||||
|
||||
__ino64_t __stdcall readdir_get_ino (const char *path, bool dot_dot) __attribute__ ((regparm (2)));
|
||||
|
||||
extern "C" int low_priority_sleep (DWORD) __attribute__ ((regparm (1)));
|
||||
#define SLEEP_0_STAY_LOW INFINITE
|
||||
|
||||
/* Returns the real page size, not the allocation size. */
|
||||
size_t getsystempagesize ();
|
||||
|
||||
@ -343,13 +331,6 @@ enum mmap_region_status
|
||||
};
|
||||
mmap_region_status mmap_is_attached_or_noreserve (void *addr, size_t len);
|
||||
|
||||
int winprio_to_nice (DWORD) __attribute__ ((regparm (1)));
|
||||
DWORD nice_to_winprio (int &) __attribute__ ((regparm (1)));
|
||||
|
||||
bool __stdcall create_pipe (PHANDLE, PHANDLE, LPSECURITY_ATTRIBUTES, DWORD)
|
||||
__attribute__ ((regparm (3)));
|
||||
#define CreatePipe create_pipe
|
||||
|
||||
inline bool flush_file_buffers (HANDLE h)
|
||||
{
|
||||
return (GetFileType (h) != FILE_TYPE_PIPE) ? FlushFileBuffers (h) : true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user