Why XWin expose multiple visuals with same depth/colormap ?

2009-12-24 Thread patrick ficheux

Hello,

It seems that XWin exposes a lot of Visuals with same caracteristics 
(depth / colormap).


xdpyinfo displays 33 visuals of 2 type :
   TrueColor / 24 bits
   DirectColor / 24 bits

Is there a reason to expose 15 identical TrueColor visuals and 16 
identical DirectColor visuals ?


Regards




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Re: can't redirect sed command to bash script

2008-09-19 Thread patrick ficheux

Bayu Adiwibowo a écrit :

Hi
  

Hi

I want using sed and redirect with pipe bash script to produce report
that sort names by state and list the name of state followed by name of
each person in that state. It's work in linux as expected but cygwin
seen can't executed bash script in such way.

This is my test script

$ cat nameState
s/ CA/, California/
s/ MA/, Massachusetts/
s/ OK/, Oklahoma/
s/ PA/, Pennsylvania/
s/ VA/, Virginia/

$ cat list
John Daggett, 341 King Road, Plymouth MA
Alice Ford, 22 East Broadway, Richmond VA
Orville Thomas, 11345 Oak Bridge Road, Tulsa OK
Terry Kalkas, 402 Lans Road, Beaver Falls PA
Eric Adams, 20 Post Road, Sudbury MA
Hubert Sims, 328A Brook Road, Roanoke VA
Amy Wilde, 334 Bayshore Pkwy, Mountain View CA
Sal Carpenter, 73 6th Street, Boston MA

$ cat byState
#! /bin/sh
awk -F, '{
  print $4 ,  $0
  }' $* |
sort |
awk -F, '
$1 == LastState {
  print \t $2
}
$1 != LastState {
  LastState = $1
  print $1
}'

Bash can't executed with following error

$ sed -f nameState list | byState
  

try

$ sed -f nameState list | ./byState

if byState is in your current directory, it is not neccessary in your PATH


Regards,


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: WG: Can't build cygwin X server : directory program/xrx is missing

2008-04-30 Thread patrick ficheux

Eberhard Harbrink a écrit :

Install the sources from the cvs STABLE tree. xrx is in the stable tree.

Regards
  

I get the release 6.8.99.901 from CVS
$ cvs -z6 -d :pserver:[EMAIL PROTECTED]:/cvs/xorg co -r 
XORG-6_8_99_901 xc


but I can't compile it
error in .../lib/Xft1 when building libXft-1.dll.a
xftpat.o:xftpat.c:(.text+0x3c2): undefined reference to « 
_FcPatternInsertElt »
xftpat.o:xftpat.c:(.text+0x3ce): undefined reference to « 
_FcPatternFindElt »


I get the main version from CVS
$ cvs -z6 -d :pserver:[EMAIL PROTECTED]:/cvs/xorg co xc

and ... there are some errors ... in makefile

make[4]: Entering directory `/e/t/freedesktop.cvs/build/lib/GL/glx'
Makefile:8: *** missing separator.  Stop.
make[4]: Leaving directory `/e/t/freedesktop.cvs/build/lib/GL/glx'
make[3]: *** [clean] Error 2

I will try with older version except if somebody has a better idea ...


