├── .gitignore ├── sys ├── machine │ ├── signal.h │ ├── endian.h │ └── limits.h └── sys │ ├── dirent.h │ ├── statvfs.h │ ├── uio.h │ ├── syslimits.h │ ├── ioctl.h │ ├── types.h │ ├── time.h │ └── unistd.h ├── lib └── w2k │ └── free │ └── i386 │ ├── cxfuse.dll │ ├── cxfuse.lib │ ├── libfs.lib │ ├── libgen.lib │ ├── libfuse.lib │ └── libgenm.lib ├── sshfs ├── glib-2.0 │ ├── glib-2.0.lib │ ├── gthread-2.0.lib │ ├── glib │ │ ├── gi18n.h │ │ ├── ghostutils.h │ │ ├── gi18n-lib.h │ │ ├── gbitlock.h │ │ ├── gqsort.h │ │ ├── gmappedfile.h │ │ ├── gpattern.h │ │ ├── gprimes.h │ │ ├── gshell.h │ │ ├── gprintf.h │ │ ├── gdir.h │ │ ├── gquark.h │ │ ├── gtimer.h │ │ ├── gbase64.h │ │ ├── gurifuncs.h │ │ ├── gbacktrace.h │ │ ├── gcache.h │ │ ├── gcompletion.h │ │ ├── grand.h │ │ ├── gtimezone.h │ │ ├── gchecksum.h │ │ ├── gslice.h │ │ ├── gerror.h │ │ ├── grel.h │ │ ├── gtree.h │ │ ├── gwin32.h │ │ ├── gfileutils.h │ │ ├── gpoll.h │ │ ├── gatomic.h │ │ ├── galloca.h │ │ ├── gstdio.h │ │ ├── gqueue.h │ │ ├── gasyncqueue.h │ │ ├── gslist.h │ │ ├── gthreadpool.h │ │ ├── glist.h │ │ └── gdataset.h │ └── glib.h ├── Makefile ├── config.h ├── sshnodelay.c ├── SOURCES ├── cache.h └── Makefile.mingw ├── include ├── fuse_opt.h ├── fuse_lowlevel.h ├── semaphore.h ├── grp.h ├── err.h ├── pthread.h ├── paths.h ├── regex.h ├── dirent.h └── pwd.h ├── hello ├── Makefile ├── SOURCES ├── Makefile.mingw └── hello.c ├── hello_ll ├── Makefile ├── SOURCES ├── Makefile.mingw └── hello_ll.c ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | CVS/ 2 | -------------------------------------------------------------------------------- /sys/machine/signal.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/w2k/free/i386/cxfuse.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossmeta/cxfuse/HEAD/lib/w2k/free/i386/cxfuse.dll -------------------------------------------------------------------------------- /lib/w2k/free/i386/cxfuse.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossmeta/cxfuse/HEAD/lib/w2k/free/i386/cxfuse.lib -------------------------------------------------------------------------------- /lib/w2k/free/i386/libfs.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossmeta/cxfuse/HEAD/lib/w2k/free/i386/libfs.lib -------------------------------------------------------------------------------- /lib/w2k/free/i386/libgen.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossmeta/cxfuse/HEAD/lib/w2k/free/i386/libgen.lib -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib-2.0.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossmeta/cxfuse/HEAD/sshfs/glib-2.0/glib-2.0.lib -------------------------------------------------------------------------------- /lib/w2k/free/i386/libfuse.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossmeta/cxfuse/HEAD/lib/w2k/free/i386/libfuse.lib -------------------------------------------------------------------------------- /lib/w2k/free/i386/libgenm.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossmeta/cxfuse/HEAD/lib/w2k/free/i386/libgenm.lib -------------------------------------------------------------------------------- /sshfs/glib-2.0/gthread-2.0.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crossmeta/cxfuse/HEAD/sshfs/glib-2.0/gthread-2.0.lib -------------------------------------------------------------------------------- /include/fuse_opt.h: -------------------------------------------------------------------------------- 1 | #ifndef _FUSE_OPT_H 2 | #define _FUSE_OPT_H 3 | 4 | #include 5 | 6 | #endif /* _FUSE_OPT_H */ 7 | -------------------------------------------------------------------------------- /include/fuse_lowlevel.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FUSE_LOWLEVEL_H_ 3 | #define _FUSE_LOWLEVEL_H_ 4 | 5 | #define _FUSE_LOWLEVEL_ 6 | #include 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /hello/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the components of NT OS/2 5 | # 6 | !INCLUDE $(NTMAKEENV)\makefile.def 7 | -------------------------------------------------------------------------------- /hello_ll/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the components of NT OS/2 5 | # 6 | !INCLUDE $(NTMAKEENV)\makefile.def 7 | -------------------------------------------------------------------------------- /sshfs/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 3 | # file to this component. This file merely indirects to the real make file 4 | # that is shared by all the components of NT OS/2 5 | # 6 | !INCLUDE $(NTMAKEENV)\makefile.def 7 | -------------------------------------------------------------------------------- /sshfs/config.h: -------------------------------------------------------------------------------- 1 | 2 | #define PACKAGE_NAME "sshfs-fuse" 3 | #define PACKAGE_STRING "sshfs-fuse 2.3" 4 | #define PACKAGE_VERSION "2.3" 5 | #define PACKAGE "sshfs-fuse" 6 | #define VERSION "2.3" 7 | 8 | #define PATH_MAX 1024 9 | 10 | 11 | #define EBADMSG ENOMSG 12 | 13 | -------------------------------------------------------------------------------- /hello/SOURCES: -------------------------------------------------------------------------------- 1 | !IF 0 2 | Fuse program info build file 3 | 4 | !ENDIF 5 | 6 | TARGETNAME=hello 7 | TARGETPATH=$(VFS_LIB_TARGET) 8 | TARGETTYPE=PROGRAM 9 | 10 | TARGETLIBS=$(SDK_LIB_PATH)\ntdll.lib 11 | LINKLIBS=$(VFS_LIB_PATH)\libfuse.lib \ 12 | $(VFS_LIB_PATH)\cxfuse.lib 13 | 14 | 15 | USE_MSVCRT=1 16 | 386_STDCALL=0 17 | 18 | INCLUDES=..\include;..\sys 19 | C_DEFINES=-D__STDC__=1 -D_FILE_OFFSET_BITS=64 20 | 21 | UMTYPE=console 22 | UMBASE=0x1000000 23 | 24 | SOURCES= hello.c 25 | 26 | -------------------------------------------------------------------------------- /hello_ll/SOURCES: -------------------------------------------------------------------------------- 1 | !IF 0 2 | hello_ll a lowlevel fuse example program build file 3 | 4 | !ENDIF 5 | 6 | TARGETNAME=hello_ll 7 | TARGETPATH=$(VFS_LIB_TARGET) 8 | TARGETTYPE=PROGRAM 9 | 10 | TARGETLIBS=$(SDK_LIB_PATH)\ntdll.lib 11 | 12 | LINKLIBS=$(VFS_LIB_PATH)\libfuse.lib \ 13 | $(VFS_LIB_PATH)\cxfuse.lib 14 | 15 | USE_MSVCRT=0 16 | 386_STDCALL=0 17 | 18 | INCLUDES=..\include;..\sys 19 | C_DEFINES=-D__STDC__=1 -D_FILE_OFFSET_BITS=64 20 | 21 | UMTYPE=console 22 | UMBASE=0x1000000 23 | 24 | SOURCES= hello_ll.c 25 | 26 | -------------------------------------------------------------------------------- /sshfs/sshnodelay.c: -------------------------------------------------------------------------------- 1 | #define _GNU_SOURCE 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int connect(int sock, const struct sockaddr *addr, socklen_t addrlen) 9 | { 10 | int (*next_connect)(int, const struct sockaddr *, socklen_t) = 11 | dlsym(RTLD_NEXT, "connect"); 12 | int res = next_connect(sock, addr, addrlen); 13 | if (!res && addr->sa_family == AF_INET) { 14 | int opt = 1; 15 | setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)); 16 | } 17 | return res; 18 | } 19 | -------------------------------------------------------------------------------- /sshfs/SOURCES: -------------------------------------------------------------------------------- 1 | !IF 0 2 | sshfs program info build file 3 | 4 | !ENDIF 5 | 6 | TARGETNAME=sshfs 7 | TARGETPATH=$(VFS_LIB_TARGET) 8 | TARGETTYPE=PROGRAM 9 | 10 | TARGETLIBS= .\glib-2.0\glib-2.0.lib \ 11 | .\glib-2.0\gthread-2.0.lib \ 12 | $(VFS_LIB_PATH)\cxfuse.lib \ 13 | $(VFS_LIB_PATH)\libfuse.lib \ 14 | $(VFS_LIB_PATH)\libfs.lib \ 15 | $(VFS_LIB_PATH)\libgen.lib 16 | 17 | LINKLIBS=$(SDK_LIB_PATH)\ntdll.lib \ 18 | $(SDK_LIB_PATH)\..\..\wnet\*\ws2_32.lib 19 | 20 | USE_MSVCRT=0 21 | 386_STDCALL=0 22 | 23 | INCLUDES=..\include;..\sys;.\glib-2.0 24 | C_DEFINES=-D__STDC__=1 -DFUSE_USE_VERSION=26 -DG_OS_WIN32 -DG_PLATFORM_WIN32 25 | 26 | UMTYPE=console 27 | UMBASE=0x1000000 28 | 29 | SOURCES= cache.c sshfs.c 30 | 31 | -------------------------------------------------------------------------------- /include/semaphore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * semaphore mapping to WIN32 for FUSE library 3 | * (C) Copyright 2012 Sammandam, Supramani suprasam@crossmeta.org 4 | */ 5 | 6 | #ifndef _INCLUDE_SEMAPHORE_H 7 | #define _INCLUDE_SEMAPHORE_H 8 | 9 | typedef HANDLE sem_t; 10 | 11 | static __inline HANDLE 12 | sem_init(sem_t *sem, int pshared, int value) 13 | { 14 | *sem = CreateEvent(NULL, FALSE, value, NULL); 15 | return 0; 16 | } 17 | 18 | static __inline int sem_wait(sem_t *sem) 19 | { 20 | HANDLE h = *sem; 21 | return WaitForSingleObject(h, INFINITE); 22 | } 23 | 24 | static __inline int sem_post(sem_t *sem) 25 | { 26 | HANDLE h = *sem; 27 | SetEvent(h); 28 | } 29 | 30 | static __inline int sem_destroy(sem_t *sem) 31 | { 32 | return CloseHandle(*sem); 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /sshfs/cache.h: -------------------------------------------------------------------------------- 1 | /* 2 | Caching file system proxy 3 | Copyright (C) 2004 Miklos Szeredi 4 | 5 | This program can be distributed under the terms of the GNU GPL. 6 | See the file COPYING. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | #ifndef FUSE_VERSION 13 | #define FUSE_VERSION (FUSE_MAJOR_VERSION * 10 + FUSE_MINOR_VERSION) 14 | #endif 15 | 16 | typedef struct fuse_cache_dirhandle *fuse_cache_dirh_t; 17 | typedef int (*fuse_cache_dirfil_t) (fuse_cache_dirh_t h, const char *name, 18 | const struct stat *stbuf); 19 | 20 | struct fuse_cache_operations { 21 | struct fuse_operations oper; 22 | int (*cache_getdir) (const char *, fuse_cache_dirh_t, fuse_cache_dirfil_t); 23 | }; 24 | 25 | struct fuse_operations *cache_init(struct fuse_cache_operations *oper); 26 | int cache_parse_options(struct fuse_args *args); 27 | void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr); 28 | void cache_invalidate(const char *path); 29 | uint64_t cache_get_write_ctr(void); 30 | -------------------------------------------------------------------------------- /hello/Makefile.mingw: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for building in MINGW32 cross compile 3 | # 4 | TARGET = hello.exe 5 | FUSEDIR=.. 6 | FUSELIBS = $(FUSEDIR)/lib/w2k/free/i386 7 | #LIBS = $(FUSELIBS)/libfuse.lib $(FUSELIBS)/cxfuse.dll 8 | LIBS = $(FUSELIBS)/libfuse.lib $(FUSELIBS)/cxfuse.dll $(FUSELIBS)/libgen.lib 9 | CC = i686-w64-mingw32-gcc 10 | CDEFINES = -DWIN32_LEAN_AND_MEAN -D_MSVCRT_ -D_POSIX -D_ALL_SOURCE -D _STAT_DEFINED -D_TIME_H_ -DNO_OLDNAMES -D_REENTRANT -DVERSION=\"0.1\" -D_FILE_OFFSET_BITS=64 11 | CINCLUDES=-I $(FUSEDIR)/include -I $(FUSEDIR) -I $(FUSEDIR)/sys 12 | CBUILDFLAGS = -O3 -fomit-frame-pointer -ffunction-sections -fdata-sections 13 | CFLAGS = -g -Wno-multichar $(CDEFINES) $(CINCLUDES) 14 | 15 | .PHONY: default all clean 16 | 17 | default: $(TARGET) 18 | all: default 19 | 20 | OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c)) 21 | HEADERS = $(wildcard *.h) 22 | 23 | %.o: %.c $(HEADERS) 24 | $(CC) $(CFLAGS) -c $< -o $@ 25 | 26 | %.o: %.cc $(HEADERS) 27 | $(CC) $(CFLAGS) -c $< -o $@ 28 | 29 | $(TARGET): $(OBJECTS) 30 | $(CC) $(OBJECTS) -o $@ $(LIBS) 31 | 32 | clean: 33 | -rm -f *.o 34 | -rm -f $(TARGET) 35 | 36 | 37 | -------------------------------------------------------------------------------- /hello_ll/Makefile.mingw: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for building in MINGW32 cross compile 3 | # 4 | TARGET = hello_ll.exe 5 | FUSEDIR=.. 6 | FUSELIBS = $(FUSEDIR)/lib/w2k/free/i386 7 | #LIBS = $(FUSELIBS)/libfuse.lib $(FUSELIBS)/cxfuse.dll 8 | LIBS = $(FUSELIBS)/libfuse.lib $(FUSELIBS)/cxfuse.dll $(FUSELIBS)/libgen.lib 9 | CC = i686-w64-mingw32-gcc 10 | CDEFINES = -DWIN32_LEAN_AND_MEAN -D_MSVCRT_ -D_POSIX -D_ALL_SOURCE -D _STAT_DEFINED -D_TIME_H_ -D_INC_STDLIB -D_IO_H_ -DNO_OLDNAMES -D_REENTRANT -D_FILE_OFFSET_BITS=64 11 | CINCLUDES=-I $(FUSEDIR)/include -I $(FUSEDIR) -I $(FUSEDIR)/sys 12 | CBUILDFLAGS = -O3 -fomit-frame-pointer -ffunction-sections -fdata-sections 13 | CFLAGS = -g -Wno-multichar $(CDEFINES) $(CINCLUDES) 14 | 15 | .PHONY: default all clean 16 | 17 | default: $(TARGET) 18 | all: default 19 | 20 | OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c)) 21 | HEADERS = $(wildcard *.h) 22 | 23 | %.o: %.c $(HEADERS) 24 | $(CC) $(CFLAGS) -c $< -o $@ 25 | 26 | %.o: %.cc $(HEADERS) 27 | $(CC) $(CFLAGS) -c $< -o $@ 28 | 29 | $(TARGET): $(OBJECTS) 30 | $(CC) $(OBJECTS) -o $@ $(LIBS) 31 | 32 | clean: 33 | -rm -f *.o 34 | -rm -f $(TARGET) 35 | 36 | 37 | -------------------------------------------------------------------------------- /sys/sys/dirent.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _SYS_DIRENT_H_ 3 | #define _SYS_DIRENT_H_ 4 | 5 | #define MAXNAMLEN 255 6 | 7 | /* 8 | * File system independent directory entry 9 | */ 10 | struct dirent { 11 | ino64_t d_ino; /* inode number of entry */ 12 | off64_t d_off; /* offset of disk directory entry */ 13 | ushort_t d_reclen; /* length of this record */ 14 | char d_name[1]; /* name of file */ 15 | }; 16 | 17 | typedef struct dirent dirent_t; 18 | 19 | #ifdef _KERNEL 20 | #define DSIZE ((uint_t)((char *)((struct dirent *)0)->d_name - (char *)0)) 21 | #define DIRHDSIZ DSIZE 22 | #define nextdp(dp) ((struct dirent *)((caddr_t)(dp) + (dp)->d_reclen)) 23 | #endif 24 | 25 | /* 26 | * Convert between stat structure types and directory types. 27 | */ 28 | #define IFTODT(mode) (((mode) & 0170000) >> 12) 29 | 30 | /* 31 | * The _GENERIC_DIRSIZ macro gives the minimum record length which will hold 32 | * the directory entry. This requires the amount of space in struct direct 33 | * without the d_name field, plus enough space for the name with a terminating 34 | * null byte (dp->d_namlen+1), rounded up to a 4 byte boundary. 35 | */ 36 | #define _GENERIC_DIRSIZ(dp,n) \ 37 | (sizeof (struct dirent) + ((n+1 + 3) &~ 3)) 38 | 39 | #ifdef _KERNEL 40 | #define GENERIC_DIRSIZ(dp,n) _GENERIC_DIRSIZ(dp,n) 41 | #endif 42 | 43 | 44 | 45 | #endif /* !_SYS_DIRENT_H_ */ 46 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gi18n.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __G_I18N_H__ 21 | #define __G_I18N_H__ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | #define _(String) gettext (String) 29 | #define Q_(String) g_dpgettext (NULL, String, 0) 30 | #define N_(String) (String) 31 | #define C_(Context,String) g_dpgettext (NULL, Context "\004" String, strlen (Context) + 1) 32 | #define NC_(Context, String) (String) 33 | 34 | #endif /* __G_I18N_H__ */ 35 | -------------------------------------------------------------------------------- /sshfs/Makefile.mingw: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for 3 | # 4 | TARGET = sshfs.exe 5 | FUSEDIR = .. 6 | FUSELIBS = $(FUSEDIR)/lib/w2k/free/i386 7 | #LIBS = $(FUSELIBS)/libfuse.lib $(FUSELIBS)/cxfuse.dll 8 | LIBS = -static -pthread -L/usr/i686-w64-mingw32/sys-root/mingw/lib -lglib-2.0 -lintl -liconv $(FUSELIBS)/libfuse.lib $(FUSELIBS)/cxfuse.dll $(FUSEDIR)/lib/w2k/free/i386/libfs.lib $(FUSEDIR)/lib/w2k/free/i386/libgen.lib -lgdi32 -lntdll -lws2_32 -lwinmm -lole32 9 | 10 | HOME=$(shell pwd) 11 | CC = i686-w64-mingw32-gcc 12 | CDEFINES = -DWIN32_LEAN_AND_MEAN -D_MSVCRT_ -D_POSIX -D_ALL_SOURCE -D _STAT_DEFINED -DNO_OLDNAMES -D_REENTRANT -D_INC_FCNTL -D_INC_STDLIB -D_IO_H_ -D_POSIX_C_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 13 | CINCLUDES=-I $(FUSEDIR)/include -I $(FUSEDIR) -I $(FUSEDIR)/sys -mms-bitfields -I/usr/i686-w64-mingw32/sys-root/mingw/include/glib-2.0 -I/usr/i686-w64-mingw32/sys-root/mingw/lib/glib-2.0/include -I/usr/i686-w64-mingw32/sys-root/mingw/include 14 | CBUILDFLAGS = -O3 -fomit-frame-pointer -ffunction-sections -fdata-sections 15 | CFLAGS = -static -g -Wno-multichar $(CDEFINES) $(CINCLUDES) 16 | 17 | .PHONY: default all clean 18 | 19 | default: $(TARGET) 20 | all: default 21 | 22 | OBJECTS = sshfs.o cache.o 23 | HEADERS = $(wildcard *.h) 24 | 25 | %.o: %.c $(HEADERS) 26 | $(CC) $(CFLAGS) -c $< -o $@ 27 | 28 | %.o: %.cc $(HEADERS) 29 | $(CC) $(CFLAGS) -c $< -o $@ 30 | 31 | $(TARGET): $(OBJECTS) 32 | $(CC) $(OBJECTS) -o $@ $(LIBS) 33 | 34 | clean: 35 | -rm -f *.o 36 | -rm -f $(TARGET) 37 | 38 | 39 | -------------------------------------------------------------------------------- /sys/sys/statvfs.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_STATVFS_H 2 | #define _SYS_STATVFS_H 3 | 4 | #include 5 | 6 | #if defined(__cplusplus) 7 | extern "C" { 8 | #endif 9 | 10 | /* 11 | * Structure returned by statvfs(2). 12 | */ 13 | 14 | #define FSTYPSZ 16 15 | 16 | typedef struct statvfs { 17 | u_long f_bsize; /* fundamental file system block size */ 18 | u_long f_frsize; /* fragment size */ 19 | uquad_t f_blocks; /* total # of blocks of f_frsize on fs */ 20 | uquad_t f_bfree; /* total # of free blocks of f_frsize */ 21 | uquad_t f_bavail; /* # of free blocks avail to non-superuser */ 22 | uquad_t f_files; /* total # of file nodes (inodes) */ 23 | uquad_t f_ffree; /* total # of free file nodes */ 24 | uquad_t f_favail; /* # of free nodes avail to non-superuser */ 25 | u_long f_fsid; /* file system id (dev for now) */ 26 | char f_basetype[FSTYPSZ]; /* target fs type name, null-terminated */ 27 | u_long f_flag; /* bit-mask of flags */ 28 | u_long f_namemax; /* maximum file name length */ 29 | char f_fstr[32]; /* filesystem-specific string */ 30 | u_long f_filler[16]; /* reserved for future expansion */ 31 | } statvfs_t; 32 | 33 | /* 34 | * Flag definitions. 35 | */ 36 | #define ST_RDONLY VFS_RDONLY 37 | #define ST_NOSUID VFS_NOSUID 38 | 39 | #if !defined(_KERNEL) 40 | int statvfs(const char *, struct statvfs *); 41 | int fstatvfs(int, struct statvfs *); 42 | #define statvfs64 statvfs 43 | #define fstatvfs64 fstatvfs 44 | #endif 45 | 46 | #if defined(__cplusplus) 47 | } 48 | #endif 49 | 50 | #endif /* _SYS_STATVFS_H */ 51 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/ghostutils.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 2008 Red Hat, Inc. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 21 | #error "Only can be included directly." 22 | #endif 23 | 24 | #ifndef __G_HOST_UTILS_H__ 25 | #define __G_HOST_UTILS_H__ 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | gboolean g_hostname_is_non_ascii (const gchar *hostname); 32 | gboolean g_hostname_is_ascii_encoded (const gchar *hostname); 33 | gboolean g_hostname_is_ip_address (const gchar *hostname); 34 | 35 | gchar *g_hostname_to_ascii (const gchar *hostname); 36 | gchar *g_hostname_to_unicode (const gchar *hostname); 37 | 38 | G_END_DECLS 39 | 40 | #endif /* __G_HOST_UTILS_H__ */ 41 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gi18n-lib.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __G_I18N_LIB_H__ 21 | #define __G_I18N_LIB_H__ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | 28 | #ifndef GETTEXT_PACKAGE 29 | #error You must define GETTEXT_PACKAGE before including gi18n-lib.h. Did you forget to include config.h? 30 | #endif 31 | 32 | #define _(String) ((char *) g_dgettext (GETTEXT_PACKAGE, String)) 33 | #define Q_(String) g_dpgettext (GETTEXT_PACKAGE, String, 0) 34 | #define N_(String) (String) 35 | #define C_(Context,String) g_dpgettext (GETTEXT_PACKAGE, Context "\004" String, strlen (Context) + 1) 36 | #define NC_(Context, String) (String) 37 | 38 | #endif /* __G_I18N_LIB_H__ */ 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2012-2019, Sam Sammandam 4 | Copyright (c) 1989, 1991, 1993 5 | The Regents of the University of California. 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | 1. Redistributions of source code must retain the above copyright notice, this 12 | list of conditions and the following disclaimer. 13 | 14 | 2. Redistributions in binary form must reproduce the above copyright notice, 15 | this list of conditions and the following disclaimer in the documentation 16 | and/or other materials provided with the distribution. 17 | 18 | 3. Neither the name of the copyright holder nor the names of its 19 | contributors may be used to endorse or promote products derived from 20 | this software without specific prior written permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 26 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 28 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gbitlock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008 Ryan Lortie 3 | * Copyright © 2010 Codethink Limited 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the licence, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | * 20 | * Author: Ryan Lortie 21 | */ 22 | 23 | #ifndef __G_BITLOCK_H__ 24 | #define __G_BITLOCK_H__ 25 | 26 | #include 27 | 28 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 29 | #error "Only can be included directly." 30 | #endif 31 | 32 | G_BEGIN_DECLS 33 | 34 | void g_bit_lock (volatile gint *address, 35 | gint lock_bit); 36 | gboolean g_bit_trylock (volatile gint *address, 37 | gint lock_bit); 38 | void g_bit_unlock (volatile gint *address, 39 | gint lock_bit); 40 | 41 | G_END_DECLS 42 | 43 | #endif /* __G_BITLOCK_H_ */ 44 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gqsort.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_QSORT_H__ 32 | #define __G_QSORT_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | void g_qsort_with_data (gconstpointer pbase, 39 | gint total_elems, 40 | gsize size, 41 | GCompareDataFunc compare_func, 42 | gpointer user_data); 43 | 44 | G_END_DECLS 45 | 46 | #endif /* __G_QSORT_H__ */ 47 | -------------------------------------------------------------------------------- /sys/sys/uio.h: -------------------------------------------------------------------------------- 1 | #ifndef _SYS_UIO_H_ 2 | #define _SYS_UIO_H_ 3 | 4 | #if defined(__cplusplus) 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | * I/O parameter information. A uio structure describes the I/O which 10 | * is to be performed by an operation. Typically the data movement will 11 | * be performed by a routine such as uiomove(), which updates the uio 12 | * structure to reflect what was done. 13 | */ 14 | 15 | /* 16 | * I/O direction. 17 | */ 18 | typedef enum uio_rw { UIO_READ, UIO_WRITE } uio_rw_t; 19 | 20 | /* 21 | * Segment flag values. 22 | */ 23 | typedef enum uio_seg { UIO_USERSPACE, UIO_SYSSPACE, UIO_USERISPACE } uio_seg_t; 24 | 25 | typedef struct iovec { 26 | caddr_t iov_base; 27 | int iov_len; 28 | } iovec_t; 29 | 30 | #if defined(_KERNEL) 31 | static __inline size_t 32 | iov_length(const struct iovec *iov, unsigned nr_segs) 33 | { 34 | unsigned i; 35 | size_t ret = 0; 36 | for (i = 0; i < nr_segs; i++) 37 | ret += iov[i].iov_len; 38 | return ret; 39 | } 40 | 41 | typedef struct uio { 42 | iovec_t *uio_iov; /* pointer to array of iovecs */ 43 | int uio_iovcnt; /* number of iovecs */ 44 | off64_t uio_offset; /* file offset */ 45 | int uio_resid; /* residual count */ 46 | enum uio_seg uio_segflag; /* address space (kernel or user) */ 47 | enum uio_rw uio_rw; 48 | struct proc *uio_procp; 49 | struct file *uio_filp; 50 | } uio_t; 51 | 52 | extern int uiomove_catch(void *kernbuf, long n, uio_rw_t rw, uio_t *uiop, 53 | uint_t catch_flags); 54 | extern int ureadc(int val, uio_t *uiop); 55 | extern int uwritec(uio_t *uiop); 56 | extern int uiomvuio(uio_t *ruiop, uio_t *wuiop); 57 | extern void uioskip(uio_t *uiop, long n); 58 | extern void uioupdate(uio_t *uiop, long n); 59 | #endif /* _KERNEL */ 60 | 61 | #if defined(__cplusplus) 62 | } 63 | #endif 64 | 65 | #endif /* _SYS_UIO_H_ */ 66 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gmappedfile.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * gmappedfile.h: Simplified wrapper around the mmap function 3 | * 4 | * Copyright 2005 Matthias Clasen 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public 8 | * License as published by the Free Software Foundation; either 9 | * version 2 of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 19 | * Boston, MA 02111-1307, USA. 20 | */ 21 | 22 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | #ifndef __G_MAPPED_FILE_H__ 27 | #define __G_MAPPED_FILE_H__ 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _GMappedFile GMappedFile; 34 | 35 | GMappedFile *g_mapped_file_new (const gchar *filename, 36 | gboolean writable, 37 | GError **error) G_GNUC_MALLOC; 38 | gsize g_mapped_file_get_length (GMappedFile *file); 39 | gchar *g_mapped_file_get_contents (GMappedFile *file); 40 | GMappedFile *g_mapped_file_ref (GMappedFile *file); 41 | void g_mapped_file_unref (GMappedFile *file); 42 | 43 | #ifndef G_DISABLE_DEPRECATED 44 | void g_mapped_file_free (GMappedFile *file); 45 | #endif 46 | 47 | G_END_DECLS 48 | 49 | #endif /* __G_MAPPED_FILE_H__ */ 50 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gpattern.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997, 1999 Peter Mattis, Red Hat, Inc. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 21 | #error "Only can be included directly." 22 | #endif 23 | 24 | #ifndef __G_PATTERN_H__ 25 | #define __G_PATTERN_H__ 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | 32 | typedef struct _GPatternSpec GPatternSpec; 33 | 34 | GPatternSpec* g_pattern_spec_new (const gchar *pattern); 35 | void g_pattern_spec_free (GPatternSpec *pspec); 36 | gboolean g_pattern_spec_equal (GPatternSpec *pspec1, 37 | GPatternSpec *pspec2); 38 | gboolean g_pattern_match (GPatternSpec *pspec, 39 | guint string_length, 40 | const gchar *string, 41 | const gchar *string_reversed); 42 | gboolean g_pattern_match_string (GPatternSpec *pspec, 43 | const gchar *string); 44 | gboolean g_pattern_match_simple (const gchar *pattern, 45 | const gchar *string); 46 | 47 | G_END_DECLS 48 | 49 | #endif /* __G_PATTERN_H__ */ 50 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gprimes.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_PRIMES_H__ 32 | #define __G_PRIMES_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | /* Prime numbers. 39 | */ 40 | 41 | /* This function returns prime numbers spaced by approximately 1.5-2.0 42 | * and is for use in resizing data structures which prefer 43 | * prime-valued sizes. The closest spaced prime function returns the 44 | * next largest prime, or the highest it knows about which is about 45 | * MAXINT/4. 46 | */ 47 | guint g_spaced_primes_closest (guint num) G_GNUC_CONST; 48 | 49 | G_END_DECLS 50 | 51 | #endif /* __G_PRIMES_H__ */ 52 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gshell.h: -------------------------------------------------------------------------------- 1 | /* gshell.h - Shell-related utilities 2 | * 3 | * Copyright 2000 Red Hat, Inc. 4 | * 5 | * GLib is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * GLib is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with GLib; see the file COPYING.LIB. If not, write 17 | * to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __G_SHELL_H__ 26 | #define __G_SHELL_H__ 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define G_SHELL_ERROR g_shell_error_quark () 33 | 34 | typedef enum 35 | { 36 | /* mismatched or otherwise mangled quoting */ 37 | G_SHELL_ERROR_BAD_QUOTING, 38 | /* string to be parsed was empty */ 39 | G_SHELL_ERROR_EMPTY_STRING, 40 | G_SHELL_ERROR_FAILED 41 | } GShellError; 42 | 43 | GQuark g_shell_error_quark (void); 44 | 45 | gchar* g_shell_quote (const gchar *unquoted_string); 46 | gchar* g_shell_unquote (const gchar *quoted_string, 47 | GError **error); 48 | gboolean g_shell_parse_argv (const gchar *command_line, 49 | gint *argcp, 50 | gchar ***argvp, 51 | GError **error); 52 | 53 | G_END_DECLS 54 | 55 | #endif /* __G_SHELL_H__ */ 56 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gprintf.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997, 2002 Peter Mattis, Red Hat, Inc. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #ifndef __G_PRINTF_H__ 21 | #define __G_PRINTF_H__ 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | gint g_printf (gchar const *format, 30 | ...) G_GNUC_PRINTF (1, 2); 31 | gint g_fprintf (FILE *file, 32 | gchar const *format, 33 | ...) G_GNUC_PRINTF (2, 3); 34 | gint g_sprintf (gchar *string, 35 | gchar const *format, 36 | ...) G_GNUC_PRINTF (2, 3); 37 | 38 | gint g_vprintf (gchar const *format, 39 | va_list args); 40 | gint g_vfprintf (FILE *file, 41 | gchar const *format, 42 | va_list args); 43 | gint g_vsprintf (gchar *string, 44 | gchar const *format, 45 | va_list args); 46 | gint g_vasprintf (gchar **string, 47 | gchar const *format, 48 | va_list args); 49 | 50 | G_END_DECLS 51 | 52 | #endif /* __G_PRINTF_H__ */ 53 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gdir.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * gdir.c: Simplified wrapper around the DIRENT functions. 5 | * 6 | * Copyright 2001 Hans Breuer 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public 10 | * License as published by the Free Software Foundation; either 11 | * version 2 of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the 20 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 21 | * Boston, MA 02111-1307, USA. 22 | */ 23 | 24 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 25 | #error "Only can be included directly." 26 | #endif 27 | 28 | #ifndef __G_DIR_H__ 29 | #define __G_DIR_H__ 30 | 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | typedef struct _GDir GDir; 36 | 37 | #ifndef __GTK_DOC_IGNORE__ 38 | #ifdef G_OS_WIN32 39 | /* For DLL ABI stability, keep old names for old (non-UTF-8) functionality. */ 40 | #define g_dir_open g_dir_open_utf8 41 | #define g_dir_read_name g_dir_read_name_utf8 42 | #endif 43 | #endif 44 | 45 | GDir * g_dir_open (const gchar *path, 46 | guint flags, 47 | GError **error); 48 | G_CONST_RETURN gchar *g_dir_read_name (GDir *dir); 49 | void g_dir_rewind (GDir *dir); 50 | void g_dir_close (GDir *dir); 51 | 52 | G_END_DECLS 53 | 54 | #endif /* __G_DIR_H__ */ 55 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gquark.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_QUARK_H__ 32 | #define __G_QUARK_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef guint32 GQuark; 39 | 40 | /* Quarks (string<->id association) 41 | */ 42 | GQuark g_quark_try_string (const gchar *string); 43 | GQuark g_quark_from_static_string (const gchar *string); 44 | GQuark g_quark_from_string (const gchar *string); 45 | G_CONST_RETURN gchar* g_quark_to_string (GQuark quark) G_GNUC_CONST; 46 | 47 | G_CONST_RETURN gchar* g_intern_string (const gchar *string); 48 | G_CONST_RETURN gchar* g_intern_static_string (const gchar *string); 49 | 50 | G_END_DECLS 51 | 52 | #endif /* __G_QUARK_H__ */ 53 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gtimer.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_TIMER_H__ 32 | #define __G_TIMER_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | /* Timer 39 | */ 40 | 41 | /* microseconds per second */ 42 | typedef struct _GTimer GTimer; 43 | 44 | #define G_USEC_PER_SEC 1000000 45 | 46 | GTimer* g_timer_new (void); 47 | void g_timer_destroy (GTimer *timer); 48 | void g_timer_start (GTimer *timer); 49 | void g_timer_stop (GTimer *timer); 50 | void g_timer_reset (GTimer *timer); 51 | void g_timer_continue (GTimer *timer); 52 | gdouble g_timer_elapsed (GTimer *timer, 53 | gulong *microseconds); 54 | 55 | void g_usleep (gulong microseconds); 56 | 57 | void g_time_val_add (GTimeVal *time_, 58 | glong microseconds); 59 | gboolean g_time_val_from_iso8601 (const gchar *iso_date, 60 | GTimeVal *time_); 61 | gchar* g_time_val_to_iso8601 (GTimeVal *time_) G_GNUC_MALLOC; 62 | 63 | G_END_DECLS 64 | 65 | #endif /* __G_TIMER_H__ */ 66 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gbase64.h: -------------------------------------------------------------------------------- 1 | /* gbase64.h - Base64 coding functions 2 | * 3 | * Copyright (C) 2005 Alexander Larsson 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __G_BASE64_H__ 26 | #define __G_BASE64_H__ 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | gsize g_base64_encode_step (const guchar *in, 33 | gsize len, 34 | gboolean break_lines, 35 | gchar *out, 36 | gint *state, 37 | gint *save); 38 | gsize g_base64_encode_close (gboolean break_lines, 39 | gchar *out, 40 | gint *state, 41 | gint *save); 42 | gchar* g_base64_encode (const guchar *data, 43 | gsize len) G_GNUC_MALLOC; 44 | gsize g_base64_decode_step (const gchar *in, 45 | gsize len, 46 | guchar *out, 47 | gint *state, 48 | guint *save); 49 | guchar *g_base64_decode (const gchar *text, 50 | gsize *out_len) G_GNUC_MALLOC; 51 | guchar *g_base64_decode_inplace (gchar *text, 52 | gsize *out_len); 53 | 54 | 55 | G_END_DECLS 56 | 57 | #endif /* __G_BASE64_H__ */ 58 | -------------------------------------------------------------------------------- /hello/hello.c: -------------------------------------------------------------------------------- 1 | /* 2 | FUSE: Filesystem in Userspace 3 | Copyright (C) 2001-2007 Miklos Szeredi 4 | 5 | This program can be distributed under the terms of the GNU GPL. 6 | See the file COPYING. 7 | 8 | gcc -Wall `pkg-config fuse --cflags --libs` hello.c -o hello 9 | */ 10 | 11 | #define FUSE_USE_VERSION 26 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | static const char *hello_str = "Hello World!\n"; 21 | static const char *hello_path = "/hello"; 22 | 23 | static int hello_getattr(const char *path, struct stat *stbuf) 24 | { 25 | int res = 0; 26 | 27 | memset(stbuf, 0, sizeof(struct stat)); 28 | if (strcmp(path, "/") == 0) { 29 | stbuf->st_mode = S_IFDIR | 0755; 30 | stbuf->st_nlink = 2; 31 | } else if (strcmp(path, hello_path) == 0) { 32 | stbuf->st_mode = S_IFREG | 0444; 33 | stbuf->st_nlink = 1; 34 | stbuf->st_size = strlen(hello_str); 35 | } else 36 | res = -ENOENT; 37 | 38 | return res; 39 | } 40 | 41 | static int hello_readdir(const char *path, void *buf, fuse_fill_dir_t filler, 42 | off_t offset, struct fuse_file_info *fi) 43 | { 44 | (void) offset; 45 | (void) fi; 46 | 47 | if (strcmp(path, "/") != 0) 48 | return -ENOENT; 49 | 50 | filler(buf, ".", NULL, 0); 51 | filler(buf, "..", NULL, 0); 52 | filler(buf, hello_path + 1, NULL, 0); 53 | 54 | return 0; 55 | } 56 | 57 | static int hello_open(const char *path, struct fuse_file_info *fi) 58 | { 59 | if (strcmp(path, hello_path) != 0) 60 | return -ENOENT; 61 | 62 | if ((fi->flags & 3) != O_RDONLY) 63 | return -EACCES; 64 | 65 | return 0; 66 | } 67 | 68 | static int hello_read(const char *path, char *buf, size_t size, off_t offset, 69 | struct fuse_file_info *fi) 70 | { 71 | size_t len; 72 | (void) fi; 73 | if(strcmp(path, hello_path) != 0) 74 | return -ENOENT; 75 | 76 | len = strlen(hello_str); 77 | if (offset < len) { 78 | if (offset + size > len) 79 | size = len - offset; 80 | memcpy(buf, hello_str + offset, size); 81 | } else 82 | size = 0; 83 | 84 | return size; 85 | } 86 | 87 | static struct fuse_operations hello_oper = { 88 | #if 0 89 | .getattr = hello_getattr, 90 | .readdir = hello_readdir, 91 | .open = hello_open, 92 | .read = hello_read, 93 | #endif 94 | 0 95 | }; 96 | 97 | int main(int argc, char *argv[]) 98 | { 99 | hello_oper.getattr = hello_getattr; 100 | hello_oper.readdir = hello_readdir; 101 | hello_oper.open = hello_open; 102 | hello_oper.read = hello_read; 103 | return fuse_main(argc, argv, &hello_oper, NULL); 104 | } 105 | -------------------------------------------------------------------------------- /include/grp.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1989, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * (c) UNIX System Laboratories, Inc. 5 | * All or some portions of this file are derived from material licensed 6 | * to the University of California by American Telephone and Telegraph 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 | * the permission of UNIX System Laboratories, Inc. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by the University of 21 | * California, Berkeley and its contributors. 22 | * 4. Neither the name of the University nor the names of its contributors 23 | * may be used to endorse or promote products derived from this software 24 | * without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 | * SUCH DAMAGE. 37 | * 38 | * @(#)grp.h 8.2 (Berkeley) 1/21/94 39 | */ 40 | 41 | #ifndef _GRP_H_ 42 | #define _GRP_H_ 43 | 44 | #include 45 | 46 | #ifndef _POSIX_SOURCE 47 | #include 48 | #define _PATH_GROUP "/etc/group" 49 | #endif 50 | 51 | struct group { 52 | char *gr_name; /* group name */ 53 | char *gr_passwd; /* group password */ 54 | int gr_gid; /* group id */ 55 | char **gr_mem; /* group members */ 56 | }; 57 | 58 | struct group *__stdcall getgrgid __P((gid_t)); 59 | struct group *__stdcall getgrnam __P((const char *)); 60 | #ifndef _POSIX_SOURCE 61 | struct group *getgrent __P((void)); 62 | int setgrent __P((void)); 63 | void endgrent __P((void)); 64 | void setgrfile __P((const char *)); 65 | int setgroupent __P((int)); 66 | #endif 67 | 68 | #endif /* !_GRP_H_ */ 69 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gurifuncs.h: -------------------------------------------------------------------------------- 1 | /* GIO - GLib Input, Output and Streaming Library 2 | * 3 | * Copyright (C) 2006-2007 Red Hat, Inc. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General 16 | * Public License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | * 20 | * Author: Alexander Larsson 21 | */ 22 | 23 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 24 | #error "Only can be included directly." 25 | #endif 26 | 27 | #ifndef __G_URI_FUNCS_H__ 28 | #define __G_URI_FUNCS_H__ 29 | 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | /** 35 | * G_URI_RESERVED_CHARS_GENERIC_DELIMITERS: 36 | * 37 | * Generic delimiters characters as defined in RFC 3986. Includes ":/?#[]@". 38 | **/ 39 | #define G_URI_RESERVED_CHARS_GENERIC_DELIMITERS ":/?#[]@" 40 | 41 | /** 42 | * G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS 43 | * 44 | * Subcomponent delimiter characters as defined in RFC 3986. Includes "!$&'()*+,;=". 45 | **/ 46 | #define G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS "!$&'()*+,;=" 47 | 48 | /** 49 | * G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT: 50 | * 51 | * Allowed characters in path elements. Includes "!$&'()*+,;=:@". 52 | **/ 53 | #define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":@" 54 | 55 | /** 56 | * G_URI_RESERVED_CHARS_ALLOWED_IN_PATH: 57 | * 58 | * Allowed characters in a path. Includes "!$&'()*+,;=:@/". 59 | **/ 60 | #define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT "/" 61 | 62 | /** 63 | * G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO: 64 | * 65 | * Allowed characters in userinfo as defined in RFC 3986. Includes "!$&'()*+,;=:". 66 | **/ 67 | #define G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":" 68 | 69 | char * g_uri_unescape_string (const char *escaped_string, 70 | const char *illegal_characters); 71 | char * g_uri_unescape_segment (const char *escaped_string, 72 | const char *escaped_string_end, 73 | const char *illegal_characters); 74 | char * g_uri_parse_scheme (const char *uri); 75 | char * g_uri_escape_string (const char *unescaped, 76 | const char *reserved_chars_allowed, 77 | gboolean allow_utf8); 78 | 79 | G_END_DECLS 80 | 81 | #endif /* __G_URI_FUNCS_H__ */ 82 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gbacktrace.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_BACKTRACE_H__ 32 | #define __G_BACKTRACE_H__ 33 | 34 | #include 35 | #include 36 | 37 | G_BEGIN_DECLS 38 | 39 | /* Fatal error handlers. 40 | * g_on_error_query() will prompt the user to either 41 | * [E]xit, [H]alt, [P]roceed or show [S]tack trace. 42 | * g_on_error_stack_trace() invokes gdb, which attaches to the current 43 | * process and shows a stack trace. 44 | * These function may cause different actions on non-unix platforms. 45 | * The prg_name arg is required by gdb to find the executable, if it is 46 | * passed as NULL, g_on_error_query() will try g_get_prgname(). 47 | */ 48 | void g_on_error_query (const gchar *prg_name); 49 | void g_on_error_stack_trace (const gchar *prg_name); 50 | 51 | /* Hacker macro to place breakpoints for selected machines. 52 | * Actual use is strongly discouraged of course ;) 53 | */ 54 | #if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2 55 | # define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("int $03"); }G_STMT_END 56 | #elif (defined (_MSC_VER) || defined (__DMC__)) && defined (_M_IX86) 57 | # define G_BREAKPOINT() G_STMT_START{ __asm int 3h }G_STMT_END 58 | #elif defined (_MSC_VER) 59 | # define G_BREAKPOINT() G_STMT_START{ __debugbreak(); }G_STMT_END 60 | #elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2 61 | # define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END 62 | #else /* !__i386__ && !__alpha__ */ 63 | # define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END 64 | #endif /* __i386__ */ 65 | 66 | G_END_DECLS 67 | 68 | #endif /* __G_BACKTRACE_H__ */ 69 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gcache.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_CACHE_H__ 32 | #define __G_CACHE_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GCache GCache; 39 | 40 | typedef gpointer (*GCacheNewFunc) (gpointer key); 41 | typedef gpointer (*GCacheDupFunc) (gpointer value); 42 | typedef void (*GCacheDestroyFunc) (gpointer value); 43 | 44 | /* Caches 45 | */ 46 | GCache* g_cache_new (GCacheNewFunc value_new_func, 47 | GCacheDestroyFunc value_destroy_func, 48 | GCacheDupFunc key_dup_func, 49 | GCacheDestroyFunc key_destroy_func, 50 | GHashFunc hash_key_func, 51 | GHashFunc hash_value_func, 52 | GEqualFunc key_equal_func); 53 | void g_cache_destroy (GCache *cache); 54 | gpointer g_cache_insert (GCache *cache, 55 | gpointer key); 56 | void g_cache_remove (GCache *cache, 57 | gconstpointer value); 58 | void g_cache_key_foreach (GCache *cache, 59 | GHFunc func, 60 | gpointer user_data); 61 | #ifndef G_DISABLE_DEPRECATED 62 | void g_cache_value_foreach (GCache *cache, 63 | GHFunc func, 64 | gpointer user_data); 65 | #endif 66 | 67 | G_END_DECLS 68 | 69 | #endif /* __G_CACHE_H__ */ 70 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gcompletion.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_COMPLETION_H__ 32 | #define __G_COMPLETION_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GCompletion GCompletion; 39 | 40 | typedef gchar* (*GCompletionFunc) (gpointer); 41 | 42 | /* GCompletion 43 | */ 44 | 45 | typedef gint (*GCompletionStrncmpFunc) (const gchar *s1, 46 | const gchar *s2, 47 | gsize n); 48 | 49 | struct _GCompletion 50 | { 51 | GList* items; 52 | GCompletionFunc func; 53 | 54 | gchar* prefix; 55 | GList* cache; 56 | GCompletionStrncmpFunc strncmp_func; 57 | }; 58 | 59 | #ifndef G_DISABLE_DEPRECATED 60 | 61 | GCompletion* g_completion_new (GCompletionFunc func); 62 | void g_completion_add_items (GCompletion* cmp, 63 | GList* items); 64 | void g_completion_remove_items (GCompletion* cmp, 65 | GList* items); 66 | void g_completion_clear_items (GCompletion* cmp); 67 | GList* g_completion_complete (GCompletion* cmp, 68 | const gchar* prefix, 69 | gchar** new_prefix); 70 | GList* g_completion_complete_utf8 (GCompletion *cmp, 71 | const gchar* prefix, 72 | gchar** new_prefix); 73 | void g_completion_set_compare (GCompletion *cmp, 74 | GCompletionStrncmpFunc strncmp_func); 75 | void g_completion_free (GCompletion* cmp); 76 | 77 | #endif 78 | 79 | G_END_DECLS 80 | 81 | #endif /* __G_COMPLETION_H__ */ 82 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/grand.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_RAND_H__ 32 | #define __G_RAND_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GRand GRand; 39 | 40 | /* GRand - a good and fast random number generator: Mersenne Twister 41 | * see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html for more info. 42 | * The range functions return a value in the intervall [begin, end). 43 | * int -> [0..2^32-1] 44 | * int_range -> [begin..end-1] 45 | * double -> [0..1) 46 | * double_range -> [begin..end) 47 | */ 48 | 49 | GRand* g_rand_new_with_seed (guint32 seed); 50 | GRand* g_rand_new_with_seed_array (const guint32 *seed, 51 | guint seed_length); 52 | GRand* g_rand_new (void); 53 | void g_rand_free (GRand *rand_); 54 | GRand* g_rand_copy (GRand *rand_); 55 | void g_rand_set_seed (GRand *rand_, 56 | guint32 seed); 57 | void g_rand_set_seed_array (GRand *rand_, 58 | const guint32 *seed, 59 | guint seed_length); 60 | 61 | #define g_rand_boolean(rand_) ((g_rand_int (rand_) & (1 << 15)) != 0) 62 | 63 | guint32 g_rand_int (GRand *rand_); 64 | gint32 g_rand_int_range (GRand *rand_, 65 | gint32 begin, 66 | gint32 end); 67 | gdouble g_rand_double (GRand *rand_); 68 | gdouble g_rand_double_range (GRand *rand_, 69 | gdouble begin, 70 | gdouble end); 71 | void g_random_set_seed (guint32 seed); 72 | 73 | #define g_random_boolean() ((g_random_int () & (1 << 15)) != 0) 74 | 75 | guint32 g_random_int (void); 76 | gint32 g_random_int_range (gint32 begin, 77 | gint32 end); 78 | gdouble g_random_double (void); 79 | gdouble g_random_double_range (gdouble begin, 80 | gdouble end); 81 | 82 | 83 | G_END_DECLS 84 | 85 | #endif /* __G_RAND_H__ */ 86 | -------------------------------------------------------------------------------- /include/err.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#)err.h 8.1 (Berkeley) 6/2/93 34 | * $Id: err.h,v 1.7 1998/11/22 05:12:27 bde Exp $ 35 | */ 36 | 37 | #ifndef _ERR_H_ 38 | #define _ERR_H_ 39 | 40 | #if defined(__cplusplus) 41 | extern "C" { 42 | #endif 43 | 44 | /* 45 | * Don't use va_list in the err/warn prototypes. Va_list is typedef'd in two 46 | * places ( and ), so if we include one 47 | * of them here we may collide with the utility's includes. It's unreasonable 48 | * for utilities to have to include one of them to include err.h, so we get 49 | * _BSD_VA_LIST_ from and use it. 50 | */ 51 | 52 | void __stdcall err(int, const char *, ...); 53 | void verr(int, const char *, void *); 54 | void errc(int, int, const char *, ...); 55 | void verrc(int, int, const char *, void *); 56 | void errx(int, const char *, ...); 57 | void verrx(int, const char *, void *); 58 | void warn(const char *, ...); 59 | void vwarn(const char *, void *); 60 | void warnc(int, const char *, ...); 61 | void vwarnc(int, const char *, void *); 62 | void __stdcall warnx(const char *, ...); 63 | void vwarnx(const char *, void *); 64 | void err_set_file(void *); 65 | void err_set_exit(void (*)(int)); 66 | int geterrno(void); 67 | void seterrno(int); 68 | int mapwinerr(int); 69 | int mapuxerr(int); 70 | int mapntoserr(unsigned long); 71 | 72 | #if defined(__cplusplus) 73 | } 74 | #endif 75 | 76 | #endif /* !_ERR_H_ */ 77 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #ifndef __G_LIB_H__ 28 | #define __G_LIB_H__ 29 | 30 | #define __GLIB_H_INSIDE__ 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include 59 | #include 60 | #include 61 | #include 62 | #include 63 | #include 64 | #include 65 | #include 66 | #include 67 | #include 68 | #include 69 | #include 70 | #include 71 | #include 72 | #include 73 | #include 74 | #include 75 | #include 76 | #include 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | #include 89 | #include 90 | #include 91 | #include 92 | #include 93 | #ifdef G_PLATFORM_WIN32 94 | #include 95 | #endif 96 | 97 | #undef __GLIB_H_INSIDE__ 98 | 99 | #endif /* __G_LIB_H__ */ 100 | -------------------------------------------------------------------------------- /sys/sys/syslimits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1988, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#)syslimits.h 8.1 (Berkeley) 6/2/93 34 | * $FreeBSD: src/sys/sys/syslimits.h,v 1.9 1999/08/28 00:52:03 peter Exp $ 35 | */ 36 | 37 | #ifndef _SYS_SYSLIMITS_H_ 38 | #define _SYS_SYSLIMITS_H_ 39 | 40 | #define ARG_MAX 65536 /* max bytes for an exec function */ 41 | #ifndef CHILD_MAX 42 | #define CHILD_MAX 40 /* max simultaneous processes */ 43 | #endif 44 | #define LINK_MAX 32767 /* max file link count */ 45 | #define MAX_CANON 255 /* max bytes in term canon input line */ 46 | #define MAX_INPUT 255 /* max bytes in terminal input */ 47 | #define NAME_MAX 255 /* max bytes in a file name */ 48 | #define NGROUPS_MAX 16 /* max supplemental group id's */ 49 | #ifndef OPEN_MAX 50 | #define OPEN_MAX 64 /* max open files per process */ 51 | #endif 52 | #define PATH_MAX 1024 /* max bytes in pathname */ 53 | #define NAMELEN_MAX 256 /* max bytes in pathname component */ 54 | #define PIPE_BUF 512 /* max bytes for atomic pipe writes */ 55 | 56 | #define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ 57 | #define BC_DIM_MAX 2048 /* max array elements in bc(1) */ 58 | #define BC_SCALE_MAX 99 /* max scale value in bc(1) */ 59 | #define BC_STRING_MAX 1000 /* max const string length in bc(1) */ 60 | #define COLL_WEIGHTS_MAX 0 /* max weights for order keyword */ 61 | #define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ 62 | #define LINE_MAX 2048 /* max bytes in an input line */ 63 | #define RE_DUP_MAX 255 /* max RE's in interval notation */ 64 | 65 | #define UT_NAMESIZE 32 /* user name size */ 66 | #endif 67 | -------------------------------------------------------------------------------- /sys/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1982, 1986, 1990, 1993, 1994 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#)ioccom.h 8.2 (Berkeley) 3/28/94 34 | * $FreeBSD: src/sys/sys/ioccom.h,v 1.9 1999/12/29 04:24:42 peter Exp $ 35 | */ 36 | 37 | #ifndef _SYS_IOCCOM_H_ 38 | #define _SYS_IOCCOM_H_ 39 | 40 | /* 41 | * Ioctl's have the command encoded in the lower word, and the size of 42 | * any in or out parameters in the upper word. The high 3 bits of the 43 | * upper word are used to encode the in/out status of the parameter. 44 | */ 45 | #define IOCPARM_MASK 0x1fff /* parameter length, at most 13 bits */ 46 | #define IOCPARM_LEN(x) (((x) >> 16) & IOCPARM_MASK) 47 | #define IOCBASECMD(x) ((x) & ~(IOCPARM_MASK << 16)) 48 | #define IOCGROUP(x) (((x) >> 8) & 0xff) 49 | 50 | #define IOCPARM_MAX PAGE_SIZE /* max size of ioctl, mult. of PAGE_SIZE */ 51 | #define IOC_VOID 0x20000000 /* no parameters */ 52 | #define IOC_OUT 0x40000000 /* copy out parameters */ 53 | #define IOC_IN 0x80000000 /* copy in parameters */ 54 | #define IOC_INOUT (IOC_IN|IOC_OUT) 55 | #define IOC_DIRMASK 0xe0000000 /* mask for IN/OUT/VOID */ 56 | 57 | #define _IOC(inout,group,num,len) \ 58 | ((unsigned long)(inout | ((len & IOCPARM_MASK) << 16) | ((group) << 8) | (num))) 59 | #define _IO(g,n) _IOC(IOC_VOID, (g), (n), 0) 60 | #define _IOR(g,n,t) _IOC(IOC_OUT, (g), (n), sizeof(t)) 61 | #define _IOW(g,n,t) _IOC(IOC_IN, (g), (n), sizeof(t)) 62 | /* this should be _IORW, but stdio got there first */ 63 | #define _IOWR(g,n,t) _IOC(IOC_INOUT, (g), (n), sizeof(t)) 64 | 65 | #ifndef _KERNEL 66 | int __stdcall ioctl(int, unsigned long, void *); 67 | #endif 68 | 69 | #endif /* !_SYS_IOCCOM_H_ */ 70 | -------------------------------------------------------------------------------- /include/pthread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * pthread mapping to WIN32 sufficient for FUSE library 3 | * (C) Copyright 2012 Sammandam, Supramani suprasam@crossmeta.org 4 | */ 5 | #ifdef __MINGW32__ 6 | #include_next 7 | #define _PTHREAD_H 8 | #endif 9 | #ifndef _PTHREAD_H 10 | #define _PTHREAD_H 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #define PTHREAD_MUTEX_INITIALIZER {(void*)-1,-1,0,0,0,0} 17 | typedef CRITICAL_SECTION pthread_mutex_t; 18 | typedef HANDLE pthread_t; 19 | typedef HANDLE pthread_cond_t; 20 | typedef void * pthread_mutexattr_t; 21 | typedef void * pthread_attr_t; 22 | typedef unsigned int pthread_key_t; 23 | 24 | #define pthread_sigmask(x,y,z) 25 | #define pthread_setcancelstate(f,a) 26 | #define pthread_kill(t,s) (0) 27 | #define pthread_cancel(t) 28 | #define pause() WaitForSingleObject(pthread_self(), INFINITE) 29 | 30 | #define pthread_self(void) GetCurrentThreadId() 31 | #define pthread_join(t, rv) WaitForSingleObject(t, INFINITE) 32 | #define pthread_detach(t) (0) 33 | #define pthread_attr_init(a) (0) 34 | #define pthread_attr_setstacksize(a, sz) (0) 35 | #define pthread_attr_destroy(a) (0) 36 | 37 | #define pthread_key(t,v) DWORD v 38 | #define pthread_key_create(k,f) ((*(k) = TlsAlloc()) == 0xFFFFFFFF) 39 | #define pthread_key_delete(k) TlsFree(k) 40 | #define pthread_getspecific(k) TlsGetValue(k) 41 | #define pthread_setspecific(k,v) TlsSetValue(k,v) 42 | 43 | static __inline void pthread_mutex_init(pthread_mutex_t *m, 44 | pthread_mutexattr_t *a) 45 | { 46 | InitializeCriticalSection(m); 47 | return (0); 48 | } 49 | 50 | static __inline int pthread_mutex_lock(pthread_mutex_t *m) 51 | { 52 | EnterCriticalSection(m); 53 | return (0); 54 | } 55 | 56 | static __inline int pthread_mutex_unlock(pthread_mutex_t *m) 57 | { 58 | LeaveCriticalSection(m); 59 | return (0); 60 | } 61 | 62 | static __inline int pthread_mutex_destroy(pthread_mutex_t *m) 63 | { 64 | DeleteCriticalSection(m); 65 | } 66 | 67 | static __inline int pthread_cond_init(pthread_cond_t *c, pthread_mutexattr_t *a) 68 | { 69 | *c = CreateEvent(NULL, FALSE, FALSE, NULL); 70 | return (0); 71 | } 72 | static __inline int pthread_cond_destroy(pthread_cond_t *c) 73 | { 74 | return CloseHandle(*c); 75 | } 76 | 77 | static __inline int pthread_cond_wait(pthread_cond_t *c, pthread_mutex_t *m) 78 | { 79 | pthread_mutex_unlock(m); 80 | WaitForSingleObject(c, INFINITE); 81 | pthread_mutex_lock(m); 82 | return (0); 83 | } 84 | 85 | static __inline int 86 | pthread_cond_timedwait(pthread_cond_t *c, pthread_mutex_t *m, 87 | const struct timespec *abstime) 88 | { 89 | u_int64_t time_ms; 90 | u_int64_t cur_ms; 91 | struct __timeb64 tb; 92 | 93 | time_ms = abstime->tv_sec * 1000 + abstime->tv_nsec / 1000000; 94 | _ftime64(&tb); 95 | cur_ms = tb.time * 1000 + tb.millitm; 96 | if (time_ms <= cur_ms) 97 | return 0; 98 | 99 | pthread_mutex_unlock(m); 100 | WaitForSingleObject(c, (time_ms - cur_ms)); 101 | pthread_mutex_lock(m); 102 | } 103 | 104 | static __inline int pthread_cond_signal(pthread_cond_t *c) 105 | { 106 | SetEvent(c); 107 | } 108 | 109 | static __inline int pthread_cond_broadcast(pthread_cond_t *c) 110 | { 111 | SetEvent(c); 112 | } 113 | 114 | static __inline int 115 | pthread_create(pthread_t *th, pthread_attr_t *attr, LPTHREAD_START_ROUTINE func, 116 | void *arg) 117 | { 118 | HANDLE h; 119 | // fprintf(stderr, "CreateThread arg %p\n", arg); 120 | h = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)func, arg, 0, NULL); 121 | if (!h) 122 | return GetLastError(); 123 | return (0); 124 | } 125 | 126 | #endif 127 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gtimezone.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2010 Codethink Limited 3 | * 4 | * This library is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU Lesser General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * licence, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 17 | * USA. 18 | * 19 | * Author: Ryan Lortie 20 | */ 21 | 22 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 23 | #error "Only can be included directly." 24 | #endif 25 | 26 | #ifndef __G_TIME_ZONE_H__ 27 | #define __G_TIME_ZONE_H__ 28 | 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _GTimeZone GTimeZone; 34 | 35 | /** 36 | * GTimeType: 37 | * @G_TIME_TYPE_STANDARD: the time is in local standard time 38 | * @G_TIME_TYPE_DAYLIGHT: the time is in local daylight time 39 | * @G_TIME_TYPE_UNIVERSAL: the time is in UTC 40 | * 41 | * Disambiguates a given time in two ways. 42 | * 43 | * First, specifies if the given time is in universal or local time. 44 | * 45 | * Second, if the time is in local time, specifies if it is local 46 | * standard time or local daylight time. This is important for the case 47 | * where the same local time occurs twice (during daylight savings time 48 | * transitions, for example). 49 | */ 50 | typedef enum 51 | { 52 | G_TIME_TYPE_STANDARD, 53 | G_TIME_TYPE_DAYLIGHT, 54 | G_TIME_TYPE_UNIVERSAL 55 | } GTimeType; 56 | 57 | GTimeZone * g_time_zone_new (const gchar *identifier); 58 | GTimeZone * g_time_zone_new_utc (void); 59 | GTimeZone * g_time_zone_new_local (void); 60 | 61 | GTimeZone * g_time_zone_ref (GTimeZone *tz); 62 | void g_time_zone_unref (GTimeZone *tz); 63 | 64 | gint g_time_zone_find_interval (GTimeZone *tz, 65 | GTimeType type, 66 | gint64 time); 67 | 68 | gint g_time_zone_adjust_time (GTimeZone *tz, 69 | GTimeType type, 70 | gint64 *time); 71 | 72 | const gchar * g_time_zone_get_abbreviation (GTimeZone *tz, 73 | gint interval); 74 | gint32 g_time_zone_get_offset (GTimeZone *tz, 75 | gint interval); 76 | gboolean g_time_zone_is_dst (GTimeZone *tz, 77 | gint interval); 78 | 79 | G_END_DECLS 80 | 81 | #endif /* __G_TIME_ZONE_H__ */ 82 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gchecksum.h: -------------------------------------------------------------------------------- 1 | /* gchecksum.h - data hashing functions 2 | * 3 | * Copyright (C) 2007 Emmanuele Bassi 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Library General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Library General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Library General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __G_CHECKSUM_H__ 26 | #define __G_CHECKSUM_H__ 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | /** 33 | * GChecksumType: 34 | * @G_CHECKSUM_MD5: Use the MD5 hashing algorithm 35 | * @G_CHECKSUM_SHA1: Use the SHA-1 hashing algorithm 36 | * @G_CHECKSUM_SHA256: Use the SHA-256 hashing algorithm 37 | * 38 | * The hashing algorithm to be used by #GChecksum when performing the 39 | * digest of some data. 40 | * 41 | * Note that the #GChecksumType enumeration may be extended at a later 42 | * date to include new hashing algorithm types. 43 | * 44 | * Since: 2.16 45 | */ 46 | typedef enum { 47 | G_CHECKSUM_MD5, 48 | G_CHECKSUM_SHA1, 49 | G_CHECKSUM_SHA256 50 | } GChecksumType; 51 | 52 | /** 53 | * GChecksum: 54 | * 55 | * An opaque structure representing a checksumming operation. 56 | * To create a new GChecksum, use g_checksum_new(). To free 57 | * a GChecksum, use g_checksum_free(). 58 | * 59 | * Since: 2.16 60 | */ 61 | typedef struct _GChecksum GChecksum; 62 | 63 | gssize g_checksum_type_get_length (GChecksumType checksum_type); 64 | 65 | GChecksum * g_checksum_new (GChecksumType checksum_type); 66 | void g_checksum_reset (GChecksum *checksum); 67 | GChecksum * g_checksum_copy (const GChecksum *checksum); 68 | void g_checksum_free (GChecksum *checksum); 69 | void g_checksum_update (GChecksum *checksum, 70 | const guchar *data, 71 | gssize length); 72 | G_CONST_RETURN gchar *g_checksum_get_string (GChecksum *checksum); 73 | void g_checksum_get_digest (GChecksum *checksum, 74 | guint8 *buffer, 75 | gsize *digest_len); 76 | 77 | gchar *g_compute_checksum_for_data (GChecksumType checksum_type, 78 | const guchar *data, 79 | gsize length); 80 | gchar *g_compute_checksum_for_string (GChecksumType checksum_type, 81 | const gchar *str, 82 | gssize length); 83 | 84 | G_END_DECLS 85 | 86 | #endif /* __G_CHECKSUM_H__ */ 87 | -------------------------------------------------------------------------------- /include/paths.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1989, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#)paths.h 8.1 (Berkeley) 6/2/93 34 | * $FreeBSD: src/include/paths.h,v 1.9.6.4 2002/07/19 07:53:41 jmallett Exp $ 35 | */ 36 | 37 | #ifndef _PATHS_H_ 38 | #define _PATHS_H_ 39 | 40 | #include 41 | 42 | /* Default search path. */ 43 | #define _PATH_DEFPATH "/usr/bin:/bin" 44 | /* All standard utilities path. */ 45 | #define _PATH_STDPATH \ 46 | "/usr/bin:/bin:/usr/sbin:/sbin:" 47 | 48 | #define _PATH_AUTHCONF "/etc/auth.conf" 49 | #define _PATH_BSHELL "/bin/sh" 50 | #define _PATH_CONSOLE "/dev/console" 51 | #define _PATH_CP "/bin/cp" 52 | #define _PATH_CSHELL "/bin/csh" 53 | #define _PATH_DEFTAPE "/dev/sa0" 54 | #define _PATH_DEVDB "/var/run/dev.db" 55 | #define _PATH_DEVNULL "/dev/null" 56 | #define _PATH_DEVZERO "/dev/zero" 57 | #define _PATH_DRUM "/dev/drum" 58 | #define _PATH_ETC "/etc" 59 | #define _PATH_FTPUSERS "/etc/ftpusers" 60 | #define _PATH_KMEM "/dev/kmem" 61 | #define _PATH_LOGIN "/usr/bin/login" 62 | #define _PATH_MAILDIR "/var/mail" 63 | #define _PATH_MAN "/usr/share/man" 64 | #define _PATH_MEM "/dev/mem" 65 | #define _PATH_NOLOGIN "/var/run/nologin" 66 | #define _PATH_RCP "/bin/rcp" 67 | #define _PATH_RLOGIN "/usr/bin/rlogin" 68 | #define _PATH_RSH "/usr/bin/rsh" 69 | #define _PATH_SENDMAIL "/usr/sbin/sendmail" 70 | #define _PATH_SHELLS "/etc/shells" 71 | #define _PATH_TTY "/dev/tty" 72 | #define _PATH_UNIX "don't use _PATH_UNIX" 73 | #define _PATH_VI "/usr/bin/vi" 74 | #define _PATH_WALL "/usr/bin/wall" 75 | 76 | /* Provide trailing slash, since mostly used for building pathnames. */ 77 | #define _PATH_DEV "/dev/" 78 | #define _PATH_TMP "/tmp/" 79 | #define _PATH_VARDB "/var/db/" 80 | #define _PATH_VARRUN "/var/run/" 81 | #define _PATH_VARTMP "/var/tmp/" 82 | #define _PATH_YP "/var/yp/" 83 | #define _PATH_UUCPLOCK "/var/spool/lock/" 84 | 85 | /* How to get the correct name of the kernel. */ 86 | __BEGIN_DECLS 87 | const char *getbootfile(void); 88 | __END_DECLS 89 | 90 | #endif /* !_PATHS_H_ */ 91 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gslice.h: -------------------------------------------------------------------------------- 1 | /* GLIB sliced memory - fast threaded memory chunk allocator 2 | * Copyright (C) 2005 Tim Janik 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 21 | #error "Only can be included directly." 22 | #endif 23 | 24 | #ifndef __G_SLICE_H__ 25 | #define __G_SLICE_H__ 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | /* slices - fast allocation/release of small memory blocks 32 | */ 33 | gpointer g_slice_alloc (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); 34 | gpointer g_slice_alloc0 (gsize block_size) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); 35 | gpointer g_slice_copy (gsize block_size, 36 | gconstpointer mem_block) G_GNUC_MALLOC G_GNUC_ALLOC_SIZE(1); 37 | void g_slice_free1 (gsize block_size, 38 | gpointer mem_block); 39 | void g_slice_free_chain_with_offset (gsize block_size, 40 | gpointer mem_chain, 41 | gsize next_offset); 42 | #define g_slice_new(type) ((type*) g_slice_alloc (sizeof (type))) 43 | #define g_slice_new0(type) ((type*) g_slice_alloc0 (sizeof (type))) 44 | /* MemoryBlockType * 45 | * g_slice_dup (MemoryBlockType, 46 | * MemoryBlockType *mem_block); 47 | * g_slice_free (MemoryBlockType, 48 | * MemoryBlockType *mem_block); 49 | * g_slice_free_chain (MemoryBlockType, 50 | * MemoryBlockType *first_chain_block, 51 | * memory_block_next_field); 52 | * pseudo prototypes for the macro 53 | * definitions following below. 54 | */ 55 | 56 | /* we go through extra hoops to ensure type safety */ 57 | #define g_slice_dup(type, mem) \ 58 | (1 ? (type*) g_slice_copy (sizeof (type), (mem)) \ 59 | : ((void) ((type*) 0 == (mem)), (type*) 0)) 60 | #define g_slice_free(type, mem) do { \ 61 | if (1) g_slice_free1 (sizeof (type), (mem)); \ 62 | else (void) ((type*) 0 == (mem)); \ 63 | } while (0) 64 | #define g_slice_free_chain(type, mem_chain, next) do { \ 65 | if (1) g_slice_free_chain_with_offset (sizeof (type), \ 66 | (mem_chain), G_STRUCT_OFFSET (type, next)); \ 67 | else (void) ((type*) 0 == (mem_chain)); \ 68 | } while (0) 69 | 70 | 71 | /* --- internal debugging API --- */ 72 | typedef enum { 73 | G_SLICE_CONFIG_ALWAYS_MALLOC = 1, 74 | G_SLICE_CONFIG_BYPASS_MAGAZINES, 75 | G_SLICE_CONFIG_WORKING_SET_MSECS, 76 | G_SLICE_CONFIG_COLOR_INCREMENT, 77 | G_SLICE_CONFIG_CHUNK_SIZES, 78 | G_SLICE_CONFIG_CONTENTION_COUNTER 79 | } GSliceConfig; 80 | void g_slice_set_config (GSliceConfig ckey, gint64 value); 81 | gint64 g_slice_get_config (GSliceConfig ckey); 82 | gint64* g_slice_get_config_state (GSliceConfig ckey, gint64 address, guint *n_values); 83 | 84 | G_END_DECLS 85 | 86 | #endif /* __G_SLICE_H__ */ 87 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gerror.h: -------------------------------------------------------------------------------- 1 | /* gerror.h - Error reporting system 2 | * 3 | * Copyright 2000 Red Hat, Inc. 4 | * 5 | * The Gnome Library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * The Gnome Library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with the Gnome Library; see the file COPYING.LIB. If not, 17 | * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __G_ERROR_H__ 26 | #define __G_ERROR_H__ 27 | 28 | #include 29 | 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | typedef struct _GError GError; 35 | 36 | struct _GError 37 | { 38 | GQuark domain; 39 | gint code; 40 | gchar *message; 41 | }; 42 | 43 | GError* g_error_new (GQuark domain, 44 | gint code, 45 | const gchar *format, 46 | ...) G_GNUC_PRINTF (3, 4); 47 | 48 | GError* g_error_new_literal (GQuark domain, 49 | gint code, 50 | const gchar *message); 51 | GError* g_error_new_valist (GQuark domain, 52 | gint code, 53 | const gchar *format, 54 | va_list args); 55 | 56 | void g_error_free (GError *error); 57 | GError* g_error_copy (const GError *error); 58 | 59 | gboolean g_error_matches (const GError *error, 60 | GQuark domain, 61 | gint code); 62 | 63 | /* if (err) *err = g_error_new(domain, code, format, ...), also has 64 | * some sanity checks. 65 | */ 66 | void g_set_error (GError **err, 67 | GQuark domain, 68 | gint code, 69 | const gchar *format, 70 | ...) G_GNUC_PRINTF (4, 5); 71 | 72 | void g_set_error_literal (GError **err, 73 | GQuark domain, 74 | gint code, 75 | const gchar *message); 76 | 77 | /* if (dest) *dest = src; also has some sanity checks. 78 | */ 79 | void g_propagate_error (GError **dest, 80 | GError *src); 81 | 82 | /* if (err && *err) { g_error_free(*err); *err = NULL; } */ 83 | void g_clear_error (GError **err); 84 | 85 | /* if (err) prefix the formatted string to the ->message */ 86 | void g_prefix_error (GError **err, 87 | const gchar *format, 88 | ...) G_GNUC_PRINTF (2, 3); 89 | 90 | /* g_propagate_error then g_error_prefix on dest */ 91 | void g_propagate_prefixed_error (GError **dest, 92 | GError *src, 93 | const gchar *format, 94 | ...) G_GNUC_PRINTF (3, 4); 95 | 96 | G_END_DECLS 97 | 98 | #endif /* __G_ERROR_H__ */ 99 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/grel.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_REL_H__ 32 | #define __G_REL_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GRelation GRelation; 39 | typedef struct _GTuples GTuples; 40 | 41 | struct _GTuples 42 | { 43 | guint len; 44 | }; 45 | 46 | /* GRelation 47 | * 48 | * Indexed Relations. Imagine a really simple table in a 49 | * database. Relations are not ordered. This data type is meant for 50 | * maintaining a N-way mapping. 51 | * 52 | * g_relation_new() creates a relation with FIELDS fields 53 | * 54 | * g_relation_destroy() frees all resources 55 | * g_tuples_destroy() frees the result of g_relation_select() 56 | * 57 | * g_relation_index() indexes relation FIELD with the provided 58 | * equality and hash functions. this must be done before any 59 | * calls to insert are made. 60 | * 61 | * g_relation_insert() inserts a new tuple. you are expected to 62 | * provide the right number of fields. 63 | * 64 | * g_relation_delete() deletes all relations with KEY in FIELD 65 | * g_relation_select() returns ... 66 | * g_relation_count() counts ... 67 | */ 68 | 69 | #ifndef G_DISABLE_DEPRECATED 70 | 71 | GRelation* g_relation_new (gint fields); 72 | void g_relation_destroy (GRelation *relation); 73 | void g_relation_index (GRelation *relation, 74 | gint field, 75 | GHashFunc hash_func, 76 | GEqualFunc key_equal_func); 77 | void g_relation_insert (GRelation *relation, 78 | ...); 79 | gint g_relation_delete (GRelation *relation, 80 | gconstpointer key, 81 | gint field); 82 | GTuples* g_relation_select (GRelation *relation, 83 | gconstpointer key, 84 | gint field); 85 | gint g_relation_count (GRelation *relation, 86 | gconstpointer key, 87 | gint field); 88 | gboolean g_relation_exists (GRelation *relation, 89 | ...); 90 | void g_relation_print (GRelation *relation); 91 | 92 | void g_tuples_destroy (GTuples *tuples); 93 | gpointer g_tuples_index (GTuples *tuples, 94 | gint index_, 95 | gint field); 96 | 97 | #endif 98 | 99 | G_END_DECLS 100 | 101 | #endif /* __G_REL_H__ */ 102 | -------------------------------------------------------------------------------- /include/regex.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1992 Henry Spencer. 3 | * Copyright (c) 1992, 1993 4 | * The Regents of the University of California. All rights reserved. 5 | * 6 | * This code is derived from software contributed to Berkeley by 7 | * Henry Spencer of the University of Toronto. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. All advertising materials mentioning features or use of this software 18 | * must display the following acknowledgement: 19 | * This product includes software developed by the University of 20 | * California, Berkeley and its contributors. 21 | * 4. Neither the name of the University nor the names of its contributors 22 | * may be used to endorse or promote products derived from this software 23 | * without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 | * SUCH DAMAGE. 36 | * 37 | * @(#)regex.h 8.2 (Berkeley) 1/3/94 38 | */ 39 | 40 | #ifndef _REGEX_H_ 41 | #define _REGEX_H_ 42 | 43 | #include 44 | #include 45 | 46 | /* types */ 47 | typedef off_t regoff_t; 48 | 49 | typedef struct { 50 | int re_magic; 51 | size_t re_nsub; /* number of parenthesized subexpressions */ 52 | __const char *re_endp; /* end pointer for REG_PEND */ 53 | struct re_guts *re_g; /* none of your business :-) */ 54 | } regex_t; 55 | 56 | typedef struct { 57 | regoff_t rm_so; /* start of match */ 58 | regoff_t rm_eo; /* end of match */ 59 | } regmatch_t; 60 | 61 | /* regcomp() flags */ 62 | #define REG_BASIC 0000 63 | #define REG_EXTENDED 0001 64 | #define REG_ICASE 0002 65 | #define REG_NOSUB 0004 66 | #define REG_NEWLINE 0010 67 | #define REG_NOSPEC 0020 68 | #define REG_PEND 0040 69 | #define REG_DUMP 0200 70 | 71 | /* regerror() flags */ 72 | #define REG_NOMATCH 1 73 | #define REG_BADPAT 2 74 | #define REG_ECOLLATE 3 75 | #define REG_ECTYPE 4 76 | #define REG_EESCAPE 5 77 | #define REG_ESUBREG 6 78 | #define REG_EBRACK 7 79 | #define REG_EPAREN 8 80 | #define REG_EBRACE 9 81 | #define REG_BADBR 10 82 | #define REG_ERANGE 11 83 | #define REG_ESPACE 12 84 | #define REG_BADRPT 13 85 | #define REG_EMPTY 14 86 | #define REG_ASSERT 15 87 | #define REG_INVARG 16 88 | #define REG_ILLSEQ 17 89 | #define REG_ATOI 255 /* convert name to number (!) */ 90 | #define REG_ITOA 0400 /* convert number to name (!) */ 91 | 92 | /* regexec() flags */ 93 | #define REG_NOTBOL 00001 94 | #define REG_NOTEOL 00002 95 | #define REG_STARTEND 00004 96 | #define REG_TRACE 00400 /* tracing of execution */ 97 | #define REG_LARGE 01000 /* force large representation */ 98 | #define REG_BACKR 02000 /* force use of backref code */ 99 | 100 | __BEGIN_DECLS 101 | int __stdcall regcomp __P((regex_t *, const char *, int)); 102 | size_t __stdcall regerror __P((int, const regex_t *, char *, size_t)); 103 | int __stdcall regexec __P((const regex_t *, 104 | const char *, size_t, regmatch_t [], int)); 105 | void __stdcall regfree __P((regex_t *)); 106 | __END_DECLS 107 | 108 | #endif /* !_REGEX_H_ */ 109 | -------------------------------------------------------------------------------- /include/dirent.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1989, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#)dirent.h 8.2 (Berkeley) 7/28/94 34 | * $FreeBSD: src/include/dirent.h,v 1.7 1999/12/29 05:01:20 peter Exp $ 35 | */ 36 | 37 | #ifndef _DIRENT_H_ 38 | #define _DIRENT_H_ 39 | 40 | /* 41 | * The kernel defines the format of directory entries returned by 42 | * the getdirentries(2) system call. 43 | */ 44 | #include 45 | 46 | #ifdef _POSIX_SOURCE 47 | typedef void * DIR; 48 | #else 49 | 50 | 51 | /* definitions for library routines operating on directories. */ 52 | #define DIRBLKSIZ 1024 53 | 54 | /* structure describing an open directory. */ 55 | typedef struct _dirdesc { 56 | int dd_fd; /* file descriptor associated with directory */ 57 | long dd_loc; /* offset in current buffer */ 58 | long dd_size; /* amount of data returned by getdirentries */ 59 | char *dd_buf; /* data buffer */ 60 | int dd_len; /* size of data buffer */ 61 | off64_t dd_seek; /* magic cookie returned by getdirentries */ 62 | off64_t dd_rewind; /* magic cookie for rewinding */ 63 | int dd_flags; /* flags for readdir */ 64 | } DIR; 65 | 66 | #define dirfd(dirp) ((dirp)->dd_fd) 67 | 68 | /* flags for opendir2 */ 69 | #define DTF_HIDEW 0x0001 /* hide whiteout entries */ 70 | #define DTF_NODUP 0x0002 /* don't return duplicate names */ 71 | #define DTF_REWIND 0x0004 /* rewind after reading union stack */ 72 | #define __DTF_READALL 0x0008 /* everything has been read */ 73 | 74 | #ifndef NULL 75 | #define NULL 0 76 | #endif 77 | 78 | #endif /* _POSIX_SOURCE */ 79 | 80 | #ifndef _KERNEL 81 | 82 | #include 83 | 84 | __BEGIN_DECLS 85 | DIR *opendir __P((const char *)); 86 | struct dirent *readdir __P((DIR *)); 87 | void rewinddir __P((DIR *)); 88 | int closedir __P((DIR *)); 89 | #ifndef _POSIX_SOURCE 90 | DIR *__opendir2 __P((const char *, int)); 91 | long telldir __P((const DIR *)); 92 | void seekdir __P((DIR *, long)); 93 | int scandir __P((const char *, struct dirent ***, 94 | int (*)(struct dirent *), int (CDECL *)(const void *, const void *))); 95 | int CDECL alphasort __P((const void *, const void *)); 96 | int getdents __P((int, char *, int)); 97 | int getdirentries __P((int, char *, int, off64_t *)); 98 | int readdir_r __P((DIR *, struct dirent *, struct dirent **)); 99 | #endif /* not POSIX */ 100 | __END_DECLS 101 | 102 | #endif /* !_KERNEL */ 103 | 104 | #endif /* !_DIRENT_H_ */ 105 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gtree.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_TREE_H__ 32 | #define __G_TREE_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GTree GTree; 39 | 40 | typedef gboolean (*GTraverseFunc) (gpointer key, 41 | gpointer value, 42 | gpointer data); 43 | 44 | /* Balanced binary trees 45 | */ 46 | GTree* g_tree_new (GCompareFunc key_compare_func); 47 | GTree* g_tree_new_with_data (GCompareDataFunc key_compare_func, 48 | gpointer key_compare_data); 49 | GTree* g_tree_new_full (GCompareDataFunc key_compare_func, 50 | gpointer key_compare_data, 51 | GDestroyNotify key_destroy_func, 52 | GDestroyNotify value_destroy_func); 53 | GTree* g_tree_ref (GTree *tree); 54 | void g_tree_unref (GTree *tree); 55 | void g_tree_destroy (GTree *tree); 56 | void g_tree_insert (GTree *tree, 57 | gpointer key, 58 | gpointer value); 59 | void g_tree_replace (GTree *tree, 60 | gpointer key, 61 | gpointer value); 62 | gboolean g_tree_remove (GTree *tree, 63 | gconstpointer key); 64 | gboolean g_tree_steal (GTree *tree, 65 | gconstpointer key); 66 | gpointer g_tree_lookup (GTree *tree, 67 | gconstpointer key); 68 | gboolean g_tree_lookup_extended (GTree *tree, 69 | gconstpointer lookup_key, 70 | gpointer *orig_key, 71 | gpointer *value); 72 | void g_tree_foreach (GTree *tree, 73 | GTraverseFunc func, 74 | gpointer user_data); 75 | 76 | #ifndef G_DISABLE_DEPRECATED 77 | void g_tree_traverse (GTree *tree, 78 | GTraverseFunc traverse_func, 79 | GTraverseType traverse_type, 80 | gpointer user_data); 81 | #endif /* G_DISABLE_DEPRECATED */ 82 | 83 | gpointer g_tree_search (GTree *tree, 84 | GCompareFunc search_func, 85 | gconstpointer user_data); 86 | gint g_tree_height (GTree *tree); 87 | gint g_tree_nnodes (GTree *tree); 88 | 89 | G_END_DECLS 90 | 91 | #endif /* __G_TREE_H__ */ 92 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gwin32.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_WIN32_H__ 32 | #define __G_WIN32_H__ 33 | 34 | #include 35 | 36 | #ifdef G_PLATFORM_WIN32 37 | 38 | G_BEGIN_DECLS 39 | 40 | #ifndef MAXPATHLEN 41 | #define MAXPATHLEN 1024 42 | #endif 43 | 44 | #ifdef G_OS_WIN32 45 | 46 | /* 47 | * To get prototypes for the following POSIXish functions, you have to 48 | * include the indicated non-POSIX headers. The functions are defined 49 | * in OLDNAMES.LIB (MSVC) or -lmoldname-msvc (mingw32). But note that 50 | * for POSIX functions that take or return file names in the system 51 | * codepage, in many cases you would want to use the GLib wrappers in 52 | * gstdio.h and UTF-8 instead. 53 | * 54 | * getcwd: (MSVC), (mingw32) 55 | * getpid: 56 | * access: 57 | * unlink: or 58 | * open, read, write, lseek, close: 59 | * rmdir: 60 | * pipe: (actually, _pipe()) 61 | */ 62 | 63 | /* For some POSIX functions that are not provided by the MS runtime, 64 | * we provide emulation functions in glib, which are prefixed with 65 | * g_win32_. Or that was the idea at some time, but there is just one 66 | * of those: 67 | */ 68 | gint g_win32_ftruncate (gint f, 69 | guint size); 70 | #endif /* G_OS_WIN32 */ 71 | 72 | /* The MS setlocale uses locale names of the form "English_United 73 | * States.1252" etc. We want the Unixish standard form "en", "zh_TW" 74 | * etc. This function gets the current thread locale from Windows and 75 | * returns it as a string of the above form for use in forming file 76 | * names etc. The returned string should be deallocated with g_free(). 77 | */ 78 | gchar* g_win32_getlocale (void); 79 | 80 | /* Translate a Win32 error code (as returned by GetLastError()) into 81 | * the corresponding message. The returned string should be deallocated 82 | * with g_free(). 83 | */ 84 | gchar* g_win32_error_message (gint error); 85 | 86 | #ifndef G_DISABLE_DEPRECATED 87 | 88 | #define g_win32_get_package_installation_directory g_win32_get_package_installation_directory_utf8 89 | #define g_win32_get_package_installation_subdirectory g_win32_get_package_installation_subdirectory_utf8 90 | 91 | gchar* g_win32_get_package_installation_directory (const gchar *package, 92 | const gchar *dll_name); 93 | 94 | gchar* g_win32_get_package_installation_subdirectory (const gchar *package, 95 | const gchar *dll_name, 96 | const gchar *subdir); 97 | 98 | #endif 99 | 100 | gchar* g_win32_get_package_installation_directory_of_module (gpointer hmodule); 101 | 102 | guint g_win32_get_windows_version (void); 103 | 104 | gchar* g_win32_locale_filename_from_utf8 (const gchar *utf8filename); 105 | 106 | /* As of GLib 2.14 we only support NT-based Windows */ 107 | #define G_WIN32_IS_NT_BASED() TRUE 108 | #define G_WIN32_HAVE_WIDECHAR_API() TRUE 109 | 110 | G_END_DECLS 111 | 112 | #endif /* G_PLATFORM_WIN32 */ 113 | 114 | #endif /* __G_WIN32_H__ */ 115 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gfileutils.h: -------------------------------------------------------------------------------- 1 | /* gfileutils.h - File utility functions 2 | * 3 | * Copyright 2000 Red Hat, Inc. 4 | * 5 | * GLib is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * GLib is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with GLib; see the file COPYING.LIB. If not, 17 | * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 22 | #error "Only can be included directly." 23 | #endif 24 | 25 | #ifndef __G_FILEUTILS_H__ 26 | #define __G_FILEUTILS_H__ 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define G_FILE_ERROR g_file_error_quark () 33 | 34 | typedef enum 35 | { 36 | G_FILE_ERROR_EXIST, 37 | G_FILE_ERROR_ISDIR, 38 | G_FILE_ERROR_ACCES, 39 | G_FILE_ERROR_NAMETOOLONG, 40 | G_FILE_ERROR_NOENT, 41 | G_FILE_ERROR_NOTDIR, 42 | G_FILE_ERROR_NXIO, 43 | G_FILE_ERROR_NODEV, 44 | G_FILE_ERROR_ROFS, 45 | G_FILE_ERROR_TXTBSY, 46 | G_FILE_ERROR_FAULT, 47 | G_FILE_ERROR_LOOP, 48 | G_FILE_ERROR_NOSPC, 49 | G_FILE_ERROR_NOMEM, 50 | G_FILE_ERROR_MFILE, 51 | G_FILE_ERROR_NFILE, 52 | G_FILE_ERROR_BADF, 53 | G_FILE_ERROR_INVAL, 54 | G_FILE_ERROR_PIPE, 55 | G_FILE_ERROR_AGAIN, 56 | G_FILE_ERROR_INTR, 57 | G_FILE_ERROR_IO, 58 | G_FILE_ERROR_PERM, 59 | G_FILE_ERROR_NOSYS, 60 | G_FILE_ERROR_FAILED 61 | } GFileError; 62 | 63 | /* For backward-compat reasons, these are synced to an old 64 | * anonymous enum in libgnome. But don't use that enum 65 | * in new code. 66 | */ 67 | typedef enum 68 | { 69 | G_FILE_TEST_IS_REGULAR = 1 << 0, 70 | G_FILE_TEST_IS_SYMLINK = 1 << 1, 71 | G_FILE_TEST_IS_DIR = 1 << 2, 72 | G_FILE_TEST_IS_EXECUTABLE = 1 << 3, 73 | G_FILE_TEST_EXISTS = 1 << 4 74 | } GFileTest; 75 | 76 | GQuark g_file_error_quark (void); 77 | /* So other code can generate a GFileError */ 78 | GFileError g_file_error_from_errno (gint err_no); 79 | 80 | #ifndef __GTK_DOC_IGNORE__ 81 | #ifdef G_OS_WIN32 82 | #define g_file_test g_file_test_utf8 83 | #define g_file_get_contents g_file_get_contents_utf8 84 | #define g_mkstemp g_mkstemp_utf8 85 | #define g_file_open_tmp g_file_open_tmp_utf8 86 | #endif 87 | #endif 88 | 89 | gboolean g_file_test (const gchar *filename, 90 | GFileTest test); 91 | gboolean g_file_get_contents (const gchar *filename, 92 | gchar **contents, 93 | gsize *length, 94 | GError **error); 95 | gboolean g_file_set_contents (const gchar *filename, 96 | const gchar *contents, 97 | gssize length, 98 | GError **error); 99 | gchar *g_file_read_link (const gchar *filename, 100 | GError **error); 101 | 102 | /* Wrapper / workalike for mkstemp() */ 103 | gint g_mkstemp (gchar *tmpl); 104 | gint g_mkstemp_full (gchar *tmpl, 105 | int flags, 106 | int mode); 107 | 108 | /* Wrapper for g_mkstemp */ 109 | gint g_file_open_tmp (const gchar *tmpl, 110 | gchar **name_used, 111 | GError **error); 112 | 113 | char *g_format_size_for_display (goffset size); 114 | 115 | gchar *g_build_path (const gchar *separator, 116 | const gchar *first_element, 117 | ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED; 118 | gchar *g_build_pathv (const gchar *separator, 119 | gchar **args) G_GNUC_MALLOC; 120 | 121 | gchar *g_build_filename (const gchar *first_element, 122 | ...) G_GNUC_MALLOC G_GNUC_NULL_TERMINATED; 123 | gchar *g_build_filenamev (gchar **args) G_GNUC_MALLOC; 124 | 125 | int g_mkdir_with_parents (const gchar *pathname, 126 | int mode); 127 | 128 | G_END_DECLS 129 | 130 | #endif /* __G_FILEUTILS_H__ */ 131 | -------------------------------------------------------------------------------- /sys/machine/endian.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1987, 1991 Regents of the University of California. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * from: @(#)endian.h 7.8 (Berkeley) 4/3/91 34 | * $FreeBSD: src/sys/i386/include/endian.h,v 1.18 1999/12/29 04:33:01 peter Exp $ 35 | */ 36 | 37 | #ifndef _MACHINE_ENDIAN_H_ 38 | #define _MACHINE_ENDIAN_H_ 39 | 40 | /* 41 | * Define the order of 32-bit words in 64-bit words. 42 | */ 43 | #define _QUAD_HIGHWORD 1 44 | #define _QUAD_LOWWORD 0 45 | 46 | #ifndef _POSIX_SOURCE 47 | 48 | /* 49 | * Definitions for byte order, according to byte significance from low 50 | * address to high. 51 | */ 52 | #define LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ 53 | #define BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ 54 | #define PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ 55 | 56 | #define BYTE_ORDER LITTLE_ENDIAN 57 | 58 | #if defined(_KERNEL) 59 | unsigned long htonl(unsigned long); 60 | unsigned short htons(unsigned short); 61 | unsigned long ntohl(unsigned long); 62 | unsigned short ntohs(unsigned short); 63 | #endif 64 | 65 | #define __word_swap_long(x) \ 66 | __extension__ ({ register u_long __X = (x); \ 67 | __asm ("rorl $16, %1" \ 68 | : "=r" (__X) \ 69 | : "0" (__X)); \ 70 | __X; }) 71 | 72 | #if defined(_KERNEL) && (defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)) && !defined(I386_CPU) 73 | 74 | #define __byte_swap_long(x) \ 75 | __extension__ ({ register u_long __X = (x); \ 76 | __asm ("bswap %0" \ 77 | : "=r" (__X) \ 78 | : "0" (__X)); \ 79 | __X; }) 80 | #else 81 | 82 | #define __byte_swap_long(x) \ 83 | __extension__ ({ register u_long __X = (x); \ 84 | __asm ("xchgb %h1, %b1\n\trorl $16, %1\n\txchgb %h1, %b1" \ 85 | : "=q" (__X) \ 86 | : "0" (__X)); \ 87 | __X; }) 88 | #endif 89 | 90 | #define __byte_swap_word(x) \ 91 | __extension__ ({ register u_short __X = (x); \ 92 | __asm ("xchgb %h1, %b1" \ 93 | : "=q" (__X) \ 94 | : "0" (__X)); \ 95 | __X; }) 96 | 97 | /* 98 | * Macros for network/external number representation conversion. 99 | */ 100 | #ifdef __GNUC__ 101 | #define ntohl __byte_swap_long 102 | #define ntohs __byte_swap_word 103 | #define htonl __byte_swap_long 104 | #define htons __byte_swap_word 105 | #endif 106 | 107 | #if _MSC_VER >= 1200 108 | #define ntohl _byteswap_ulong 109 | #define ntohs _byteswap_ushort 110 | #define htonl _byteswap_ulong 111 | #define htons _byteswap_ushort 112 | #endif 113 | 114 | #define NTOHL(x) ((x) = ntohl((u_long)(x))) 115 | #define NTOHS(x) ((x) = ntohs((u_short)(x))) 116 | #define HTONL(x) ((x) = htonl((u_long)(x))) 117 | #define HTONS(x) ((x) = htons((u_short)(x))) 118 | 119 | 120 | #endif /* ! _POSIX_SOURCE */ 121 | 122 | #endif /* !_MACHINE_ENDIAN_H_ */ 123 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gpoll.h: -------------------------------------------------------------------------------- 1 | /* gpoll.h - poll(2) support 2 | * Copyright (C) 2008 Red Hat, Inc. 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Library General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Library General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Library General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | #if !defined (__GLIB_H_INSIDE__) && !defined (__G_MAIN_H__) && !defined (GLIB_COMPILATION) 21 | #error "Only can be included directly." 22 | #endif 23 | 24 | #ifndef __G_POLL_H__ 25 | #define __G_POLL_H__ 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | /* Any definitions using GPollFD or GPollFunc are primarily 32 | * for Unix and not guaranteed to be the compatible on all 33 | * operating systems on which GLib runs. Right now, the 34 | * GLib does use these functions on Win32 as well, but interprets 35 | * them in a fairly different way than on Unix. If you use 36 | * these definitions, you are should be prepared to recode 37 | * for different operating systems. 38 | * 39 | * Note that on systems with a working poll(2), that function is used 40 | * in place of g_poll(). Thus g_poll() must have the same signature as 41 | * poll(), meaning GPollFD must have the same layout as struct pollfd. 42 | * 43 | * 44 | * On Win32, the fd in a GPollFD should be Win32 HANDLE (*not* a file 45 | * descriptor as provided by the C runtime) that can be used by 46 | * MsgWaitForMultipleObjects. This does *not* include file handles 47 | * from CreateFile, SOCKETs, nor pipe handles. (But you can use 48 | * WSAEventSelect to signal events when a SOCKET is readable). 49 | * 50 | * On Win32, fd can also be the special value G_WIN32_MSG_HANDLE to 51 | * indicate polling for messages. 52 | * 53 | * But note that G_WIN32_MSG_HANDLE GPollFDs should not be used by GDK 54 | * (GTK) programs, as GDK itself wants to read messages and convert them 55 | * to GDK events. 56 | * 57 | * So, unless you really know what you are doing, it's best not to try 58 | * to use the main loop polling stuff for your own needs on 59 | * Windows. 60 | */ 61 | typedef struct _GPollFD GPollFD; 62 | 63 | /** 64 | * GPollFunc: 65 | * @ufds: an array of #GPollFD elements 66 | * @nfsd: the number of elements in @ufds 67 | * @timeout_: the maximum time to wait for an event of the file descriptors. 68 | * A negative value indicates an infinite timeout. 69 | * 70 | * Specifies the type of function passed to g_main_context_set_poll_func(). 71 | * The semantics of the function should match those of the poll() system call. 72 | * 73 | * Returns: the number of #GPollFD elements which have events or errors 74 | * reported, or -1 if an error occurred. 75 | */ 76 | typedef gint (*GPollFunc) (GPollFD *ufds, 77 | guint nfsd, 78 | gint timeout_); 79 | 80 | /** 81 | * GPollFD: 82 | * @fd: the file descriptor to poll (or a HANDLE on Win32) 83 | * @events: a bitwise combination from #GIOCondition, specifying which 84 | * events should be polled for. Typically for reading from a file 85 | * descriptor you would use %G_IO_IN | %G_IO_HUP | %G_IO_ERR, and 86 | * for writing you would use %G_IO_OUT | %G_IO_ERR. 87 | * @revents: a bitwise combination of flags from #GIOCondition, returned 88 | * from the poll() function to indicate which events occurred. 89 | */ 90 | struct _GPollFD 91 | { 92 | #if defined (G_OS_WIN32) && GLIB_SIZEOF_VOID_P == 8 93 | gint64 fd; 94 | #else 95 | gint fd; 96 | #endif 97 | gushort events; 98 | gushort revents; 99 | }; 100 | 101 | #ifdef G_OS_WIN32 102 | #if GLIB_SIZEOF_VOID_P == 8 103 | #define G_POLLFD_FORMAT "%#I64x" 104 | #else 105 | #define G_POLLFD_FORMAT "%#x" 106 | #endif 107 | #else 108 | #define G_POLLFD_FORMAT "%d" 109 | #endif 110 | 111 | gint g_poll (GPollFD *fds, 112 | guint nfds, 113 | gint timeout); 114 | 115 | G_END_DECLS 116 | 117 | #endif /* __G_POLL_H__ */ 118 | -------------------------------------------------------------------------------- /include/pwd.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1989, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * (c) UNIX System Laboratories, Inc. 5 | * All or some portions of this file are derived from material licensed 6 | * to the University of California by American Telephone and Telegraph 7 | * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 | * the permission of UNIX System Laboratories, Inc. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by the University of 21 | * California, Berkeley and its contributors. 22 | * 4. Neither the name of the University nor the names of its contributors 23 | * may be used to endorse or promote products derived from this software 24 | * without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 | * SUCH DAMAGE. 37 | * 38 | * @(#)pwd.h 8.2 (Berkeley) 1/21/94 39 | */ 40 | 41 | #ifndef _PWD_H_ 42 | #define _PWD_H_ 43 | 44 | #include 45 | #include 46 | 47 | #ifndef _POSIX_SOURCE 48 | #define _PATH_PWD "/etc" 49 | #define _PATH_PASSWD "/etc/passwd" 50 | #define _PASSWD "passwd" 51 | #define _PATH_MASTERPASSWD "/etc/master.passwd" 52 | #define _MASTERPASSWD "master.passwd" 53 | 54 | #define _PATH_MP_DB "/etc/pwd.db" 55 | #define _MP_DB "pwd.db" 56 | #define _PATH_SMP_DB "/etc/spwd.db" 57 | #define _SMP_DB "spwd.db" 58 | 59 | #define _PATH_PWD_MKDB "/bin/pwd_mkdb" 60 | 61 | #define _PW_KEYBYNAME '1' /* stored by name */ 62 | #define _PW_KEYBYNUM '2' /* stored by entry in the "file" */ 63 | #define _PW_KEYBYUID '3' /* stored by uid */ 64 | #define _PW_KEYYPENABLED '4' /* YP is enabled */ 65 | #define _PW_KEYYPBYNUM '5' /* special +@netgroup entries */ 66 | 67 | #define _PASSWORD_EFMT1 '_' /* extended encryption format */ 68 | 69 | #define _PASSWORD_LEN 128 /* max length, not counting NULL */ 70 | #endif 71 | 72 | struct passwd { 73 | char *pw_name; /* user name */ 74 | char *pw_passwd; /* encrypted password */ 75 | uid_t pw_uid; /* user uid */ 76 | gid_t pw_gid; /* user gid */ 77 | time_t pw_change; /* password change time */ 78 | char *pw_class; /* user access class */ 79 | char *pw_gecos; /* Honeywell login info */ 80 | char *pw_dir; /* home directory */ 81 | char *pw_shell; /* default shell */ 82 | time_t pw_expire; /* account expiration */ 83 | int pw_fields; /* internal: fields filled in */ 84 | }; 85 | 86 | /* Mapping from fields to bits for pw_fields. */ 87 | #define _PWF(x) (1 << x) 88 | #define _PWF_NAME _PWF(0) 89 | #define _PWF_PASSWD _PWF(1) 90 | #define _PWF_UID _PWF(2) 91 | #define _PWF_GID _PWF(3) 92 | #define _PWF_CHANGE _PWF(4) 93 | #define _PWF_CLASS _PWF(5) 94 | #define _PWF_GECOS _PWF(6) 95 | #define _PWF_DIR _PWF(7) 96 | #define _PWF_SHELL _PWF(8) 97 | #define _PWF_EXPIRE _PWF(9) 98 | 99 | 100 | struct passwd *__stdcall getpwuid __P((uid_t)); 101 | struct passwd *__stdcall getpwnam __P((const char *)); 102 | #ifndef _POSIX_SOURCE 103 | struct passwd *getpwent __P((void)); 104 | int setpassent __P((int)); 105 | void setpwent __P((void)); 106 | void endpwent __P((void)); 107 | #endif 108 | 109 | #endif /* !_PWD_H_ */ 110 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gatomic.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * g_atomic_*: atomic operations. 5 | * Copyright (C) 2003 Sebastian Wilhelmi 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public 9 | * License as published by the Free Software Foundation; either 10 | * version 2 of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the 19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 | * Boston, MA 02111-1307, USA. 21 | */ 22 | 23 | /* 24 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 25 | * file for a list of people on the GLib Team. See the ChangeLog 26 | * files for a list of changes. These files are distributed with 27 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 28 | */ 29 | 30 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 31 | #error "Only can be included directly." 32 | #endif 33 | 34 | #ifndef __G_ATOMIC_H__ 35 | #define __G_ATOMIC_H__ 36 | 37 | #include 38 | 39 | G_BEGIN_DECLS 40 | 41 | gint g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic, 42 | gint val); 43 | void g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic, 44 | gint val); 45 | gboolean g_atomic_int_compare_and_exchange (volatile gint G_GNUC_MAY_ALIAS *atomic, 46 | gint oldval, 47 | gint newval); 48 | gboolean g_atomic_pointer_compare_and_exchange (volatile gpointer G_GNUC_MAY_ALIAS *atomic, 49 | gpointer oldval, 50 | gpointer newval); 51 | 52 | gint g_atomic_int_get (volatile gint G_GNUC_MAY_ALIAS *atomic); 53 | void g_atomic_int_set (volatile gint G_GNUC_MAY_ALIAS *atomic, 54 | gint newval); 55 | gpointer g_atomic_pointer_get (volatile gpointer G_GNUC_MAY_ALIAS *atomic); 56 | void g_atomic_pointer_set (volatile gpointer G_GNUC_MAY_ALIAS *atomic, 57 | gpointer newval); 58 | 59 | #ifndef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED 60 | # define g_atomic_int_get(atomic) ((gint)*(atomic)) 61 | # define g_atomic_int_set(atomic, newval) ((void) (*(atomic) = (newval))) 62 | # define g_atomic_pointer_get(atomic) ((gpointer)*(atomic)) 63 | # define g_atomic_pointer_set(atomic, newval) ((void) (*(atomic) = (newval))) 64 | #else 65 | # define g_atomic_int_get(atomic) \ 66 | ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]), \ 67 | (g_atomic_int_get) ((volatile gint G_GNUC_MAY_ALIAS *) (volatile void *) (atomic))) 68 | # define g_atomic_int_set(atomic, newval) \ 69 | ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gint) ? 1 : -1]), \ 70 | (g_atomic_int_set) ((volatile gint G_GNUC_MAY_ALIAS *) (volatile void *) (atomic), (newval))) 71 | # define g_atomic_pointer_get(atomic) \ 72 | ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \ 73 | (g_atomic_pointer_get) ((volatile gpointer G_GNUC_MAY_ALIAS *) (volatile void *) (atomic))) 74 | # define g_atomic_pointer_set(atomic, newval) \ 75 | ((void) sizeof (gchar [sizeof (*(atomic)) == sizeof (gpointer) ? 1 : -1]), \ 76 | (g_atomic_pointer_set) ((volatile gpointer G_GNUC_MAY_ALIAS *) (volatile void *) (atomic), (newval))) 77 | #endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */ 78 | 79 | /** 80 | * g_atomic_int_inc: 81 | * @atomic: a pointer to an integer. 82 | * 83 | * Atomically increments the integer pointed to by @atomic by 1. 84 | * 85 | * Since: 2.4 86 | */ 87 | #define g_atomic_int_inc(atomic) (g_atomic_int_add ((atomic), 1)) 88 | 89 | /** 90 | * g_atomic_int_dec_and_test: 91 | * @atomic: a pointer to an integer 92 | * 93 | * Atomically decrements the integer pointed to by @atomic by 1. 94 | * 95 | * Returns: %TRUE if the integer pointed to by @atomic is 0 96 | * after decrementing it 97 | * 98 | * Since: 2.4 99 | */ 100 | #define g_atomic_int_dec_and_test(atomic) \ 101 | (g_atomic_int_exchange_and_add ((atomic), -1) == 1) 102 | 103 | G_END_DECLS 104 | 105 | #endif /* __G_ATOMIC_H__ */ 106 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/galloca.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_ALLOCA_H__ 32 | #define __G_ALLOCA_H__ 33 | 34 | #include 35 | 36 | #ifdef __GNUC__ 37 | /* GCC does the right thing */ 38 | # undef alloca 39 | # define alloca(size) __builtin_alloca (size) 40 | #elif defined (GLIB_HAVE_ALLOCA_H) 41 | /* a native and working alloca.h is there */ 42 | # include 43 | #else /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */ 44 | # if defined(_MSC_VER) || defined(__DMC__) 45 | # include 46 | # define alloca _alloca 47 | # else /* !_MSC_VER && !__DMC__ */ 48 | # ifdef _AIX 49 | # pragma alloca 50 | # else /* !_AIX */ 51 | # ifndef alloca /* predefined by HP cc +Olibcalls */ 52 | G_BEGIN_DECLS 53 | char *alloca (); 54 | G_END_DECLS 55 | # endif /* !alloca */ 56 | # endif /* !_AIX */ 57 | # endif /* !_MSC_VER && !__DMC__ */ 58 | #endif /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */ 59 | 60 | /** 61 | * g_alloca: 62 | * @size: number of bytes to allocate. 63 | * 64 | * Allocates @size bytes on the stack; these bytes will be freed when the current 65 | * stack frame is cleaned up. This macro essentially just wraps the alloca() 66 | * function present on most UNIX variants. 67 | * Thus it provides the same advantages and pitfalls as alloca(): 68 | * 69 | * 70 | * + alloca() is very fast, as on most systems it's implemented by just adjusting 71 | * the stack pointer register. 72 | * 73 | * 74 | * + It doesn't cause any memory fragmentation, within its scope, separate alloca() 75 | * blocks just build up and are released together at function end. 76 | * 77 | * 78 | * - Allocation sizes have to fit into the current stack frame. For instance in a 79 | * threaded environment on Linux, the per-thread stack size is limited to 2 Megabytes, 80 | * so be sparse with alloca() uses. 81 | * 82 | * 83 | * - Allocation failure due to insufficient stack space is not indicated with a %NULL 84 | * return like e.g. with malloc(). Instead, most systems probably handle it the same 85 | * way as out of stack space situations from infinite function recursion, i.e. 86 | * with a segmentation fault. 87 | * 88 | * 89 | * - Special care has to be taken when mixing alloca() with GNU C variable sized arrays. 90 | * Stack space allocated with alloca() in the same scope as a variable sized array 91 | * will be freed together with the variable sized array upon exit of that scope, and 92 | * not upon exit of the enclosing function scope. 93 | * 94 | * 95 | * 96 | * Returns: space for @size bytes, allocated on the stack 97 | */ 98 | #define g_alloca(size) alloca (size) 99 | /** 100 | * g_newa: 101 | * @struct_type: Type of memory chunks to be allocated 102 | * @n_structs: Number of chunks to be allocated 103 | * 104 | * Wraps g_alloca() in a more typesafe manner. 105 | * 106 | * Returns: Pointer to stack space for @n_structs chunks of type @struct_type 107 | */ 108 | #define g_newa(struct_type, n_structs) ((struct_type*) g_alloca (sizeof (struct_type) * (gsize) (n_structs))) 109 | 110 | #endif /* __G_ALLOCA_H__ */ 111 | -------------------------------------------------------------------------------- /sys/machine/limits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1988, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#)limits.h 8.3 (Berkeley) 1/4/94 34 | * $FreeBSD$ 35 | */ 36 | 37 | #ifndef _MACHINE_LIMITS_H_ 38 | #define _MACHINE_LIMITS_H_ 39 | 40 | #define CHAR_BIT 8 /* number of bits in a char */ 41 | #define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */ 42 | 43 | /* 44 | * According to ANSI (section 2.2.4.2), the values below must be usable by 45 | * #if preprocessing directives. Additionally, the expression must have the 46 | * same type as would an expression that is an object of the corresponding 47 | * type converted according to the integral promotions. The subtraction for 48 | * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an 49 | * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). 50 | * These numbers are for the default configuration of gcc. They work for 51 | * some other compilers as well, but this should not be depended on. 52 | */ 53 | #define SCHAR_MAX 0x7f /* max value for a signed char */ 54 | #define SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ 55 | 56 | #define UCHAR_MAX 0xff /* max value for an unsigned char */ 57 | 58 | #ifdef __CHAR_UNSIGNED__ 59 | #define CHAR_MAX UCHAR_MAX /* max value for a char */ 60 | #define CHAR_MIN 0 /* min value for a char */ 61 | #else 62 | #define CHAR_MAX SCHAR_MAX /* max value for a char */ 63 | #define CHAR_MIN SCHAR_MIN /* min value for a char */ 64 | #endif 65 | 66 | #define USHRT_MAX 0xffff /* max value for an unsigned short */ 67 | #define SHRT_MAX 0x7fff /* max value for a short */ 68 | #define SHRT_MIN (-0x7fff - 1) /* min value for a short */ 69 | 70 | #define UINT_MAX 0xffffffffU /* max value for an unsigned int */ 71 | #define INT_MAX 0x7fffffff /* max value for an int */ 72 | #define INT_MIN (-0x7fffffff - 1) /* min value for an int */ 73 | 74 | /* Bad hack for gcc configured to give 64-bit longs. */ 75 | #ifdef _LARGE_LONG 76 | #define ULONG_MAX 0xffffffffffffffffUL 77 | #define LONG_MAX 0x7fffffffffffffffL 78 | #define LONG_MIN (-0x7fffffffffffffffL - 1) 79 | #else 80 | #define ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ 81 | #define LONG_MAX 0x7fffffffL /* max value for a long */ 82 | #define LONG_MIN (-0x7fffffffL - 1) /* min value for a long */ 83 | #endif 84 | 85 | /* max value for an unsigned long long */ 86 | #define ULLONG_MAX 0xffffffffffffffffULL 87 | #define LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ 88 | #define LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ 89 | 90 | #if !defined(_ANSI_SOURCE) 91 | #define SSIZE_MAX INT_MAX /* max value for a ssize_t */ 92 | 93 | #if !defined(_POSIX_SOURCE) 94 | #define SIZE_T_MAX UINT_MAX /* max value for a size_t */ 95 | 96 | /* Quads and long longs are the same size. Ensure they stay in sync. */ 97 | #define UQUAD_MAX ULLONG_MAX /* max value for a uquad_t */ 98 | #define QUAD_MAX LLONG_MAX /* max value for a quad_t */ 99 | #define QUAD_MIN LLONG_MIN /* min value for a quad_t */ 100 | 101 | #endif /* !_POSIX_SOURCE */ 102 | #endif /* !_ANSI_SOURCE */ 103 | 104 | #endif /* !_MACHINE_LIMITS_H_ */ 105 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gstdio.h: -------------------------------------------------------------------------------- 1 | /* gstdio.h - GFilename wrappers for C library functions 2 | * 3 | * Copyright 2004 Tor Lillqvist 4 | * 5 | * GLib is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU Lesser General Public License as 7 | * published by the Free Software Foundation; either version 2 of the 8 | * License, or (at your option) any later version. 9 | * 10 | * GLib is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with GLib; see the file COPYING.LIB. If not, 17 | * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 | * Boston, MA 02111-1307, USA. 19 | */ 20 | 21 | #ifndef __G_STDIO_H__ 22 | #define __G_STDIO_H__ 23 | 24 | #include 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #if defined (_MSC_VER) && !defined(_WIN64) 31 | 32 | /* Make it clear that we mean the struct with 32-bit st_size and 33 | * 32-bit st_*time fields as that is how the 32-bit GLib DLL normally 34 | * has been compiled. If you get a compiler warning when calling 35 | * g_stat(), do take it seriously and make sure that the type of 36 | * struct stat the code in GLib fills in matches the struct the type 37 | * of struct stat you pass to g_stat(). To avoid hassle, to get file 38 | * attributes just use the GIO API instead which doesn't use struct 39 | * stat. 40 | * 41 | * Sure, it would be nicer to use a struct with 64-bit st_size and 42 | * 64-bit st_*time fields, but changing that now would break ABI. And 43 | * in MinGW, a plain "struct stat" is the one with 32-bit st_size and 44 | * st_*time fields. 45 | */ 46 | 47 | typedef struct _stat32 GStatBuf; 48 | 49 | #else 50 | 51 | typedef struct stat GStatBuf; 52 | 53 | #endif 54 | 55 | #if defined(G_OS_UNIX) && !defined(G_STDIO_NO_WRAP_ON_UNIX) 56 | 57 | /* Just pass on to the system functions, so there's no potential for data 58 | * format mismatches, especially with large file interfaces. 59 | * A few functions can't be handled in this way, since they are not defined 60 | * in a portable system header that we could include here. 61 | */ 62 | 63 | #define g_chmod chmod 64 | #define g_open open 65 | #define g_creat creat 66 | #define g_rename rename 67 | #define g_mkdir mkdir 68 | #define g_stat stat 69 | #define g_lstat lstat 70 | #define g_remove remove 71 | #define g_fopen fopen 72 | #define g_freopen freopen 73 | #define g_utime utime 74 | 75 | int g_access (const gchar *filename, 76 | int mode); 77 | 78 | int g_chdir (const gchar *path); 79 | 80 | int g_unlink (const gchar *filename); 81 | 82 | int g_rmdir (const gchar *filename); 83 | 84 | #else /* ! G_OS_UNIX */ 85 | 86 | /* Wrappers for C library functions that take pathname arguments. On 87 | * Unix, the pathname is a file name as it literally is in the file 88 | * system. On well-maintained systems with consistent users who know 89 | * what they are doing and no exchange of files with others this would 90 | * be a well-defined encoding, preferrably UTF-8. On Windows, the 91 | * pathname is always in UTF-8, even if that is not the on-disk 92 | * encoding, and not the encoding accepted by the C library or Win32 93 | * API. 94 | */ 95 | 96 | int g_access (const gchar *filename, 97 | int mode); 98 | 99 | int g_chmod (const gchar *filename, 100 | int mode); 101 | 102 | int g_open (const gchar *filename, 103 | int flags, 104 | int mode); 105 | 106 | int g_creat (const gchar *filename, 107 | int mode); 108 | 109 | int g_rename (const gchar *oldfilename, 110 | const gchar *newfilename); 111 | 112 | int g_mkdir (const gchar *filename, 113 | int mode); 114 | 115 | int g_chdir (const gchar *path); 116 | 117 | int g_stat (const gchar *filename, 118 | GStatBuf *buf); 119 | 120 | int g_lstat (const gchar *filename, 121 | GStatBuf *buf); 122 | 123 | int g_unlink (const gchar *filename); 124 | 125 | int g_remove (const gchar *filename); 126 | 127 | int g_rmdir (const gchar *filename); 128 | 129 | FILE *g_fopen (const gchar *filename, 130 | const gchar *mode); 131 | 132 | FILE *g_freopen (const gchar *filename, 133 | const gchar *mode, 134 | FILE *stream); 135 | 136 | struct utimbuf; /* Don't need the real definition of struct utimbuf when just 137 | * including this header. 138 | */ 139 | 140 | int g_utime (const gchar *filename, 141 | struct utimbuf *utb); 142 | 143 | #endif /* G_OS_UNIX */ 144 | 145 | G_END_DECLS 146 | 147 | #endif /* __G_STDIO_H__ */ 148 | -------------------------------------------------------------------------------- /hello_ll/hello_ll.c: -------------------------------------------------------------------------------- 1 | /* 2 | FUSE: Filesystem in Userspace 3 | Copyright (C) 2001-2007 Miklos Szeredi 4 | 5 | This program can be distributed under the terms of the GNU GPL. 6 | See the file COPYING. 7 | 8 | gcc -Wall `pkg-config fuse --cflags --libs` hello_ll.c -o hello_ll 9 | */ 10 | 11 | #define FUSE_USE_VERSION 26 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | static const char *hello_str = "Hello World!\n"; 23 | static const char *hello_name = "hello"; 24 | 25 | static int hello_stat(fuse_ino_t ino, struct stat *stbuf) 26 | { 27 | stbuf->st_ino = ino; 28 | switch (ino) { 29 | case 1: 30 | stbuf->st_mode = S_IFDIR | 0755; 31 | stbuf->st_nlink = 2; 32 | break; 33 | 34 | case 2: 35 | stbuf->st_mode = S_IFREG | 0444; 36 | stbuf->st_nlink = 1; 37 | stbuf->st_size = strlen(hello_str); 38 | break; 39 | 40 | default: 41 | return -1; 42 | } 43 | return 0; 44 | } 45 | 46 | static void hello_ll_getattr(fuse_req_t req, fuse_ino_t ino, 47 | struct fuse_file_info *fi) 48 | { 49 | struct stat stbuf; 50 | 51 | (void) fi; 52 | 53 | memset(&stbuf, 0, sizeof(stbuf)); 54 | if (hello_stat(ino, &stbuf) == -1) 55 | fuse_reply_err(req, ENOENT); 56 | else 57 | fuse_reply_attr(req, &stbuf, 1.0); 58 | } 59 | 60 | static void hello_ll_lookup(fuse_req_t req, fuse_ino_t parent, const char *name) 61 | { 62 | struct fuse_entry_param e; 63 | 64 | if (parent != 1 || strcmp(name, hello_name) != 0) 65 | fuse_reply_err(req, ENOENT); 66 | else { 67 | memset(&e, 0, sizeof(e)); 68 | e.ino = 2; 69 | e.attr_timeout = 1.0; 70 | e.entry_timeout = 1.0; 71 | hello_stat(e.ino, &e.attr); 72 | 73 | fuse_reply_entry(req, &e); 74 | } 75 | } 76 | 77 | struct dirbuf { 78 | char *p; 79 | size_t size; 80 | }; 81 | 82 | static void dirbuf_add(fuse_req_t req, struct dirbuf *b, const char *name, 83 | fuse_ino_t ino) 84 | { 85 | struct stat stbuf; 86 | size_t oldsize = b->size; 87 | b->size += fuse_add_direntry(req, NULL, 0, name, NULL, 0); 88 | b->p = (char *) realloc(b->p, b->size); 89 | memset(&stbuf, 0, sizeof(stbuf)); 90 | stbuf.st_ino = ino; 91 | fuse_add_direntry(req, b->p + oldsize, b->size - oldsize, name, &stbuf, 92 | b->size); 93 | } 94 | 95 | #define min(x, y) ((x) < (y) ? (x) : (y)) 96 | 97 | static int reply_buf_limited(fuse_req_t req, const char *buf, size_t bufsize, 98 | off_t off, size_t maxsize) 99 | { 100 | if (off < bufsize) 101 | return fuse_reply_buf(req, buf + off, 102 | min(bufsize - off, maxsize)); 103 | else 104 | return fuse_reply_buf(req, NULL, 0); 105 | } 106 | 107 | static void hello_ll_readdir(fuse_req_t req, fuse_ino_t ino, size_t size, 108 | off_t off, struct fuse_file_info *fi) 109 | { 110 | (void) fi; 111 | 112 | if (ino != 1) 113 | fuse_reply_err(req, ENOTDIR); 114 | else { 115 | struct dirbuf b; 116 | 117 | memset(&b, 0, sizeof(b)); 118 | dirbuf_add(req, &b, ".", 1); 119 | dirbuf_add(req, &b, "..", 1); 120 | dirbuf_add(req, &b, hello_name, 2); 121 | reply_buf_limited(req, b.p, b.size, off, size); 122 | free(b.p); 123 | } 124 | } 125 | 126 | static void hello_ll_open(fuse_req_t req, fuse_ino_t ino, 127 | struct fuse_file_info *fi) 128 | { 129 | if (ino != 2) 130 | fuse_reply_err(req, EISDIR); 131 | else if ((fi->flags & 3) != O_RDONLY) 132 | fuse_reply_err(req, EACCES); 133 | else 134 | fuse_reply_open(req, fi); 135 | } 136 | 137 | static void hello_ll_read(fuse_req_t req, fuse_ino_t ino, size_t size, 138 | off_t off, struct fuse_file_info *fi) 139 | { 140 | (void) fi; 141 | 142 | assert(ino == 2); 143 | reply_buf_limited(req, hello_str, strlen(hello_str), off, size); 144 | } 145 | 146 | static struct fuse_lowlevel_ops hello_ll_oper = { 147 | 0 148 | #if 0 149 | .lookup = hello_ll_lookup, 150 | .getattr = hello_ll_getattr, 151 | .readdir = hello_ll_readdir, 152 | .open = hello_ll_open, 153 | .read = hello_ll_read, 154 | #endif 155 | }; 156 | 157 | int main(int argc, char *argv[]) 158 | { 159 | struct fuse_args args = FUSE_ARGS_INIT(argc, argv); 160 | struct fuse_chan *ch; 161 | char *mountpoint; 162 | int err = -1; 163 | 164 | hello_ll_oper.lookup = hello_ll_lookup; 165 | hello_ll_oper.getattr = hello_ll_getattr; 166 | hello_ll_oper.readdir = hello_ll_readdir; 167 | hello_ll_oper.open = hello_ll_open; 168 | hello_ll_oper.read = hello_ll_read; 169 | 170 | if (fuse_parse_cmdline(&args, &mountpoint, NULL, NULL) != -1 && 171 | (ch = fuse_mount(mountpoint, &args)) != NULL) { 172 | struct fuse_session *se; 173 | 174 | se = fuse_lowlevel_new(&args, &hello_ll_oper, 175 | sizeof(hello_ll_oper), NULL); 176 | if (se != NULL) { 177 | if (fuse_set_signal_handlers(se) != -1) { 178 | fuse_session_add_chan(se, ch); 179 | err = fuse_session_loop(se); 180 | fuse_remove_signal_handlers(se); 181 | fuse_session_remove_chan(ch); 182 | } 183 | fuse_session_destroy(se); 184 | } 185 | fuse_unmount(mountpoint, ch); 186 | } 187 | fuse_opt_free_args(&args); 188 | 189 | return err ? 1 : 0; 190 | } 191 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Crossmeta FUSE for Windows 2 | 3 | Crossmeta FUSE (Filesystem in Userspace) is the easiest way to port your favorite FUSE programs to Windows. It is a set of kernel-mode and user mode software that works with Crossmeta Kernel. The project home page is https://crossmeta.io 4 | 5 | #### POSIX File system semantics are provided by ![Crossmeta Kernel](https://github.com/crossmeta/sys/blob/master/README.md) 6 | 7 | This means symbolic links, hardlinks, mount, etc are available readily for easy integration with your FUSE program. 8 | 9 | #### Multi-threaded FUSE DLL in userspace 10 | Hides all the complexity of interfacing with kernel-mode driver interface and provides both the popular APIs 11 | * Fuse *high-level*, synchronous API 12 | * Fuse *low-level*, asynchronous API. 13 | 14 | 15 | Fuse mounts are managed in NT kernel namespace and is available to all Windows applications. 16 | 17 | ![FUSE Hello, World Sample](https://cloud.githubusercontent.com/assets/1268351/25301136/29418f40-26ed-11e7-98f9-0dc7b0127070.gif) 18 | 19 | ## Examples 20 | FUSE comes with following examples. 21 | **hello.c** 22 | The "Hello World" sample FUSE program shows uses the high-level API by including fuse.h. It shows how easy it is to get started. Only changes required was manual initialization, since MSVC is compiler being used here. If using MinGW cross compile environment with gcc the following is not applicable. 23 | 24 | static struct fuse_operations hello_oper = { 25 | .getattr = hello_getattr, 26 | .readdir = hello_readdir, 27 | .open = hello_open, 28 | .read = hello_read, 29 | }; 30 | 31 | Changed to 32 | 33 | hello_oper.getattr = hello_getattr; 34 | hello_oper.readdir = hello_readdir; 35 | hello_oper.open = hello_open; 36 | hello_oper.read = hello_read; 37 | 38 | 39 | **hello_ll.c** 40 | The same "Hello World" program using the FUSE Low level API by including `fuse_lowlevel.h`. Once again only changes required was the manual initialzation of `fuse_operations` structure. 41 | 42 | Updated Build information from Blog 43 | * [Cross Compile using MinGW32](https://www.crossmeta.io/mingw32-cross-compile-to-windows-from-linux/) 44 | * [Fuse Examples](https://www.crossmeta.io/crossmeta-fuse-hello-world/) 45 | 46 | ## Build Environments 47 | 48 | Uses standard Microsoft DDK Build environment that comes with compiler and necessary header files. No need to install Visual Studio Compiler. The most convenient way is to use the Microsoft DDK build environment. 49 | 50 | Install Microsoft DDK 7.1 and start command shell with DDK build environment set to i386. 51 | 52 | 53 | git clone https://github.com/crossmeta/cxfuse.git 54 | set BUILD_ALLOW_COMPILER_WARNINGS=1 55 | set VFS_LIB_PATH=c:\users\\cxfuse\lib\w2f\free\* 56 | set VFS_LIB_TARGET=c:\users\\cxfuse\lib\w2f\free 57 | cd cxfuse\hello 58 | build -cz 59 | 60 | 61 | ## Installation 62 | 63 | * Download [Crossmeta 2.0] (https://github.com/crossmeta/cxfuse/releases/latest) 64 | * Extract **crossmeta-fuse\_2\_0\_1.zip** to %TEMP\temp\crossmeta 65 | * Launch elevated cmd prompt (Administrator) console 66 | * cd %TEMP%\crossmeta 67 | * Run setup.exe 68 | Follow instructions to install Crossmeta Release 2.0 software. 69 | 70 | *No reboot required* 71 | 72 | Check Crossmeta kernel is up and running 73 | 74 | cd c:\program files\crossmeta 75 | service_crossmeta status 76 | cxvfs is RUNNING 77 | cxfuse is STOPPED 78 | cxnfs is STOPPED 79 | cxhfs is STOPPED 80 | cxvfsmgr is RUNNING 81 | 82 | Start cxfuse service 83 | 84 | C:\Program Files\crossmeta>net start cxfuse 85 | 86 | The CROSSMETA FUSE kernel mode driver service was started successfully. 87 | 88 | Run hello.exe with mount point in the Crossmeta namespace, which is any directory in V:\ drive 89 | 90 | C:\Program Files\crossmeta>busybox.exe ls / 91 | 92 | bin cachefs etc lib lost+found proc sbin tmp var dev home 93 | lib64 mnt root testdir usr 94 | 95 | copy C:\user\user\cxfuse\lib\w2k\free\i386\hello.exe 96 | 97 | C:\Program Files\crossmeta>hello.exe /mnt 98 | Sorry run in background not supported. 99 | 100 | From another command window 101 | 102 | V:\>cd \mnt 103 | V:\mnt>dir 104 | Volume in drive V is vfsroot 105 | Volume Serial Number is 0122-B5C1 106 | 107 | Directory of V:\mnt 108 | 109 | 12/31/1969 05:00 PM . 110 | 12/31/1969 05:00 PM .. 111 | 12/31/1969 05:00 PM 13 hello 112 | 1 File(s) 13 bytes 113 | 2 Dir(s) 5,242,880 bytes free 114 | V:\mnt>type hello 115 | 116 | Hello World! 117 | 118 | V:\mnt> 119 | 120 | To stop the FUSE program, just issue umount /mnt 121 | 122 | Crossmeta BusyBox v0.60.5 (2017.03.23-21:18+0000) Built-in shell (ash) 123 | Enter 'help' for a list of built-in commands. 124 | 125 | sh: can't access tty; job control turned off 126 | # umount /mnt 127 | # 128 | 129 | ## Summary 130 | With Crossmeta FUSE for Windows, it is not only easy to port FUSE programs but also the fastest with no or minimal changes required to your existing FUSE program. Also the Crossmeta kernel provides the necessary POSIX APIs without dependency on yet another software package. 131 | 132 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gqueue.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_QUEUE_H__ 32 | #define __G_QUEUE_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GQueue GQueue; 39 | 40 | struct _GQueue 41 | { 42 | GList *head; 43 | GList *tail; 44 | guint length; 45 | }; 46 | 47 | #define G_QUEUE_INIT { NULL, NULL, 0 } 48 | 49 | /* Queues 50 | */ 51 | GQueue* g_queue_new (void); 52 | void g_queue_free (GQueue *queue); 53 | void g_queue_init (GQueue *queue); 54 | void g_queue_clear (GQueue *queue); 55 | gboolean g_queue_is_empty (GQueue *queue); 56 | guint g_queue_get_length (GQueue *queue); 57 | void g_queue_reverse (GQueue *queue); 58 | GQueue * g_queue_copy (GQueue *queue); 59 | void g_queue_foreach (GQueue *queue, 60 | GFunc func, 61 | gpointer user_data); 62 | GList * g_queue_find (GQueue *queue, 63 | gconstpointer data); 64 | GList * g_queue_find_custom (GQueue *queue, 65 | gconstpointer data, 66 | GCompareFunc func); 67 | void g_queue_sort (GQueue *queue, 68 | GCompareDataFunc compare_func, 69 | gpointer user_data); 70 | 71 | void g_queue_push_head (GQueue *queue, 72 | gpointer data); 73 | void g_queue_push_tail (GQueue *queue, 74 | gpointer data); 75 | void g_queue_push_nth (GQueue *queue, 76 | gpointer data, 77 | gint n); 78 | gpointer g_queue_pop_head (GQueue *queue); 79 | gpointer g_queue_pop_tail (GQueue *queue); 80 | gpointer g_queue_pop_nth (GQueue *queue, 81 | guint n); 82 | gpointer g_queue_peek_head (GQueue *queue); 83 | gpointer g_queue_peek_tail (GQueue *queue); 84 | gpointer g_queue_peek_nth (GQueue *queue, 85 | guint n); 86 | gint g_queue_index (GQueue *queue, 87 | gconstpointer data); 88 | void g_queue_remove (GQueue *queue, 89 | gconstpointer data); 90 | void g_queue_remove_all (GQueue *queue, 91 | gconstpointer data); 92 | void g_queue_insert_before (GQueue *queue, 93 | GList *sibling, 94 | gpointer data); 95 | void g_queue_insert_after (GQueue *queue, 96 | GList *sibling, 97 | gpointer data); 98 | void g_queue_insert_sorted (GQueue *queue, 99 | gpointer data, 100 | GCompareDataFunc func, 101 | gpointer user_data); 102 | 103 | void g_queue_push_head_link (GQueue *queue, 104 | GList *link_); 105 | void g_queue_push_tail_link (GQueue *queue, 106 | GList *link_); 107 | void g_queue_push_nth_link (GQueue *queue, 108 | gint n, 109 | GList *link_); 110 | GList* g_queue_pop_head_link (GQueue *queue); 111 | GList* g_queue_pop_tail_link (GQueue *queue); 112 | GList* g_queue_pop_nth_link (GQueue *queue, 113 | guint n); 114 | GList* g_queue_peek_head_link (GQueue *queue); 115 | GList* g_queue_peek_tail_link (GQueue *queue); 116 | GList* g_queue_peek_nth_link (GQueue *queue, 117 | guint n); 118 | gint g_queue_link_index (GQueue *queue, 119 | GList *link_); 120 | void g_queue_unlink (GQueue *queue, 121 | GList *link_); 122 | void g_queue_delete_link (GQueue *queue, 123 | GList *link_); 124 | 125 | G_END_DECLS 126 | 127 | #endif /* __G_QUEUE_H__ */ 128 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gasyncqueue.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_ASYNCQUEUE_H__ 32 | #define __G_ASYNCQUEUE_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GAsyncQueue GAsyncQueue; 39 | 40 | /* Asyncronous Queues, can be used to communicate between threads */ 41 | 42 | /* Get a new GAsyncQueue with the ref_count 1 */ 43 | GAsyncQueue* g_async_queue_new (void); 44 | 45 | GAsyncQueue* g_async_queue_new_full (GDestroyNotify item_free_func); 46 | 47 | /* Lock and unlock a GAsyncQueue. All functions lock the queue for 48 | * themselves, but in certain cirumstances you want to hold the lock longer, 49 | * thus you lock the queue, call the *_unlocked functions and unlock it again. 50 | */ 51 | void g_async_queue_lock (GAsyncQueue *queue); 52 | void g_async_queue_unlock (GAsyncQueue *queue); 53 | 54 | /* Ref and unref the GAsyncQueue. */ 55 | GAsyncQueue* g_async_queue_ref (GAsyncQueue *queue); 56 | void g_async_queue_unref (GAsyncQueue *queue); 57 | 58 | #ifndef G_DISABLE_DEPRECATED 59 | /* You don't have to hold the lock for calling *_ref and *_unref anymore. */ 60 | void g_async_queue_ref_unlocked (GAsyncQueue *queue); 61 | void g_async_queue_unref_and_unlock (GAsyncQueue *queue); 62 | #endif /* !G_DISABLE_DEPRECATED */ 63 | 64 | /* Push data into the async queue. Must not be NULL. */ 65 | void g_async_queue_push (GAsyncQueue *queue, 66 | gpointer data); 67 | void g_async_queue_push_unlocked (GAsyncQueue *queue, 68 | gpointer data); 69 | 70 | void g_async_queue_push_sorted (GAsyncQueue *queue, 71 | gpointer data, 72 | GCompareDataFunc func, 73 | gpointer user_data); 74 | void g_async_queue_push_sorted_unlocked (GAsyncQueue *queue, 75 | gpointer data, 76 | GCompareDataFunc func, 77 | gpointer user_data); 78 | 79 | /* Pop data from the async queue. When no data is there, the thread is blocked 80 | * until data arrives. 81 | */ 82 | gpointer g_async_queue_pop (GAsyncQueue *queue); 83 | gpointer g_async_queue_pop_unlocked (GAsyncQueue *queue); 84 | 85 | /* Try to pop data. NULL is returned in case of empty queue. */ 86 | gpointer g_async_queue_try_pop (GAsyncQueue *queue); 87 | gpointer g_async_queue_try_pop_unlocked (GAsyncQueue *queue); 88 | 89 | 90 | 91 | /* Wait for data until at maximum until end_time is reached. NULL is returned 92 | * in case of empty queue. 93 | */ 94 | gpointer g_async_queue_timed_pop (GAsyncQueue *queue, 95 | GTimeVal *end_time); 96 | gpointer g_async_queue_timed_pop_unlocked (GAsyncQueue *queue, 97 | GTimeVal *end_time); 98 | 99 | /* Return the length of the queue. Negative values mean that threads 100 | * are waiting, positve values mean that there are entries in the 101 | * queue. Actually this function returns the length of the queue minus 102 | * the number of waiting threads, g_async_queue_length == 0 could also 103 | * mean 'n' entries in the queue and 'n' thread waiting. Such can 104 | * happen due to locking of the queue or due to scheduling. 105 | */ 106 | gint g_async_queue_length (GAsyncQueue *queue); 107 | gint g_async_queue_length_unlocked (GAsyncQueue *queue); 108 | void g_async_queue_sort (GAsyncQueue *queue, 109 | GCompareDataFunc func, 110 | gpointer user_data); 111 | void g_async_queue_sort_unlocked (GAsyncQueue *queue, 112 | GCompareDataFunc func, 113 | gpointer user_data); 114 | 115 | /* Private API */ 116 | GMutex* _g_async_queue_get_mutex (GAsyncQueue *queue); 117 | 118 | G_END_DECLS 119 | 120 | #endif /* __G_ASYNCQUEUE_H__ */ 121 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gslist.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_SLIST_H__ 32 | #define __G_SLIST_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GSList GSList; 39 | 40 | struct _GSList 41 | { 42 | gpointer data; 43 | GSList *next; 44 | }; 45 | 46 | /* Singly linked lists 47 | */ 48 | GSList* g_slist_alloc (void) G_GNUC_WARN_UNUSED_RESULT; 49 | void g_slist_free (GSList *list); 50 | void g_slist_free_1 (GSList *list); 51 | #define g_slist_free1 g_slist_free_1 52 | void g_slist_free_full (GSList *list, 53 | GDestroyNotify free_func); 54 | GSList* g_slist_append (GSList *list, 55 | gpointer data) G_GNUC_WARN_UNUSED_RESULT; 56 | GSList* g_slist_prepend (GSList *list, 57 | gpointer data) G_GNUC_WARN_UNUSED_RESULT; 58 | GSList* g_slist_insert (GSList *list, 59 | gpointer data, 60 | gint position) G_GNUC_WARN_UNUSED_RESULT; 61 | GSList* g_slist_insert_sorted (GSList *list, 62 | gpointer data, 63 | GCompareFunc func) G_GNUC_WARN_UNUSED_RESULT; 64 | GSList* g_slist_insert_sorted_with_data (GSList *list, 65 | gpointer data, 66 | GCompareDataFunc func, 67 | gpointer user_data) G_GNUC_WARN_UNUSED_RESULT; 68 | GSList* g_slist_insert_before (GSList *slist, 69 | GSList *sibling, 70 | gpointer data) G_GNUC_WARN_UNUSED_RESULT; 71 | GSList* g_slist_concat (GSList *list1, 72 | GSList *list2) G_GNUC_WARN_UNUSED_RESULT; 73 | GSList* g_slist_remove (GSList *list, 74 | gconstpointer data) G_GNUC_WARN_UNUSED_RESULT; 75 | GSList* g_slist_remove_all (GSList *list, 76 | gconstpointer data) G_GNUC_WARN_UNUSED_RESULT; 77 | GSList* g_slist_remove_link (GSList *list, 78 | GSList *link_) G_GNUC_WARN_UNUSED_RESULT; 79 | GSList* g_slist_delete_link (GSList *list, 80 | GSList *link_) G_GNUC_WARN_UNUSED_RESULT; 81 | GSList* g_slist_reverse (GSList *list) G_GNUC_WARN_UNUSED_RESULT; 82 | GSList* g_slist_copy (GSList *list) G_GNUC_WARN_UNUSED_RESULT; 83 | GSList* g_slist_nth (GSList *list, 84 | guint n); 85 | GSList* g_slist_find (GSList *list, 86 | gconstpointer data); 87 | GSList* g_slist_find_custom (GSList *list, 88 | gconstpointer data, 89 | GCompareFunc func); 90 | gint g_slist_position (GSList *list, 91 | GSList *llink); 92 | gint g_slist_index (GSList *list, 93 | gconstpointer data); 94 | GSList* g_slist_last (GSList *list); 95 | guint g_slist_length (GSList *list); 96 | void g_slist_foreach (GSList *list, 97 | GFunc func, 98 | gpointer user_data); 99 | GSList* g_slist_sort (GSList *list, 100 | GCompareFunc compare_func) G_GNUC_WARN_UNUSED_RESULT; 101 | GSList* g_slist_sort_with_data (GSList *list, 102 | GCompareDataFunc compare_func, 103 | gpointer user_data) G_GNUC_WARN_UNUSED_RESULT; 104 | gpointer g_slist_nth_data (GSList *list, 105 | guint n); 106 | 107 | #define g_slist_next(slist) ((slist) ? (((GSList *)(slist))->next) : NULL) 108 | 109 | #ifndef G_DISABLE_DEPRECATED 110 | void g_slist_push_allocator (gpointer dummy); 111 | void g_slist_pop_allocator (void); 112 | #endif 113 | 114 | G_END_DECLS 115 | 116 | #endif /* __G_SLIST_H__ */ 117 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gthreadpool.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_THREADPOOL_H__ 32 | #define __G_THREADPOOL_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GThreadPool GThreadPool; 39 | 40 | /* Thread Pools 41 | */ 42 | 43 | /* The real GThreadPool is bigger, so you may only create a thread 44 | * pool with the constructor function */ 45 | struct _GThreadPool 46 | { 47 | GFunc func; 48 | gpointer user_data; 49 | gboolean exclusive; 50 | }; 51 | 52 | /* Get a thread pool with the function func, at most max_threads may 53 | * run at a time (max_threads == -1 means no limit), exclusive == TRUE 54 | * means, that the threads shouldn't be shared and that they will be 55 | * prestarted (otherwise they are started as needed) user_data is the 56 | * 2nd argument to the func */ 57 | GThreadPool* g_thread_pool_new (GFunc func, 58 | gpointer user_data, 59 | gint max_threads, 60 | gboolean exclusive, 61 | GError **error); 62 | 63 | /* Push new data into the thread pool. This task is assigned to a thread later 64 | * (when the maximal number of threads is reached for that pool) or now 65 | * (otherwise). If necessary a new thread will be started. The function 66 | * returns immediatly */ 67 | void g_thread_pool_push (GThreadPool *pool, 68 | gpointer data, 69 | GError **error); 70 | 71 | /* Set the number of threads, which can run concurrently for that pool, -1 72 | * means no limit. 0 means has the effect, that the pool won't process 73 | * requests until the limit is set higher again */ 74 | void g_thread_pool_set_max_threads (GThreadPool *pool, 75 | gint max_threads, 76 | GError **error); 77 | gint g_thread_pool_get_max_threads (GThreadPool *pool); 78 | 79 | /* Get the number of threads assigned to that pool. This number doesn't 80 | * necessarily represent the number of working threads in that pool */ 81 | guint g_thread_pool_get_num_threads (GThreadPool *pool); 82 | 83 | /* Get the number of unprocessed items in the pool */ 84 | guint g_thread_pool_unprocessed (GThreadPool *pool); 85 | 86 | /* Free the pool, immediate means, that all unprocessed items in the queue 87 | * wont be processed, wait means, that the function doesn't return immediatly, 88 | * but after all threads in the pool are ready processing items. immediate 89 | * does however not mean, that threads are killed. */ 90 | void g_thread_pool_free (GThreadPool *pool, 91 | gboolean immediate, 92 | gboolean wait_); 93 | 94 | /* Set the maximal number of unused threads before threads will be stopped by 95 | * GLib, -1 means no limit */ 96 | void g_thread_pool_set_max_unused_threads (gint max_threads); 97 | gint g_thread_pool_get_max_unused_threads (void); 98 | guint g_thread_pool_get_num_unused_threads (void); 99 | 100 | /* Stop all currently unused threads, but leave the limit untouched */ 101 | void g_thread_pool_stop_unused_threads (void); 102 | 103 | /* Set sort function for priority threading */ 104 | void g_thread_pool_set_sort_function (GThreadPool *pool, 105 | GCompareDataFunc func, 106 | gpointer user_data); 107 | 108 | /* Set maximum time a thread can be idle in the pool before it is stopped */ 109 | void g_thread_pool_set_max_idle_time (guint interval); 110 | guint g_thread_pool_get_max_idle_time (void); 111 | 112 | G_END_DECLS 113 | 114 | #endif /* __G_THREADPOOL_H__ */ 115 | -------------------------------------------------------------------------------- /sys/sys/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Crossmeta Windows kernel data types. 3 | * (C) Copyright 2003 Sammandam, Supramani 4 | */ 5 | 6 | #ifndef _SYS_TYPES_H_ 7 | #define _SYS_TYPES_H_ 8 | 9 | #ifdef _WIN64 10 | #include 11 | #endif 12 | #ifdef __MINGW32__ 13 | #include <_mingw.h> 14 | #include <_mingw_off_t.h> 15 | #endif 16 | 17 | #if defined(__cplusplus) 18 | extern "C" { 19 | #endif 20 | 21 | /* 22 | * Definitions of all the basic system types that is present in UNIX. 23 | */ 24 | 25 | /* POSIX Extensions */ 26 | 27 | typedef unsigned char uchar_t; 28 | 29 | typedef unsigned short ushort_t; 30 | 31 | typedef unsigned int uint_t; 32 | 33 | typedef unsigned long ulong_t; 34 | 35 | typedef __int64 quad_t; 36 | typedef unsigned __int64 uquad_t, u_quad_t; 37 | 38 | #define QUAD_LOWPART(q) (((PLARGE_INTEGER)(q))->LowPart) 39 | #define QUAD_HIGHPART(q) (((PLARGE_INTEGER)(q))->HighPart) 40 | #define UQUAD_LOWPART(q) (((PULARGE_INTEGER)(q))->LowPart) 41 | #define UQUAD_HIGHPART(q) (((PULARGE_INTEGER)(q))->HighPart) 42 | 43 | typedef unsigned short wchar_t; 44 | 45 | typedef char * addr_t; /* ? type (BSD compat) */ 46 | typedef char * caddr_t; /* ? type */ 47 | /* 48 | * Do not change daddr_t to unsigned, otherwise FFS code will break 49 | */ 50 | #ifdef _WIN64 51 | typedef LONGLONG daddr_t; /* type */ 52 | #else 53 | typedef long daddr_t; /* type */ 54 | #endif 55 | typedef quad_t daddr64_t; /* type */ 56 | typedef char * faddr_t; /* XENIX compat */ 57 | typedef __int32 ufs_daddr_t; 58 | 59 | #ifdef _WIN64 60 | typedef LONGLONG off_t; /* ? type */ 61 | #else 62 | #ifndef __MINGW32__ 63 | #if (defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)) 64 | typedef quad_t off_t; 65 | #else 66 | typedef long off_t; /* ? type */ 67 | #endif /* _FILE_OFFSET_BITS */ 68 | #endif /* __MINGW32__ */ 69 | #endif /* _WIN64 */ 70 | typedef quad_t off64_t; /* ? type */ 71 | 72 | typedef short cnt_t; /* ? type */ 73 | typedef ulong_t vaddr_t; /* type */ 74 | typedef ulong_t paddr_t; /* type */ 75 | typedef uint_t ppid_t; /* type */ 76 | typedef uchar_t use_t; /* use count for swap */ 77 | typedef short sysid_t; /* system ID (RFS) */ 78 | typedef short index_t; /* bitmap index (no longer used) */ 79 | 80 | /* POSIX and XOPEN Declarations */ 81 | 82 | typedef int key_t; /* IPC key type */ 83 | 84 | typedef ulong_t mode_t; /* file attribute type */ 85 | 86 | typedef unsigned int uid_t; /* UID type */ 87 | 88 | typedef uid_t gid_t; /* GID type */ 89 | 90 | typedef ulong_t nlink_t; /* file link type */ 91 | 92 | 93 | typedef ulong_t ino_t; /* expanded inode type */ 94 | typedef unsigned __int64 ino64_t; /* expanded inode type */ 95 | typedef __int64 id_t; /* can hold a gid_t, pid_t, or uid_t */ 96 | typedef __int64 rlim_t; /* resource limit - intentionally */ 97 | 98 | typedef int pid_t; /* process id type */ 99 | 100 | typedef uint_t size32_t; /* len param for string funcs */ 101 | 102 | typedef int ssize_t; /* return byte count or indicate error */ 103 | 104 | /* windows 64bit collisions */ 105 | #ifndef POINTER_32 106 | #define POINTER_32 107 | #endif 108 | #ifndef _SIZE_T_DEFINED 109 | typedef uint_t size_t; 110 | #define _SIZE_T_DEFINED 111 | #endif 112 | #ifndef _TIME_T_DEFINED 113 | typedef long time_t; /* time of day in seconds */ 114 | #endif 115 | typedef char * POINTER_32 caddr32_t; /* ? 32bit type */ 116 | 117 | #ifndef _UINTPTR_T_DEFINED 118 | #ifdef _WIN64 119 | typedef unsigned __int64 uintptr_t; 120 | #else 121 | typedef unsigned int uintptr_t; 122 | #endif 123 | #define _UINTPTR_T_DEFINED 124 | #endif 125 | 126 | #ifndef _CLOCK_T_DEFINED 127 | typedef long clock_t; /* relative time in a specified resolution */ 128 | #define _CLOCK_T_DEFINED 129 | #endif 130 | 131 | typedef unsigned char u_char; 132 | typedef unsigned short u_short; 133 | typedef unsigned int u_int; 134 | typedef unsigned long u_long; 135 | 136 | /* 137 | * Basic integral types. 138 | */ 139 | typedef signed char int8_t; 140 | typedef unsigned char u_int8_t, uint8_t; 141 | typedef short int16_t; 142 | typedef unsigned short u_int16_t, uint16_t; 143 | typedef int int32_t; 144 | typedef unsigned int u_int32_t, uint32_t; 145 | typedef __int64 int64_t; 146 | typedef unsigned __int64 u_int64_t, uint64_t; 147 | 148 | #ifdef _KERNEL 149 | struct specinfo; 150 | 151 | typedef u_int32_t udev_t; /* device number */ 152 | typedef struct specinfo *dev_t; 153 | #else 154 | typedef ulong_t dev_t; /* expanded device type */ 155 | #define udev_t dev_t 156 | #define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */ 157 | #define minor(x) ((int)((x)&0xffff00ff)) /* minor number */ 158 | #define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */ 159 | 160 | #endif 161 | 162 | #ifdef _CXVFS 163 | #define CXVFSAPI DECLSPEC_IMPORT 164 | #else 165 | #define CXVFSAPI 166 | #endif 167 | 168 | #ifndef CDECL 169 | #define CDECL __cdecl 170 | #endif 171 | 172 | #ifndef _CRTIMP 173 | #ifdef _DLL 174 | #define _CRTIMP __declspec(dllimport) 175 | #else /* ndef _DLL */ 176 | #define _CRTIMP 177 | #endif /* _DLL */ 178 | #endif /* _CRTIMP */ 179 | 180 | #ifndef FASTCALL 181 | #define FASTCALL __fastcall 182 | #endif 183 | 184 | #if DBG 185 | #define STATIC 186 | #define KASSERT(exp,msg) do { if (!(exp)) panic msg; } while (0) 187 | #else 188 | #define STATIC static 189 | #define KASSERT(exp,msg) 190 | #endif /* DBG */ 191 | 192 | #if defined(__cplusplus) 193 | } 194 | #endif 195 | #endif /* !_SYS_TYPES_H_ */ 196 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/glist.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_LIST_H__ 32 | #define __G_LIST_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GList GList; 39 | 40 | struct _GList 41 | { 42 | gpointer data; 43 | GList *next; 44 | GList *prev; 45 | }; 46 | 47 | /* Doubly linked lists 48 | */ 49 | GList* g_list_alloc (void) G_GNUC_WARN_UNUSED_RESULT; 50 | void g_list_free (GList *list); 51 | void g_list_free_1 (GList *list); 52 | #define g_list_free1 g_list_free_1 53 | void g_list_free_full (GList *list, 54 | GDestroyNotify free_func); 55 | GList* g_list_append (GList *list, 56 | gpointer data) G_GNUC_WARN_UNUSED_RESULT; 57 | GList* g_list_prepend (GList *list, 58 | gpointer data) G_GNUC_WARN_UNUSED_RESULT; 59 | GList* g_list_insert (GList *list, 60 | gpointer data, 61 | gint position) G_GNUC_WARN_UNUSED_RESULT; 62 | GList* g_list_insert_sorted (GList *list, 63 | gpointer data, 64 | GCompareFunc func) G_GNUC_WARN_UNUSED_RESULT; 65 | GList* g_list_insert_sorted_with_data (GList *list, 66 | gpointer data, 67 | GCompareDataFunc func, 68 | gpointer user_data) G_GNUC_WARN_UNUSED_RESULT; 69 | GList* g_list_insert_before (GList *list, 70 | GList *sibling, 71 | gpointer data) G_GNUC_WARN_UNUSED_RESULT; 72 | GList* g_list_concat (GList *list1, 73 | GList *list2) G_GNUC_WARN_UNUSED_RESULT; 74 | GList* g_list_remove (GList *list, 75 | gconstpointer data) G_GNUC_WARN_UNUSED_RESULT; 76 | GList* g_list_remove_all (GList *list, 77 | gconstpointer data) G_GNUC_WARN_UNUSED_RESULT; 78 | GList* g_list_remove_link (GList *list, 79 | GList *llink) G_GNUC_WARN_UNUSED_RESULT; 80 | GList* g_list_delete_link (GList *list, 81 | GList *link_) G_GNUC_WARN_UNUSED_RESULT; 82 | GList* g_list_reverse (GList *list) G_GNUC_WARN_UNUSED_RESULT; 83 | GList* g_list_copy (GList *list) G_GNUC_WARN_UNUSED_RESULT; 84 | GList* g_list_nth (GList *list, 85 | guint n); 86 | GList* g_list_nth_prev (GList *list, 87 | guint n); 88 | GList* g_list_find (GList *list, 89 | gconstpointer data); 90 | GList* g_list_find_custom (GList *list, 91 | gconstpointer data, 92 | GCompareFunc func); 93 | gint g_list_position (GList *list, 94 | GList *llink); 95 | gint g_list_index (GList *list, 96 | gconstpointer data); 97 | GList* g_list_last (GList *list); 98 | GList* g_list_first (GList *list); 99 | guint g_list_length (GList *list); 100 | void g_list_foreach (GList *list, 101 | GFunc func, 102 | gpointer user_data); 103 | GList* g_list_sort (GList *list, 104 | GCompareFunc compare_func) G_GNUC_WARN_UNUSED_RESULT; 105 | GList* g_list_sort_with_data (GList *list, 106 | GCompareDataFunc compare_func, 107 | gpointer user_data) G_GNUC_WARN_UNUSED_RESULT; 108 | gpointer g_list_nth_data (GList *list, 109 | guint n); 110 | 111 | 112 | #define g_list_previous(list) ((list) ? (((GList *)(list))->prev) : NULL) 113 | #define g_list_next(list) ((list) ? (((GList *)(list))->next) : NULL) 114 | 115 | #ifndef G_DISABLE_DEPRECATED 116 | void g_list_push_allocator (gpointer allocator); 117 | void g_list_pop_allocator (void); 118 | #endif 119 | 120 | G_END_DECLS 121 | 122 | #endif /* __G_LIST_H__ */ 123 | -------------------------------------------------------------------------------- /sys/sys/time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1982, 1986, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#)time.h 8.5 (Berkeley) 5/4/95 34 | * $Id: time.h,v 1.8 1996/09/19 18:21:20 nate Exp $ 35 | */ 36 | 37 | #ifndef _SYS_TIME_H_ 38 | #define _SYS_TIME_H_ 39 | 40 | 41 | #ifndef _WINSOCKAPI_ 42 | /* 43 | * Structure returned by gettimeofday(2) system call, 44 | * and used in other calls. 45 | */ 46 | struct timeval { 47 | long tv_sec; /* seconds */ 48 | long tv_usec; /* and microseconds */ 49 | }; 50 | #endif 51 | 52 | /* 53 | * Structure defined by POSIX.4 to be like a timeval. 54 | */ 55 | struct timespec { 56 | time_t tv_sec; /* seconds */ 57 | long tv_nsec; /* and nanoseconds */ 58 | }; 59 | 60 | typedef struct timespec timespec_t; 61 | typedef struct timespec timestruc_t; 62 | 63 | 64 | #define TIMEVAL_TO_TIMESPEC(tv, ts) { \ 65 | (ts)->tv_sec = (tv)->tv_sec; \ 66 | (ts)->tv_nsec = (tv)->tv_usec * 1000; \ 67 | } 68 | #define TIMESPEC_TO_TIMEVAL(tv, ts) { \ 69 | (tv)->tv_sec = (ts)->tv_sec; \ 70 | (tv)->tv_usec = (ts)->tv_nsec / 1000; \ 71 | } 72 | 73 | struct timezone { 74 | int tz_minuteswest; /* minutes west of Greenwich */ 75 | int tz_dsttime; /* type of dst correction */ 76 | }; 77 | #define DST_NONE 0 /* not on dst */ 78 | #define DST_USA 1 /* USA style dst */ 79 | #define DST_AUST 2 /* Australian style dst */ 80 | #define DST_WET 3 /* Western European dst */ 81 | #define DST_MET 4 /* Middle European dst */ 82 | #define DST_EET 5 /* Eastern European dst */ 83 | #define DST_CAN 6 /* Canada */ 84 | 85 | #ifndef _WINSOCKAPI_ 86 | /* Operations on timevals. */ 87 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 88 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 89 | #define timercmp(tvp, uvp, cmp) \ 90 | (((tvp)->tv_sec == (uvp)->tv_sec) ? \ 91 | ((tvp)->tv_usec cmp (uvp)->tv_usec) : \ 92 | ((tvp)->tv_sec cmp (uvp)->tv_sec)) 93 | #endif 94 | 95 | /* 96 | * Names of the interval timers, and structure 97 | * defining a timer setting. 98 | */ 99 | #define ITIMER_REAL 0 100 | #define ITIMER_VIRTUAL 1 101 | #define ITIMER_PROF 2 102 | 103 | struct itimerval { 104 | struct timeval it_interval; /* timer interval */ 105 | struct timeval it_value; /* current value */ 106 | }; 107 | 108 | /* 109 | * Getkerninfo clock information structure 110 | */ 111 | struct clockinfo { 112 | int hz; /* clock frequency */ 113 | int tick; /* micro-seconds per hz tick */ 114 | int stathz; /* statistics clock frequency */ 115 | int profhz; /* profiling clock frequency */ 116 | }; 117 | 118 | #ifndef _ANSI_SOURCE 119 | /* 120 | * Frequency of the clock ticks reported by times(). Deprecated - use 121 | * sysconf(_SC_CLK_TCK) instead. 122 | */ 123 | #define CLK_TCK 1000 124 | #endif 125 | 126 | #ifndef _KERNEL 127 | #ifdef __MINGW32__ 128 | #define _TIME_T_DEFINED 129 | //#define _TIME64_T_DEFINED 130 | #define _TIMESPEC_DEFINED 131 | #define _TIMEVAL_DEFINED 132 | #define _TIMEZONE_DEFINED 133 | #endif 134 | #include /* pull in microsoft version!! */ 135 | #include 136 | 137 | static __inline void 138 | gettimeofday(struct timeval *tp, void *tzp) 139 | { 140 | struct __timeb64 tb; 141 | 142 | _ftime64(&tb); 143 | tp->tv_sec = (long)tb.time; 144 | tp->tv_usec = tb.millitm * 1000; 145 | } 146 | 147 | #ifndef _POSIX_SOURCE 148 | #include 149 | 150 | __BEGIN_DECLS 151 | int adjtime __P((const struct timeval *, struct timeval *)); 152 | int getitimer __P((int, struct itimerval *)); 153 | //int gettimeofday __P((struct timeval *, struct timezone *)); 154 | int setitimer __P((int, const struct itimerval *, struct itimerval *)); 155 | int settimeofday __P((const struct timeval *, const struct timezone *)); 156 | int utimes __P((const char *, const struct timeval *)); 157 | __END_DECLS 158 | #endif /* !POSIX */ 159 | 160 | #endif /* !KERNEL */ 161 | 162 | #endif /* !_SYS_TIME_H_ */ 163 | -------------------------------------------------------------------------------- /sshfs/glib-2.0/glib/gdataset.h: -------------------------------------------------------------------------------- 1 | /* GLIB - Library of useful routines for C programming 2 | * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | */ 19 | 20 | /* 21 | * Modified by the GLib Team and others 1997-2000. See the AUTHORS 22 | * file for a list of people on the GLib Team. See the ChangeLog 23 | * files for a list of changes. These files are distributed with 24 | * GLib at ftp://ftp.gtk.org/pub/gtk/. 25 | */ 26 | 27 | #if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION) 28 | #error "Only can be included directly." 29 | #endif 30 | 31 | #ifndef __G_DATASET_H__ 32 | #define __G_DATASET_H__ 33 | 34 | #include 35 | 36 | G_BEGIN_DECLS 37 | 38 | typedef struct _GData GData; 39 | 40 | typedef void (*GDataForeachFunc) (GQuark key_id, 41 | gpointer data, 42 | gpointer user_data); 43 | 44 | /* Keyed Data List 45 | */ 46 | void g_datalist_init (GData **datalist); 47 | void g_datalist_clear (GData **datalist); 48 | gpointer g_datalist_id_get_data (GData **datalist, 49 | GQuark key_id); 50 | void g_datalist_id_set_data_full (GData **datalist, 51 | GQuark key_id, 52 | gpointer data, 53 | GDestroyNotify destroy_func); 54 | gpointer g_datalist_id_remove_no_notify (GData **datalist, 55 | GQuark key_id); 56 | void g_datalist_foreach (GData **datalist, 57 | GDataForeachFunc func, 58 | gpointer user_data); 59 | 60 | /** 61 | * G_DATALIST_FLAGS_MASK: 62 | * 63 | * A bitmask that restricts the possible flags passed to 64 | * g_datalist_set_flags(). Passing a flags value where 65 | * flags & ~G_DATALIST_FLAGS_MASK != 0 is an error. 66 | */ 67 | #define G_DATALIST_FLAGS_MASK 0x3 68 | 69 | void g_datalist_set_flags (GData **datalist, 70 | guint flags); 71 | void g_datalist_unset_flags (GData **datalist, 72 | guint flags); 73 | guint g_datalist_get_flags (GData **datalist); 74 | 75 | #define g_datalist_id_set_data(dl, q, d) \ 76 | g_datalist_id_set_data_full ((dl), (q), (d), NULL) 77 | #define g_datalist_id_remove_data(dl, q) \ 78 | g_datalist_id_set_data ((dl), (q), NULL) 79 | #define g_datalist_get_data(dl, k) \ 80 | (g_datalist_id_get_data ((dl), g_quark_try_string (k))) 81 | #define g_datalist_set_data_full(dl, k, d, f) \ 82 | g_datalist_id_set_data_full ((dl), g_quark_from_string (k), (d), (f)) 83 | #define g_datalist_remove_no_notify(dl, k) \ 84 | g_datalist_id_remove_no_notify ((dl), g_quark_try_string (k)) 85 | #define g_datalist_set_data(dl, k, d) \ 86 | g_datalist_set_data_full ((dl), (k), (d), NULL) 87 | #define g_datalist_remove_data(dl, k) \ 88 | g_datalist_id_set_data ((dl), g_quark_try_string (k), NULL) 89 | 90 | 91 | /* Location Associated Keyed Data 92 | */ 93 | void g_dataset_destroy (gconstpointer dataset_location); 94 | gpointer g_dataset_id_get_data (gconstpointer dataset_location, 95 | GQuark key_id); 96 | void g_dataset_id_set_data_full (gconstpointer dataset_location, 97 | GQuark key_id, 98 | gpointer data, 99 | GDestroyNotify destroy_func); 100 | gpointer g_dataset_id_remove_no_notify (gconstpointer dataset_location, 101 | GQuark key_id); 102 | void g_dataset_foreach (gconstpointer dataset_location, 103 | GDataForeachFunc func, 104 | gpointer user_data); 105 | #define g_dataset_id_set_data(l, k, d) \ 106 | g_dataset_id_set_data_full ((l), (k), (d), NULL) 107 | #define g_dataset_id_remove_data(l, k) \ 108 | g_dataset_id_set_data ((l), (k), NULL) 109 | #define g_dataset_get_data(l, k) \ 110 | (g_dataset_id_get_data ((l), g_quark_try_string (k))) 111 | #define g_dataset_set_data_full(l, k, d, f) \ 112 | g_dataset_id_set_data_full ((l), g_quark_from_string (k), (d), (f)) 113 | #define g_dataset_remove_no_notify(l, k) \ 114 | g_dataset_id_remove_no_notify ((l), g_quark_try_string (k)) 115 | #define g_dataset_set_data(l, k, d) \ 116 | g_dataset_set_data_full ((l), (k), (d), NULL) 117 | #define g_dataset_remove_data(l, k) \ 118 | g_dataset_id_set_data ((l), g_quark_try_string (k), NULL) 119 | 120 | G_END_DECLS 121 | 122 | #endif /* __G_DATASET_H__ */ 123 | -------------------------------------------------------------------------------- /sys/sys/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1989, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#)unistd.h 8.2 (Berkeley) 1/7/94 34 | * $Id: unistd.h,v 1.8.2.2 1997/02/28 12:02:38 bde Exp $ 35 | */ 36 | 37 | #ifndef _SYS_UNISTD_H_ 38 | #define _SYS_UNISTD_H_ 39 | 40 | /* compile-time symbolic constants */ 41 | #define _POSIX_JOB_CONTROL /* implementation supports job control */ 42 | 43 | /* 44 | * Although we have saved user/group IDs, we do not use them in setuid 45 | * as described in POSIX 1003.1, because the feature does not work for 46 | * root. We use the saved IDs in seteuid/setegid, which are not currently 47 | * part of the POSIX 1003.1 specification. 48 | */ 49 | #ifdef _NOT_AVAILABLE 50 | #define _POSIX_SAVED_IDS /* saved set-user-ID and set-group-ID */ 51 | #endif 52 | 53 | #define _POSIX_VERSION 199009L 54 | #define _POSIX2_VERSION 199212L 55 | 56 | /* execution-time symbolic constants */ 57 | /* chown requires appropriate privileges */ 58 | #define _POSIX_CHOWN_RESTRICTED 1 59 | /* too-long path components generate errors */ 60 | #define _POSIX_NO_TRUNC 1 61 | /* may disable terminal special characters */ 62 | #define _POSIX_VDISABLE 0xff 63 | 64 | /* access function */ 65 | #define F_OK 0 /* test for existence of file */ 66 | #define X_OK 0x01 /* test for execute or search permission */ 67 | #define W_OK 0x02 /* test for write permission */ 68 | #define R_OK 0x04 /* test for read permission */ 69 | 70 | /* whence values for lseek(2) */ 71 | #define SEEK_SET 0 /* set file offset to offset */ 72 | #define SEEK_CUR 1 /* set file offset to current plus offset */ 73 | #define SEEK_END 2 /* set file offset to EOF plus offset */ 74 | 75 | #ifndef _POSIX_SOURCE 76 | /* whence values for lseek(2); renamed by POSIX 1003.1 */ 77 | #define L_SET SEEK_SET 78 | #define L_INCR SEEK_CUR 79 | #define L_XTND SEEK_END 80 | #endif 81 | 82 | /* configurable pathname variables */ 83 | #define _PC_LINK_MAX 1 84 | #define _PC_MAX_CANON 2 85 | #define _PC_MAX_INPUT 3 86 | #define _PC_NAME_MAX 4 87 | #define _PC_PATH_MAX 5 88 | #define _PC_PIPE_BUF 6 89 | #define _PC_CHOWN_RESTRICTED 7 90 | #define _PC_NO_TRUNC 8 91 | #define _PC_VDISABLE 9 92 | 93 | /* configurable system variables */ 94 | #define _SC_ARG_MAX 1 95 | #define _SC_CHILD_MAX 2 96 | #define _SC_CLK_TCK 3 97 | #define _SC_NGROUPS_MAX 4 98 | #define _SC_OPEN_MAX 5 99 | #define _SC_JOB_CONTROL 6 100 | #define _SC_SAVED_IDS 7 101 | #define _SC_VERSION 8 102 | #define _SC_BC_BASE_MAX 9 103 | #define _SC_BC_DIM_MAX 10 104 | #define _SC_BC_SCALE_MAX 11 105 | #define _SC_BC_STRING_MAX 12 106 | #define _SC_COLL_WEIGHTS_MAX 13 107 | #define _SC_EXPR_NEST_MAX 14 108 | #define _SC_LINE_MAX 15 109 | #define _SC_RE_DUP_MAX 16 110 | #define _SC_2_VERSION 17 111 | #define _SC_2_C_BIND 18 112 | #define _SC_2_C_DEV 19 113 | #define _SC_2_CHAR_TERM 20 114 | #define _SC_2_FORT_DEV 21 115 | #define _SC_2_FORT_RUN 22 116 | #define _SC_2_LOCALEDEF 23 117 | #define _SC_2_SW_DEV 24 118 | #define _SC_2_UPE 25 119 | #define _SC_STREAM_MAX 26 120 | #define _SC_TZNAME_MAX 27 121 | 122 | /* configurable system strings */ 123 | #define _CS_PATH 1 124 | 125 | #ifndef _POSIX_SOURCE 126 | /* 127 | * rfork() options. 128 | * 129 | * XXX currently, operations without RFPROC set are not supported. 130 | */ 131 | #define RFNAMEG (1<<0) /* UNIMPL new plan9 `name space' */ 132 | #define RFENVG (1<<1) /* UNIMPL copy plan9 `env space' */ 133 | #define RFFDG (1<<2) /* copy fd table */ 134 | #define RFNOTEG (1<<3) /* UNIMPL create new plan9 `note group' */ 135 | #define RFPROC (1<<4) /* change child (else changes curproc) */ 136 | #define RFMEM (1<<5) /* share `address space' */ 137 | #define RFNOWAIT (1<<6) /* parent need not wait() on child */ 138 | #define RFCNAMEG (1<<10) /* UNIMPL zero plan9 `name space' */ 139 | #define RFCENVG (1<<11) /* UNIMPL zero plan9 `env space' */ 140 | #define RFCFDG (1<<12) /* zero fd table */ 141 | #define RFPPWAIT (1<<31) /* parent sleeps until child exits (vfork) */ 142 | #endif /* !_POSIX_SOURCE */ 143 | 144 | #endif /* !_SYS_UNISTD_H_ */ 145 | --------------------------------------------------------------------------------