-Ursprüngliche Nachricht-
Von: patrick ficheux [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 29. April 2008 10:30

An: cygwin-xfree@cygwin.com
Betreff: Can't build cygwin X server : directory program/xrx is missing


I'm trying to rebuild X server (XWin.exe) from the source tree xorg-x11
6.8.99.901-1 (last stable version)

when I run 'make', I get those errors

$ make World
...
make[3]: Leaving directory `/usr/src/xc/programs/xrefresh' cleaning in
programs/xrx...
make: Entering an unknown directory
make: *** xrx: No such file or directory.  Stop.
make: Leaving an unknown directory
make[2]: *** [clean] Error 2
make[2]: Leaving directory `/usr/src/xc/programs'
make[1]: *** [clean] Error 2
make[1]: Leaving directory `/usr/src/xc'
make: *** [World] Error 2

The directory /usr/src/xc/programs/xrx is missing

The source package of xorg-x11-bin (which contains xrx.exe) doesn't contain
this directory Where can I find it ?

I find an older thread here :
http://cygwin.com/ml/cygwin-xfree/2006-10/msg00045.html
with the same problem  but without solution.

any ideas ?

Regards,





--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/


  




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



Can't build cygwin X server : directory program/xrx is missing

2008-04-29 Thread patrick ficheux

I'm trying to rebuild X server (XWin.exe) from the source tree xorg-x11
6.8.99.901-1 (last stable version)

when I run 'make', I get those errors

$ make World
...
make[3]: Leaving directory `/usr/src/xc/programs/xrefresh'
cleaning in programs/xrx...
make: Entering an unknown directory
make: *** xrx: No such file or directory.  Stop.
make: Leaving an unknown directory
make[2]: *** [clean] Error 2
make[2]: Leaving directory `/usr/src/xc/programs'
make[1]: *** [clean] Error 2
make[1]: Leaving directory `/usr/src/xc'
make: *** [World] Error 2

The directory /usr/src/xc/programs/xrx is missing

The source package of xorg-x11-bin (which contains xrx.exe) doesn't
contain this directory
Where can I find it ?

I find an older thread here :
http://cygwin.com/ml/cygwin-xfree/2006-10/msg00045.html
with the same problem  but without solution.

any ideas ?

Regards,




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/



socket : MSG_WAITALL isn't defined

2007-11-28 Thread patrick ficheux

Hi,

I want to use recv() with MSG_WAITALL flag. But this constant isn't
defined in cygwin.
I find a old message about this issue here =
http://www.cygwin.com/ml/cygwin/2000-06/msg01229.html

Why MSG_WAITALL is not present in cygwin ?
It's a posix compliance problem ?

It seems that
# define MSG_WAITALL0x08
works well on Windows

Regards,



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: socket : MSG_WAITALL isn't defined

2007-11-28 Thread patrick ficheux

Phil Betts a écrit :

Corinna Vinschen wrote on Wednesday, November 28, 2007 2:57 PM::

  

On Nov 28 15:24, patrick ficheux wrote:


Hi,

I want to use recv() with MSG_WAITALL [...]
  

Don't you read earlier replies on the list?


oups, ...


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



socket : MSG_WAITALL isn't defined

2007-11-27 Thread patrick ficheux

Hi,

I want to use recv() with MSG_WAITALL flag. But this constant isn't 
defined in cygwin.
I find a old message about this issue here = 
http://www.cygwin.com/ml/cygwin/2000-06/msg01229.html


Why MSG_WAITALL is not present in cygwin ?
It's a posix compliance problem ?

It seems that
# define MSG_WAITALL0x08
works well

Regards,


--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



problem with SANE : scanimage freeze

2007-10-17 Thread patrick ficheux

Hi,

I try to use SANE on cygwin with USB scanner (agfa snapscan 1212U) but 
scanimage doesn't work


sane-find-scanner.exe works fine, it detects my scanner
$ sane-find-scanner.exe
...
found USB scanner (vendor=0x06bd [AGFA ], product=0x2061 [SNAPSCAN]) at 
libusb:bus-0:\\.\libusb0-0003--0x06bd-0x2061

...

but when I try to list available scanner :

$ scanimage -L
device `snapscan:libusb:bus-0:\\.\libusb0-0003--0x06bd-0x2061' is a AGFA 
SNAPSCAN flatbed scanner


scanimage displays correct information but it never returns
I must kill scanimage (scanimage takes 100% CPU)

when I set debug trace on, I get the following message :

$ scanimage -L
[sanei_debug] Setting debug level of dll to 128.
[dll] sane_init: SANE dll backend version 1.0.12 from sane-backends 1.0.18
[dll] sane_init: reading dll.conf
[dll] add_backend: adding backend `snapscan'
[dll] sane_get_devices
[dll] load: searching backend `snapscan' in `/usr/local/lib/sane'
[dll] load: trying to load `/usr/local/lib/sane/cygsane-snapscan-1.dll'
[dll] load: dlopen()ing `/usr/local/lib/sane/cygsane-snapscan-1.dll'
[dll] init: initializing backend `snapscan'
[sanei_debug] Setting debug level of snapscan to 128.
[snapscan] sane_snapscan_init
[snapscan] sane_snapscan_init: Snapscan backend version 1.4.53
[sanei_debug] Setting debug level of sanei_usb to 128.
[sanei_usb] sanei_usb_init: Looking for kernel scanner devices
[sanei_usb] sanei_usb_init: Looking for libusb devices
LIBUSB_DLL: info: usb_os_find_busses: found bus-0
LIBUSB_DLL: info: usb_os_find_devices: found 
\\.\libusb0-0001--0x413c-0x2005 on bus-0
LIBUSB_DLL: info: usb_os_find_devices: found 
\\.\libusb0-0002--0x046d-0xc016 on bus-0
LIBUSB_DLL: info: usb_os_find_devices: found 
\\.\libusb0-0003--0x06bd-0x2061 on bus-0
[sanei_usb] sanei_usb_init: device 0x413c/0x2005, interface 0 doesn't 
look like a scanner (0/3)

[sanei_usb] sanei_usb_init: device 0x413c/0x2005: no suitable interfaces
[sanei_usb] sanei_usb_init: device 0x046d/0xc016, interface 0 doesn't 
look like a scanner (0/3)

[sanei_usb] sanei_usb_init: device 0x046d/0xc016: no suitable interfaces
[sanei_usb] sanei_usb_init: found libusb device (0x06bd/0x2061) 
interface 0  at libusb:bus-0:\\.\libusb0-0003--0x06bd-0x2061

[sanei_usb] sanei_usb_init: found 1 devices
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x1a20
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x1a26
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x2022
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x1a2a
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x2040
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x2060
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x207e
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20be
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20c0
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20b0
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20de
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20f8
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20fc
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x20fe
[sanei_usb] sanei_usb_find_devices: vendor=0x04a5, product=0x2137
[sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x0002
[sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x0001
[sanei_usb] sanei_usb_find_devices: vendor=0x06bd, product=0x2061
[snapscan] add_usb_device(libusb:bus-0:\\.\libusb0-0003--0x06bd-0x2061)
[snapscan] add_usb_device: Detected (kind of) an USB device
[snapscan] add_usb_device: before snapscani_usb_shm_init()
[snapscan] snapscani_usb_shm_init USE_PTHREAD
[snapscan] add_usb_device: after snapscani_usb_shm_init()
[snapscan] snapscani_usb_open(libusb:bus-0:\\.\libusb0-0003--0x06bd-0x2061)
[sanei_usb] sanei_usb_open: trying to open device 
`libusb:bus-0:\\.\libusb0-0003--0x06bd-0x2061'

[sanei_usb] sanei_usb_open: configuration nr: 0
[sanei_usb] sanei_usb_open: interface nr: 0
[sanei_usb] sanei_usb_open:   alt_setting nr: 0
[sanei_usb] sanei_usb_open: endpoint nr: 0
[sanei_usb] sanei_usb_open: direction: 128
[sanei_usb] sanei_usb_open: address: 1 transfertype: 2
[sanei_usb] sanei_usb_open: found bulk-in endpoint (address 0x01)
[sanei_usb] sanei_usb_open: endpoint nr: 1
[sanei_usb] sanei_usb_open: direction: 0
[sanei_usb] sanei_usb_open: address: 2 transfertype: 2
[sanei_usb] sanei_usb_open: found bulk-out endpoint (address 0x02)
[sanei_usb] sanei_usb_open: endpoint nr: 2
[sanei_usb] sanei_usb_open: direction: 128
[sanei_usb] sanei_usb_open: address: 3 transfertype: 3
[sanei_usb] sanei_usb_open: found interrupt-in endpoint (address 0x03)
[sanei_usb] sanei_usb_open: opened usb device 
`libusb:bus-0:\\.\libusb0-0003--0x06bd-0x2061' (*dn=0)
[sanei_usb] sanei_usb_get_vendor_product: device 0: vendorID: 0x06bd, 
productID: 0x2061

[snapscan] add_usb_device: Checking if 0x06bd is a supported USB vendor ID
[snapscan] 

shmget() returns xx if current user is not a administrator

2007-10-12 Thread patrick ficheux
In SANE (scanner project), the backend for snapscan failed to call 
shmget() with error EACCES (Permission denied) if the current user isn't 
administrator.

When I'am logged as windows administrator, shmget() is called successfully

In both case, the env. variable CYGWIN exists and this value is 
CYGWIN=server

cygserver is installed and runs


Is it possible to call shmget() without administrator's privileges ?
In this case, what kind of privileges a user must have ? and how to set 
those privileges ?


Thanks

extract from snapscan backend

#ifndef SHM_R
#define SHM_R 0
#endif

#ifndef SHM_W
#define SHM_W 0
#endif

struct urb_counters_t {
   unsigned long read_urbs;
   unsigned long write_urbs;
};

static struct urb_counters_t* urb_counters = NULL;

static SANE_Status snapscani_usb_shm_init(void)
{
   unsigned int shm_size = sizeof(struct urb_counters_t);
   void* shm_area = NULL;
   int shm_id = shmget (IPC_PRIVATE, shm_size, IPC_CREAT | SHM_R | SHM_W);
   if (shm_id == -1)
   {
   DBG (snapscani_usb_shm_init: cannot create shared memory 
segment: %s\n,

   strerror (errno));
   return 1;
   }

a log from strace
  92   19220 [main] testshmget 2944 shmget: shmget (key = 0, size = 8, 
shmflg = 0x200)
1627   20847 [main] testshmget 2944 shmat: shmat (shmid = 327680, 
shmaddr = 0x0, shmflg = 0x0)

 732   21579 [main] testshmget 2944 shmat: -1 [13] = shmat ()
  65   21644 [main] testshmget 2944 __set_errno: void* shmat(int, const 
void*, int):224 val 13




--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/



Re: shmget() returns xx if current user is not a administrator

2007-10-12 Thread patrick ficheux

Corinna Vinschen a écrit :

On Oct 12 11:09, patrick ficheux wrote:
  
In SANE (scanner project), the backend for snapscan failed to call shmget() 
with error EACCES (Permission denied) if the current user isn't 
administrator.

When I'am logged as windows administrator, shmget() is called successfully

In both case, the env. variable CYGWIN exists and this value is 
CYGWIN=server

cygserver is installed and runs


Is it possible to call shmget() without administrator's privileges ?
In this case, what kind of privileges a user must have ? and how to set 
those privileges ?


Thanks

extract from snapscan backend

#ifndef SHM_R
#define SHM_R 0
#endif

#ifndef SHM_W
#define SHM_W 0
#endif




This is the problem.  SHM_R and SHM_W are not defined on Cygwin.
These flags are not defined by POSIX and relying on them as above is
non-portable.  As a result, you create a shared mem region with
permission bits set to 000.

  

   int shm_id = shmget (IPC_PRIVATE, shm_size, IPC_CREAT | SHM_R | SHM_W);



Try something like

 #include sys/stat.h
 int shm_id = shmget (IPC_PRIVATE, shm_size, IPC_CREAT | S_IRWXU);
  

it works fine !
thanks a lot



--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ:   http://cygwin.com/faq/