From axeld at mail.berlios.de Mon Jan 1 17:18:36 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 1 Jan 2007 17:18:36 +0100 Subject: [Haiku-commits] r19665 - haiku/trunk/src/add-ons/kernel/network/protocols/tcp Message-ID: <200701011618.l01GIaoC030548@sheep.berlios.de> Author: axeld Date: 2007-01-01 17:18:35 +0100 (Mon, 01 Jan 2007) New Revision: 19665 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19665&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/tcp.cpp Log: Added some more (optional) debug output. Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/tcp.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/tcp.cpp 2006-12-31 16:33:21 UTC (rev 19664) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/tcp.cpp 2007-01-01 16:18:35 UTC (rev 19665) @@ -297,6 +297,26 @@ } +#if 0 +void +dump_tcp_header(tcp_header &header) +{ + dprintf(" source port: %u\n", ntohs(header.source_port)); + dprintf(" dest port: %u\n", ntohs(header.destination_port)); + dprintf(" sequence: %lu\n", header.Sequence()); + dprintf(" ack: %lu\n", header.Acknowledge()); + dprintf(" flags: %s%s%s%s%s%s\n", (header.flags & TCP_FLAG_FINISH) ? "FIN " : "", + (header.flags & TCP_FLAG_SYNCHRONIZE) ? "SYN " : "", + (header.flags & TCP_FLAG_RESET) ? "RST " : "", + (header.flags & TCP_FLAG_PUSH) ? "PUSH " : "", + (header.flags & TCP_FLAG_ACKNOWLEDGE) ? "ACK " : "", + (header.flags & TCP_FLAG_URGENT) ? "URG " : ""); + dprintf(" window: %u\n", header.AdvertisedWindow()); + dprintf(" urgent offset: %u\n", header.UrgentOffset()); +} +#endif + + // #pragma mark - protocol API @@ -507,6 +527,7 @@ TRACE((" Looking for: peer %s, local %s\n", AddressString(gDomain, (sockaddr *)&buffer->source, true).Data(), AddressString(gDomain, (sockaddr *)&buffer->destination, true).Data())); + //dump_tcp_header(header); tcp_segment_header segment; segment.sequence = header.Sequence(); @@ -530,6 +551,7 @@ (struct sockaddr *)&buffer->destination, (struct sockaddr *)&buffer->source); if (endpoint != NULL) { RecursiveLocker locker(endpoint->Lock()); + TRACE(("Endpoint %p in state %s\n", endpoint, name_for_state(endpoint->State()))); switch (endpoint->State()) { case TIME_WAIT: From axeld at mail.berlios.de Mon Jan 1 17:25:19 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 1 Jan 2007 17:25:19 +0100 Subject: [Haiku-commits] r19666 - haiku/trunk/src/add-ons/kernel/network/protocols/tcp Message-ID: <200701011625.l01GPJqB031693@sheep.berlios.de> Author: axeld Date: 2007-01-01 17:25:19 +0100 (Mon, 01 Jan 2007) New Revision: 19666 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19666&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp Log: * Connect() now sets the initial send queue sequence before calling _SendQueued() so that it's already correct at this point (even though it's currently not possible to queue data before connecting, it might be in some point in the future). * ListenReceive() did not initialize the initial send queue sequence of the new endpoint correctly; it took the values from the wrong endpoint (itself). * Suppressed the debug output "FIN ack'd" when the connection was not even established yet. * Minor debug output improvements. Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp 2007-01-01 16:18:35 UTC (rev 19665) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp 2007-01-01 16:25:19 UTC (rev 19666) @@ -252,6 +252,7 @@ fSendNext = fInitialSendSequence; fSendUnacknowledged = fInitialSendSequence; fSendMax = fInitialSendSequence; + fSendQueue.SetInitialSequence(fSendNext + 1); // send SYN status = _SendQueued(); @@ -260,8 +261,6 @@ return status; } - fSendQueue.SetInitialSequence(fSendNext); - // wait until 3-way handshake is complete (if needed) bigtime_t timeout = min_c(socket->send.timeout, TCP_CONNECTION_TIMEOUT); @@ -368,7 +367,8 @@ status_t TCPEndpoint::SendData(net_buffer *buffer) { - TRACE(("TCP:%p.SendData(buffer %p, size %lu)\n", this, buffer, buffer->size)); + TRACE(("TCP:%p.SendData(buffer %p, size %lu, flags %lx)\n", + this, buffer, buffer->size, buffer->flags)); size_t bytesLeft = buffer->size; @@ -624,8 +624,8 @@ // send SYN+ACK status_t status = endpoint->_SendQueued(); - endpoint->fInitialSendSequence = fSendNext; - endpoint->fSendQueue.SetInitialSequence(fSendNext); + endpoint->fInitialSendSequence = endpoint->fSendNext; + endpoint->fSendQueue.SetInitialSequence(endpoint->fSendNext); if (status < B_OK) return DROP; @@ -702,7 +702,7 @@ int32 TCPEndpoint::Receive(tcp_segment_header &segment, net_buffer *buffer) { - TRACE(("TCP:%p.ReceiveData(): Connection in state %d received packet %p (%lu bytes) with flags 0x%x, seq %lu, ack %lu!\n", + TRACE(("TCP:%p.Receive(): Connection in state %d received packet %p (%lu bytes) with flags 0x%x, seq %lu, ack %lu!\n", this, fState, buffer, buffer->size, segment.flags, segment.sequence, segment.acknowledge)); // TODO: rethink locking! @@ -891,7 +891,7 @@ if (fSendNext < fSendUnacknowledged) fSendNext = fSendUnacknowledged; - if (segment.acknowledge > fSendQueue.LastSequence()) { + if (segment.acknowledge > fSendQueue.LastSequence() && fState > ESTABLISHED) { // our TCP_FLAG_FINISH has been acknowledged dprintf("FIN has been acknowledged!\n"); From axeld at mail.berlios.de Mon Jan 1 19:09:32 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 1 Jan 2007 19:09:32 +0100 Subject: [Haiku-commits] r19667 - haiku/trunk/src/add-ons/kernel/drivers/network/stack Message-ID: <200701011809.l01I9WfH004545@sheep.berlios.de> Author: axeld Date: 2007-01-01 19:09:20 +0100 (Mon, 01 Jan 2007) New Revision: 19667 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19667&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/network/stack/kernel_stack.cpp Log: No longer deny starting in safe mode - the Bootscript is supposed to do that already. This way, we can still bring up the net in safe mode manually. Modified: haiku/trunk/src/add-ons/kernel/drivers/network/stack/kernel_stack.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/stack/kernel_stack.cpp 2007-01-01 16:25:19 UTC (rev 19666) +++ haiku/trunk/src/add-ons/kernel/drivers/network/stack/kernel_stack.cpp 2007-01-01 18:09:20 UTC (rev 19667) @@ -25,7 +25,6 @@ // debugging macros #define LOGID "net_stack_driver: " #define ERROR(format, args...) dprintf(LOGID "ERROR: " format, ## args) -#define WARN(format, args...) dprintf(LOGID "WARNING: " format, ## args) #ifdef DEBUG # define TRACE(format, args...) dprintf(format, ## args) @@ -589,27 +588,9 @@ // #pragma mark - driver -/** Do we init ourselves? If we're in safe mode we'll decline so if things - * screw up we can boot and delete the broken driver! - * After my experiences earlier - a good idea! - */ - status_t init_hardware(void) { - void *settings = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS); - if (settings != NULL) { - // we got a pointer, now get settings... - bool safemode = get_driver_boolean_parameter(settings, B_SAFEMODE_SAFE_MODE, false, false); - // now get rid of settings - unload_driver_settings(settings); - - if (safemode) { - WARN("net_stack: Safemode! Declining offer to join the party.\n"); - return B_ERROR; - } - } - return B_OK; } From nielx at mail.berlios.de Mon Jan 1 19:40:52 2007 From: nielx at mail.berlios.de (nielx at BerliOS) Date: Mon, 1 Jan 2007 19:40:52 +0100 Subject: [Haiku-commits] r19668 - haiku/trunk/src/kits/support Message-ID: <200701011840.l01IeqqH027987@sheep.berlios.de> Author: nielx Date: 2007-01-01 19:40:51 +0100 (Mon, 01 Jan 2007) New Revision: 19668 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19668&view=rev Modified: haiku/trunk/src/kits/support/String.cpp Log: Remove all the user API comments. There are still some superfluous comments (the name of every function before every function), but the person that coded this class should decide which are superfluous and which aren't. Modified: haiku/trunk/src/kits/support/String.cpp =================================================================== --- haiku/trunk/src/kits/support/String.cpp 2007-01-01 18:09:20 UTC (rev 19667) +++ haiku/trunk/src/kits/support/String.cpp 2007-01-01 18:40:51 UTC (rev 19668) @@ -1,4 +1,4 @@ -/* +?/* * Copyright 2001-2006, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * @@ -9,7 +9,7 @@ * Axel D?rfler, axeld at pinc-software.de */ -/*! String class supporting common string operations. */ +/* String class supporting common string operations. */ #include @@ -34,7 +34,7 @@ const char *B_EMPTY_STRING = ""; -//! helper function, returns minimum of two given values (but clamps to 0): +// helper function, returns minimum of two given values (but clamps to 0): static inline int32 min_clamp0(int32 num1, int32 num2) { @@ -45,7 +45,7 @@ } -//! helper function, returns length of given string (but clamps to given maximum): +// helper function, returns length of given string (but clamps to given maximum): static inline int32 strlen_clamp(const char* str, int32 max) { // this should yield 0 for max<0: @@ -56,7 +56,7 @@ } -//! helper function, massages given pointer into a legal c-string: +// helper function, massages given pointer into a legal c-string: static inline const char * safestr(const char* str) { @@ -64,7 +64,7 @@ } -//! helper class for BString::_ReplaceAtPositions(): +// helper class for BString::_ReplaceAtPositions(): struct BString::PosVect { PosVect() @@ -140,26 +140,8 @@ // #pragma mark - -/*! - \class BString - \brief String class supporting common string operations - - BString is a string allocation and manipulation class. The object - takes care to allocate and free memory for you, so it will always be - "big enough" to store your strings. - - \author Stefano Ceccherini - \author Lowercase ------------------------------------------------*/ // ToLower -/*! \brief Converts the BString to lowercase - \return This function always returns *this . -*/ BString& BString::ToLower() { @@ -1753,9 +1424,6 @@ // ToUpper -/*! \brief Converts the BString to uppercase - \return This function always returns *this . -*/ BString& BString::ToUpper() { @@ -1769,9 +1437,6 @@ // Capitalize -/*! \brief Converts the first character to uppercase, rest to lowercase - \return This function always returns *this . -*/ BString& BString::Capitalize() { @@ -1790,12 +1455,6 @@ // CapitalizeEachWord -/*! \brief Converts the first character of every word to uppercase, rest to lowercase. - - Converts the first character of every "word" (series of alpabetical characters - separated by non alphabetical characters) to uppercase, and the rest to lowercase. - \return This function always returns *this . -*/ BString& BString::CapitalizeEachWord() { @@ -2310,7 +1969,7 @@ // #pragma mark - backwards compatibility -/*! +/* Translates to (missing const): BString& BString::operator<<(BString& string) */ From nielx at mail.berlios.de Mon Jan 1 19:44:06 2007 From: nielx at mail.berlios.de (nielx at BerliOS) Date: Mon, 1 Jan 2007 19:44:06 +0100 Subject: [Haiku-commits] r19669 - haiku/trunk/src/kits/support Message-ID: <200701011844.l01Ii6r2028404@sheep.berlios.de> Author: nielx Date: 2007-01-01 19:44:06 +0100 (Mon, 01 Jan 2007) New Revision: 19669 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19669&view=rev Modified: haiku/trunk/src/kits/support/String.cpp Log: Fixed a bug where BString::FindLast(char,int32) might be fed an offset that was beyond the Length of the string. Modified: haiku/trunk/src/kits/support/String.cpp =================================================================== --- haiku/trunk/src/kits/support/String.cpp 2007-01-01 18:40:51 UTC (rev 19668) +++ haiku/trunk/src/kits/support/String.cpp 2007-01-01 18:44:06 UTC (rev 19669) @@ -984,7 +984,7 @@ return B_ERROR; const char *start = String(); - const char *end = String() + beforeOffset; + const char *end = String() + min_clamp0(beforeOffset, Length()); /* Scans the string backwards until we found the character, */ /* or we reach the string's start */ From nielx at mail.berlios.de Mon Jan 1 19:47:26 2007 From: nielx at mail.berlios.de (nielx at BerliOS) Date: Mon, 1 Jan 2007 19:47:26 +0100 Subject: [Haiku-commits] r19670 - haiku/trunk/src/kits/support Message-ID: <200701011847.l01IlQsI028931@sheep.berlios.de> Author: nielx Date: 2007-01-01 19:47:23 +0100 (Mon, 01 Jan 2007) New Revision: 19670 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19670&view=rev Modified: haiku/trunk/src/kits/support/String.cpp Log: Remove strange character... Apparently I left some junk. Modified: haiku/trunk/src/kits/support/String.cpp =================================================================== --- haiku/trunk/src/kits/support/String.cpp 2007-01-01 18:44:06 UTC (rev 19669) +++ haiku/trunk/src/kits/support/String.cpp 2007-01-01 18:47:23 UTC (rev 19670) @@ -1,4 +1,4 @@ -?/* +/* * Copyright 2001-2006, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * From axeld at mail.berlios.de Mon Jan 1 20:09:57 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 1 Jan 2007 20:09:57 +0100 Subject: [Haiku-commits] r19671 - haiku/trunk/src/add-ons/kernel/network/stack Message-ID: <200701011909.l01J9v8O000592@sheep.berlios.de> Author: axeld Date: 2007-01-01 20:09:57 +0100 (Mon, 01 Jan 2007) New Revision: 19671 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19671&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp Log: Added temporary possibility to dump a net_buffer via the buffer module. Modified: haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp 2007-01-01 18:47:23 UTC (rev 19670) +++ haiku/trunk/src/add-ons/kernel/network/stack/net_buffer.cpp 2007-01-01 19:09:57 UTC (rev 19671) @@ -1149,6 +1149,6 @@ get_iovecs, count_iovecs, - NULL, // dump + dump_buffer, // dump }; From axeld at mail.berlios.de Mon Jan 1 23:10:44 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 1 Jan 2007 23:10:44 +0100 Subject: [Haiku-commits] r19672 - in haiku/trunk/src/add-ons/kernel/network: datalink_protocols/arp devices/ethernet protocols/ipv4 protocols/tcp protocols/udp stack Message-ID: <200701012210.l01MAiDY025503@sheep.berlios.de> Author: axeld Date: 2007-01-01 23:10:43 +0100 (Mon, 01 Jan 2007) New Revision: 19672 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19672&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/datalink_protocols/arp/arp.cpp haiku/trunk/src/add-ons/kernel/network/devices/ethernet/ethernet.cpp haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp haiku/trunk/src/add-ons/kernel/network/protocols/tcp/BufferQueue.cpp haiku/trunk/src/add-ons/kernel/network/protocols/tcp/EndpointManager.cpp haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp haiku/trunk/src/add-ons/kernel/network/protocols/tcp/tcp.cpp haiku/trunk/src/add-ons/kernel/network/protocols/udp/udp.cpp haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp haiku/trunk/src/add-ons/kernel/network/stack/routes.cpp haiku/trunk/src/add-ons/kernel/network/stack/stack.cpp Log: Calmed down the networking stack a lot - since it basically works, there is no reason to slow it down with debug output that much; this will also help investigating some issues where you just aren't interested in most of the output. Modified: haiku/trunk/src/add-ons/kernel/network/datalink_protocols/arp/arp.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/datalink_protocols/arp/arp.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/datalink_protocols/arp/arp.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -32,7 +32,7 @@ #include -#define TRACE_ARP +//#define TRACE_ARP #ifdef TRACE_ARP # define TRACE(x) dprintf x #else Modified: haiku/trunk/src/add-ons/kernel/network/devices/ethernet/ethernet.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/devices/ethernet/ethernet.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/devices/ethernet/ethernet.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -130,7 +130,7 @@ { ethernet_device *device = (ethernet_device *)_device; -dprintf("try to send ethernet packet of %lu bytes (flags %ld):\n", buffer->size, buffer->flags); +//dprintf("try to send ethernet packet of %lu bytes (flags %ld):\n", buffer->size, buffer->flags); if (buffer->size > device->frame_size || buffer->size < ETHER_HEADER_LENGTH) return B_BAD_VALUE; @@ -156,9 +156,9 @@ struct iovec iovec; gBufferModule->get_iovecs(buffer, &iovec, 1); -dump_block((const char *)iovec.iov_base, buffer->size, " "); +//dump_block((const char *)iovec.iov_base, buffer->size, " "); ssize_t bytesWritten = write(device->fd, iovec.iov_base, iovec.iov_len); -dprintf("sent: %ld\n", bytesWritten); +//dprintf("sent: %ld\n", bytesWritten); if (bytesWritten < 0) { device->stats.send.errors++; Modified: haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -28,7 +28,7 @@ #include -#define TRACE_IPV4 +//#define TRACE_IPV4 #ifdef TRACE_IPV4 # define TRACE(x) dprintf x #else Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/BufferQueue.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/BufferQueue.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/BufferQueue.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -12,7 +12,7 @@ #include -#define TRACE_BUFFER_QUEUE +//#define TRACE_BUFFER_QUEUE #ifdef TRACE_BUFFER_QUEUE # define TRACE(x) dprintf x #else Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/EndpointManager.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/EndpointManager.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/EndpointManager.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -17,7 +17,7 @@ #include -#define TRACE_ENDPOINT_MANAGER +//#define TRACE_ENDPOINT_MANAGER #ifdef TRACE_ENDPOINT_MANAGER # define TRACE(x) dprintf x #else Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -41,7 +41,7 @@ // SACK, Selective Acknowledgment - RFC 2018, RFC 2883, RFC 3517 // Forward RTO-Recovery, RFC 4138 -#define TRACE_TCP +//#define TRACE_TCP #ifdef TRACE_TCP # define TRACE(x) dprintf x #else @@ -380,7 +380,7 @@ * fSendMaxSegmentSize; chunk = gBufferModule->split(buffer, chunkSize); -dprintf(" TCP::Send() split buffer at %lu (buffer size %lu, mss %lu) -> %p\n", chunkSize, socket->send.buffer_size, fSendMaxSegmentSize, chunk); +TRACE((" TCP::Send() split buffer at %lu (buffer size %lu, mss %lu) -> %p\n", chunkSize, socket->send.buffer_size, fSendMaxSegmentSize, chunk)); if (chunk == NULL) return B_NO_MEMORY; } else @@ -475,7 +475,7 @@ RecursiveLocker locker(fLock); -dprintf("read %lu bytes, %lu are available\n", numBytes, fReceiveQueue.Available()); +TRACE(("read %lu bytes, %lu are available\n", numBytes, fReceiveQueue.Available())); if (numBytes < fReceiveQueue.Available()) release_sem_etc(fReceiveLock, 1, B_DO_NOT_RESCHEDULE); @@ -722,7 +722,7 @@ // this is a pure acknowledge segment - we're on the sending end if (fSendUnacknowledged < segment.acknowledge && fSendMax >= segment.acknowledge) { -dprintf("header prediction send!\n"); +TRACE(("header prediction send!\n")); // and it only acknowledges outstanding data // TODO: update RTT estimators @@ -745,11 +745,11 @@ } else if (segment.acknowledge == fSendUnacknowledged && fReceiveQueue.IsContiguous() && fReceiveQueue.Free() >= buffer->size) { -dprintf("header prediction receive!\n"); +TRACE(("header prediction receive!\n")); // we're on the receiving end of the connection, and this segment // is the one we were expecting, in-sequence fReceiveNext += buffer->size; -dprintf("receive next = %lu!\n", (uint32)fReceiveNext); +TRACE(("receive next = %lu!\n", (uint32)fReceiveNext)); fReceiveQueue.Add(buffer, segment.sequence); release_sem_etc(fReceiveLock, 1, B_DO_NOT_RESCHEDULE); @@ -805,7 +805,7 @@ } // remove duplicate data at the start -dprintf("* remove %ld bytes from the start\n", drop); +TRACE(("* remove %ld bytes from the start\n", drop)); gBufferModule->remove_header(buffer, drop); segment.sequence += drop; } @@ -830,7 +830,7 @@ } segment.flags &= ~(TCP_FLAG_FINISH | TCP_FLAG_PUSH); -dprintf("* remove %ld bytes from the end\n", drop); +TRACE(("* remove %ld bytes from the end\n", drop)); gBufferModule->remove_trailer(buffer, drop); } @@ -859,7 +859,7 @@ // TODO: handle this! if (buffer->size == 0 && advertisedWindow == fSendWindow && (segment.flags & TCP_FLAG_FINISH) == 0) { - dprintf("duplicate ack!\n"); +TRACE(("duplicate ack!\n")); fDuplicateAcknowledgeCount++; gStackModule->cancel_timer(&fRetransmitTimer); @@ -876,10 +876,10 @@ // there is no outstanding data to be acknowledged // TODO: if the transmit timer function is already waiting // to acquire this endpoint's lock, we should stop it anyway -dprintf("all inflight data ack'd!\n"); +TRACE(("all inflight data ack'd!\n")); gStackModule->cancel_timer(&fRetransmitTimer); } else { -dprintf("set retransmit timer!\n"); +TRACE(("set retransmit timer!\n")); // TODO: set retransmit timer correctly if (!gStackModule->is_timer_active(&fRetransmitTimer)) gStackModule->set_timer(&fRetransmitTimer, 1000000LL); @@ -893,7 +893,7 @@ if (segment.acknowledge > fSendQueue.LastSequence() && fState > ESTABLISHED) { // our TCP_FLAG_FINISH has been acknowledged -dprintf("FIN has been acknowledged!\n"); +TRACE(("FIN has been acknowledged!\n")); switch (fState) { case FINISH_SENT: @@ -923,7 +923,7 @@ // TODO: ignore data *after* FIN if (segment.flags & TCP_FLAG_FINISH) { - dprintf("peer is finishing connection!"); +TRACE(("peer is finishing connection!")); fReceiveNext++; fFlags |= FLAG_NO_RECEIVE; @@ -966,7 +966,7 @@ if (buffer->size > 0) { if (fReceiveNext == segment.sequence) fReceiveNext += buffer->size; -dprintf("adding data, receive next = %lu!\n", (uint32)fReceiveNext); +TRACE(("adding data, receive next = %lu!\n", (uint32)fReceiveNext)); fReceiveQueue.Add(buffer, segment.sequence); release_sem_etc(fReceiveLock, 1, B_DO_NOT_RESCHEDULE); Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/tcp.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/tcp.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/tcp.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -29,7 +29,7 @@ #include #include -#define TRACE_TCP +//#define TRACE_TCP #ifdef TRACE_TCP # define TRACE(x) dprintf x # define TRACE_BLOCK(x) dump_block x @@ -298,7 +298,7 @@ #if 0 -void +static void dump_tcp_header(tcp_header &header) { dprintf(" source port: %u\n", ntohs(header.source_port)); @@ -528,6 +528,7 @@ AddressString(gDomain, (sockaddr *)&buffer->source, true).Data(), AddressString(gDomain, (sockaddr *)&buffer->destination, true).Data())); //dump_tcp_header(header); + //gBufferModule->dump(buffer); tcp_segment_header segment; segment.sequence = header.Sequence(); Modified: haiku/trunk/src/add-ons/kernel/network/protocols/udp/udp.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/udp/udp.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/protocols/udp/udp.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -27,7 +27,7 @@ #include -#define TRACE_UDP +//#define TRACE_UDP #ifdef TRACE_UDP # define TRACE(x) dprintf x # define TRACE_BLOCK(x) dump_block x Modified: haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -49,7 +49,7 @@ net_buffer *buffer; status = device->module->receive_data(device, &buffer); if (status == B_OK) { - dprintf("received buffer of %ld bytes length\n", buffer->size); + //dprintf("received buffer of %ld bytes length\n", buffer->size); tries = 0; // feed device monitors @@ -354,8 +354,8 @@ net_interface *interface = route->interface; net_domain *domain = interface->domain; - dprintf("send buffer (%ld bytes) to interface %s (route flags %lx)\n", - buffer->size, interface->name, route->flags); + //dprintf("send buffer (%ld bytes) to interface %s (route flags %lx)\n", + // buffer->size, interface->name, route->flags); if (route->flags & RTF_REJECT) return ENETUNREACH; Modified: haiku/trunk/src/add-ons/kernel/network/stack/routes.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/routes.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/stack/routes.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -27,7 +27,7 @@ #include -#define TRACE_ROUTES +//#define TRACE_ROUTES #ifdef TRACE_ROUTES # define TRACE(x) dprintf x #else Modified: haiku/trunk/src/add-ons/kernel/network/stack/stack.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/stack.cpp 2007-01-01 19:09:57 UTC (rev 19671) +++ haiku/trunk/src/add-ons/kernel/network/stack/stack.cpp 2007-01-01 22:10:43 UTC (rev 19672) @@ -31,7 +31,7 @@ #include -#define TRACE_STACK +//#define TRACE_STACK #ifdef TRACE_STACK # define TRACE(x) dprintf x #else @@ -314,9 +314,11 @@ // TODO: check if this makes a good hash... #define HASH(o) ((uint32)(((o)->family) ^ ((o)->type) ^ ((o)->protocol)) % range) +#if 0 TRACE(("%d.%d.%d: Hash: %lu\n", chain ? chain->family : key->family, chain ? chain->type : key->type, chain ? chain->protocol : key->protocol, chain ? HASH(chain) : HASH(key))); +#endif if (chain != NULL) return HASH(chain); From axeld at mail.berlios.de Tue Jan 2 01:16:33 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 2 Jan 2007 01:16:33 +0100 Subject: [Haiku-commits] r19673 - haiku/trunk/src/add-ons/kernel/network/protocols/ipv4 Message-ID: <200701020016.l020GXrV017495@sheep.berlios.de> Author: axeld Date: 2007-01-02 01:16:32 +0100 (Tue, 02 Jan 2007) New Revision: 19673 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19673&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp Log: Added support for IP_TOS and IP_TTL options. Modified: haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp 2007-01-01 22:10:43 UTC (rev 19672) +++ haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp 2007-01-02 00:16:32 UTC (rev 19673) @@ -127,6 +127,8 @@ struct ipv4_protocol : net_protocol { RawSocket *raw; + uint8 service_type; + uint8 time_to_live; uint32 flags; }; @@ -670,6 +672,8 @@ return NULL; protocol->raw = NULL; + protocol->service_type = 0; + protocol->time_to_live = 254; protocol->flags = 0; return protocol; } @@ -773,7 +777,26 @@ return user_memcpy(value, &headerIncluded, sizeof(headerIncluded)); } + case IP_TTL: + { + if (*_length != sizeof(int)) + return B_BAD_VALUE; + + int timeToLive = protocol->time_to_live; + return user_memcpy(value, &timeToLive, sizeof(timeToLive)); + } + + case IP_TOS: + { + if (*_length != sizeof(int)) + return B_BAD_VALUE; + + int serviceType = protocol->service_type; + return user_memcpy(value, &serviceType, sizeof(serviceType)); + } + default: + dprintf("IPv4::control(): get unknown option: %d\n", option); return ENOPROTOOPT; } } else { @@ -795,7 +818,32 @@ break; } + case IP_TTL: + { + int timeToLive; + if (*_length != sizeof(int)) + return B_BAD_VALUE; + if (user_memcpy(&timeToLive, value, sizeof(timeToLive)) < B_OK) + return B_BAD_ADDRESS; + + protocol->time_to_live = timeToLive; + break; + } + + case IP_TOS: + { + int serviceType; + if (*_length != sizeof(int)) + return B_BAD_VALUE; + if (user_memcpy(&serviceType, value, sizeof(serviceType)) < B_OK) + return B_BAD_ADDRESS; + + protocol->service_type = serviceType; + break; + } + default: + dprintf("IPv4::control(): set unknown option: %d\n", option); return ENOPROTOOPT; } } @@ -876,11 +924,11 @@ header.version = IP_VERSION; header.header_length = sizeof(ipv4_header) >> 2; - header.service_type = 0; + header.service_type = protocol ? protocol->service_type : 0; header.total_length = htons(buffer->size); header.id = htons(atomic_add(&sPacketID, 1)); header.fragment_offset = 0; - header.time_to_live = 254; + header.time_to_live = protocol ? protocol->time_to_live : 254; header.protocol = protocol ? protocol->socket->protocol : buffer->protocol; header.checksum = 0; if (route->interface->address != NULL) { From axeld at mail.berlios.de Tue Jan 2 02:39:19 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 2 Jan 2007 02:39:19 +0100 Subject: [Haiku-commits] r19674 - haiku/trunk/src/bin/network/ftp Message-ID: <200701020139.l021dJnG027429@sheep.berlios.de> Author: axeld Date: 2007-01-02 02:39:18 +0100 (Tue, 02 Jan 2007) New Revision: 19674 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19674&view=rev Modified: haiku/trunk/src/bin/network/ftp/Jamfile Log: We already link against libncurses.a - no need for libtermcap.a as well. Modified: haiku/trunk/src/bin/network/ftp/Jamfile =================================================================== --- haiku/trunk/src/bin/network/ftp/Jamfile 2007-01-02 00:16:32 UTC (rev 19673) +++ haiku/trunk/src/bin/network/ftp/Jamfile 2007-01-02 01:39:18 UTC (rev 19674) @@ -21,7 +21,7 @@ progressbar.c ruserpass.c util.c - : libtermcap.a libedit.a libncurses.a libutil.a libbsd.so $(NETWORK_LIBS) + : libedit.a libncurses.a libutil.a libbsd.so $(NETWORK_LIBS) ; # Installation -- in the test directory for the time being From axeld at mail.berlios.de Tue Jan 2 02:43:12 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 2 Jan 2007 02:43:12 +0100 Subject: [Haiku-commits] r19675 - haiku/trunk/src/libs/ncurses/include Message-ID: <200701020143.l021hCGU027768@sheep.berlios.de> Author: axeld Date: 2007-01-02 02:43:11 +0100 (Tue, 02 Jan 2007) New Revision: 19675 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19675&view=rev Modified: haiku/trunk/src/libs/ncurses/include/curses.h haiku/trunk/src/libs/ncurses/include/ncurses_cfg.h Log: * Since we don't have a terminfo database installed, we need to enable termcap support. "ftp" will now accept the terminal type beterm, even though our /etc/termcap file causes ncurses to print some warnings. * Unlike BeOS, we do have stdbool.h, so we should use it. Modified: haiku/trunk/src/libs/ncurses/include/curses.h =================================================================== --- haiku/trunk/src/libs/ncurses/include/curses.h 2007-01-02 01:39:18 UTC (rev 19674) +++ haiku/trunk/src/libs/ncurses/include/curses.h 2007-01-02 01:43:11 UTC (rev 19675) @@ -69,7 +69,7 @@ * User-definable tweak to disable the include of . */ #ifndef NCURSES_ENABLE_STDBOOL_H -#define NCURSES_ENABLE_STDBOOL_H 0 +#define NCURSES_ENABLE_STDBOOL_H 1 #endif /* Modified: haiku/trunk/src/libs/ncurses/include/ncurses_cfg.h =================================================================== --- haiku/trunk/src/libs/ncurses/include/ncurses_cfg.h 2007-01-02 01:39:18 UTC (rev 19674) +++ haiku/trunk/src/libs/ncurses/include/ncurses_cfg.h 2007-01-02 01:43:11 UTC (rev 19675) @@ -53,8 +53,10 @@ #define USE_DATABASE 1 #define TERMINFO_DIRS "/usr/local/share/terminfo" #define TERMINFO "/usr/local/share/terminfo" +#define TERMPATH "/etc/termcap" #define HAVE_BIG_CORE 1 -#define PURE_TERMINFO 1 +#define PURE_TERMINFO 0 +#define USE_TERMCAP 1 #define USE_HOME_TERMINFO 1 #define USE_ROOT_ENVIRON 1 #define HAVE_REMOVE 1 From jackburton at mail.berlios.de Tue Jan 2 08:03:11 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Tue, 2 Jan 2007 08:03:11 +0100 Subject: [Haiku-commits] r19676 - haiku/trunk/src/bin Message-ID: <200701020703.l0273BLP029679@sheep.berlios.de> Author: jackburton Date: 2007-01-02 08:03:11 +0100 (Tue, 02 Jan 2007) New Revision: 19676 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19676&view=rev Modified: haiku/trunk/src/bin/isvolume.cpp Log: now returns 1 in case of error, not -1, as Korli asked. Modified: haiku/trunk/src/bin/isvolume.cpp =================================================================== --- haiku/trunk/src/bin/isvolume.cpp 2007-01-02 01:43:11 UTC (rev 19675) +++ haiku/trunk/src/bin/isvolume.cpp 2007-01-02 07:03:11 UTC (rev 19676) @@ -64,14 +64,14 @@ else { fprintf(stderr, "%s: option %s is not understood (use --help for help)\n", argv[0], argv[i]); - return -1; + return 1; } } else { volumeDevice = dev_for_path(argv[i]); if (volumeDevice < 0) { fprintf(stderr, "%s: can't get information about volume: %s\n", argv[0], argv[i]); - return -1; + return 1; } } } @@ -85,6 +85,6 @@ return 0; } else { fprintf(stderr, "%s: can't get information about dev_t: %ld\n", argv[0], volumeDevice); - return -1; + return 1; } } From darkwyrm at mail.berlios.de Tue Jan 2 18:50:53 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 2 Jan 2007 18:50:53 +0100 Subject: [Haiku-commits] r19677 - haiku/trunk/src/kits/mail Message-ID: <200701021750.l02HorDJ026919@sheep.berlios.de> Author: darkwyrm Date: 2007-01-02 18:50:45 +0100 (Tue, 02 Jan 2007) New Revision: 19677 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19677&view=rev Modified: haiku/trunk/src/kits/mail/ErrorLogWindow.cpp Log: Remove stray carriage returns. Modified: haiku/trunk/src/kits/mail/ErrorLogWindow.cpp =================================================================== --- haiku/trunk/src/kits/mail/ErrorLogWindow.cpp 2007-01-02 07:03:11 UTC (rev 19676) +++ haiku/trunk/src/kits/mail/ErrorLogWindow.cpp 2007-01-02 17:50:45 UTC (rev 19677) @@ -145,10 +145,13 @@ array.runs[0].font = *be_bold_font; array.runs[0].color = HighColor(); + BString msgString(message); + msgString.RemoveAll("\r"); + BTextView *view = new BTextView(BRect(20,0,rect.Width(),rect.Height()),"error_display",BRect(0,3,rect.Width() - 20 - 3,LONG_MAX),B_FOLLOW_ALL_SIDES); view->SetLowColor(bkg); view->SetViewColor(bkg); - view->SetText(message); + view->SetText(msgString.String()); view->MakeSelectable(true); view->SetStylable(true); view->MakeEditable(false); From darkwyrm at mail.berlios.de Tue Jan 2 20:01:01 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 2 Jan 2007 20:01:01 +0100 Subject: [Haiku-commits] r19678 - haiku/trunk/src/preferences/mail Message-ID: <200701021901.l02J11if002613@sheep.berlios.de> Author: darkwyrm Date: 2007-01-02 20:01:00 +0100 (Tue, 02 Jan 2007) New Revision: 19678 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19678&view=rev Modified: haiku/trunk/src/preferences/mail/ConfigWindow.cpp Log: A couple of capitalization fixes Modified: haiku/trunk/src/preferences/mail/ConfigWindow.cpp =================================================================== --- haiku/trunk/src/preferences/mail/ConfigWindow.cpp 2007-01-02 17:50:45 UTC (rev 19677) +++ haiku/trunk/src/preferences/mail/ConfigWindow.cpp 2007-01-02 19:01:00 UTC (rev 19678) @@ -331,12 +331,12 @@ rect.OffsetBy(0,height + 9); rect.bottom -= 2; fPPPActiveCheckBox = new BCheckBox(rect,"ppp active", - MDR_DIALECT_CHOICE ("Only When Dial-Up Is Connected","PPP??????"), NULL); + MDR_DIALECT_CHOICE ("Only When Dial-Up is Connected","PPP??????"), NULL); box->AddChild(fPPPActiveCheckBox); rect.OffsetBy(0,height + 9); rect.bottom -= 2; fPPPActiveSendCheckBox = new BCheckBox(rect,"ppp activesend", - MDR_DIALECT_CHOICE ("Schedule Outgoing Mail When Dial-Up Is Disconnected","PPP?????????????????"), NULL); + MDR_DIALECT_CHOICE ("Schedule Outgoing Mail When Dial-Up is Disconnected","PPP?????????????????"), NULL); box->AddChild(fPPPActiveSendCheckBox); // Miscellaneous settings box From darkwyrm at mail.berlios.de Tue Jan 2 20:48:43 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 2 Jan 2007 20:48:43 +0100 Subject: [Haiku-commits] r19679 - haiku/trunk/src/apps/deskbar Message-ID: <200701021948.l02Jmhcq007861@sheep.berlios.de> Author: darkwyrm Date: 2007-01-02 20:48:43 +0100 (Tue, 02 Jan 2007) New Revision: 19679 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19679&view=rev Modified: haiku/trunk/src/apps/deskbar/BarApp.cpp haiku/trunk/src/apps/deskbar/BeMenu.cpp Log: Tweaked a couple of menu labels to make more sense under Haiiku Modified: haiku/trunk/src/apps/deskbar/BarApp.cpp =================================================================== --- haiku/trunk/src/apps/deskbar/BarApp.cpp 2007-01-02 19:01:00 UTC (rev 19678) +++ haiku/trunk/src/apps/deskbar/BarApp.cpp 2007-01-02 19:48:43 UTC (rev 19679) @@ -694,7 +694,11 @@ get_ref_for_path(path.Path(), &startref); fConfigWindow = new TFavoritesConfigWindow(BRect(0, 0, 320, 240), +#ifdef __HAIKU__ + "Configure Leaf Menu", false, B_ANY_NODE, +#else "Configure Be Menu", false, B_ANY_NODE, +#endif BMessenger(this), &startref, fSettings.recentAppsCount, fSettings.recentDocsCount, fSettings.recentFoldersCount); Modified: haiku/trunk/src/apps/deskbar/BeMenu.cpp =================================================================== --- haiku/trunk/src/apps/deskbar/BeMenu.cpp 2007-01-02 19:01:00 UTC (rev 19678) +++ haiku/trunk/src/apps/deskbar/BeMenu.cpp 2007-01-02 19:48:43 UTC (rev 19679) @@ -271,7 +271,11 @@ BMenu *subMenu = new BMenu("Deskbar Settings"); subMenu->SetEnabled(!dragging); +#ifdef __HAIKU__ + item = new BMenuItem("Configure Leaf Menu"B_UTF8_ELLIPSIS, new BMessage(msg_config_db)); +#else item = new BMenuItem("Configure Be Menu"B_UTF8_ELLIPSIS, new BMessage(msg_config_db)); +#endif item->SetTarget(be_app); subMenu->AddItem(item); From darkwyrm at mail.berlios.de Tue Jan 2 21:16:22 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 2 Jan 2007 21:16:22 +0100 Subject: [Haiku-commits] r19680 - haiku/trunk/src/preferences/mail Message-ID: <200701022016.l02KGMrA010677@sheep.berlios.de> Author: darkwyrm Date: 2007-01-02 21:16:21 +0100 (Tue, 02 Jan 2007) New Revision: 19680 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19680&view=rev Modified: haiku/trunk/src/preferences/mail/Account.cpp Log: Automatically select the main item for a newly-created account Modified: haiku/trunk/src/preferences/mail/Account.cpp =================================================================== --- haiku/trunk/src/preferences/mail/Account.cpp 2007-01-02 19:48:43 UTC (rev 19679) +++ haiku/trunk/src/preferences/mail/Account.cpp 2007-01-02 20:16:21 UTC (rev 19680) @@ -650,6 +650,9 @@ Account *account = new Account(); gAccounts.AddItem(account); account->AddToListView(); + + if (gListView) + gListView->Select(gListView->IndexOf(account->fAccountItem)); } From darkwyrm at mail.berlios.de Tue Jan 2 22:10:22 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 2 Jan 2007 22:10:22 +0100 Subject: [Haiku-commits] r19681 - haiku/trunk/src/apps/bemail Message-ID: <200701022110.l02LAMhr016718@sheep.berlios.de> Author: darkwyrm Date: 2007-01-02 22:10:22 +0100 (Tue, 02 Jan 2007) New Revision: 19681 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19681&view=rev Modified: haiku/trunk/src/apps/bemail/FindWindow.cpp haiku/trunk/src/apps/bemail/FindWindow.h haiku/trunk/src/apps/bemail/Jamfile Log: Removed an ugly hack - using a BTextView for a BTextControl Fixed font sensitivity Removed the now-unsused DialogTextView class Escape key now closes the window (for free, from AutoTextControl class) Modified: haiku/trunk/src/apps/bemail/FindWindow.cpp =================================================================== --- haiku/trunk/src/apps/bemail/FindWindow.cpp 2007-01-02 20:16:21 UTC (rev 19680) +++ haiku/trunk/src/apps/bemail/FindWindow.cpp 2007-01-02 21:10:22 UTC (rev 19681) @@ -39,6 +39,7 @@ #include "FindWindow.h" #include "Mail.h" +#include "AutoTextControl.h" #include #include @@ -48,6 +49,10 @@ #include +enum { + M_FIND_STRING_CHANGED = 'fsch' +}; + void TextBevel(BView& view, BRect r); // ============================================================================ @@ -116,22 +121,20 @@ : BBox(rect, "FindPanel", B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW) { - BRect r = Bounds(); - r.InsetBy(8,8); - r.bottom -= 44; - BRect text = r; - text.OffsetTo(B_ORIGIN); - text.InsetBy(2,2); + BRect r = Bounds().InsetByCopy(10,10); - mBTextView = new DialogTextView(r,"BTextView",text,B_FOLLOW_ALL,B_WILL_DRAW); - mBTextView->DisallowChar('\n'); - mBTextView->SetText(sPreviousFind.String()); - mBTextView->MakeFocus(); - AddChild(mBTextView); + mBTextControl = new AutoTextControl(r,"BTextControl",NULL,sPreviousFind.String(), + new BMessage(M_FIND_STRING_CHANGED), + B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); + mBTextControl->SetText(sPreviousFind.String()); + mBTextControl->MakeFocus(); + mBTextControl->SetEscapeCancel(true); + AddChild(mBTextControl); mFindButton = new BButton(BRect(0,0,90,20),"FINDBUTTON", MDR_DIALECT_CHOICE ("Find","??"), new BMessage(FINDBUTTON),B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); + mFindButton->ResizeToPreferred(); AddChild(mFindButton); r = mFindButton->Bounds(); @@ -142,7 +145,7 @@ FindPanel::~FindPanel() { - sPreviousFind = mBTextView->Text(); + sPreviousFind = mBTextControl->Text(); } void FindPanel::AttachedToWindow() @@ -151,8 +154,13 @@ SetViewColor(216,216,216); Window()->SetDefaultButton(mFindButton); mFindButton->SetTarget(this); - mBTextView->MakeFocus(true); - mBTextView->SelectAll(); + + mBTextControl->SetTarget(this); + mBTextControl->ResizeToPreferred(); + mBTextControl->ResizeTo(Bounds().Width() - 20, mBTextControl->Frame().Height()); + + mBTextControl->MakeFocus(true); + mBTextControl->TextView()->SelectAll(); } void FindPanel::MouseDown(BPoint point) @@ -163,12 +171,12 @@ void FindPanel::Draw(BRect) { - TextBevel(*this,mBTextView->Frame()); +// TextBevel(*this,mBTextView->Frame()); } void FindPanel::KeyDown(const char *, int32) { - int32 length = mBTextView->TextLength(); + int32 length = mBTextControl->TextView()->TextLength(); bool enabled = mFindButton->IsEnabled(); if (length > 0 && !enabled) @@ -180,10 +188,18 @@ void FindPanel::MessageReceived(BMessage *msg) { switch (msg->what) { - case FINDBUTTON: + case M_FIND_STRING_CHANGED: { + if (strlen(mBTextControl->Text()) == 0) + mFindButton->SetEnabled(false); + else + mFindButton->SetEnabled(true); + break; + } + case FINDBUTTON: { Find(); Window()->PostMessage(B_QUIT_REQUESTED); break; + } default: BView::MessageReceived(msg); } @@ -191,8 +207,8 @@ void FindPanel::Find() { - mBTextView->SelectAll(); - const char *text = mBTextView->Text(); + mBTextControl->TextView()->SelectAll(); + const char *text = mBTextControl->Text(); if (text == NULL || text[0] == 0) return; BWindow *window = NULL; @@ -259,38 +275,3 @@ { return sPreviousFind.String(); } - - -DialogTextView::DialogTextView(BRect frame, const char *name, BRect textRect, - uint32 resizingMode, uint32 flags) - : BTextView(frame, name, textRect, resizingMode, flags) -{ -} - -void DialogTextView::KeyDown(const char *bytes, int32 numBytes) -{ - BTextView::KeyDown(bytes, numBytes); - if (Parent()) - Parent()->KeyDown(bytes, numBytes); -} - -void DialogTextView::MouseDown(BPoint point) -{ - Window()->Activate(); - BTextView::MouseDown(point); -} - -void DialogTextView::InsertText(const char *inText, int32 inLength, int32 inOffset, - const text_run_array *inRuns) -{ - BTextView::InsertText(inText, inLength, inOffset, inRuns); - if (Parent()) - Parent()->KeyDown(NULL, 0); -} - -void DialogTextView::DeleteText(int32 fromOffset, int32 toOffset) -{ - BTextView::DeleteText(fromOffset, toOffset); - if (Parent()) - Parent()->KeyDown(NULL, 0); -} Modified: haiku/trunk/src/apps/bemail/FindWindow.h =================================================================== --- haiku/trunk/src/apps/bemail/FindWindow.h 2007-01-02 20:16:21 UTC (rev 19680) +++ haiku/trunk/src/apps/bemail/FindWindow.h 2007-01-02 21:10:22 UTC (rev 19681) @@ -42,10 +42,10 @@ #include #include -#include #include class FindPanel; +class AutoTextControl; // ============================================================================ // Floating find window, just one of them..... @@ -85,21 +85,10 @@ protected: BButton* mFindButton; - BTextView* mBTextView; + AutoTextControl* mBTextControl; }; -class DialogTextView : public BTextView { -public: - DialogTextView(BRect frame, const char *name, BRect textRect, - uint32 resizingMode, uint32 flags); - virtual void KeyDown(const char *bytes, int32 numBytes); - virtual void MouseDown(BPoint point); - virtual void InsertText(const char *inText, int32 inLength, - int32 inOffset, const text_run_array *inRuns); - virtual void DeleteText(int32 fromOffset, int32 toOffset); -}; - // ============================================================================ #endif // #ifndef _FINDWINDOW_H Modified: haiku/trunk/src/apps/bemail/Jamfile =================================================================== --- haiku/trunk/src/apps/bemail/Jamfile 2007-01-02 20:16:21 UTC (rev 19680) +++ haiku/trunk/src/apps/bemail/Jamfile 2007-01-02 21:10:22 UTC (rev 19681) @@ -12,6 +12,7 @@ AddResources BeMail : BeMail.rdef pictures.rdef ; Application BeMail : + AutoTextControl.cpp BmapButton.cpp ButtonBar.cpp ComboBox.cpp From marcusoverhagen at arcor.de Tue Jan 2 22:11:29 2007 From: marcusoverhagen at arcor.de (Marcus Overhagen) Date: Tue, 2 Jan 2007 22:11:29 +0100 (CET) Subject: [Haiku-commits] r19678 - haiku/trunk/src/preferences/mail In-Reply-To: <200701021901.l02J11if002613@sheep.berlios.de> References: <200701021901.l02J11if002613@sheep.berlios.de> Message-ID: <9541051.1167772289832.JavaMail.ngmail@webmail14> Why are you changing this to a lower case is? > - MDR_DIALECT_CHOICE ("Only When Dial-Up Is Connected","PPP??????"), NULL); > + MDR_DIALECT_CHOICE ("Only When Dial-Up is Connected","PPP??????"), NULL); Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: g?nstig und schnell mit DSL - das All-Inclusive-Paket f?r clevere Doppel-Sparer, nur 44,85 ? inkl. DSL- und ISDN-Grundgeb?hr! http://www.arcor.de/rd/emf-dsl-2 From darkwyrm at mail.berlios.de Tue Jan 2 22:12:01 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 2 Jan 2007 22:12:01 +0100 Subject: [Haiku-commits] r19682 - haiku/trunk/src/documentation/haiku_user_guide Message-ID: <200701022112.l02LC1m0016854@sheep.berlios.de> Author: darkwyrm Date: 2007-01-02 22:12:01 +0100 (Tue, 02 Jan 2007) New Revision: 19682 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19682&view=rev Modified: haiku/trunk/src/documentation/haiku_user_guide/HaikuUserGuide.txt Log: Added a couple chapters and some revisions Modified: haiku/trunk/src/documentation/haiku_user_guide/HaikuUserGuide.txt =================================================================== --- haiku/trunk/src/documentation/haiku_user_guide/HaikuUserGuide.txt 2007-01-02 21:10:22 UTC (rev 19681) +++ haiku/trunk/src/documentation/haiku_user_guide/HaikuUserGuide.txt 2007-01-02 21:12:01 UTC (rev 19682) @@ -10,17 +10,14 @@ Working with Files Opening & Saving Archives - Different Kinds of Files Drag and Drop -Chapter 3: Getting Things Done - E-Mail +Chapter 3: E-Mail + +Chapter 4: Getting Things Done The World Wide Web - Working with Pictures - Gotta Have My Music - Video + Gotta Have My Music and Movies Keeping an Address Book - Keep Your System Running Smoothly Customizing Haiku: Preferences and Tweaks Chapter 4: Beyond Your Four Walls -- Haiku Out There @@ -45,6 +42,7 @@ Queries Workspaces Tracker Add-ons + Filesystems Chapter 6: Installation Before You Install @@ -64,64 +62,69 @@ What is Haiku? - Haiku is a free operating system designed to get the most out of your computer without requiring you to have a degree in Computer Science. The inner workings of Haiku are designed for ease of use and for speed. If you go back to working with Windows or Linux after using Haiku for quite a while, it will probably feel much slower than it did before. Working with audio and video are easier than elsewhere + Haiku is a free operating system designed to get the most out of your computer without requiring you to have a degree in Computer Science. The inner workings of Haiku are designed for ease of use and speed. In fact, if you go back to working with Windows or Linux after using Haiku for quite a while, it will probably feel much slower than it did before. Working with audio and video are easier than elsewhere Why Haiku? - You may have heard of a kind of software called an operating system. Operating systems are a piece of software that handles all the technical ugliness that goes with working with the computer's hardware components. It also determines the way that programmers will write programs and provides certain services for them. Here are some reasons why Haiku is better: + You may or may not have heard of a kind of software called an operating system. Operating systems are a piece of software that handles all the technical ugliness that goes with working with the computer's hardware components. It also determines the way that programmers will write programs and provides certain services for them. Here are some reasons why Haiku is better: -Fast - Every program is written so that more things are done at the same time. In this day of processors with more than one core, Haiku uses all of them in a way to add even more speed to programs than in other operating systems. Each program even handles more than one task at the same time. It makes programming a little more complicated, but the results are worth it - a much smoother experience and it even *feels* faster. +Fast - Every program is written so that more things are done at the same time. In this day of processors with more than one core, Haiku uses all of them in a way to add even more speed to programs than in other operating systems. Each program even handles more than one task at the same time. It makes programming a little more complicated, but the results are worth it: programs are noticeably faster and you have a much smoother experience. -Usable - Marketing departments put "easy to use" or "intuitive" on packaging when their software really isn't. Haiku may not always be perfect, but it does carry remarkable ease-of-use for everyone. +Usable - Marketing departments put "easy to use" or "intuitive" on packaging even when their software really isn't. Haiku may have quirks, but it does have remarkable ease-of-use for everyone. -Free - Haiku truly is a gift for each one of us who are sick and tired of paying too much money for software that makes our lives harder instead of easier. Programmers can even take the files used to make Haiku for any purpose they want as long as they mention that they started with Haiku code. +Free - Haiku truly is a gift for each one of us who are sick and tired of paying too much money for software that makes our lives harder instead of easier. Programmers can even take the files that are used to make Haiku and use them for any purpose they want as long as they mention that they started with Haiku code. History of BeOS and Haiku -In 1990, ex-Apple employees Jean-Louis Gass?e and Steve Sakoman created a company: Be Incorporated. Be, Inc. was founded with a purpose in mind: to create a powerful, elegant, media-oriented, friendly computer that addressed the user's needs. They manufactured a product to tackle these goals head-on: a personal computer called the BeBox. This computer and its operating system, the BeOS, were first presented at Agenda 95 in October, 1995. The audience was elated. +In 1990, ex-Apple employees Jean-Louis Gass?e and Steve Sakoman created a company: Be Incorporated. It was founded with a purpose in mind: to create a powerful, elegant, media-oriented, friendly computer that addressed the user's needs. They manufactured a product to tackle these goals head-on: a personal computer called the BeBox. This computer and its operating system, the BeOS, were first presented at Agenda 95 in October, 1995. The audience was elated. -The BeBox and BeOS were outfitted with features that were never seen before in the world of personal computing. The BeBox contained two processors and three additional chips dedicated to sound processing to provide a fast platform for video and audio. In the back of the BeBox was a feature of particular interest to computer enthusiasts and developers -- the GeekPort, which was a multi-purpose port for experimentation. +The BeBox and BeOS had features that were never before seen in the world of personal computing. The BeBox contained two processors and three additional chips dedicated to sound processing to provide a fast platform for video and audio. In the back of the BeBox was a feature of particular interest to computer enthusiasts and developers -- the GeekPort, which was a multi-purpose port intended for experimentation. -The operating system, BeOS, was equally packed with features. Its design was attractive to many, and its yellow tabbed windows distinguished it from the Macintosh and regular PCs. For many people, it was an operating system that was easy to fall in love with. +The operating system, BeOS, was equally packed with features. Its design was attractive to many and its yellow tabbed windows distinguished it from the Macintosh and regular PCs. For many people, it was an operating system that was easy to fall in love with. Unfortunately, Be, Inc. abandoned its stake in the hardware market because of low sales and hardware supply problems. The BeOS was then modified to work on Apple Macintosh systems in 1997 and again to regular PCs in 1998. Although it had many enthusiastic users and developers, it never gained a significant market share for a variety of reasons which included a lack of third party programs, hardware support, and Microsoft's business tactics. In 2000, BeOS saw its fifth release in two versions: a Pro Edition and a Personal Edition. The Personal Edition didn't have quite as much software included as the Pro Edition, but it was free for anyone to download. This undermined the sales of the Pro Edition, increasing Be's financial difficulties. The company shifted its focus to attempt to use BeOS in Internet appliances. Some claim that this decision eroded the credibility of BeOS as a viable alternative to Windows or Linux. Be, Inc. filed for bankruptcy in 2001 and soon after sold its intellectual property to Palm, Inc. -Be Inc. left behind a legacy: a community of dedicated and loyal users who continued to use BeOS despite the demise of its parent company. Some people added support for newer hardware and others wrote software to keep it current. +Be, Inc. left behind a legacy: a community of dedicated and loyal users who continued to use BeOS despite the demise of its parent company. Some people added support for newer hardware and others wrote software to keep it current. -Others wanted to recreate the entire operating system. Michael Phipps was one of them and in August 2001, he founded the only one of several projects started with the intention of reviving BeOS. The project was called OpenBeOS. Not only was OpenBeOS going to rewrite the operating system, but it also had the ambitious goal of programs written for BeOS run unmodified on the new software. In June of the following year, OpenBeOS held a convention in Columbus, Ohio where talks were given and a new name for the project was announced: Haiku. +Others wanted to recreate the entire operating system. Michael Phipps was one of them and in August 2001, he founded one of several projects started with the intention of reviving BeOS. The project was called OpenBeOS. Not only was OpenBeOS going to rewrite the operating system, but it also had the ambitious goal of writing it so that programs written for BeOS would run unmodified on the new software. In June of the following year, OpenBeOS held a convention in Columbus, Ohio where talks were given and a new name for the project was announced: Haiku. The rest, as is often said, is history. + Chapter 2: Getting to Know Haiku The Desktop: Tracker and the Deskbar - Tracker and Deskbar are two programs that tend to fade into the background even though they are used all the time because they are used for starting programs and moving files around. Tracker shows all the icons on the desktop and shows the different windows with files and folders in them. Deskbar is the big gray box which shows the time and programs running and also is home to the Applications and Preferences menus. It is a close cousin to the Start Menu and task bar in Windows operating systems. In this chapter, we will be examining these two programs in order to effectively and comfortably work with the system in day-to-day tasks. + Tracker and Deskbar are the two most-used programs that a person will use with Haiku. They tend to fade into the background, however, because they are used for starting programs and managing files. Tracker provides the icons on the desktop and shows the different windows with files and folders in them. Deskbar could be compared to the Windows Start Menu -- it is the big gray box which shows the time and programs running and also is home to the Applications and Preferences menus. In this chapter, we will be examining these two programs in order to effectively and comfortably work with the system in day-to-day tasks. The Deskbar What and Why is It? - The Deskbar is a program that helps you start programs, shows you what programs are running, displays the time and date, and gives you an area, called the system tray, which can hold small icons to show information like if you've got mail or how hard the computer is working. If you've used Windows before, this should be relatively familiar, even if you've never done much with it there. - There are three main parts to the Deskbar: the Haiku menu, the system tray, and the list of running programs. Of course, where these parts are on the screen depends on where the Deskbar itself is located. It is possible to have it in any of the four corners of the screen or along the top or bottom edges of the screen. It can also be in an expanded or compacted mode when in one of the screen corners. - Each of the modes are fairly simple to understand. In Compact mode, the only things that are visible are the leaf for the Leaf Menu, a man standing at a blackboard, and the system tray (where the time is shown). Clicking on the blackboard guy shows the list of running programs in a menu. The expanded corner mode is a little bigger -- the little blackboard guy has disappeared and, the Leaf Menu is centered in the window, and no clicking is needed to see the list of running programs. The Edge mode works just like the Windows Start menu -- the Leaf Menu on the left side, the system tray on the right, and list of running programs in the middle. + The Deskbar is a program that helps you start programs, shows you what programs are running, displays the time and date, and gives you an area, called the system tray, for frequently updated information. If you've used Windows before, this will probably be familiar even if you've never done much with it before. + The Deskbar consists of three main parts: the Haiku menu, the system tray, and the list of running programs, but where these parts are on the screen depends on where the Deskbar itself is located. The Deskbar can be in any of the four corners of the screen or along the top or bottom edges of the screen and can also be in an expanded or compacted mode when in one of the screen corners. + Each of the Deskbar's display modes is fairly simple to understand. Compact mode, as the name implies, is intended to take up as little desktop space as possible. All that you will see is the button for the Leaf Menu, a man standing at a blackboard, and the system tray (where the time is shown). Clicking on the blackboard guy shows the list of running programs in a menu. The Expanded corner mode is a little bigger -- the little blackboard guy has disappeared, the Leaf Menu is centered in the window, and no clicking is needed to see the list of running programs. Edge mode works just like the Windows Start menu -- the Leaf Menu on the left side, the system tray on the right, and list of running programs in the middle. The Leaf Menu - "Just click on the leaf." "What??" Yep. A little quirk of Haiku that I'm sure you'll come to appreciate. Linux has the icon du jour. Windows has the Start button. Mac OS X has... the Apple menu. Sort of. Anyway, clicking on the leaf will pop up a menu chock full of useful little items. Let's just go through them one by one. + "Where are all my programs?" + "Just click on the leaf." + "What??" + + Yep. A little quirk of Haiku that I'm sure you'll come to appreciate. Windows has the Start button. Linux has the icon du jour -- the KDE gear, the Gnome footprint, etc. Mac OS X has... the Apple menu. Sort of. Anyway, clicking on the leaf will pop up a menu chock full of useful little items. Let's just go through them one by one. -About Haiku... - This will show the About window for Haiku. The About window shows some nice-to-know information, such as how much RAM your machine has, what kind of processor it has, what version of Haiku you're running, and the people who helped make Haiku possible. +About Haiku... - Unsuprisingly, this will show the About window for Haiku, which contains some nice-to-know information such as how much RAM your machine has, what kind of processor it has, what version of Haiku you're running, and the people who helped make Haiku possible. Find... - This brings up Tracker's Find window, which allows you to search for any files on a BeOS, Haiku, or Zeta disk by using a query. We'll hear more about queries later in Chapter 5. -Show/Hide Replicants - Clicking on this particular menu item shows or hides the little handle used to work with replicants, which are a really neat technology which is covered in-depth in Chapter 5. If you don't care about replicants or what they are, you can just ignore this item and nothing bad will happen. +Show/Hide Replicants - Clicking on this particular menu item shows or hides the little handle used to work with replicants, which are a really neat technology which, like queries, is covered in-depth in Chapter 5. If you don't care about what replicants are or how to use them, you can safely ignore this item. -Deskbar Settings - Items in this submenu are some small ways that you can change how the Deskbar works. We will cover these particulars below. +Deskbar Settings - Items in this submenu are some small ways that you can change how the Deskbar works. We will cover the particulars in a moment. -Restart / Shutdown - These will restart or shut down your computer. Unlike in BeOS, Haiku will ask you if you're really sure you'd like to restart or shut down your system just in case you accidentally clicked either of these menu items. +Restart / Shutdown - These will restart or shut down your computer. Unlike in BeOS, Haiku will ask you if you're really sure you'd like to restart or shut down your system just in case you accidentally clicked on either of these menu items. Recent Documents - This submenu will contain a list of the most recent documents which you have opened in various programs. If you were working with a particular file not that long ago and suddenly need it again, this is an excellent way to bring it back up without starting the app and hunting for it. @@ -132,45 +135,230 @@ The Deskbar Settings Menu -Within the Deskbar is a menu which gives you a few options in its behavior. +Within the Deskbar is a menu which gives you a few choices in how it behaves. -Configure Be Menu - Add or remove folders from the top level of the Be Menu to share space with the Applications and Preferences menus. +Change the Leaf Menu - Add or remove folders from the top level of the Leaf Menu. These folders will share the same space as the Applications and Preferences menus. -Always on Top - The Deskbar cannot be covered by other windows +Always on Top - When checked, the Deskbar cannot be covered by other windows Sort Running Applications - Puts the list of running programs that the Deskbar shows in alphabetical order. Tracker Always First - Always put Tracker first in the list of running programs -24 Hour Clock - Show time in 24-hour time instead of AM / PM. +24 Hour Clock - Show the time in 24-hour time instead of AM / PM. -Show Seconds - Have the time display also show the seconds +Show Seconds - Also show the seconds in the time display. European Date - Clicking on the time shows the date. This makes the date display with the day first instead of the month. Full Date - Show the date with full names instead of just numbers. -Show Application Expander - This feature only works when the Deskbar is placed in a corner (as opposed to somewhere else) and shows the program list without clicking on anything. Enabling this option allows you to show or hide what windows are open in each program just by clicking on a little triangle button. +Show Application Expander - This feature only works in the Expanded mode where the program list is shown without clicking on anything. Enabling this option allows you to show or hide a list of a program's open windows just by clicking on a little triangle button. -Expand New Applications - This works only when Application Expanders are shown. When a new program is started, the open windows are visible by default. +Expand New Applications - This works only when Application Expanders are shown. When a new program is started, the list of open windows is visible by default. The Running Programs List - If you run more than one program at a time, which is quite likely, you will at some point find a need what it provides. By selecting an item in the list in Compact mode or by clicking on an item in the list in Expanded or Edge mode, you can see a list of all the windows belonging to that program. You can also hide, close, or show all of that program's windows. Visible windows will have a little white window with a yellow tab. Hidden program windows will be light gray with a dark gray tab. - A hidden -- but very useful -- feature of the program list is being able to force a misbehaving program to quit. On a standard PC keyboard, it's easy: hold down the left Shift, Control, Alt, and Option (Windows) keys and click on the program you wish to force quit. If you don't have this choice available to you, you can still force quit an program by holding Control and Alt and hitting the Delete key and then using the Team Monitor window to quit a program. + While you certainly can get away with never using the services of the Running Programs list, you can work more easily if you understand how to use it. By selecting an item in the list in Compact mode or by clicking on an item in the list in Expanded or Edge mode, you can see a list of all the windows belonging to a particular program. You can also hide, close, or show all of that program's windows. Visible windows will have a little white window with a yellow tab. Hidden program windows will be light gray with a dark gray tab. + A hidden -- but very useful -- feature of the program list is being able to force a misbehaving program to quit. On a modern PC keyboard, it's easy: hold down the left Shift, Control, Alt, and Option (Windows) keys and click on the program you wish to force quit. If you don't have this choice available to you, you can still force quit an program by holding Control and Alt and hitting the Delete key once. This will show the Team Monitor window, which you can use to force quit a program by selecting it from the list and then clicking the Force Quit button. The System Tray + If you are familiar with Windows, you already have seen, if not used, what is known as the System Tray. It is a small area of the screen which contains the time and sometimes some small icons which give you frequently updated information and allow you to perform certain tasks very quickly. The most common uses for the System Tray in Haiku are for getting your E-mail by clicking on a little mailbox with the right mouse button, changing the volume by left-clicking on a little speaker, or checking the date by clicking on the time once. -Working with Files - Opening & Saving - Archives - Different Kinds of Files - Drag and Drop +Tracker: Managing Your Files + While the majority of a person's time at the computer is spent working with other programs, knowing how to move your files around is critical in being able to work effectively. Tracker works much like the Finder program used on Macintosh computers, so many people will need a little time to adjust. We will take a look at these differences below to help you get familiarized more easily. + +Opening & Saving + + Haiku gives programs a common way to both open and save files. You will see the same basic window over and over again with an occasional difference here and there. There are four parts: the location button, the file list, and two buttons. When you are saving a file, there is also a box which lets you type in the name of your file. + When you are opening or saving a file, you can see what folder in your computer that you are currently looking at. Clicking on the folder button will show a menu that contains the series of folders that you would need to click on to get where you are, starting with the Desktop. This makes it easier to quickly navigate folders. The file list will show the contents of the folder that you are looking at. Often a program will show you just the kinds of files that you can open with that program. Double-clicking on a file in the list will open that file or attempt to save over that file, depending on whether you are opening or saving. If you do try to save over a file, you will be asked to confirm that you really do want to save over a file to prevent accidental loss of your data. + +Archives + + Just as there are real-life archives used for storing documents, artifacts, and the like, computers also use archives. However, computer archives just hold files and folders and store them all in a special way so that the archive takes up less space on the hard drive than the original files themselves. Here are a list of common ones that you may find in your comings and goings: + + +ZIP - the most common in BeOS and Windows. ZIP files are special because they can store the attributes of a BeOS file and not just the file's regular data. This is especially important for files like People files, which keep all of their information in attributes. Unless you're sure of what your doing, use ZIP archives to package files together. + +TAR - This is a package file used in UNIX operating systems that doesn't compress the files it contains. Instead, a separate program is normally used to compress the package, so most of the time you will see files ending in .tar.bz2, .tar.gz, or .tgz. + +BZ2 - BZip2. This is getting to be a more common kind of archive because of its ability to make smaller archives than other types. + +GZ - GZip. Like TAR, this kind of archive normally comes from the UNIX / Linux operating system. + +RAR - RAR files still appear now and then today, but they are not nearly as common as the ones listed above. They normally contain Windows files, and the software used to make RAR archives is proprietary, so you will not find many of them containing files specific to BeOS and Haiku. + +ARJ - An older format which you may still come across now and then. ARJ files nowadays most often contain files from MS-DOS, a predecessor to Windows. + +7z - 7-Zip is an becoming an increasingly popular archive type because it is very good at making smaller archives than the others. + +DMG - A program archive for the OS X operating system by Apple. Haiku does not support these, but they are listed so that you can be aware of what they are. + +SIT - Stuff-It archive. This is an older archive type used in Macintosh computers. Haiku does not support these, either, but are listed for your information. + + +Getting Files into and Out of an Archive + + If you are going to send documents to someone via e-mail, put a lot of files on a floppy disk or keychain drive, or put files on the Internet for others to download, you normally want to package them into an archive to make transport faster. Some files, such as Microsoft Word and Excel documents benefit greatly from this. Others, such as MP3s and photos, don't because the information inside them is already compressed. + Haiku makes archiving files about as easy as it could possibly be by way of a Tracker Add-On called Zip-O-Matic. Simply select all the files and/or folders you wish to archive, right-click on one of them to bring up the menu, move down to Add-Ons, and choose Zip-O-Matic. As soon as you click on it, your files will be placed into a ZIP archive. All that you will need to do from there is rename it -- most of the time it will be given the name Archive.zip. + +Tip: If you really want speed, hold down the right Control and Alt keys and hit the Z key. Your files will be archived just as if you used the menu, but without all the clicking! + + Getting files out of an archive is almost as easy as putting them in one, thanks to the Expander program. Double-click on an archive and if Expander will open it -- it handles almost all of the kinds of archives listed above -- you will just need to choose where you would like the files places (click on the Destination button to browse for one or just type it in) and click the Expand button. It's that simple! + + +Drag and Drop + + Drag and Drop is a method for opening files and exchanging data between programs that is used in lots of places in the Haiku operating system. Just by clicking on an object -- often a file in Tracker -- and dragging it to a target, you can open files, move them around, rearrange items in lists, and many other things. You will probably use drag and drop most in Tracker to move files, from a Tracker window to a program in order to open it. + +Tip: You can drag a file to a program's entry in the Deskbar to open the file with that program. It saves time over using the Open With menu or the Open window. + + + +Chapter 3: E-Mail + + One neat thing that BeOS did that Haiku does even more is make it easy for programs to read information from files. This is why there are more than a couple different mail programs for BeOS and Haiku. Here we will focus on the mail program included with Haiku, BeMail. + +Setting Up E-mail in Haiku + + The first job is to set up your e-mail accounts. BeMail can handle multiple accounts, secure connections, and a host of other features of e-mail providers. You manage your e-mail settings from the E-mail preferences program which is in the Preferences folder in the Leaf menu. When it starts up, go to the Settings tab and make sure that 'Start Mail Services on Startup' is checked. If you have a dial-up Internet account, you will want to check 'Only When Dial-Up is Connected' and 'Schedule Outgoing Mail When Dial-Up is Disconnected' also. Set your mail-checking interval to whatever works best for you. + Now go back to the Accounts tab. You start adding an account by clicking on the Add button and filling in the form that pops up on the right. The Account Name is a name you choose, like the name of your Internet provider, your name, or something else. Put your name in the Real Name box and your e-mail address into the Return Address box. Change the account type only if you want to just send mail or just receive it on this account. + Now that you have entered in the general settings for your e-mail account, you will need to set the Incoming and Outgoing settings. While we will not go through the nitty-gritty details of these settings because they will depend on your Internet provider, we will go over a summary of what the terms you will probably see when learning about your provider's mail settings to point you in the right direction. + +POP3 and IMAP - The Internet uses different ways of communication (called protocols) to get and send mail. POP3 (or just POP) and IMAP are the two major protocols for getting mail, with POP3 being the most common. If your provider says you have to use a specific port number, place a colon and the number after the name of the mail server. If your provider told you that the server name is name.myserver.com and to use port 1400, you will enter "name.myserver.com:1400 " (without the quotes) in the box. + +Tip: If you have POP3 e-mail and check your mail from more than one computer, you probably will want to check the "Leave mail on the server" box on every machine that you check mail from except your main one to help you keep it all organized. + +SMTP - This is the protocol for sending mail over the Internet. Entering information for this is done the same way as for incoming mail. Your provider may or may not ask your computer for a username and password. + +Filters - You can set up mail filters to sort your mail, reduce Spam, and other neat tricks. For more information, see the section on Filters later in this chapter. + + +Getting, Sending, and Reading Your E-mail + + + Getting e-mail is easy in Haiku. If you enabled automatic mail checking (under the Settings tab in the E-mail preferences program), you don't have to do anything to check your e-mail. If not, all that is needed is to right-click on the mailbox icon in the system tray and choose "Check for E-mail" from the menu. + +Tip: If your mouse has a middle button, you can middle-click on the mailbox icon to trigger a mail check. Most mice that have a scroll wheel allow you to push it down like a button in addition to using it to scroll. + + Reading your e-mail under Haiku doesn't require any fancy tricks, either -- just click on the mailbox icon and it will show you everything in Haiku's main mail folder -- new mail, old mail, and everything else. If you have more complicated e-mail needs, you can right-click on the mailbox icon in the system tray and choose the item " new messages". A window will pop up and show you just your new e-mail. This is really nice to have if you prefer to save all your e-mail or if you have more than one account and store each account's mail in a separate folder. Either way, you can just double-click on a piece of mail to read it with Haiku's mail program, BeMail. + +Tip: You can customize the columns in your mail window to show just the Subject, the sender, or whatever else you like. See the section on Tracker in Chapter 2 for details. + + +Using BeMail + + BeMail is about as simple as mail programs can get, but even it has some nice features which make life a little nicer. First of all, if you have added a spam filter to your e-mail account, you can mark mail as genuine ("real") mail or as spam -- more on this later. You can place a tagline (called a signature) at the bottom of an e-mail. BeMail lets you have more than one, and clicking on the Signature button pops up a menu which allows you to choose which signature you'd like to add. + + +Filtering Your E-mail + + Some people get tons of e-mail each day. Others don't. Everyone seems to get spam even though its kinda shady and illegal in some places, not to mention highly annoying. E-mail filtering can help with a lot of this. We will look at each of the filters bundled with Haiku, how to set them up, and some possible uses for them. Filtering is a step above basic e-mail and you might not need it or want to be bothered with it. If you don't do that much with e-mail, you can skip this section and be no worse for the wear. + First of all, you will be working with the E-mail preferences program to set up filtering. Select the item marked 'Filtering' beneath the name of the account you would like to filter. On the right you will see a list for the filters. Note that the order of this list is important - filters are applied in the order that they are listed. If you would like to change the order, just click on an item, drag it to where you want it, and drop it. + +R5 Daemon Filter - This one is kept around more for backwards compatibility. The mail services packaged in with BeOS version 5 and earlier used a different way of storing and using mail filters. If you know what they are all about, then you will know what to do with this filter. + +Match Header - This filter replaces the R5 Daemon Filter. It looks for a pattern in some aspect of a piece of mail and performs some action on it. The first box is for what you would like to search. Below is a list of what you can enter and what part of the e-mail it is: + +Name - the name of the sender + +From - the sender's e-mail address + +To - your e-mail address (different for each e-mail account) + +Reply To - the e-mail address replies are sent to + +When - the date and time received + +Subject - the subject line + +Cc - addresses of anyone receiving a carbon copy (CC) + +Account - the name of the e-mail's account + +Status - The current status of the e-mail. Normally, this can be Read, Replied, Sent, Forwarded, New, or anything you have designated yourself. However, unless you change it yourself in a filter, it will always be New. + +Priority - This is often not used and is set by the sender's e-mail program. Most of the time, it is ignored. More often than not, it is used by spammers with an 'urgent' designation or something similar. + +Thread - Essentially the same as Subject, but without things like Re: or Fwd: + +Classification Group - Depending on what the spam filter classified it as, this will either be empty (if uncertain) or contain the word Genuine or Spam + +Spam/Genuine Estimate - This is a numerical estimate that the spam filter assigned to your e-mail. They are shown in scientific notation, where 1.065e-12 translates to 1.065 divided by 10 to the 12th power, which in this case translates to 0.000000000001065. + +By entering one of these into the first box, you can search it for whatever pattern you enter. What pattern do you put in? It's more than little complicated. You can search around the Internet for a tutorial on UNIX regular expressions, but here are some examples: + +\[Spam - matches the word Spam with a left bracket before it. +[a-z] - matches one lowercase letter +[A-Za-z] - matches one lowercase or capital letter +[A-Za-z]+ - matches one or more letters +[0-9] - matches one number +. - matches any character +\. - matches any one period + +Because regular expressions are complicated and can be frustrating to get to match only what you want them to, here are some sample filters which you will probably find useful: + +What: Pattern: Matches: +Subject \[Spam Mail marked as Spam by the spam filter +Account MyAccount Mail sent to the MyAccount account +From test at notmail.com Mail from test at notmail.com + + +Tip: If you want to do more than one action on an e-mail, set up two filters with the same matching pattern and place them one after another. + + +Spam Filter - Eliminating spam is tough because spammers are always coming up with new tricks to be able to send you e-mails. This filter can reduce it by quite a lot, however. It uses statistics to help determine which e-mails are spam and which are not. As it gets used, it needs less and less help in figuring out which is which. For each e-mail, it calculates a decimal rating which runs from 0 to 1 where the bigger the number, the more likely it is spam. The filter itself has options to allow you to change the value range for Spam / Uncertain / Genuine, to treat e-mails with nothing in them as spam, and to automatically learn from all incoming e-mails. There is also an option to add the spam rating to the beginning of the e-mail's Subject which will then, in turn, allow a Match Header filter to act on whether or not it is spam. + + +Add Fortune - This filter adds a fortune from the /boot/beos/etc/fortunes file to all outgoing e-mails. + + +Simple and Not-So-Simple E-mail Filtering Setups + +All of this tweaking can be a lot to take in, so here are some in-depth examples of how to use filters effectively. + +Example 1: Place different mail from 2 different accounts into different folders + +1) Account names are Account1 and Account2, so create 2 folders -- /boot/home/mail/Account1 and /boot/home/mail/Account2 +2) Add a Match Header filter to Account1: What=Subject, Pattern=Account1, Action=Move to Folder, Folder=/boot/home/mail/Account1 +3) Add a Match Header filter to Account2: What=Subject, Pattern=Account2, Action=Move to Folder, Folder=/boot/home/mail/Account2 + +Example 2: Move all Spam to the Trash + +1) Add a Spam filter to an account. Make it mark Spam mails with a rating. +2) Add a Match header filter. What=Subject, Pattern=\[Spam , Action=Mark as Read +3) Add a Match header filter. What=Subject, Pattern=\[Spam , Action=Move to Folder, Folder=/boot/home/Desktop/Trash + + +Chapter 4: Getting Things Done + + Aside from the complexity from e-mail setup and customization, there are many other things that you will probably do on a fairly frequent basis, including using a Web browser, listening to music, and watching movies. + + +The World Wide Web + + Haiku, along with many other non-Windows operating systems, has a web browser which allows you to go online for learning about the weather, getting news, going shopping, and so forth. Mozilla Firefox (or just Firefox) is the web browser of choice for most Haiku users. While Haiku does not, by default, ship with Firefox, it is relatively simple to download and install. You may find that a small percentage of websites do not work properly. This is not the fault of the Firefox developers. It is because the people responsible for creating the website designed it only for the Internet Explorer browser, which is lazy and a mistake. In these cases, if at all possible, e-mail the webmaster of the site to kindly consider resolving the problem. + + +Gotta Have My Music and Movies + + Haiku has the ability to play most movies and music files, compliments of MediaPlayer. You can take advantage of playing all your favorite MP3s. You can also take advantage of the BFS filesystem's attributes to create custom playlists very quickly in a way similar to iTunes' smart playlists. You can also enjoy other kinds of music and movie files, such as Ogg Vorbis, FLAC, Matroska, Windows Media, and others. + + +Keeping an Address Book + + An address book is important for anyone who has a lot of friends. You can enter in all the information you like with the People program. To look up information about someone, all you have to do is go to the /boot/home/People folder. You can remove and add columns to view just the information that you want to have at a glance, and if you want to see everything about a person, all that is needed is to double-click on his or her file. + How do you do you customize the columns? Check and uncheck items in the Attributes menu. Attributes which are specific to People files can be found in the People submenu of the Attributes menu. You can also rearrange columns just by dragging the column title around. A column can be automatically resized to display all the data in the column by moving the cursor over the divider in between the column title boxes and double-clicking the mouse. + + +Customizing Haiku: Preferences and Tweaks + + ----------------------------------------------------------------------------- BeOS Bible: From darkwyrm at earthlink.net Tue Jan 2 22:16:56 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Tue, 02 Jan 2007 16:16:56 -0500 EST Subject: [Haiku-commits] r19678 - haiku/trunk/src/preferences/mail In-Reply-To: <9541051.1167772289832.JavaMail.ngmail@webmail14> Message-ID: <6385350842-BeMail@sapphire> > Why are you changing this to a lower case is? Proper capitalization rules for English. Definite articles and certain "unimportant" verbs (such as forms of be and have) are not capitalized unless they are the first word of a sentence or phrase. I must have gotten carried away when I made these label edits. :^) --DW From darkwyrm at mail.berlios.de Tue Jan 2 22:53:45 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 2 Jan 2007 22:53:45 +0100 Subject: [Haiku-commits] r19683 - haiku/trunk/src/add-ons/mail_daemon/inbound_filters/match_header Message-ID: <200701022153.l02LrjZq022975@sheep.berlios.de> Author: darkwyrm Date: 2007-01-02 22:53:44 +0100 (Tue, 02 Jan 2007) New Revision: 19683 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19683&view=rev Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp haiku/trunk/src/add-ons/mail_daemon/inbound_filters/match_header/RuleFilter.cpp Log: Added both power and ease-of-use to the Match Header addon. A regular case-sensitive string search is done unless REGEX: appears at the beginning, in which case a full-blown regular expression search is done Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp 2007-01-02 21:12:01 UTC (rev 19682) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp 2007-01-02 21:53:44 UTC (rev 19683) @@ -50,8 +50,8 @@ attr->SetText(settings->FindString("attribute")); AddChild(attr); - regex = new BTextControl(BRect(104,5,255,20),"attr",MDR_DIALECT_CHOICE (" is "," ? "),MDR_DIALECT_CHOICE ("value (can be a regular expression, like *spam*)","?(??????)"),NULL); - regex->SetDivider(be_plain_font->StringWidth(MDR_DIALECT_CHOICE (" is "," ? ")) + 4); + regex = new BTextControl(BRect(104,5,255,20),"attr",MDR_DIALECT_CHOICE (" has "," ? "),MDR_DIALECT_CHOICE ("value (use REGEX: in from of regular expressions like *spam*)","?(??????)"),NULL); + regex->SetDivider(be_plain_font->StringWidth(MDR_DIALECT_CHOICE (" has "," ? ")) + 4); if (settings->HasString("regex")) regex->SetText(settings->FindString("regex")); AddChild(regex); Modified: haiku/trunk/src/add-ons/mail_daemon/inbound_filters/match_header/RuleFilter.cpp =================================================================== --- haiku/trunk/src/add-ons/mail_daemon/inbound_filters/match_header/RuleFilter.cpp 2007-01-02 21:12:01 UTC (rev 19682) +++ haiku/trunk/src/add-ons/mail_daemon/inbound_filters/match_header/RuleFilter.cpp 2007-01-02 21:53:44 UTC (rev 19683) @@ -21,10 +21,17 @@ attr.CapitalizeEachWord(); attribute = strdup(attr.String()); - const char *regex = NULL; + BString regex; settings->FindString("regex",®ex); - matcher.SetPattern(regex,true); + int32 index = regex.FindFirst("REGEX:"); + if (index == B_ERROR || index > 0) + EscapeRegexTokens(regex); + else + regex.RemoveFirst("REGEX:"); + + matcher.SetPattern(regex.String(),false); + settings->FindString("argument",&arg); settings->FindInt32("do_what",(long *)&do_what); if (do_what == Z_SET_REPLY) @@ -59,10 +66,10 @@ if (data == NULL) //--- How would this happen? No idea return B_OK; - + if (!matcher.Match(data)) return B_OK; //-----There wasn't an error. We're just not supposed to do anything - + switch (do_what) { case Z_MOVE_TO: if (io_headers->ReplaceString("DESTINATION",arg) != B_OK) From koki at haiku-os.org Tue Jan 2 22:28:21 2007 From: koki at haiku-os.org (Jorge G. Mare (a.k.a. Koki)) Date: Tue, 02 Jan 2007 13:28:21 -0800 Subject: [Haiku-commits] r19678 - haiku/trunk/src/preferences/mail In-Reply-To: <6385350842-BeMail@sapphire> References: <6385350842-BeMail@sapphire> Message-ID: <459ACE75.20508@haiku-os.org> DarkWyrm wrote: >> Why are you changing this to a lower case is? > Proper capitalization rules for English. Definite articles and certain > "unimportant" verbs (such as forms of be and have) are not capitalized > unless they are the first word of a sentence or phrase. I must have > gotten carried away when I made these label edits. :^) I think the more important question here is: why do we use title case in what is clearly not a title? I am really sorry that I bring this back again here, but I really see the use of title case in this instances as an aberration. Cheers, Koki From darkwyrm at mail.berlios.de Tue Jan 2 23:22:00 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 2 Jan 2007 23:22:00 +0100 Subject: [Haiku-commits] r19684 - haiku/trunk/src/apps/bemail Message-ID: <200701022222.l02MM0RU026085@sheep.berlios.de> Author: darkwyrm Date: 2007-01-02 23:21:59 +0100 (Tue, 02 Jan 2007) New Revision: 19684 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19684&view=rev Modified: haiku/trunk/src/apps/bemail/Mail.cpp Log: Close the spam server on quit -- this remedies the problem of a zombie spam server after training it on a message Fixed a label in an alert, too Modified: haiku/trunk/src/apps/bemail/Mail.cpp =================================================================== --- haiku/trunk/src/apps/bemail/Mail.cpp 2007-01-02 21:53:44 UTC (rev 19683) +++ haiku/trunk/src/apps/bemail/Mail.cpp 2007-01-02 22:21:59 UTC (rev 19684) @@ -518,7 +518,23 @@ mail_window = last_window; // Last closed window becomes standard window size. + + // Shut down the spam server if it's still running. If the user has trained it on a message, it will stay + // open. This is actually a good thing if there's quite a bit of spam -- no waiting for the thing to start + // up for each message, but it has no business staying that way if the user isn't doing anything with e-mail. :) + if (be_roster->IsRunning(kSpamServerSignature)) { + team_id serverTeam = be_roster->TeamFor(kSpamServerSignature); + if (serverTeam >= 0) { + int32 errorCode = B_SERVER_NOT_FOUND; + gMessengerToSpamServer = BMessenger (kSpamServerSignature, serverTeam, &errorCode); + if (gMessengerToSpamServer.IsValid()) { + BMessage quitMessage(B_QUIT_REQUESTED); + gMessengerToSpamServer.SendMessage(&quitMessage); + } + } + } + SaveSettings(); return true; } @@ -3606,7 +3622,7 @@ "Possibly useful error code: %s (%ld).", filePath.Path(), CommandWord, strerror (errorCode), errorCode); (new BAlert("", errorString, - MDR_DIALECT_CHOICE("Ok","??")))->Go(); + MDR_DIALECT_CHOICE("OK","??")))->Go(); return errorCode; } From marcusoverhagen at arcor.de Wed Jan 3 01:50:11 2007 From: marcusoverhagen at arcor.de (Marcus Overhagen) Date: Wed, 3 Jan 2007 01:50:11 +0100 (CET) Subject: [Haiku-commits] Build is broken! Re: r19681 - haiku/trunk/src/apps/bemail In-Reply-To: <200701022110.l02LAMhr016718@sheep.berlios.de> References: <200701022110.l02LAMhr016718@sheep.berlios.de> Message-ID: <30402868.1167785411288.JavaMail.ngmail@webmail17> darkwyrm at BerliOS wrote: > - mBTextView = new DialogTextView(r,"BTextView",text,B_FOLLOW_ALL,B_WILL_DRAW); > + mBTextControl = new AutoTextControl(r,"BTextControl",NULL,sPreviousFind.String(), > Modified: haiku/trunk/src/apps/bemail/Jamfile > =================================================================== > --- haiku/trunk/src/apps/bemail/Jamfile 2007-01-02 20:16:21 UTC (rev 19680) > +++ haiku/trunk/src/apps/bemail/Jamfile 2007-01-02 21:10:22 UTC (rev 19681) > @@ -12,6 +12,7 @@ > > AddResources BeMail : BeMail.rdef pictures.rdef ; > Application BeMail : > + AutoTextControl.cpp > BmapButton.cpp This breaks the build. Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: g?nstig und schnell mit DSL - das All-Inclusive-Paket f?r clevere Doppel-Sparer, nur 44,85 ? inkl. DSL- und ISDN-Grundgeb?hr! http://www.arcor.de/rd/emf-dsl-2 From darkwyrm at mail.berlios.de Wed Jan 3 03:38:06 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Wed, 3 Jan 2007 03:38:06 +0100 Subject: [Haiku-commits] r19685 - haiku/trunk/src/apps/bemail Message-ID: <200701030238.l032c6g3001956@sheep.berlios.de> Author: darkwyrm Date: 2007-01-03 03:38:05 +0100 (Wed, 03 Jan 2007) New Revision: 19685 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19685&view=rev Added: haiku/trunk/src/apps/bemail/AutoTextControl.cpp haiku/trunk/src/apps/bemail/AutoTextControl.h Log: Whoops! Forgot to add these files to the repo in the r19681. Thanks for pointing this out, Marcus! Added: haiku/trunk/src/apps/bemail/AutoTextControl.cpp =================================================================== --- haiku/trunk/src/apps/bemail/AutoTextControl.cpp 2007-01-02 22:21:59 UTC (rev 19684) +++ haiku/trunk/src/apps/bemail/AutoTextControl.cpp 2007-01-03 02:38:05 UTC (rev 19685) @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#include "AutoTextControl.h" +#include +#include +#include +#include + +AutoTextControlFilter::AutoTextControlFilter(AutoTextControl *box) + : BMessageFilter(B_PROGRAMMED_DELIVERY, B_ANY_SOURCE,B_KEY_DOWN), + fBox(box), + fMessenger(NULL), + fCurrentMessage(NULL) +{ +} + +AutoTextControlFilter::~AutoTextControlFilter(void) +{ +} + +filter_result AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) +{ + // This is really slick -- all that is needed to allow Escape key cancelling is + // just calling SetEscapeCancel(true) for just *one* AutoTextControl in a window. *heh* + int32 rawchar,mod; + msg->FindInt32("raw_char",&rawchar); + msg->FindInt32("modifiers",&mod); + + + if(rawchar == B_ESCAPE) + { + if(mod & B_COMMAND_KEY) + return B_DISPATCH_MESSAGE; + + if(IsEscapeCancel()) + { + BLooper *loop = (*target)->Looper(); + if(loop) + { + BMessenger msgr(loop); + msgr.SendMessage(B_QUIT_REQUESTED); + return B_SKIP_MESSAGE; + } + } + } + + BView *v=dynamic_cast(*target); + if(!v || strcmp("_input_",v->Name())!=0) + return B_DISPATCH_MESSAGE; + + AutoTextControl *text = dynamic_cast(v->Parent()); + if(!text || text!=fBox) + return B_DISPATCH_MESSAGE; + + // handle instances where numlock is off and the user tries to punch in numbers. + // Instead of simply blocking the resulting keypresses, transform them into legit ones + // and turn NumLock on for the user. This doesn't work on R5, so only do it on other + // versions of BeOS + #ifndef HAIKU_TARGET_PLATFORM_R5 + + int32 scancode; + if(msg->FindInt32("key",&scancode)!=B_OK) + scancode = -1; + + HandleNoNumLock(scancode,rawchar,msg); + + #endif + + fCurrentMessage = msg; + filter_result result = KeyFilter(rawchar,mod); + fCurrentMessage = NULL; + + if(fBox->fCharLimit && result == B_DISPATCH_MESSAGE) + { + // See to it that we still allow shortcut keys + if(mod & B_COMMAND_KEY) + return B_DISPATCH_MESSAGE; + + // We don't use strlen() because it is not UTF-8 aware, which can affect + // how many characters can be typed. + if(isprint(rawchar) && (uint32)BString(text->Text()).CountChars()==text->fCharLimit) + return B_SKIP_MESSAGE; + } + + return result; +} + +filter_result AutoTextControlFilter::KeyFilter(const int32 &rawchar, const int32 &mod) +{ + if(fMessenger) + fMessenger->SendMessage(fBox->ModificationMessage()); + else + if(fBox) + fBox->Invoke(); + return B_DISPATCH_MESSAGE; +} + +void AutoTextControlFilter::SetMessenger(BMessenger *msgr) +{ + if(fMessenger) + delete fMessenger; + fMessenger = msgr; +} + +void AutoTextControlFilter::SendMessage(BMessage *msg) +{ + if(!msg) + return; + + if(fMessenger) + fMessenger->SendMessage(msg); + else + delete msg; +} + +void AutoTextControlFilter::HandleNoNumLock(const int32 &code, int32 &rawchar, + BMessage *msg) +{ + switch(code) + { + case 101: // Numlock . + { + rawchar = '.'; + break; + } + case 100: // Numlock 0 + { + rawchar = '0'; + break; + } + case 88: + { + rawchar = '1'; + break; + } + case 89: + { + rawchar = '2'; + break; + } + case 90: + { + rawchar = '3'; + break; + } + case 72: + { + rawchar = '4'; + break; + } + case 74: + { + rawchar = '6'; + break; + } + case 55: + { + rawchar = '7'; + break; + } + case 56: + { + rawchar = '8'; + break; + } + case 57: + { + rawchar = '9'; + break; + } + default: + return; + } + msg->ReplaceInt32("raw_char",rawchar); + + BString string; + string << (char)rawchar; + msg->ReplaceString("bytes",string); + + msg->ReplaceInt8("byte",(int8)rawchar); + + int32 mod; + if(msg->FindInt32("modifiers",&mod)==B_OK) + { + uint32 mask = B_NUM_LOCK; + if(mod & B_CAPS_LOCK) + mask |= B_CAPS_LOCK; + if(mod & B_SCROLL_LOCK) + mask |= B_SCROLL_LOCK; + + set_keyboard_locks(mask); + } +} + + +AutoTextControl::AutoTextControl(const BRect &frame, const char *name, const char *label, + const char *text, BMessage *msg, uint32 resize, uint32 flags) + : BTextControl(frame,name,label,text,msg,resize,flags), + fFilter(NULL), + fEscapeCancel(false), + fCharLimit(0) +{ + SetFilter(new AutoTextControlFilter(this)); +} + +AutoTextControl::~AutoTextControl(void) +{ + if(Window()) + Window()->RemoveCommonFilter(fFilter); + + delete fFilter; +} + +void AutoTextControl::AttachedToWindow(void) +{ + BTextControl::AttachedToWindow(); + if(fFilter) + Window()->AddCommonFilter(fFilter); +} + +void AutoTextControl::DetachedFromWindow(void) +{ + if(fFilter) + Window()->RemoveCommonFilter(fFilter); +} + +void AutoTextControl::SetCharacterLimit(const uint32 &limit) +{ + fCharLimit = limit; +} + +uint32 AutoTextControl::GetCharacterLimit(const uint32 &limit) +{ + return fCharLimit; +} + +void AutoTextControl::SetFilter(AutoTextControlFilter *filter) +{ + if(fFilter) + { + if(Window()) + Window()->RemoveCommonFilter(fFilter); + delete fFilter; + } + + fFilter = filter; + if(Window()) + Window()->AddCommonFilter(fFilter); +} Added: haiku/trunk/src/apps/bemail/AutoTextControl.h =================================================================== --- haiku/trunk/src/apps/bemail/AutoTextControl.h 2007-01-02 22:21:59 UTC (rev 19684) +++ haiku/trunk/src/apps/bemail/AutoTextControl.h 2007-01-03 02:38:05 UTC (rev 19685) @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#ifndef AUTOTEXT_H +#define AUTOTEXT_H + +#include +#include +#include + +class AutoTextControlFilter; + +enum +{ + M_PREVIOUS_FIELD='mprf', + M_NEXT_FIELD='mnxf', + M_ENTER_NAVIGATION='ennv' +}; + +class AutoTextControl : public BTextControl +{ +public: + AutoTextControl(const BRect &frame, const char *name, const char *label, + const char *text, BMessage *msg, + uint32 resize = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + virtual ~AutoTextControl(void); + virtual void AttachedToWindow(void); + virtual void DetachedFromWindow(void); + void SetFilter(AutoTextControlFilter *filter); + AutoTextControlFilter *GetFilter(void) { return fFilter; } + + void SetCharacterLimit(const uint32 &limit); + uint32 GetCharacterLimit(const uint32 &limit); + + void SetEscapeCancel(const bool &value) { fEscapeCancel = value; } + bool IsEscapeCancel(void) const { return fEscapeCancel; } +private: + friend AutoTextControlFilter; + AutoTextControlFilter *fFilter; + bool fEscapeCancel; + uint32 fCharLimit; +}; + +class AutoTextControlFilter : public BMessageFilter +{ +public: + AutoTextControlFilter(AutoTextControl *checkview); + ~AutoTextControlFilter(void); + virtual filter_result Filter(BMessage *msg, BHandler **target); + virtual filter_result KeyFilter(const int32 &key, const int32 &mod); + + AutoTextControl *TextControl(void) const { return fBox; } + + void SetMessenger(BMessenger *msgr); + BMessenger *GetMessenger(void) const { return fMessenger; } + void SendMessage(BMessage *msg); + BMessage *GetCurrentMessage(void) { return fCurrentMessage; } + +protected: + bool IsEscapeCancel(void) const { return fBox->IsEscapeCancel(); } + +private: + void HandleNoNumLock(const int32 &code, int32 &rawchar, BMessage *msg); + + AutoTextControl *fBox; + BMessenger *fMessenger; + BMessage *fCurrentMessage; +}; + +#endif From jackburton at mail.berlios.de Wed Jan 3 08:04:01 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Wed, 3 Jan 2007 08:04:01 +0100 Subject: [Haiku-commits] r19686 - haiku/trunk/src/kits/interface Message-ID: <200701030704.l03741Rn000984@sheep.berlios.de> Author: jackburton Date: 2007-01-03 08:04:01 +0100 (Wed, 03 Jan 2007) New Revision: 19686 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19686&view=rev Modified: haiku/trunk/src/kits/interface/SeparatorItem.cpp Log: Removed different menu separators Modified: haiku/trunk/src/kits/interface/SeparatorItem.cpp =================================================================== --- haiku/trunk/src/kits/interface/SeparatorItem.cpp 2007-01-03 02:38:05 UTC (rev 19685) +++ haiku/trunk/src/kits/interface/SeparatorItem.cpp 2007-01-03 07:04:01 UTC (rev 19686) @@ -78,49 +78,11 @@ BRect bounds = Frame(); rgb_color oldColor = menu->HighColor(); - // TODO: remove superfluous separators - menu_info menuInfo; - get_menu_info(&menuInfo); - switch (menuInfo.separator) { - case 0: - menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), - B_DARKEN_1_TINT)); - menu->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 4.0f), - BPoint(bounds.right - 1.0f, bounds.top + 4.0f)); - menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), - B_LIGHTEN_2_TINT)); - menu->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 5.0f), - BPoint(bounds.right - 1.0f, bounds.top + 5.0f)); - break; + menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_DARKEN_1_TINT)); + menu->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 4.0f), BPoint(bounds.right - 1.0f, bounds.top + 4.0f)); + menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), B_LIGHTEN_2_TINT)); + menu->StrokeLine(BPoint(bounds.left + 1.0f, bounds.top + 5.0f), BPoint(bounds.right - 1.0f, bounds.top + 5.0f)); - case 1: - menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), - B_DARKEN_1_TINT)); - menu->StrokeLine(BPoint(bounds.left + 9.0f, bounds.top + 4.0f), - BPoint(bounds.right - 9.0f, bounds.top + 4.0f)); - menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), - B_LIGHTEN_2_TINT)); - menu->StrokeLine(BPoint(bounds.left + 9.0f, bounds.top + 5.0f), - BPoint(bounds.right - 9.0f, bounds.top + 5.0f)); - break; - - case 2: - menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), - B_DARKEN_1_TINT)); - menu->StrokeLine(BPoint(bounds.left + 9.0f, bounds.top + 4.0f), - BPoint(bounds.right - 9.0f, bounds.top + 4.0f)); - menu->StrokeLine(BPoint(bounds.left + 10.0f, bounds.top + 5.0f), - BPoint(bounds.right - 10.0f, bounds.top + 5.0f)); - menu->SetHighColor(tint_color(ui_color(B_MENU_BACKGROUND_COLOR), - B_LIGHTEN_2_TINT)); - menu->StrokeLine(BPoint(bounds.left + 11.0f, bounds.top + 6.0f), - BPoint(bounds.right - 11.0f, bounds.top + 6.0f)); - break; - - default: - break; - } - menu->SetHighColor(oldColor); } From stefano.ceccherini at gmail.com Wed Jan 3 08:09:39 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Wed, 3 Jan 2007 08:09:39 +0100 Subject: [Haiku-commits] r19685 - haiku/trunk/src/apps/bemail In-Reply-To: <200701030238.l032c6g3001956@sheep.berlios.de> References: <200701030238.l032c6g3001956@sheep.berlios.de> Message-ID: <894b9700701022309k477561aar471495b1d529f0f4@mail.gmail.com> 2007/1/3, darkwyrm at BerliOS : > Author: darkwyrm > Date: 2007-01-03 03:38:05 +0100 (Wed, 03 Jan 2007) > New Revision: 19685 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19685&view=rev > > Added: > haiku/trunk/src/apps/bemail/AutoTextControl.cpp > haiku/trunk/src/apps/bemail/AutoTextControl.h + if(rawchar == B_ESCAPE) + { Ahem.... coding style... there is a space between if and (, and braces shouldn't be put after a newline. From jackburton at mail.berlios.de Wed Jan 3 08:35:32 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Wed, 3 Jan 2007 08:35:32 +0100 Subject: [Haiku-commits] r19687 - haiku/trunk/src/kits/interface Message-ID: <200701030735.l037ZWVZ003189@sheep.berlios.de> Author: jackburton Date: 2007-01-03 08:35:31 +0100 (Wed, 03 Jan 2007) New Revision: 19687 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19687&view=rev Modified: haiku/trunk/src/kits/interface/View.cpp Log: in case of error, set buttons to 0, for real Modified: haiku/trunk/src/kits/interface/View.cpp =================================================================== --- haiku/trunk/src/kits/interface/View.cpp 2007-01-03 07:04:01 UTC (rev 19686) +++ haiku/trunk/src/kits/interface/View.cpp 2007-01-03 07:35:31 UTC (rev 19687) @@ -1426,7 +1426,7 @@ if (deleteMessage) delete message; - + return; } } @@ -1447,7 +1447,7 @@ // TODO: See above comment about coordinates ConvertFromScreen(location); } else - buttons = 0; + *buttons = 0; } From jackburton at mail.berlios.de Wed Jan 3 08:43:14 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Wed, 3 Jan 2007 08:43:14 +0100 Subject: [Haiku-commits] r19688 - haiku/trunk/src/kits/interface Message-ID: <200701030743.l037hEi4003744@sheep.berlios.de> Author: jackburton Date: 2007-01-03 08:43:14 +0100 (Wed, 03 Jan 2007) New Revision: 19688 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19688&view=rev Modified: haiku/trunk/src/kits/interface/View.cpp Log: extended a comment and added a new one Modified: haiku/trunk/src/kits/interface/View.cpp =================================================================== --- haiku/trunk/src/kits/interface/View.cpp 2007-01-03 07:35:31 UTC (rev 19687) +++ haiku/trunk/src/kits/interface/View.cpp 2007-01-03 07:43:14 UTC (rev 19688) @@ -1443,9 +1443,11 @@ && code == B_OK) { fOwner->fLink->Read(location); fOwner->fLink->Read(buttons); + // TODO: ServerWindow replies with an int32 here - // TODO: See above comment about coordinates ConvertFromScreen(location); + // TODO: in beos R5, location is already converted to the view local coordinate system, + // so if an app checks the window message queue by itself, it might not find what it expects. } else *buttons = 0; } From axeld at pinc-software.de Wed Jan 3 11:38:45 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 3 Jan 2007 11:38:45 +0100 (MET) Subject: [Haiku-commits] r19685 - haiku/trunk/src/apps/bemail In-Reply-To: <200701030238.l032c6g3001956@sheep.berlios.de> Message-ID: <893042058-BeMail@zon> darkwyrm at BerliOS wrote: > Log: > Whoops! Forgot to add these files to the repo in the r19681. Thanks > for pointing > this out, Marcus! And did you forget anything about our coding style, again? :-/ BTW what's the difference between this class and the previous one? Bye, Axel. From darkwyrm at earthlink.net Wed Jan 3 12:44:49 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Wed, 03 Jan 2007 06:44:49 -0500 EST Subject: [Haiku-commits] r19685 - haiku/trunk/src/apps/bemail In-Reply-To: <893042058-BeMail@zon> Message-ID: <1495341948-BeMail@sapphire> > darkwyrm at BerliOS wrote: > > Log: > > Whoops! Forgot to add these files to the repo in the r19681. Thanks > > for pointing > > this out, Marcus! > > And did you forget anything about our coding style, again? :-/ > BTW what's the difference between this class and the previous one? I didn't forget our coding style for once, actually. This is code that I swiped from Capital Be and apparently I forgot that it used my regular coding style. The find window used an ugly hack -- a BTextView for a 1-line text editing box, but it didn't do it very well. The main reason AFAICT that it did all this was to have a text editing control which sent out update messages on each keypress. This code (style issues aside) is much cleaner and because I wrote it to be a drop-in replacement for BTextControl, it was dead easy to put in place. I will fix the style issues soon, possibly tonight after work if there is time. Sorry about that. --DW From axeld at mail.berlios.de Wed Jan 3 17:36:05 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 3 Jan 2007 17:36:05 +0100 Subject: [Haiku-commits] r19689 - haiku/trunk/src/servers/app Message-ID: <200701031636.l03Ga5Z1008713@sheep.berlios.de> Author: axeld Date: 2007-01-03 17:36:04 +0100 (Wed, 03 Jan 2007) New Revision: 19689 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19689&view=rev Modified: haiku/trunk/src/servers/app/WorkspacesLayer.cpp Log: Looks like DrawingEngine::ContrainClippingRegion() no longer copies the region passed in, but references it. This broke drawing the workspaces window background. Modified: haiku/trunk/src/servers/app/WorkspacesLayer.cpp =================================================================== --- haiku/trunk/src/servers/app/WorkspacesLayer.cpp 2007-01-03 07:43:14 UTC (rev 19688) +++ haiku/trunk/src/servers/app/WorkspacesLayer.cpp 2007-01-03 16:36:04 UTC (rev 19689) @@ -203,10 +203,8 @@ frame = frame & workspaceFrame; if (frame.IsValid()) { + drawingEngine->FillRect(frame.InsetByCopy(1, 1), white); backgroundRegion.Exclude(frame); - - frame.InsetBy(1, 1); - drawingEngine->FillRect(frame, white); } // draw title @@ -281,7 +279,7 @@ // draw background - drawingEngine->ConstrainClippingRegion(&backgroundRegion); + //drawingEngine->ConstrainClippingRegion(&backgroundRegion); drawingEngine->FillRect(rect, color); drawingEngine->ConstrainClippingRegion(&redraw); From marcusoverhagen at mail.berlios.de Wed Jan 3 21:39:33 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Wed, 3 Jan 2007 21:39:33 +0100 Subject: [Haiku-commits] r19690 - haiku/trunk/src/system/boot/platform/bios_ia32 Message-ID: <200701032039.l03KdXEW013028@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-03 21:39:33 +0100 (Wed, 03 Jan 2007) New Revision: 19690 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19690&view=rev Modified: haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp Log: updated comment to account for PXE memory ranges Modified: haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2007-01-03 16:36:04 UTC (rev 19689) +++ haiku/trunk/src/system/boot/platform/bios_ia32/smp.cpp 2007-01-03 20:39:33 UTC (rev 19690) @@ -392,10 +392,12 @@ TRACE(("trampolining other cpus\n")); - // The first 8 MB are identity mapped, 0x9e000-0x9ffff is reserved for this + // The first 8 MB are identity mapped, either 0x9e000-0x9ffff is reserved for + // this, or when PXE services are used 0x8b000-0x8cfff. // allocate a stack and a code area for the smp trampoline - // (these have to be < 1M physical, 0xa0000-0xfffff is reserved by the BIOS) + // (these have to be < 1M physical, 0xa0000-0xfffff is reserved by the BIOS, + // and when PXE services are used, the 0x8d000-0x9ffff is also reserved) #ifdef _PXE_ENV trampolineCode = 0x8b000; trampolineStack = 0x8c000; From darkwyrm at mail.berlios.de Wed Jan 3 22:57:43 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Wed, 3 Jan 2007 22:57:43 +0100 Subject: [Haiku-commits] r19691 - haiku/trunk/src/apps/bemail Message-ID: <200701032157.l03Lvhlj021160@sheep.berlios.de> Author: darkwyrm Date: 2007-01-03 22:57:42 +0100 (Wed, 03 Jan 2007) New Revision: 19691 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19691&view=rev Modified: haiku/trunk/src/apps/bemail/AutoTextControl.cpp haiku/trunk/src/apps/bemail/AutoTextControl.h Log: Style fixes. I'm pretty sure I got everything, too. :^) Modified: haiku/trunk/src/apps/bemail/AutoTextControl.cpp =================================================================== --- haiku/trunk/src/apps/bemail/AutoTextControl.cpp 2007-01-03 20:39:33 UTC (rev 19690) +++ haiku/trunk/src/apps/bemail/AutoTextControl.cpp 2007-01-03 21:57:42 UTC (rev 19691) @@ -12,7 +12,7 @@ #include AutoTextControlFilter::AutoTextControlFilter(AutoTextControl *box) - : BMessageFilter(B_PROGRAMMED_DELIVERY, B_ANY_SOURCE,B_KEY_DOWN), + : BMessageFilter(B_PROGRAMMED_DELIVERY, B_ANY_SOURCE,B_KEY_DOWN), fBox(box), fMessenger(NULL), fCurrentMessage(NULL) @@ -23,8 +23,9 @@ { } -filter_result AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) -{ +filter_result +AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) { + // This is really slick -- all that is needed to allow Escape key cancelling is // just calling SetEscapeCancel(true) for just *one* AutoTextControl in a window. *heh* int32 rawchar,mod; @@ -32,16 +33,14 @@ msg->FindInt32("modifiers",&mod); - if(rawchar == B_ESCAPE) - { - if(mod & B_COMMAND_KEY) + if (rawchar == B_ESCAPE) { + if (mod & B_COMMAND_KEY) return B_DISPATCH_MESSAGE; - if(IsEscapeCancel()) - { + if (IsEscapeCancel()) { BLooper *loop = (*target)->Looper(); - if(loop) - { + + if (loop) { BMessenger msgr(loop); msgr.SendMessage(B_QUIT_REQUESTED); return B_SKIP_MESSAGE; @@ -49,12 +48,12 @@ } } - BView *v=dynamic_cast(*target); - if(!v || strcmp("_input_",v->Name())!=0) + BView *v = dynamic_cast(*target); + if (!v || strcmp("_input_",v->Name()) != 0) return B_DISPATCH_MESSAGE; AutoTextControl *text = dynamic_cast(v->Parent()); - if(!text || text!=fBox) + if (!text || text != fBox) return B_DISPATCH_MESSAGE; // handle instances where numlock is off and the user tries to punch in numbers. @@ -64,7 +63,7 @@ #ifndef HAIKU_TARGET_PLATFORM_R5 int32 scancode; - if(msg->FindInt32("key",&scancode)!=B_OK) + if (msg->FindInt32("key",&scancode) != B_OK) scancode = -1; HandleNoNumLock(scancode,rawchar,msg); @@ -75,101 +74,93 @@ filter_result result = KeyFilter(rawchar,mod); fCurrentMessage = NULL; - if(fBox->fCharLimit && result == B_DISPATCH_MESSAGE) - { + if (fBox->fCharLimit && result == B_DISPATCH_MESSAGE) { // See to it that we still allow shortcut keys - if(mod & B_COMMAND_KEY) + if (mod & B_COMMAND_KEY) return B_DISPATCH_MESSAGE; // We don't use strlen() because it is not UTF-8 aware, which can affect // how many characters can be typed. - if(isprint(rawchar) && (uint32)BString(text->Text()).CountChars()==text->fCharLimit) + if (isprint(rawchar) && (uint32)BString(text->Text()).CountChars() == text->fCharLimit) return B_SKIP_MESSAGE; } return result; } -filter_result AutoTextControlFilter::KeyFilter(const int32 &rawchar, const int32 &mod) +filter_result +AutoTextControlFilter::KeyFilter(const int32 &rawchar, const int32 &mod) { - if(fMessenger) + if (fMessenger) fMessenger->SendMessage(fBox->ModificationMessage()); - else - if(fBox) + else if (fBox) fBox->Invoke(); return B_DISPATCH_MESSAGE; } -void AutoTextControlFilter::SetMessenger(BMessenger *msgr) +void +AutoTextControlFilter::SetMessenger(BMessenger *msgr) { - if(fMessenger) + if (fMessenger) delete fMessenger; fMessenger = msgr; } -void AutoTextControlFilter::SendMessage(BMessage *msg) +void +AutoTextControlFilter::SendMessage(BMessage *msg) { - if(!msg) + if (!msg) return; - if(fMessenger) + if (fMessenger) fMessenger->SendMessage(msg); else delete msg; } -void AutoTextControlFilter::HandleNoNumLock(const int32 &code, int32 &rawchar, - BMessage *msg) +void +AutoTextControlFilter::HandleNoNumLock(const int32 &code, int32 &rawchar, BMessage *msg) { - switch(code) - { - case 101: // Numlock . - { + switch(code) { + case 101: { + // Numlock . rawchar = '.'; break; } - case 100: // Numlock 0 - { + case 100: { + // Numlock 0 rawchar = '0'; break; } - case 88: - { + case 88: { rawchar = '1'; break; } - case 89: - { + case 89: { rawchar = '2'; break; } - case 90: - { + case 90: { rawchar = '3'; break; } - case 72: - { + case 72: { rawchar = '4'; break; } - case 74: - { + case 74: { rawchar = '6'; break; } - case 55: - { + case 55: { rawchar = '7'; break; } - case 56: - { + case 56: { rawchar = '8'; break; } - case 57: - { + case 57: { rawchar = '9'; break; } @@ -185,12 +176,13 @@ msg->ReplaceInt8("byte",(int8)rawchar); int32 mod; - if(msg->FindInt32("modifiers",&mod)==B_OK) - { + if (msg->FindInt32("modifiers",&mod)==B_OK) { uint32 mask = B_NUM_LOCK; - if(mod & B_CAPS_LOCK) + + if (mod & B_CAPS_LOCK) mask |= B_CAPS_LOCK; - if(mod & B_SCROLL_LOCK) + + if (mod & B_SCROLL_LOCK) mask |= B_SCROLL_LOCK; set_keyboard_locks(mask); @@ -199,8 +191,9 @@ AutoTextControl::AutoTextControl(const BRect &frame, const char *name, const char *label, - const char *text, BMessage *msg, uint32 resize, uint32 flags) - : BTextControl(frame,name,label,text,msg,resize,flags), + const char *text, BMessage *msg, uint32 resize, + uint32 flags) + : BTextControl(frame,name,label,text,msg,resize,flags), fFilter(NULL), fEscapeCancel(false), fCharLimit(0) @@ -210,45 +203,49 @@ AutoTextControl::~AutoTextControl(void) { - if(Window()) + if (Window()) Window()->RemoveCommonFilter(fFilter); delete fFilter; } -void AutoTextControl::AttachedToWindow(void) +void +AutoTextControl::AttachedToWindow(void) { BTextControl::AttachedToWindow(); - if(fFilter) + if (fFilter) Window()->AddCommonFilter(fFilter); } -void AutoTextControl::DetachedFromWindow(void) +void +AutoTextControl::DetachedFromWindow(void) { - if(fFilter) + if (fFilter) Window()->RemoveCommonFilter(fFilter); } -void AutoTextControl::SetCharacterLimit(const uint32 &limit) +void +AutoTextControl::SetCharacterLimit(const uint32 &limit) { fCharLimit = limit; } -uint32 AutoTextControl::GetCharacterLimit(const uint32 &limit) +uint32 +AutoTextControl::GetCharacterLimit(const uint32 &limit) { return fCharLimit; } -void AutoTextControl::SetFilter(AutoTextControlFilter *filter) +void +AutoTextControl::SetFilter(AutoTextControlFilter *filter) { - if(fFilter) - { - if(Window()) + if (fFilter) { + if (Window()) Window()->RemoveCommonFilter(fFilter); delete fFilter; } fFilter = filter; - if(Window()) + if (Window()) Window()->AddCommonFilter(fFilter); } Modified: haiku/trunk/src/apps/bemail/AutoTextControl.h =================================================================== --- haiku/trunk/src/apps/bemail/AutoTextControl.h 2007-01-03 20:39:33 UTC (rev 19690) +++ haiku/trunk/src/apps/bemail/AutoTextControl.h 2007-01-03 21:57:42 UTC (rev 19691) @@ -14,8 +14,7 @@ class AutoTextControlFilter; -enum -{ +enum { M_PREVIOUS_FIELD='mprf', M_NEXT_FIELD='mnxf', M_ENTER_NAVIGATION='ennv' @@ -24,52 +23,55 @@ class AutoTextControl : public BTextControl { public: - AutoTextControl(const BRect &frame, const char *name, const char *label, - const char *text, BMessage *msg, - uint32 resize = B_FOLLOW_LEFT | B_FOLLOW_TOP, - uint32 flags = B_WILL_DRAW | B_NAVIGABLE); - virtual ~AutoTextControl(void); - virtual void AttachedToWindow(void); - virtual void DetachedFromWindow(void); - void SetFilter(AutoTextControlFilter *filter); - AutoTextControlFilter *GetFilter(void) { return fFilter; } + AutoTextControl(const BRect &frame, const char *name, + const char *label, const char *text, + BMessage *msg, + uint32 resize = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + virtual ~AutoTextControl(void); + virtual void AttachedToWindow(void); + virtual void DetachedFromWindow(void); + void SetFilter(AutoTextControlFilter *filter); + AutoTextControlFilter * GetFilter(void) { return fFilter; } - void SetCharacterLimit(const uint32 &limit); - uint32 GetCharacterLimit(const uint32 &limit); + void SetCharacterLimit(const uint32 &limit); + uint32 GetCharacterLimit(const uint32 &limit); - void SetEscapeCancel(const bool &value) { fEscapeCancel = value; } - bool IsEscapeCancel(void) const { return fEscapeCancel; } + void SetEscapeCancel(const bool &value) { fEscapeCancel = value; } + bool IsEscapeCancel(void) const { return fEscapeCancel; } private: - friend AutoTextControlFilter; - AutoTextControlFilter *fFilter; - bool fEscapeCancel; - uint32 fCharLimit; + friend AutoTextControlFilter; + + AutoTextControlFilter *fFilter; + bool fEscapeCancel; + uint32 fCharLimit; }; class AutoTextControlFilter : public BMessageFilter { public: - AutoTextControlFilter(AutoTextControl *checkview); - ~AutoTextControlFilter(void); - virtual filter_result Filter(BMessage *msg, BHandler **target); - virtual filter_result KeyFilter(const int32 &key, const int32 &mod); + AutoTextControlFilter(AutoTextControl *checkview); + ~AutoTextControlFilter(void); + virtual filter_result Filter(BMessage *msg, BHandler **target); + virtual filter_result KeyFilter(const int32 &key, const int32 &mod); - AutoTextControl *TextControl(void) const { return fBox; } + AutoTextControl * TextControl(void) const { return fBox; } - void SetMessenger(BMessenger *msgr); - BMessenger *GetMessenger(void) const { return fMessenger; } - void SendMessage(BMessage *msg); - BMessage *GetCurrentMessage(void) { return fCurrentMessage; } + void SetMessenger(BMessenger *msgr); + BMessenger * GetMessenger(void) const { return fMessenger; } + void SendMessage(BMessage *msg); + BMessage * GetCurrentMessage(void) { return fCurrentMessage; } protected: - bool IsEscapeCancel(void) const { return fBox->IsEscapeCancel(); } + bool IsEscapeCancel(void) const { return fBox->IsEscapeCancel(); } private: - void HandleNoNumLock(const int32 &code, int32 &rawchar, BMessage *msg); + void HandleNoNumLock(const int32 &code, int32 &rawchar, + BMessage *msg); - AutoTextControl *fBox; - BMessenger *fMessenger; - BMessage *fCurrentMessage; + AutoTextControl *fBox; + BMessenger *fMessenger; + BMessage *fCurrentMessage; }; #endif From bonefish at cs.tu-berlin.de Thu Jan 4 00:52:58 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Thu, 04 Jan 2007 00:52:58 +0100 Subject: [Haiku-commits] r19691 - haiku/trunk/src/apps/bemail In-Reply-To: <200701032157.l03Lvhlj021160@sheep.berlios.de> References: <200701032157.l03Lvhlj021160@sheep.berlios.de> Message-ID: <20070104005258.496.1@cs.tu-berlin.de> On 2007-01-03 at 22:57:43 [+0100], darkwyrm at BerliOS wrote: > Author: darkwyrm > Date: 2007-01-03 22:57:42 +0100 (Wed, 03 Jan 2007) > New Revision: 19691 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19691&view=rev > > Modified: > haiku/trunk/src/apps/bemail/AutoTextControl.cpp > haiku/trunk/src/apps/bemail/AutoTextControl.h > Log: > Style fixes. I'm pretty sure I got everything, too. :^) Actually even more than that. :-P > Modified: haiku/trunk/src/apps/bemail/AutoTextControl.cpp > =================================================================== > --- haiku/trunk/src/apps/bemail/AutoTextControl.cpp 2007-01-03 20:39:33 > UTC (rev 19690) > +++ haiku/trunk/src/apps/bemail/AutoTextControl.cpp 2007-01-03 21:57:42 > UTC (rev 19691) > @@ -12,7 +12,7 @@ > #include > > AutoTextControlFilter::AutoTextControlFilter(AutoTextControl *box) > - : BMessageFilter(B_PROGRAMMED_DELIVERY, B_ANY_SOURCE,B_KEY_DOWN), > + : BMessageFilter(B_PROGRAMMED_DELIVERY, B_ANY_SOURCE,B_KEY_DOWN), > fBox(box), > fMessenger(NULL), > fCurrentMessage(NULL) > @@ -23,8 +23,9 @@ > { > } > > -filter_result AutoTextControlFilter::Filter(BMessage *msg, BHandler > **target) > -{ > +filter_result > +AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) { > + Like here. :-) CU, Ingo From darkwyrm at earthlink.net Thu Jan 4 03:47:32 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Wed, 03 Jan 2007 21:47:32 -0500 EST Subject: [Haiku-commits] r19691 - haiku/trunk/src/apps/bemail In-Reply-To: <20070104005258.496.1@cs.tu-berlin.de> Message-ID: <303263003-BeMail@sapphire> > > AutoTextControlFilter::AutoTextControlFilter(AutoTextControl *box) > > - : BMessageFilter(B_PROGRAMMED_DELIVERY, B_ANY_SOURCE,B_KEY_DOWN), > > + : BMessageFilter(B_PROGRAMMED_DELIVERY, > > B_ANY_SOURCE,B_KEY_DOWN), > > fBox(box), > > fMessenger(NULL), > > fCurrentMessage(NULL) > > @@ -23,8 +23,9 @@ > > { > > } > > > > -filter_result AutoTextControlFilter::Filter(BMessage *msg, > > BHandler > > **target) > > -{ > > +filter_result > > +AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) { > > + > > Like here. :-) Huh?? --DW From axeld at pinc-software.de Thu Jan 4 10:39:28 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 4 Jan 2007 10:39:28 +0100 (MET) Subject: [Haiku-commits] r19691 - haiku/trunk/src/apps/bemail In-Reply-To: <303263003-BeMail@sapphire> Message-ID: <586816522-BeMail@zon> "DarkWyrm" wrote: > > > -filter_result AutoTextControlFilter::Filter(BMessage *msg, > > > BHandler > > > **target) > > > -{ > > > +filter_result > > > +AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) > > > { > > > + > > Like here. :-) > Huh?? It should have been: filter_result AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) { ... Function brackets are always on the first column. Bye, Axel. From jackburton at mail.berlios.de Thu Jan 4 10:40:55 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 4 Jan 2007 10:40:55 +0100 Subject: [Haiku-commits] r19692 - haiku/trunk/src/kits/interface Message-ID: <200701040940.l049et47014272@sheep.berlios.de> Author: jackburton Date: 2007-01-04 10:40:54 +0100 (Thu, 04 Jan 2007) New Revision: 19692 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19692&view=rev Modified: haiku/trunk/src/kits/interface/TextView.cpp Log: - Fixed wrong redrawing of the caret in some particular circumstancies (most notably when you clicked the first time on the textview, the caret would be left "drawn" on the old position. - Implemented vertical auto scrolling (horizontal auto scrolling is still missing). Note that the view jumps when there is nothing to scroll, might be a bug in BView::ScrollBy() ? Modified: haiku/trunk/src/kits/interface/TextView.cpp =================================================================== --- haiku/trunk/src/kits/interface/TextView.cpp 2007-01-03 21:57:42 UTC (rev 19691) +++ haiku/trunk/src/kits/interface/TextView.cpp 2007-01-04 09:40:54 UTC (rev 19692) @@ -913,21 +913,32 @@ } } else { // Scroll the view a bit if mouse is outside the view bounds - BPoint scrollBy; - BRect bounds = Bounds(); // TODO: Use the textrect instead ? - if (fWhere.x > bounds.right) + + BRect bounds = Bounds(); + + // TODO: Horizontal scrolling + /*if (fWhere.x > bounds.right) scrollBy.x = fWhere.x - bounds.right; else if (fWhere.x < bounds.left) scrollBy.x = fWhere.x - bounds.left; + */ + float lineHeight = 0; + float diff = 0; + if (fWhere.y > bounds.bottom) { + lineHeight = LineHeight(LineAt(bounds.LeftBottom())); + diff = fWhere.y - bounds.bottom; + } else if (fWhere.y < bounds.top) { + lineHeight = LineHeight(LineAt(bounds.LeftTop())); + diff = fWhere.y - bounds.top; // negative value + } - if (fWhere.y > bounds.bottom) - scrollBy.y = fWhere.y - bounds.bottom; - else if (fWhere.y < bounds.top) - scrollBy.y = fWhere.y - bounds.top; - - // TODO: Review this, it's not working correctly - //if (scrollBy != B_ORIGIN) - // ScrollBy(scrollBy.x, scrollBy.y); + // Always scroll vertically by multiples of line height, + // based on the distance of the cursor from the border of the view + // TODO: Refine this, I can't even remember how beos works here + BPoint scrollBy; + scrollBy.y = lineHeight > 0 ? lineHeight * (int32)(floorf(diff) / lineHeight) : 0; + if (scrollBy != B_ORIGIN) + ScrollBy(scrollBy.x, scrollBy.y); } break; } @@ -1830,8 +1841,7 @@ \param outToOffset A pointer to an integer which will contain the ending offset of the word. */ void -BTextView::FindWord(int32 inOffset, int32 *outFromOffset, - int32 *outToOffset) +BTextView::FindWord(int32 inOffset, int32 *outFromOffset, int32 *outToOffset) { int32 offset; uint32 charType = CharClassification(inOffset); @@ -2228,7 +2238,7 @@ void BTextView::SetMaxBytes(int32 max) { - int32 textLength = fText->Length(); + const int32 textLength = fText->Length(); fMaxBytes = max; if (fMaxBytes < textLength) @@ -3569,6 +3579,10 @@ if (fAlignment != B_ALIGN_LEFT) erase = true; + // Actually hide the caret + if (fCaretVisible) + DrawCaret(fSelStart); + BRect eraseRect = clipRect; long startEraseLine = startLine; STELine* line = (*fLines)[startLine]; @@ -3922,7 +3936,7 @@ BMessenger messenger(this); BMessage message(_DISPOSE_DRAG_); - fDragRunner = new (nothrow) BMessageRunner(this, &message, 100000); + fDragRunner = new (nothrow) BMessageRunner(messenger, &message, 100000); } @@ -4401,10 +4415,10 @@ int32 selectionEnd = 0; message->FindInt32("be:selection", 0, &selectionStart); message->FindInt32("be:selection", 1, &selectionEnd); - + fInline->SetSelectionOffset(selectionStart); fInline->SetSelectionLength(selectionEnd - selectionStart); - + // Insert the new text InsertText(string, stringLen, fSelStart, NULL); fSelStart += stringLen; From axeld at mail.berlios.de Thu Jan 4 10:47:08 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 4 Jan 2007 10:47:08 +0100 Subject: [Haiku-commits] r19693 - haiku/trunk/build/jam Message-ID: <200701040947.l049l8NO014798@sheep.berlios.de> Author: axeld Date: 2007-01-04 10:47:08 +0100 (Thu, 04 Jan 2007) New Revision: 19693 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19693&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: Removed ACPI module for the time being - it doesn't give us anything yet, and seems to make lots of problems (like spawning threads from an interrupt handler...). Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-04 09:40:54 UTC (rev 19692) +++ haiku/trunk/build/jam/HaikuImage 2007-01-04 09:47:08 UTC (rev 19693) @@ -98,9 +98,9 @@ via-rhine wb840 net_stack vlance $(GPL_ONLY)bcm440x $(GPL_ONLY)bcm570x ; -BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button ; +#BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button ; BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi config_manager - $(X86_ONLY)acpi $(X86_ONLY)agp usb + $(X86_ONLY)agp usb ; BEOS_ADD_ONS_FILESYSTEMS = bfs dos iso9660 ; @@ -135,7 +135,7 @@ AddDriversToHaikuImage input : ps2_hid usb_hid ; AddDriversToHaikuImage misc : poke ; AddDriversToHaikuImage net : $(BEOS_ADD_ONS_DRIVERS_NET) ; -AddDriversToHaikuImage power : $(BEOS_ADD_ONS_DRIVERS_ACPI) ; +#AddDriversToHaikuImage power : $(BEOS_ADD_ONS_DRIVERS_ACPI) ; # kernel AddFilesToHaikuImage beos system : kernel_$(TARGET_ARCH) ; @@ -239,7 +239,7 @@ AddFilesToHaikuImage beos system : zbeos ; # boot module links -AddBootModuleSymlinks $(X86_ONLY)acpi config_manager bfs block_io fast_log generic_ide_pci +AddBootModuleSymlinks config_manager bfs block_io fast_log generic_ide_pci $(X86_ONLY)isa ide ide_adapter $(X86_ONLY)ide_isa intel locked_pool $(PPC_ONLY)openpic pci scsi scsi_cd scsi_dsk scsi_periph silicon_image_3112 From axeld at pinc-software.de Thu Jan 4 11:37:01 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 4 Jan 2007 11:37:01 +0100 (MET) Subject: [Haiku-commits] r19692 - haiku/trunk/src/kits/interface In-Reply-To: <200701040940.l049et47014272@sheep.berlios.de> Message-ID: <4039625376-BeMail@zon> jackburton at BerliOS wrote: > - Implemented vertical auto scrolling (horizontal auto scrolling is > still missing). Note that the view jumps when there is nothing to > scroll, might be a bug in BView::ScrollBy() ? You can always scroll a view; it just changes the view's offset. Can you still compile our BTextView for R5 and test there? Bye, Axel. From stefano.ceccherini at gmail.com Thu Jan 4 11:38:42 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Thu, 4 Jan 2007 11:38:42 +0100 Subject: [Haiku-commits] r19692 - haiku/trunk/src/kits/interface In-Reply-To: <4039625376-BeMail@zon> References: <200701040940.l049et47014272@sheep.berlios.de> <4039625376-BeMail@zon> Message-ID: <894b9700701040238q2207e985pca4a761d41cb7f60@mail.gmail.com> 2007/1/4, Axel D?rfler : > You can always scroll a view; it just changes the view's offset. Can I'm not sure I understand what you mean. What seem to happen is that the view scrolls back and forth by a very small value. > you still compile our BTextView for R5 and test there? Not in the next few decades... er... weeks :) From jackburton at mail.berlios.de Thu Jan 4 11:44:30 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Thu, 4 Jan 2007 11:44:30 +0100 Subject: [Haiku-commits] r19694 - in haiku/trunk: headers/os/interface src/kits/interface Message-ID: <200701041044.l04AiUw1025045@sheep.berlios.de> Author: jackburton Date: 2007-01-04 11:44:29 +0100 (Thu, 04 Jan 2007) New Revision: 19694 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19694&view=rev Modified: haiku/trunk/headers/os/interface/TextView.h haiku/trunk/src/kits/interface/TextView.cpp Log: Implemented auto horizontal scrolling (by fixed steps for now), moved auto scrolling to its own method, introduced a new private StyledWidthUTF8Safe method. Modified: haiku/trunk/headers/os/interface/TextView.h =================================================================== --- haiku/trunk/headers/os/interface/TextView.h 2007-01-04 09:47:08 UTC (rev 19693) +++ haiku/trunk/headers/os/interface/TextView.h 2007-01-04 10:44:29 UTC (rev 19694) @@ -311,6 +311,11 @@ int32 length, float *outAscent = NULL, float *outDescent = NULL) const; + float StyledWidthUTF8Safe(int32 fromOffset, + int32 numChars, + float *outAscent = NULL, + float *outDescent = NULL) const; + float ActualTabWidth(float location) const; void DoInsertText(const char *inText, @@ -343,7 +348,8 @@ bool MessageDropped(BMessage *inMessage, BPoint where, BPoint offset); - + + void PerformAutoScrolling(); void UpdateScrollbars(); void AutoResize(bool doredraw=true); Modified: haiku/trunk/src/kits/interface/TextView.cpp =================================================================== --- haiku/trunk/src/kits/interface/TextView.cpp 2007-01-04 09:47:08 UTC (rev 19693) +++ haiku/trunk/src/kits/interface/TextView.cpp 2007-01-04 10:44:29 UTC (rev 19694) @@ -911,35 +911,8 @@ delete fClickRunner; fClickRunner = NULL; } - } else { - // Scroll the view a bit if mouse is outside the view bounds - - BRect bounds = Bounds(); - - // TODO: Horizontal scrolling - /*if (fWhere.x > bounds.right) - scrollBy.x = fWhere.x - bounds.right; - else if (fWhere.x < bounds.left) - scrollBy.x = fWhere.x - bounds.left; - */ - float lineHeight = 0; - float diff = 0; - if (fWhere.y > bounds.bottom) { - lineHeight = LineHeight(LineAt(bounds.LeftBottom())); - diff = fWhere.y - bounds.bottom; - } else if (fWhere.y < bounds.top) { - lineHeight = LineHeight(LineAt(bounds.LeftTop())); - diff = fWhere.y - bounds.top; // negative value - } - - // Always scroll vertically by multiples of line height, - // based on the distance of the cursor from the border of the view - // TODO: Refine this, I can't even remember how beos works here - BPoint scrollBy; - scrollBy.y = lineHeight > 0 ? lineHeight * (int32)(floorf(diff) / lineHeight) : 0; - if (scrollBy != B_ORIGIN) - ScrollBy(scrollBy.x, scrollBy.y); - } + } else + PerformAutoScrolling(); break; } @@ -1690,7 +1663,7 @@ // special case: go down one line if inOffset is a newline if (inOffset == textLength && (*fText)[inOffset - 1] == B_ENTER) { float ascent, descent; - StyledWidth(inOffset, 1, &ascent, &descent); + StyledWidthUTF8Safe(inOffset, 1, &ascent, &descent); result.y += height; height = ascent + descent; @@ -1698,23 +1671,23 @@ } else { int32 offset = line->offset; int32 length = inOffset - line->offset; - int32 numChars = length; + int32 numBytes = length; bool foundTab = false; do { - foundTab = fText->FindChar(B_TAB, offset, &numChars); + foundTab = fText->FindChar(B_TAB, offset, &numBytes); - float width = StyledWidth(offset, numChars); + float width = StyledWidth(offset, numBytes); result.x += width; if (foundTab) { result.x += ActualTabWidth(result.x); - numChars++; + numBytes++; } - offset += numChars; - length -= numChars; - numChars = length; + offset += numBytes; + length -= numBytes; + numBytes = length; } while (foundTab && length > 0); } } @@ -3497,6 +3470,21 @@ } +// Unlike the StyledWidth method, this one takes as parameter +// the number of chars, not the number of bytes. +float +BTextView::StyledWidthUTF8Safe(int32 fromOffset, int32 numChars, + float *outAscent, float *outDescent) const +{ + int32 toOffset = fromOffset; + while (numChars--) + toOffset = NextInitialByte(toOffset); + + const int32 length = toOffset - fromOffset; + return StyledWidth(fromOffset, length, outAscent, outDescent); +} + + /*! \brief Calculate the actual tab width for the given location. \param location The location to calculate the tab width of. \return The actual tab width for the given location @@ -4007,6 +3995,41 @@ } +void +BTextView::PerformAutoScrolling() +{ + // Scroll the view a bit if mouse is outside the view bounds + BRect bounds = Bounds(); + BPoint scrollBy; + + // TODO: refine horizontal scrolling, for example by + // scrolling char by char and not using fixed values + if (fWhere.x > bounds.right) { + scrollBy.x = floorf((fWhere.x - bounds.right) / 10); + } else if (fWhere.x < bounds.left) { + scrollBy.x = floorf((fWhere.x - bounds.left) / 10); // negative value + } + + float lineHeight = 0; + float vertDiff = 0; + if (fWhere.y > bounds.bottom) { + lineHeight = LineHeight(LineAt(bounds.LeftBottom())); + vertDiff = fWhere.y - bounds.bottom; + } else if (fWhere.y < bounds.top) { + lineHeight = LineHeight(LineAt(bounds.LeftTop())); + vertDiff = fWhere.y - bounds.top; // negative value + } + + // Always scroll vertically line by line or by multiples of that + // based on the distance of the cursor from the border of the view + // TODO: Refine this, I can't even remember how beos works here + scrollBy.y = lineHeight > 0 ? lineHeight * (int32)(floorf(vertDiff) / lineHeight) : 0; + + if (scrollBy != B_ORIGIN) + ScrollBy(scrollBy.x, scrollBy.y); +} + + /*! \brief Updates the scrollbars associated with the object (if any). */ void From darkwyrm at earthlink.net Thu Jan 4 12:37:58 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Thu, 04 Jan 2007 06:37:58 -0500 EST Subject: [Haiku-commits] r19691 - haiku/trunk/src/apps/bemail In-Reply-To: <586816522-BeMail@zon> Message-ID: <1622131927-BeMail@sapphire> > It should have been: > > filter_result > AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) > { > ... > > Function brackets are always on the first column. Yesterday was overall a really bad day. I'm not surprised I was a little overzealous on that one. Nothing went right yesterday and apparently I was too tired to see this last night before bed. Yeesh. :- / --DW From axeld at mail.berlios.de Thu Jan 4 13:28:32 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 4 Jan 2007 13:28:32 +0100 Subject: [Haiku-commits] r19695 - haiku/trunk/src/servers/app Message-ID: <200701041228.l04CSWTd013692@sheep.berlios.de> Author: axeld Date: 2007-01-04 13:28:31 +0100 (Thu, 04 Jan 2007) New Revision: 19695 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19695&view=rev Modified: haiku/trunk/src/servers/app/CursorManager.cpp haiku/trunk/src/servers/app/CursorManager.h haiku/trunk/src/servers/app/ServerCursor.cpp haiku/trunk/src/servers/app/ServerCursor.h haiku/trunk/src/servers/app/ViewLayer.cpp Log: At least temporary fix for the Deskbar not updating additional items (unless you resize it). The problem was that the view's screen clipping was not updated if its frame did not change because of a resized parent - but that might be needed if the new parent frame reveals a new portion of that view. I added a TODO so that if there is a way to test for this case, we only need to invalidate the clipping if really needed. For now, we always do it. Modified: haiku/trunk/src/servers/app/CursorManager.cpp =================================================================== --- haiku/trunk/src/servers/app/CursorManager.cpp 2007-01-04 10:44:29 UTC (rev 19694) +++ haiku/trunk/src/servers/app/CursorManager.cpp 2007-01-04 12:28:31 UTC (rev 19695) @@ -133,19 +133,27 @@ /*! - \brief Releases a reference to a cursor + \brief Removes a cursor if it's not referenced anymore. If this was the last reference to this cursor, it will be deleted. + Only if the cursor is deleted, \c true is returned. */ -void +bool CursorManager::RemoveCursor(ServerCursor* cursor) { if (!Lock()) - return; + return false; + if (cursor->ReferenceCount() > 0) { + // cursor has been referenced again in the mean time + Unlock(); + return false; + } + _RemoveCursor(cursor); Unlock(); + return true; } Modified: haiku/trunk/src/servers/app/CursorManager.h =================================================================== --- haiku/trunk/src/servers/app/CursorManager.h 2007-01-04 10:44:29 UTC (rev 19694) +++ haiku/trunk/src/servers/app/CursorManager.h 2007-01-04 12:28:31 UTC (rev 19695) @@ -39,7 +39,7 @@ int32 AddCursor(ServerCursor* cursor, int32 token = -1); void DeleteCursors(team_id team); - void RemoveCursor(ServerCursor* cursor); + bool RemoveCursor(ServerCursor* cursor); void SetCursorSet(const char* path); ServerCursor* GetCursor(cursor_which which); Modified: haiku/trunk/src/servers/app/ServerCursor.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerCursor.cpp 2007-01-04 10:44:29 UTC (rev 19694) +++ haiku/trunk/src/servers/app/ServerCursor.cpp 2007-01-04 12:28:31 UTC (rev 19695) @@ -197,11 +197,10 @@ return false; } - if (fManager) { - fManager->RemoveCursor(this); - } - delete this; + if (fManager && !fManager->RemoveCursor(this)) + return false; + delete this; return true; } return false; Modified: haiku/trunk/src/servers/app/ServerCursor.h =================================================================== --- haiku/trunk/src/servers/app/ServerCursor.h 2007-01-04 10:44:29 UTC (rev 19694) +++ haiku/trunk/src/servers/app/ServerCursor.h 2007-01-04 12:28:31 UTC (rev 19695) @@ -50,6 +50,7 @@ void Acquire() { atomic_add(&fReferenceCount, 1); } bool Release(); + int32 ReferenceCount() { return fReferenceCount; } void SetPendingViewCursor(bool pending); @@ -63,7 +64,7 @@ BPoint fHotSpot; team_id fOwningTeam; - int32 fReferenceCount; + vint32 fReferenceCount; uint8* fCursorData; CursorManager* fManager; vint32 fPendingViewCursor; Modified: haiku/trunk/src/servers/app/ViewLayer.cpp =================================================================== --- haiku/trunk/src/servers/app/ViewLayer.cpp 2007-01-04 10:44:29 UTC (rev 19694) +++ haiku/trunk/src/servers/app/ViewLayer.cpp 2007-01-04 12:28:31 UTC (rev 19695) @@ -900,6 +900,12 @@ newFrame.top - fFrame.top, dirtyRegion); ResizeBy(widthDiff, heightDiff, dirtyRegion); + } else { + // TODO: this covers the fact that our screen clipping might change + // when the parent changes its size, even though our frame stays + // the same - there might be a way to test for this, but axeld doesn't + // know, stippi should look into this when he's back :) + InvalidateScreenClipping(); } } From axeld at pinc-software.de Thu Jan 4 13:31:06 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 4 Jan 2007 13:31:06 +0100 (MET) Subject: [Haiku-commits] r19695 - haiku/trunk/src/servers/app In-Reply-To: <200701041228.l04CSWTd013692@sheep.berlios.de> Message-ID: <10885516881-BeMail@zon> axeld at BerliOS wrote: > Modified: > haiku/trunk/src/servers/app/CursorManager.cpp > haiku/trunk/src/servers/app/CursorManager.h > haiku/trunk/src/servers/app/ServerCursor.cpp > haiku/trunk/src/servers/app/ServerCursor.h > haiku/trunk/src/servers/app/ViewLayer.cpp > Log: > At least temporary fix for the Deskbar not updating additional items > (unless you resize it). > The problem was that the view's screen clipping was not updated if > its frame did not change > because of a resized parent - but that might be needed if the new > parent frame reveals a > new > portion of that view. > I added a TODO so that if there is a way to test for this case, we > only need to invalidate > the clipping if really needed. For now, we always do it. I accidently added some other changes to this revision: they shouldn't do any harm, but they also don't improve anything; ie. they *don't* solve the reference counting problem we have in the cursor code. Bye, Axel. From axeld at mail.berlios.de Thu Jan 4 13:32:44 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 4 Jan 2007 13:32:44 +0100 Subject: [Haiku-commits] r19696 - haiku/trunk/src/servers/app Message-ID: <200701041232.l04CWibr015196@sheep.berlios.de> Author: axeld Date: 2007-01-04 13:32:44 +0100 (Thu, 04 Jan 2007) New Revision: 19696 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19696&view=rev Modified: haiku/trunk/src/servers/app/CursorManager.cpp Log: Added a comment that should make clear my last accidental commit doesn't fix anything. Modified: haiku/trunk/src/servers/app/CursorManager.cpp =================================================================== --- haiku/trunk/src/servers/app/CursorManager.cpp 2007-01-04 12:28:31 UTC (rev 19695) +++ haiku/trunk/src/servers/app/CursorManager.cpp 2007-01-04 12:32:44 UTC (rev 19696) @@ -144,6 +144,7 @@ if (!Lock()) return false; + // TODO: this doesn't work as it looks like, and it's not safe! if (cursor->ReferenceCount() > 0) { // cursor has been referenced again in the mean time Unlock(); From axeld at mail.berlios.de Thu Jan 4 15:25:14 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 4 Jan 2007 15:25:14 +0100 Subject: [Haiku-commits] r19697 - in haiku/trunk: headers/os/interface src/kits/interface Message-ID: <200701041425.l04EPE25000237@sheep.berlios.de> Author: axeld Date: 2007-01-04 15:25:13 +0100 (Thu, 04 Jan 2007) New Revision: 19697 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19697&view=rev Modified: haiku/trunk/headers/os/interface/Slider.h haiku/trunk/src/kits/interface/Slider.cpp Log: Changes to let updates happen less frequently: * _ContrainPoint() was broken as it could never change the point it was supposed to contrain. * MouseDown() no longer sends a notification message automatically (only if it changed something) * MouseMoved() and synchronous MouseDown() will now only send modification messages if something actually changed (not for every mouse update). * After key presses, the invokation message is only sent when the value changed. Modified: haiku/trunk/headers/os/interface/Slider.h =================================================================== --- haiku/trunk/headers/os/interface/Slider.h 2007-01-04 12:32:44 UTC (rev 19696) +++ haiku/trunk/headers/os/interface/Slider.h 2007-01-04 14:25:13 UTC (rev 19697) @@ -148,7 +148,7 @@ float _MinPosition() const; float _MaxPosition() const; - bool _ConstrainPoint(BPoint point, BPoint compare) const; + bool _ConstrainPoint(BPoint& point, BPoint compare) const; virtual void _ReservedSlider5(); virtual void _ReservedSlider6(); Modified: haiku/trunk/src/kits/interface/Slider.cpp =================================================================== --- haiku/trunk/src/kits/interface/Slider.cpp 2007-01-04 12:32:44 UTC (rev 19696) +++ haiku/trunk/src/kits/interface/Slider.cpp 2007-01-04 14:25:13 UTC (rev 19697) @@ -407,14 +407,20 @@ switch (bytes[0]) { case B_LEFT_ARROW: case B_DOWN_ARROW: { + int32 oldValue = Value(); + SetValue(Value() - KeyIncrementValue()); - Invoke(); + if (oldValue != Value()) + Invoke(); break; } case B_RIGHT_ARROW: case B_UP_ARROW: { + int32 oldValue = Value(); + SetValue(Value() + KeyIncrementValue()); - Invoke(); + if (oldValue != Value()) + Invoke(); break; } default: @@ -423,8 +429,13 @@ } +/*! + Makes sure the \a point is within valid bounds. + Returns \c true if the relevant coordinate (depending on the orientation + of the slider) differs from \a comparePoint. +*/ bool -BSlider::_ConstrainPoint(BPoint point, BPoint comparePoint) const +BSlider::_ConstrainPoint(BPoint& point, BPoint comparePoint) const { if (fOrientation == B_HORIZONTAL) { if (point.x != comparePoint.x) { @@ -465,7 +476,8 @@ _ConstrainPoint(point, fInitialLocation); SetValue(ValueForPoint(point)); - InvokeNotify(ModificationMessage(), B_CONTROL_MODIFIED); + if (_Location() != fInitialLocation) + InvokeNotify(ModificationMessage(), B_CONTROL_MODIFIED); if (Window()->Flags() & B_ASYNCHRONOUS_CONTROLS) { SetTracking(true); @@ -481,8 +493,11 @@ GetMouse(&point, &buttons, true); if (_ConstrainPoint(point, prevPoint)) { - SetValue(ValueForPoint(point)); - InvokeNotify(ModificationMessage(), B_CONTROL_MODIFIED); + int32 value = ValueForPoint(point); + if (value != Value()) { + SetValue(value); + InvokeNotify(ModificationMessage(), B_CONTROL_MODIFIED); + } } } if (_Location() != fInitialLocation) @@ -509,8 +524,11 @@ { if (IsTracking()) { if (_ConstrainPoint(point, _Location())) { - SetValue(ValueForPoint(point)); - InvokeNotify(ModificationMessage(), B_CONTROL_MODIFIED); + int32 value = ValueForPoint(point); + if (value != Value()) { + SetValue(value); + InvokeNotify(ModificationMessage(), B_CONTROL_MODIFIED); + } } } else BControl::MouseMoved(point, transit, message); From axeld at mail.berlios.de Thu Jan 4 15:27:05 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 4 Jan 2007 15:27:05 +0100 Subject: [Haiku-commits] r19698 - haiku/trunk/src/preferences/screensaver Message-ID: <200701041427.l04ER59j000785@sheep.berlios.de> Author: axeld Date: 2007-01-04 15:27:05 +0100 (Thu, 04 Jan 2007) New Revision: 19698 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19698&view=rev Modified: haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp Log: * Changing any of the sliders will now cause the settings to be saved. * The TimeSlider now sends an update message for ongoing changes, and an invokation message when the mouse button was released (standard BSlider behaviour). * Fixed incorrect initial string when the screen saver should start after 30 seconds of inactivity. Modified: haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp 2007-01-04 14:25:13 UTC (rev 19697) +++ haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp 2007-01-04 14:27:05 UTC (rev 19698) @@ -43,27 +43,27 @@ const int32 kMsgTestSaver = 'TEST'; const int32 kMsgAddSaver = 'ADD '; const int32 kMsgPasswordCheckBox = 'PWCB'; -const int32 kMsgRunSliderChanged = 'RSCG'; -const int32 kMsgPasswordSliderChanged = 'PWCG'; +const int32 kMsgRunSliderUpdate = 'RSup'; +const int32 kMsgPasswordSliderUpdate = 'PWup'; const int32 kMsgChangePassword = 'PWBT'; const int32 kMsgEnableScreenSaverBox = 'ESCH'; const int32 kMsgTurnOffCheckBox = 'TUOF'; -const int32 kMsgTurnOffSliderChanged = 'TUCG'; +const int32 kMsgTurnOffSliderUpdate = 'TUup'; const int32 kMsgFadeCornerChanged = 'fdcc'; const int32 kMsgNeverFadeCornerChanged = 'nfcc'; -static const uint32 kTimeSliderChanged = 'tsch'; +const uint32 kMsgTimeSliderChanged = 'tsch'; class TimeSlider : public BSlider { public: - TimeSlider(BRect frame, const char* name, uint32 modificationMessage); + TimeSlider(BRect frame, const char* name, uint32 changedMessage, + uint32 updateMessage); virtual ~TimeSlider(); virtual void AttachedToWindow(); - virtual void MessageReceived(BMessage* message); virtual void SetValue(int32 value); void SetTime(bigtime_t useconds); @@ -71,8 +71,6 @@ private: void _TimeToString(bigtime_t useconds, BString& string); - - uint32 fModificationMessage; }; class FadeView : public BView { @@ -130,13 +128,13 @@ static const int32 kTimeUnitCount = sizeof(kTimeInUnits) / sizeof(kTimeInUnits[0]); -TimeSlider::TimeSlider(BRect frame, const char* name, uint32 modificationMessage) - : BSlider(frame, name, "0 minutes", new BMessage(kTimeSliderChanged), - 0, kTimeUnitCount - 1, B_TRIANGLE_THUMB, B_FOLLOW_LEFT_RIGHT), - fModificationMessage(modificationMessage) +TimeSlider::TimeSlider(BRect frame, const char* name, uint32 changedMessage, + uint32 updateMessage) + : BSlider(frame, name, "30 seconds", new BMessage(changedMessage), + 0, kTimeUnitCount - 1, B_TRIANGLE_THUMB, B_FOLLOW_LEFT_RIGHT) { SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); - SetModificationMessage(new BMessage(kTimeSliderChanged)); + SetModificationMessage(new BMessage(updateMessage)); SetBarThickness(10); } @@ -150,25 +148,11 @@ TimeSlider::AttachedToWindow() { BSlider::AttachedToWindow(); - SetTarget(this); + SetTarget(Window()); } void -TimeSlider::MessageReceived(BMessage* message) -{ - switch (message->what) { - case kTimeSliderChanged: - Window()->PostMessage(fModificationMessage); - break; - - default: - BSlider::MessageReceived(message); - } -} - - -void TimeSlider::SetValue(int32 value) { int32 oldValue = Value(); @@ -673,7 +657,8 @@ box->AddChild(stringView); rect.left += labelWidth; - fRunSlider = new TimeSlider(rect, "RunSlider", kMsgRunSliderChanged); + fRunSlider = new TimeSlider(rect, "RunSlider", kMsgTimeSliderChanged, + kMsgRunSliderUpdate); float width, height; fRunSlider->GetPreferredSize(&width, &height); fRunSlider->ResizeTo(fRunSlider->Bounds().Width(), height); @@ -688,7 +673,8 @@ box->AddChild(fTurnOffCheckBox); rect.left += radioButtonOffset + labelWidth; - fTurnOffSlider = new TimeSlider(rect, "TurnOffSlider", kMsgTurnOffSliderChanged); + fTurnOffSlider = new TimeSlider(rect, "TurnOffSlider", kMsgTimeSliderChanged, + kMsgTurnOffSliderUpdate); fTurnOffSlider->ResizeTo(fTurnOffSlider->Bounds().Width(), height); box->AddChild(fTurnOffSlider); @@ -701,7 +687,8 @@ box->AddChild(fPasswordCheckBox); rect.left += radioButtonOffset + labelWidth; - fPasswordSlider = new TimeSlider(rect, "PasswordSlider", kMsgPasswordSliderChanged); + fPasswordSlider = new TimeSlider(rect, "PasswordSlider", kMsgTimeSliderChanged, + kMsgPasswordSliderUpdate); fPasswordSlider->ResizeTo(fPasswordSlider->Bounds().Width(), height); box->AddChild(fPasswordSlider); @@ -845,7 +832,7 @@ switch (msg->what) { // "Fade" tab - case kMsgRunSliderChanged: + case kMsgRunSliderUpdate: if (fRunSlider->Value() > fTurnOffSlider->Value()) fTurnOffSlider->SetValue(fRunSlider->Value()); @@ -857,16 +844,17 @@ fTurnOffSlider->SetEnabled(fTurnOffCheckBox->Value() == B_CONTROL_ON); break; - case kMsgTurnOffSliderChanged: + case kMsgTurnOffSliderUpdate: if (fRunSlider->Value() > fTurnOffSlider->Value()) fRunSlider->SetValue(fTurnOffSlider->Value()); break; - case kMsgPasswordSliderChanged: + case kMsgPasswordSliderUpdate: if (fPasswordSlider->Value() < fRunSlider->Value()) fRunSlider->SetValue(fPasswordSlider->Value()); break; + case kMsgTimeSliderChanged: case kMsgPasswordCheckBox: case kMsgEnableScreenSaverBox: case kMsgFadeCornerChanged: From axeld at mail.berlios.de Thu Jan 4 16:29:52 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 4 Jan 2007 16:29:52 +0100 Subject: [Haiku-commits] r19699 - haiku/trunk/src/add-ons/input_server/filters/screensaver Message-ID: <200701041529.l04FTqxP007748@sheep.berlios.de> Author: axeld Date: 2007-01-04 16:29:52 +0100 (Thu, 04 Jan 2007) New Revision: 19699 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19699&view=rev Modified: haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.cpp haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.h Log: * fEnabled is now maintained correctly, so that a screen blanker is now also quit by _Banish() (never happened before). * Instead of sending a new message for every mouse move in a corner, we now keep one BMessageRunner around and only update its interval; we now also check the time with no events in CheckCornerInvoke() - this both makes sure that the screen is not blanked while there is still user activity. * The screen saver never worked if you didn't set the never-blank corner to something. Modified: haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.cpp =================================================================== --- haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.cpp 2007-01-04 14:27:05 UTC (rev 19698) +++ haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.cpp 2007-01-04 15:29:52 UTC (rev 19699) @@ -20,11 +20,15 @@ #include +#include + #define CALLED() SERIAL_PRINT(("%s\n", __PRETTY_FUNCTION__)) static const int32 kNeverBlankCornerSize = 10; static const int32 kBlankCornerSize = 5; +static const bigtime_t kCornerDelay = 1000000LL; + // one second static const int32 kMsgCheckTime = 'SSCT'; static const int32 kMsgCornerInvoke = 'Scin'; @@ -38,7 +42,7 @@ BInputServerFilter* instantiate_input_filter() { - return new ScreenSaverFilter(); + return new (std::nothrow) ScreenSaverFilter(); } @@ -105,11 +109,15 @@ fEnabled(false), fFrameNum(0), fRunner(NULL), + fCornerRunner(NULL), fWatchingDirectory(false), fWatchingFile(false) { CALLED(); - fController = new ScreenSaverController(this); + fController = new (std::nothrow) ScreenSaverController(this); + if (fController == NULL) + return; + fController->Run(); ReloadSettings(); @@ -119,6 +127,7 @@ ScreenSaverFilter::~ScreenSaverFilter() { + delete fCornerRunner; delete fRunner; if (fWatchingFile || fWatchingDirectory) @@ -169,13 +178,15 @@ ScreenSaverFilter::_Invoke() { CALLED(); - if (fCurrentCorner == fNeverBlankCorner || fEnabled + if (fCurrentCorner == fNeverBlankCorner && fNeverBlankCorner != NO_CORNER || fSettings.TimeFlags() == SAVER_DISABLED + || fEnabled || be_roster->IsRunning(SCREEN_BLANKER_SIG)) return; SERIAL_PRINT(("we run screenblanker\n")); - be_roster->Launch(SCREEN_BLANKER_SIG); + if (be_roster->Launch(SCREEN_BLANKER_SIG) == B_OK) + fEnabled = true; } @@ -192,6 +203,10 @@ return; } + delete fCornerRunner; + delete fRunner; + fRunner = fCornerRunner = NULL; + fSettings.Load(); fBlankCorner = fSettings.BlankCorner(); @@ -199,10 +214,15 @@ fBlankTime = fSnoozeTime = fSettings.BlankTime(); CheckTime(); - delete fRunner; + if (fBlankCorner != NO_CORNER || fNeverBlankCorner != NO_CORNER) { + BMessage invoke(kMsgCornerInvoke); + fCornerRunner = new (std::nothrow) BMessageRunner(fController, + &invoke, B_INFINITE_TIMEOUT); + // will be reset in Filter() + } BMessage check(kMsgCheckTime); - fRunner = new BMessageRunner(fController, &check, fSnoozeTime); + fRunner = new (std::nothrow) BMessageRunner(fController, &check, fSnoozeTime); if (fRunner->InitCheck() != B_OK) { SERIAL_PRINT(("fRunner init failed\n")); } @@ -221,6 +241,7 @@ // Don't care if it fails BMessenger blankerMessenger(SCREEN_BLANKER_SIG, -1, NULL); blankerMessenger.SendMessage(B_QUIT_REQUESTED); + fEnabled = false; } @@ -252,7 +273,10 @@ void ScreenSaverFilter::CheckCornerInvoke() { - if (fCurrentCorner == fBlankCorner) + bigtime_t inactivity = system_time() - fLastEventTime; + + if (fCurrentCorner == fBlankCorner && fBlankCorner != NO_CORNER + && inactivity >= kCornerDelay) _Invoke(); } @@ -320,9 +344,8 @@ if (fBlankRect.Contains(where)) { fCurrentCorner = fBlankCorner; - // start screen blanker after one second - BMessage invoke(kMsgCornerInvoke); - if (BMessageRunner::StartSending(fController, &invoke, 1000000ULL, 1) != B_OK) + // start screen blanker after one second of inactivity + if (fCornerRunner->SetInterval(kCornerDelay) != B_OK) _Invoke(); break; } Modified: haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.h =================================================================== --- haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.h 2007-01-04 14:27:05 UTC (rev 19698) +++ haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.h 2007-01-04 15:29:52 UTC (rev 19699) @@ -66,6 +66,7 @@ ScreenSaverController* fController; node_ref fNodeRef; BMessageRunner* fRunner; + BMessageRunner* fCornerRunner; bool fWatchingDirectory, fWatchingFile; }; From axeld at mail.berlios.de Thu Jan 4 16:36:22 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 4 Jan 2007 16:36:22 +0100 Subject: [Haiku-commits] r19700 - haiku/trunk/src/preferences/screensaver Message-ID: <200701041536.l04FaMxq008357@sheep.berlios.de> Author: axeld Date: 2007-01-04 16:36:22 +0100 (Thu, 04 Jan 2007) New Revision: 19700 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19700&view=rev Modified: haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp Log: Now makes sure that the other sliders are updated on keyboard input as well. Modified: haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp 2007-01-04 15:29:52 UTC (rev 19699) +++ haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp 2007-01-04 15:36:22 UTC (rev 19700) @@ -43,20 +43,21 @@ const int32 kMsgTestSaver = 'TEST'; const int32 kMsgAddSaver = 'ADD '; const int32 kMsgPasswordCheckBox = 'PWCB'; +const int32 kMsgRunSliderChanged = 'RSch'; const int32 kMsgRunSliderUpdate = 'RSup'; +const int32 kMsgPasswordSliderChanged = 'PWch'; const int32 kMsgPasswordSliderUpdate = 'PWup'; const int32 kMsgChangePassword = 'PWBT'; const int32 kMsgEnableScreenSaverBox = 'ESCH'; const int32 kMsgTurnOffCheckBox = 'TUOF'; +const int32 kMsgTurnOffSliderChanged = 'TUch'; const int32 kMsgTurnOffSliderUpdate = 'TUup'; const int32 kMsgFadeCornerChanged = 'fdcc'; const int32 kMsgNeverFadeCornerChanged = 'nfcc'; -const uint32 kMsgTimeSliderChanged = 'tsch'; - class TimeSlider : public BSlider { public: TimeSlider(BRect frame, const char* name, uint32 changedMessage, @@ -657,7 +658,7 @@ box->AddChild(stringView); rect.left += labelWidth; - fRunSlider = new TimeSlider(rect, "RunSlider", kMsgTimeSliderChanged, + fRunSlider = new TimeSlider(rect, "RunSlider", kMsgRunSliderChanged, kMsgRunSliderUpdate); float width, height; fRunSlider->GetPreferredSize(&width, &height); @@ -673,8 +674,8 @@ box->AddChild(fTurnOffCheckBox); rect.left += radioButtonOffset + labelWidth; - fTurnOffSlider = new TimeSlider(rect, "TurnOffSlider", kMsgTimeSliderChanged, - kMsgTurnOffSliderUpdate); + fTurnOffSlider = new TimeSlider(rect, "TurnOffSlider", + kMsgTurnOffSliderChanged, kMsgTurnOffSliderUpdate); fTurnOffSlider->ResizeTo(fTurnOffSlider->Bounds().Width(), height); box->AddChild(fTurnOffSlider); @@ -687,8 +688,8 @@ box->AddChild(fPasswordCheckBox); rect.left += radioButtonOffset + labelWidth; - fPasswordSlider = new TimeSlider(rect, "PasswordSlider", kMsgTimeSliderChanged, - kMsgPasswordSliderUpdate); + fPasswordSlider = new TimeSlider(rect, "PasswordSlider", + kMsgPasswordSliderChanged, kMsgPasswordSliderUpdate); fPasswordSlider->ResizeTo(fPasswordSlider->Bounds().Width(), height); box->AddChild(fPasswordSlider); @@ -829,9 +830,10 @@ void ScreenSaverWindow::MessageReceived(BMessage *msg) { + // "Fade" tab, slider updates + switch (msg->what) { - // "Fade" tab - + case kMsgRunSliderChanged: case kMsgRunSliderUpdate: if (fRunSlider->Value() > fTurnOffSlider->Value()) fTurnOffSlider->SetValue(fRunSlider->Value()); @@ -840,21 +842,29 @@ fPasswordSlider->SetValue(fRunSlider->Value()); break; - case kMsgTurnOffCheckBox: - fTurnOffSlider->SetEnabled(fTurnOffCheckBox->Value() == B_CONTROL_ON); - break; - + case kMsgTurnOffSliderChanged: case kMsgTurnOffSliderUpdate: if (fRunSlider->Value() > fTurnOffSlider->Value()) fRunSlider->SetValue(fTurnOffSlider->Value()); break; + case kMsgPasswordSliderChanged: case kMsgPasswordSliderUpdate: if (fPasswordSlider->Value() < fRunSlider->Value()) fRunSlider->SetValue(fPasswordSlider->Value()); break; + } - case kMsgTimeSliderChanged: + switch (msg->what) { + // "Fade" tab + + case kMsgTurnOffCheckBox: + fTurnOffSlider->SetEnabled(fTurnOffCheckBox->Value() == B_CONTROL_ON); + break; + + case kMsgRunSliderChanged: + case kMsgTurnOffSliderChanged: + case kMsgPasswordSliderChanged: case kMsgPasswordCheckBox: case kMsgEnableScreenSaverBox: case kMsgFadeCornerChanged: @@ -872,8 +882,11 @@ case kMsgUpdateList: fModulesView->PopulateScreenSaverList(); break; + + default: + BWindow::MessageReceived(msg); + break; } - BWindow::MessageReceived(msg); } From fekdahl at gmail.com Thu Jan 4 20:21:03 2007 From: fekdahl at gmail.com (Fredrik Ekdahl) Date: Thu, 04 Jan 2007 20:21:03 +0100 Subject: [Haiku-commits] r19691 - haiku/trunk/src/apps/bemail In-Reply-To: <200701032157.l03Lvhlj021160@sheep.berlios.de> References: <200701032157.l03Lvhlj021160@sheep.berlios.de> Message-ID: <459D539F.9020709@gmail.com> darkwyrm at BerliOS skrev: > Author: darkwyrm > Date: 2007-01-03 22:57:42 +0100 (Wed, 03 Jan 2007) > New Revision: 19691 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19691&view=rev > > Modified: > haiku/trunk/src/apps/bemail/AutoTextControl.cpp > haiku/trunk/src/apps/bemail/AutoTextControl.h > Log: > Style fixes. I'm pretty sure I got everything, too. :^) > > > > Modified: haiku/trunk/src/apps/bemail/AutoTextControl.h > =================================================================== > > + friend AutoTextControlFilter Hello! If you change that line (43) to friend class AutoTextControlFilter instead, the build is no longer broken with gcc4. /Fredrik Ekdahl From darkwyrm at mail.berlios.de Thu Jan 4 23:16:10 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Thu, 4 Jan 2007 23:16:10 +0100 Subject: [Haiku-commits] r19701 - haiku/trunk/src/apps/bemail Message-ID: <200701042216.l04MGApm003949@sheep.berlios.de> Author: darkwyrm Date: 2007-01-04 23:16:09 +0100 (Thu, 04 Jan 2007) New Revision: 19701 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19701&view=rev Modified: haiku/trunk/src/apps/bemail/AutoTextControl.cpp haiku/trunk/src/apps/bemail/AutoTextControl.h Log: Style fix, courtesy of Ingo (man, yesterday was bad!) GCC4 compilation fix, thanks to Frederik Ekdahl Modified: haiku/trunk/src/apps/bemail/AutoTextControl.cpp =================================================================== --- haiku/trunk/src/apps/bemail/AutoTextControl.cpp 2007-01-04 15:36:22 UTC (rev 19700) +++ haiku/trunk/src/apps/bemail/AutoTextControl.cpp 2007-01-04 22:16:09 UTC (rev 19701) @@ -24,8 +24,8 @@ } filter_result -AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) { - +AutoTextControlFilter::Filter(BMessage *msg, BHandler **target) +{ // This is really slick -- all that is needed to allow Escape key cancelling is // just calling SetEscapeCancel(true) for just *one* AutoTextControl in a window. *heh* int32 rawchar,mod; Modified: haiku/trunk/src/apps/bemail/AutoTextControl.h =================================================================== --- haiku/trunk/src/apps/bemail/AutoTextControl.h 2007-01-04 15:36:22 UTC (rev 19700) +++ haiku/trunk/src/apps/bemail/AutoTextControl.h 2007-01-04 22:16:09 UTC (rev 19701) @@ -40,7 +40,7 @@ void SetEscapeCancel(const bool &value) { fEscapeCancel = value; } bool IsEscapeCancel(void) const { return fEscapeCancel; } private: - friend AutoTextControlFilter; + friend class AutoTextControlFilter; AutoTextControlFilter *fFilter; bool fEscapeCancel; From darkwyrm at mail.berlios.de Thu Jan 4 23:20:41 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Thu, 4 Jan 2007 23:20:41 +0100 Subject: [Haiku-commits] r19702 - haiku/trunk/data/etc Message-ID: <200701042220.l04MKfno004536@sheep.berlios.de> Author: darkwyrm Date: 2007-01-04 23:20:40 +0100 (Thu, 04 Jan 2007) New Revision: 19702 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19702&view=rev Removed: haiku/trunk/data/etc/fortunes Log: Removing fortunes file to be replaced by a folder of fortune files in a forthcoming commit - matches R5 folder hierarchy this way Deleted: haiku/trunk/data/etc/fortunes From darkwyrm at mail.berlios.de Thu Jan 4 23:22:40 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Thu, 4 Jan 2007 23:22:40 +0100 Subject: [Haiku-commits] r19703 - in haiku/trunk/data/etc: . fortunes Message-ID: <200701042222.l04MMeFm005588@sheep.berlios.de> Author: darkwyrm Date: 2007-01-04 23:22:29 +0100 (Thu, 04 Jan 2007) New Revision: 19703 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19703&view=rev Added: haiku/trunk/data/etc/fortunes/ haiku/trunk/data/etc/fortunes/Art haiku/trunk/data/etc/fortunes/Computers haiku/trunk/data/etc/fortunes/Education haiku/trunk/data/etc/fortunes/Food haiku/trunk/data/etc/fortunes/Fortunes haiku/trunk/data/etc/fortunes/Goedel haiku/trunk/data/etc/fortunes/Humorists haiku/trunk/data/etc/fortunes/Kids haiku/trunk/data/etc/fortunes/Law haiku/trunk/data/etc/fortunes/Linux cookies haiku/trunk/data/etc/fortunes/Love haiku/trunk/data/etc/fortunes/Magic haiku/trunk/data/etc/fortunes/Medicine haiku/trunk/data/etc/fortunes/Miscellaneous haiku/trunk/data/etc/fortunes/News haiku/trunk/data/etc/fortunes/OS Fortunes haiku/trunk/data/etc/fortunes/One Liners haiku/trunk/data/etc/fortunes/Pets haiku/trunk/data/etc/fortunes/Platitudes haiku/trunk/data/etc/fortunes/Riddles haiku/trunk/data/etc/fortunes/Songs & Poems haiku/trunk/data/etc/fortunes/Sports haiku/trunk/data/etc/fortunes/Tech Support Excuses Log: Adding reworked fortunes from the Fortuna fortune pack Added: haiku/trunk/data/etc/fortunes/Art =================================================================== --- haiku/trunk/data/etc/fortunes/Art 2007-01-04 22:20:40 UTC (rev 19702) +++ haiku/trunk/data/etc/fortunes/Art 2007-01-04 22:22:29 UTC (rev 19703) @@ -0,0 +1,1675 @@ +7:30, Channel 5: The Bionic Dog (Action/Adventure) + The Bionic Dog drinks too much and kicks over the National Redwood Forest. + +7:30, Channel 8: The Bionic Dog (Action/Adventure) + The Bionic Dog gets a hormonal short-circuit and violates the Mann Act with an interstate Greyhound bus. +% +A "critic" is a man who creates nothing and thereby feels qualified to judge the work of creative men. There is logic in this; he is unbiased -- he hates all creative people equally. +% +A celebrity is a person who is known for his well-knownness. +% + A circus foreman was making the rounds inspecting the big top when a scrawny little man entered the tent and walked up to him. "Are you the foreman around here?" he asked timidly. "I'd like to join your circus; I have what I think is a pretty good act." + The foreman nodded assent, whereupon the little man hurried over to the main pole and rapidly climbed up to the very tip-top of the big top. Drawing a deep breath, he hurled himself off into the air and began flapping his arms furiously. Amazingly, rather than plummeting to his death the little man began to fly all around the poles, lines, trapezes and other obstacles, +performing astounding feats of aerobatics which ended in a long power dive from the top of the tent, pulling up into a gentle feet-first landing beside the foreman, who had been nonchalantly watching the whole time. + "Well," puffed the little man. "What do you think?" + "That's all you do?" answered the foreman scornfully. "Bird imitations?" +% +A critic is a bundle of biases held loosely together by a sense of taste. + -- Whitney Balliett +% +A diva who specializes in risque arias is an off-coloratura soprano. +% +A drama critic is a person who surprises a playwright by informing him what he meant. + -- Wilson Mizner +% +A fool-proof method for sculpting an elephant: first, get a huge block of marble; then you chip away everything that doesn't look like an elephant. +% + A hard-luck actor who appeared in one coloossal disaster after another finally got a break, a broken leg to be exact. Someone pointed out that it's the first time the poor fellow's been in the same cast for more than a week. +% +A Hollywood producer calls a friend, another producer on the phone. + "Hello?" his friend answers. + "Hi!" says the man. "This is Bob, how are you doing?" + "Oh," says the friend, "I'm doing great! I just sold a screenplay for two hundred thousand dollars. I've started a novel adaptation and the studio advanced me fifty thousand dollars on it. I also have a television series coming on next week, and everyone says it's going to be a big hit! I'm doing *great*! How are you?" + "Okay," says the producer, "give me a call when he leaves." +% +A man paints with his brains and not with his hands. +% + A musical reviewer admitted he always praised the first show of a new theatrical season. "Who am I to stone the first cast?" +% + A musician of more ambition than talent composed an elegy at the death of composer Edward MacDowell. She played the elegy for the pianist Josef Hoffman, then asked his opinion. "Well, it's quite nice," he replied, but don't you think it would be better if..." + "If what?" asked the composer. + "If ... if you had died and MacDowell had written the elegy?" +% +A poet who reads his verse in public may have other nasty habits. +% +A rose is a rose is a rose. Just ask Jean Marsh, known to millions of PBS viewers in the '70s as Rose, the maid on the BBC export "Upstairs, Downstairs." Though Marsh has since gone on to other projects, ... it's with Rose she's forever identified. So much so that she even likes to joke about having one named after her, a distinction not without its drawbacks. "I was very flattered when I heard about it, but when I looked up the official description, it said, `Jean Marsh: pale peach, not very good in beds; better up against a wall.' I want to tell you that's not true. I'm very good in beds as well." +% +A sequel is an admission that you've been reduced to imitating yourself. + -- Don Marquis +% + A shy teenage boy finally worked up the nerve to give a gift to Madonna, a young puppy. It hitched its waggin' to a star. +% +A team effort is a lot of people doing what I say. + -- Michael Winner, British film director +% +A true artist will let his wife starve, his children go barefoot, his mother drudge for his living at seventy, sooner than work at anything but his art. + -- Shaw +% +A writer is congenitally unable to tell the truth and that is why we call what he writes fiction. + -- William Faulkner +% +A yawn is a silent shout. + -- G.K. Chesterton +% +A young man wrote to Mozart and said: + +Q: "Herr Mozart, I am thinking of writing symphonies. Can you give me any suggestions as to how to get started?" +A: "A symphony is a very complex musical form, perhaps you should begin with some simple lieder and work your way up to a symphony." +Q: "But Herr Mozart, you were writing symphonies when you were 8 years old." +A: "But I never asked anybody how." +% +Acting is an art which consists of keeping the audience from coughing. +% +Actor Real Name + +Boris Karloff William Henry Pratt +Cary Grant Archibald Leach +Edward G. Robinson Emmanual Goldenburg +Gene Wilder Gerald Silberman +John Wayne Marion Morrison +Kirk Douglas Issur Danielovitch +Richard Burton Richard Jenkins Jr. +Roy Rogers Leonard Slye +Woody Allen Allen Stewart Konigsberg +% +Actors will happen even in the best-regulated families. +% +Actresses will happen in the best regulated families. + -- Addison Mizner and Oliver Herford, "The Entirely + New Cynic's Calendar", 1905 +% +Adding sound to movies would be like putting lipstick on the Venus de Milo. + -- actress Mary Pickford, 1925 +% +Adhere to your own act, and congratulate yourself if you have done something strange and extravagant, and broken the monotony of a decorous age. + -- Ralph Waldo Emerson +% +After a few boring years, socially meaningful rock 'n' roll died out. It was replaced by disco, which offers no guidance to any form of life more advanced than the lichen family. + -- Dave Barry, "Kids Today: They Don't Know Dum Diddly Do" +% +Alex Haley was adopted! +% +All art is but imitation of nature. + -- Lucius Annaeus Seneca +% +An actor's a guy who if you ain't talkin' about him, ain't listening. + -- Marlon Brando +% +An artist should be fit for the best society and keep out of it. +% +Another possible source of guidance for teenagers is television, but television's message has always been that the need for truth, wisdom and world peace pales by comparison with the need for a toothpaste that offers whiter teeth *and* fresher breath. + -- Dave Barry, "Kids Today: They Don't Know Dum Diddly Do" +% +Any dramatic series the producers want us to take seriously as a representation of contemporary reality cannot be taken seriously as a representation of anything -- except a show to be ignored by anyone capable of sitting upright in a chair and chewing gum simultaneously. + -- Richard Schickel +% +Any fool can paint a picture, but it takes a wise person to be able to sell it. +% + "Are you police officers?" + "No, ma'am. We're musicians." + -- The Blues Brothers +% +Around the turn of this century, a composer named Camille Saint-Saens wrote a satirical zoological-fantasy called "Le Carnaval des Animaux." Aside from one movement of this piece, "The Swan", Saint-Saens didn't allow this work to be published or even performed until a year had elapsed after his death. (He died in 1921.) + Most of us know the "Swan" movement rather well, with its smooth, flowing cello melody against a calm background; but I've been having this fantasy... + What if he had written this piece with lyrics, as a song to be sung? And, further, what if he had accompanied this song with a musical saw? (This instrument really does exist, often played by percussionists!) Then the piece would be better known as: + SAINT-SAENS' SAW SONG "SWAN"! +% +Art is a jealous mistress. + -- Ralph Waldo Emerson +% +Art is a lie which makes us realize the truth. + -- Picasso +% +Art is anything you can get away with. + -- Marshall McLuhan. +% +Art is either plagiarism or revolution. + -- Paul Gauguin +% +Art is Nature speeded up and God slowed down. + -- Chazal +% +Art is the tree of life. Science is the tree of death. +% +As a goatherd learns his trade by goat, so a writer learns his trade by wrote. +% +Asking a working writer what he thinks about critics is like asking a lamp-post how it feels about dogs. + -- Christopher Hampton +% +Authors (and perhaps columnists) eventually rise to the top of whatever depths they were once able to plumb. + -- Stanley Kaufman +% +Authors are easy to get on with -- if you're fond of children. + -- Michael Joseph, "Observer" +% +Bahdges? We don't need no stinkin' bahdges! + -- "The Treasure of Sierra Madre" +% +Be regular and orderly in your life, so that you may be violent and original in your work. + -- Flaubert +% +Being a mime means never having to say you're sorry. +% +"Being disintegrated makes me ve-ry an-gry!" +% +Ben, why didn't you tell me? + -- Luke Skywalker +% +"Benson, you are so free of the ravages of intelligence" + -- Time Bandits +% +Best Mistakes In Films + In his "Filmgoer's Companion", Mr. Leslie Halliwell helpfully lists four of the cinema's greatest moments which you should get to see if at all possible. + In "Carmen Jones", the camera tracks with Dorothy Dandridge down a street; and the entire film crew is reflected in the shop window. + In "The Wrong Box", the roofs of Victorian London are emblazoned with television aerials. + In "Decameron Nights", Louis Jourdain stands on the deck of his fourteenth century pirate ship; and a white lorry trundles down the hill in the background. + In "Viking Queen", set in the times of Boadicea, a wrist watch is clearly visible on one of the leading characters. + -- Stephen Pile, "The Book of Heroic Failures" +% +BS: You remind me of a man. +B: What man? +BS: The man with the power. +B: What power? +BS: The power of voodoo. +B: Voodoo? +BS: You do. +B: Do what? +BS: Remind me of a man. +B: What man? +BS: The man with the power... + -- Cary Grant, "The Bachelor and the Bobby-Soxer" +% +Burnt Sienna. That's the best thing that ever happened to Crayolas. + -- Ken Weaver +% +But if you wish at once to do nothing and to be respectable nowdays, the best pretext is to be at work on some profound study. + -- Leslie Stephen, "Sketches from Cambridge" +% +But you shall not escape my iambics. + -- Gaius Valerius Catullus +% +Can't act. Slightly bald. Also dances. + -- RKO executive, reacting to Fred Astaire's screen test. + Cerf/Navasky, "The Experts Speak" +% +Classical music is the kind we keep thinking will turn into a tune. + -- Kin Hubbard, "Abe Martin's Sayings" +% +Darth Vader sleeps with a Teddywookie. +% +Darth Vader! Only you would be so bold! + -- Princess Leia Organa +% +Did you know that the voice tapes easily identify the Russian pilot that shot down the Korean jet? At one point he definitely states: + + "Natasha! First we shoot jet, then we go after moose and squirrel." + + -- ihuxw!tommyo +% +Disco is to music what Etch-A-Sketch is to art. +% +Don't everyone thank me at once! + -- Han Solo +% +Dustin Farnum: Why, yesterday, I had the audience glued to their seats! +Oliver Herford: Wonderful! Wonderful! Clever of you to think of it! + -- Brian Herbert, "Classic Comebacks" +% +Dying is easy. Comedy is difficult. + -- Actor Edmond Gween, on his deathbed. +% +E.T. GO HOME!!! (And take your Smurfs with you.) +% +Ed Sullivan will be around as long as someone else has talent. + -- Fred Allen +% +Eeny, Meeny, Jelly Beanie, the spirits are about to speak! + -- Bullwinkle Moose +% +Elwood: What kind of music do you get here ma'am? +Barmaid: Why, we get both kinds of music, Country and Western. +% +Ever get the feeling that the world's on tape and one of the reels is missing? + -- Rich Little +% +Everyone is in the best seat. + -- John Cage +% +Fame lost its appeal for me when I went into a public restroom and an autograph seeker handed me a pen and paper under the stall door. + -- Marlo Thomas +% +Fast ship? You mean you've never heard of the Millennium Falcon? + -- Han Solo +% +"First things first -- but not necessarily in that order" + -- The Doctor, "Doctor Who" +% +Fools rush in -- and get the best seats in the house. +% +For myself, I can only say that I am astonished and somewhat terrified at the results of this evening's experiments. Astonished at the wonderful power you have developed, and terrified at the thought that so much hideous and bad music may be put on record forever. + -- Sir Arthur Sullivan, message to Edison, 1888 +% +For the next hour, WE will control all that you see and hear. +% +Forms follow function, and often obliterate it. +% +FORTUNE DISCUSSES THE OBSCURE FILMS: #12 + +O.E.D.: David Lean, 1969, 3 hours 30 min. + + Lean's version of the Oxford Dictionary has been accused of + shallowness in its treatment of a complete work. Omar Sharif + tends to overact as aardvark, but Alec Guiness is solid in + the role of abbacy. As usual, the photography is stunning. + With Julie Christie. +% +FORTUNE DISCUSSES THE OBSCURE FILMS: #3 + +MIRACLE ON 42ND STREET: + Santa Claus, in the off season, follows his heart's desire and tries to make it big on Broadway. Santa sings and dances his way into your heart. +% +FORTUNE DISCUSSES THE OBSCURE FILMS: #5 + +THE ATOMIC GRANDMOTHER: + This humorous but heart-warming story tells of an elderly woman forced to work at a nuclear power plant in order to help the family make ends meet. At night, granny sits on the porch, tells tales of her colorful past, and the family uses her to cook barbecues and to power small electrical appliances. Maureen Stapleton gives a glowing performance. +% +FORTUNE DISCUSSES THE OBSCURE FILMS: #9 + +THE PARKING PROBLEM IN PARIS: Jean-Luc Godard, 1971, 7 hours 18 min. + + Godard's meditation on the topic has been described as everything from "timeless" to "endless." (Remade by Gene Wilder as NO PLACE TO PARK.) +% +FORTUNE'S FUN FACTS TO KNOW AND TELL: #37 + Can you name the seven seas? + Antartic, Artic, North Atlantic, South Atlantic, Indian, + North Pacific, South Pacific. + + Can you name the seven dwarfs from Snow White? + Doc, Dopey, Sneezy, Happy, Grumpy, Sleepy and Bashful. +% +Fremen add life to spice! +% + FROM THE DESK OF + Dorothy Gale + + Auntie Em: + Hate you. + Hate Kansas. + Taking the dog. + Dorothy +% +G. B. Shaw to William Douglas Home: "Go on writing plays, my boy. One of these days a London producer will go into his office and say to his secretary, `Is there a play from Shaw this morning?' and when she says `No,' he will say, `Well, then we'll have to start on the rubbish.' And that's your chance, my boy." +% +Gauls! We have nothing to fear; except perhaps that the sky may fall on our heads tomorrow. But as we all know, tomorrow never comes!! + -- Adventures of Asterix +% +George Bernard Shaw once sent two tickets to the opening night of one of his plays to Winston Churchill with the following note: + "Bring a friend, if you have one." + +Churchill wrote back, returning the two tickets and excused himself as he had a previous engagement. He also attached the following: + "Please send me two tickets for the next night, if there is one." +% +Go ahead... make my day. + -- Dirty Harry +% +God help the troubadour who tries to be a star. The more that you try to find success, the more that you will fail. + -- Phil Ochs, on the Second System Effect +% +God is really only another artist. He invented the giraffe, the elephant and the cat. He has no real style, He just goes on trying other things. + -- Pablo Picasso +% +God save us from a bad neighbor and a beginner on the fiddle. +% +Good night, Mrs. Calabash, wherever you are. +% +Governor Tarkin. I should have expected to find you holding Vader's leash. I thought I recognized your foul stench when I was brought on board. + -- Princess Leia Organa +% +GREAT MOMENTS IN AMERICAN HISTORY (#17): + +On November 13, Felix Unger was asked to remove himself from his place of residence. +% +Grig (the navigator): ... so you see, it's just the two of us against the entire space armada. +Alex (the gunner): What?!? +Grig: I've always wanted to fight a desperate battle against overwhelming odds. +Alex: It'll be a slaughter! +Grig: That's the spirit! + -- The Last Starfighter +% +H. L. Mencken suffers from the hallucination that he is H. L. Mencken -- there is no cure for a disease of that magnitude. + -- Maxwell Bodenheim +% +"Hawk, we're going to die." +"Never say die... and certainly never say we." + -- M*A*S*H +% +He played the king as if afraid someone else would play the ace. + -- John Mason Brown, drama critic +% +He was a fiddler, and consequently a rogue. + -- Jonathon Swift +% +"Hello," he lied. + -- Don Carpenter, quoting a Hollywood agent +% +Hello. Jim Rockford's machine, this is Larry Doheny's machine. Will you please have your master call my master at his convenience? Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. + -- "The Rockford Files" +% +Hi Jimbo. Dennis. Really appreciate the help on the income tax. You wanna help on the audit now? + -- "The Rockford Files" +% +Hoaars-Faisse Gallery presents: +An exhibit of works by the artist known only as Pretzel. + +The exhibit includes several large conceptual works using non-traditional media and found objects including old sofa-beds, used mace canisters, discarded sanitary napkins and parts of freeways. The artist explores our dehumanization due to high technology and unresponsive governmental structures in a post-industrial world. She/he (the artist prefers to remain without gender) strives to create dialogue between viewer and creator, to aid us in our quest to experience contemporary life with its inner-city tensions, homelessness, global warming and gender and class-based stress. The works are arranged to lead us to the essence of the argument: that the alienation of the person/machine boundary has sapped the strength of our voices and must be destroyed for society to +exist in a more fundamental sense. +% +Hollywood is where if you don't have happiness you send out for it. + -- Rex Reed +% +Holy Dilemma! Is this the end for the Caped Crusader and the Boy Wonder? Will the Joker and the Riddler have the last laugh? + + Tune in again tomorrow: + same Bat-time, same Bat-channel! +% +How wonderful opera would be if there were no singers. +% +Hummingbirds never remember the words to songs. +% +Humpty Dumpty was pushed. +% +I accept chaos. I am not sure whether it accepts me. I know some people are terrified of the bomb. But then some people are terrified to be seen carrying a modern screen magazine. Experience teaches us that silence terrifies people the most. + -- Bob Dylan +% +I always had a repulsive need to be something more than human. + -- David Bowie +% +I am a deeply superficial person. + -- Andy Warhol +% +I believe that the moment is near when by a procedure of active paranoiac thought, it will be possible to systematize confusion and contribute to the total discrediting of the world of reality. + -- Salvador Dali +% +I can't understand why a person will take a year or two to write a novel when he can easily buy one for a few dollars. + -- Fred Allen +% +I didn't do it! Nobody saw me do it! Can't prove anything! + -- Bart Simpson +% +I didn't like the play, but I saw it under adverse conditions. The curtain was up. +% +I distrust a close-mouthed man. He generally picks the wrong time to talk and says the wrong things. Talking's something you can't do judiciously, unless you keep in practice. Now, sir, we'll talk if you like. I'll tell you right out, I'm a man who likes talking to a man who likes to talk. + -- Sidney Greenstreet, "The Maltese Falcon" +% +I don't know anything about music. In my line you don't have to. + -- Elvis Presley +% +I dread success. To have succeeded is to have finished one's business on earth, like the male spider, who is killed by the female the moment he has succeeded in his courtship. I like a state of continual becoming, with a goal in front and not behind. + -- George Bernard Shaw +% +I had another dream the other day about music critics. They were small and rodent-like with padlocked ears, as if they had stepped out of a painting by Goya. + -- Stravinsky +% +I have a very strange feeling about this... + -- Luke Skywalker +% +"I have come up with a sure-fire concept for a hit television show, which would be called `A Live Celebrity Gets Eaten by a Shark'." + -- Dave Barry, "The Wonders of Sharks on TV" +% +I have had my television aerials removed. It's the moral equivalent of a prostate operation. + -- Malcolm Muggeridge +% +I have more humility in my little finger than you have in your whole BODY! + -- from "Cerebus" #82 +% +I never failed to convince an audience that the best thing they could do was to go away. +% +I never made a mistake in my life. I thought I did once, but I was wrong. + -- Lucy Van Pelt +% +I often quote myself; it adds spice to my conversation. + -- G. B. Shaw +% +I played lead guitar in a band called The Federal Duck, which is the kind of name that was popular in the '60s as a result of controlled substances being in widespread use. Back then, there were no restrictions, in terms of talent, on who could make an album, so we made one, and it sounds like a group of people who have been given powerful but unfamiliar instruments as a therapy for a degenerative nerve disease. + -- Dave Barry, "The Snake" +% +I recognize terror as the finest emotion and so I will try to terrorize the reader. But if I find that I cannot terrify, I will try to horrify, and if I find that I cannot horrify, I'll go for the gross-out. + -- Stephen King +% +I remember once being on a station platform in Cleveland at four in the morning. A black porter was carrying my bags, and as we were waiting for the train to come in, he said to me: "Excuse me, Mr. Cooke, I don't want to invade your privacy, but I have a bet with a friend of mine. Who composed the opening theme music of 'Omnibus'? My friend said Virgil Thomson." I asked him, "What do you say?" He replied, "I say Aaron Copeland." I said, "You're right." The porter said, "I knew Thomson doesn't write counterpoint that way." I told that to a network president, and he was deeply unimpressed. + -- Alistair Cooke +% +I remember Ulysses well... Left one day for the post office to mail a letter, met a blonde named Circe on the streetcar, and didn't come back for 20 years. +% +I saw Lassie. It took me four shows to figure out why the hairy kid never spoke. I mean, he could roll over and all that, but did that deserve a series? +% +I stick my neck out for nobody. + -- Humphrey Bogart, "Casablanca" +% +I stopped believing in Santa Claus when I was six. Mother took me to see him in a department store and he asked for my autograph. + -- Shirley Temple +% +I suggest a new strategy, Artoo: let the Wookie win. + -- C3P0 +% + "I suppose you expect me to talk." + "No, Mr. Bond. I expect you to die." + -- Goldfinger +% +I think we're in trouble. + -- Han Solo +% +I think... I think it's in my basement... Let me go upstairs and check. + -- Escher +% +I truly wish I could be a great surgeon or philosopher or author or anything constructive, but in all honesty I'd rather turn up my amplifier full blast and drown myself in the noise. + -- Charles Schmid, the "Tucson Murderer" +% +I used to be disgusted, now I find I'm just amused. + -- Elvis Costello +% +I was working on a case. It had to be a case, because I couldn't afford a desk. Then I saw her. This tall blond lady. She must have been tall because I was on the third floor. She rolled her deep blue eyes towards me. I picked them up and rolled them back. We kissed. She screamed. I took the cigarette from my mouth and kissed her again. +% +I watch television because you don't know what it will do if you leave it in the room alone. +% +I went into the business for the money, and the art grew out of it. If people are disillusioned by that remark, I can't help it. It's the truth. + -- Charlie Chaplin +% +I went to a Grateful Dead Concert and they played for SEVEN hours. Great song. + -- Fred Reuss +% +I WISH I HAD A KRYPTONITE CROSS, because then you could keep both Dracula and Superman away. + -- Jack Handley, The New Mexican, 1988. +% +I wish there was a knob on the TV to turn up the intelligence. There's a knob called "brightness", but it doesn't seem to work. + -- Gallagher +% +I'd just as soon kiss a Wookie. + -- Princess Leia Organa +% +I'll be Grateful when they're Dead. +% +I'll never get off this planet. + -- Luke Skywalker +% +I'm a Hollywood writer; so I put on a sports jacket and take off my brain. +% +I'm not a real movie star -- I've still got the same wife I started out with twenty-eight years ago. + -- Will Rogers +% +I've got a very bad feeling about this. + -- Han Solo +% + I. Any body suspended in space will remain in space until made aware of its situation. + Daffy Duck steps off a cliff, expecting further pastureland. He + loiters in midair, soliloquizing flippantly, until he chances to + look down. At this point, the familiar principle of 32 feet per + second per second takes over. + II. Any body in motion will tend to remain in motion until solid matter intervenes suddenly. + Whether shot from a cannon or in hot pursuit on foot, cartoon + characters are so absolute in their momentum that only a telephone + pole or an outsize boulder retards their forward motion absolutely. + Sir Isaac Newton called this sudden termination of motion the + stooge's surcease. +III. Any body passing through solid matter will leave a perforation conforming to its perimeter. + Also called the silhouette of passage, this phenomenon is the + speciality of victims of directed-pressure explosions and of reckless + cowards who are so eager to escape that they exit directly through + the wall of a house, leaving a cookie-cutout-perfect hole. The + threat of skunks or matrimony often catalyzes this reaction. + -- Esquire, "O'Donnell's Laws of Cartoon Motion", June 1980 +% +If *I* had a hammer, there'd be no more folk singers. +% +If all the world's a stage, I want to operate the trap door. + -- Paul Beatty +% +If an average person on the subway turns to you, like an ancient mariner, and starts telling you her tale, you turn away or nod and hope she stops, not just because you fear she might be crazy. If she tells her tale on camera, you might listen. Watching strangers on television , even responding to them from a studio audience, we're disengaged -- voyeurs collaborating with exhibitionists in rituals of sham community. Never have so many known so much about people for whom they cared so little. + -- Wendy Kaminer commenting on testimonial television in "I'm Dysfunctional, You're Dysfunctional". +% +If Beethoven's Seventh Symphony is not by some means abridged, it will soon fall into disuse. + -- Philip Hale, Boston music critic, 1837 +% +If dolphins are so smart, why did Flipper work for television? +% +If God didn't mean for us to juggle, tennis balls wouldn't come three to a can. +% +If God had intended Man to Watch TV, He would have given him Rabbit Ears. +% +If I had any humility I would be perfect. + -- Ted Turner +% +If I had done everything I'm credited with, I'd be speaking to you from a laboratory jar at Harvard. + -- Frank Sinatra + +AS USUAL, YOUR INFORMATION STINKS. + -- Frank Sinatra, telegram to "Time" magazine +% +If I have to lay an egg for my country, I'll do it. + -- Bob Hope +% +If it ain't baroque, don't phiques it. +% +If it were thought that anything I wrote was influenced by Robert Frost, I would take that particular work of mine, shred it, and flush it down the toilet, hoping not to clog the pipes. A more sententious, holding- forth old bore who expected every hero-worshiping adenoidal little twerp of a student-poet to hang on to his every word I never saw. + -- James Dickey +% +If life is a stage, I want some better lighting. +% +If you are of the opinion that the contemplation of suicide is sufficient evidence of a poetic nature, do not forget that actions speak louder than words. + -- Fran Lebowitz, "Metropolitan Life" +% +If you have to ask what jazz is, you'll never know. + -- Louis Armstrong +% +If you lose a son you can always get another, but there's only one +Maltese Falcon. + -- Sidney Greenstreet, "The Maltese Falcon" +% +If you think the pen is mightier than the sword, the next time someone pulls out a sword I'd like to see you get up there with your Bic. +% +If you want to get rich from writing, write the sort of thing that's read by persons who move their lips when the're reading to themselves. + -- Don Marquis +% +Imitation is the sincerest form of television. + -- Fred Allen +% +Immature artists imitate, mature artists steal. + -- Lionel Trilling +% +Immature poets imitate, mature poets steal. + -- T.S. Eliot, "Philip Massinger" +% +In Hollywood, all marriages are happy. It's trying to live together afterwards that causes the problems. + -- Shelley Winters +% +In Hollywood, if you don't have happiness, you send out for it. + -- Rex Reed +% +In just seven days, I can make you a man! + -- The Rocky Horror Picture Show +% +In my experience, if you have to keep the lavatory door shut by extending your left leg, it's modern architecture. + -- Nancy Banks Smith +% +In Oz, never say "krizzle kroo" to a Woozy. +% +In the force if Yoda's so strong, construct a sentence with words in the proper order then why can't he? +% +In the Old West a wagon train is crossing the plains. As night falls the wagon train forms a circle, and a campfire is lit in the middle. After everyone has gone to sleep two lone cavalry officers stand watch over the camp. + After several hours of quiet, they hear war drums starting from a nearby Indian village they had passed during the day. The drums get louder and louder. + Finally one soldier turns to the other and says, "I don't like the sound of those drums." + Suddenly, they hear a cry come from the Indian camp: "IT'S NOT OUR REGULAR DRUMMER." +% +It happened that a fire broke out backstage in a theater. The clown came out to inform the public. They thought it was just a jest and applauded. He repeated his warning, they shouted even louder. So I think the world will come to an end amid general applause from all the wits, who believe that it is a joke. +% +It is a sobering thought that when Mozart was my age, he had been dead for two years. + -- Tom Lehrer +% +It is difficult to produce a television documentary that is both incisive and probing when every twelve minutes one is interrupted by twelve dancing rabbits singing about toilet paper. + -- Rod Serling +% +It is something to be able to paint a particular picture, or to carve a statue, and so to make a few objects beautiful; but it is far more glorious to carve and paint the very atmosphere and medium through which we look, which morally we can do. To affect the quality of the day, that is the highest of arts. Every man is tasked to make his life, even in its details, worthy of the contemplation of his most elevated and critical hour. + -- Henry David Thoreau, "Where I Live" +% +It is up to us to produce better-quality movies. + -- Lloyd Kaufman, producer of "Stuff Stephanie in the Incinerator" +% +It just doesn't seem right to go over the river and through the woods to Grandmother's condo. +% +It looks like it's up to me to save our skins. Get into that garbage chute, flyboy! + -- Princess Leia Organa +% +It proves what they say, give the public what they want to see and they'll come out for it. + -- Red Skelton, surveying the funeral of Hollywood mogul Harry Cohn +% +It took me fifteen years to discover that I had no talent for writing, but I couldn't give it up because by that time I was too famous. + -- Robert Benchley +% +It was a book to kill time for those who liked it better dead. +% +It'll be just like Beggars' Canyon back home. + -- Luke Skywalker +% +It's all right letting yourself go as long as you can let yourself back. + -- Mick Jagger +% +It's clever, but is it art? +% +It's difficult to see the picture when you are inside the frame. +% +It's from Casablanca. I've been waiting all my life to use that line. + -- Woody Allen, "Play It Again, Sam" +% +"It's kind of fun to do the impossible." + -- Walt Disney +% +It's more than magnificent -- it's mediocre. + -- Sam Goldwyn +% +It's not easy, being green. + -- Kermit the Frog +% +It's not the valleys in life I dread so much as the dips. + -- Garfield +% +IV. The time required for an object to fall twenty stories is greater than or equal to the time it takes for whoever knocked it off the ledge to spiral down twenty flights to attempt to capture it unbroken. + Such an object is inevitably priceless, the attempt to capture it + inevitably unsuccessful. + V. All principles of gravity are negated by fear. + Psychic forces are sufficient in most bodies for a shock to propel + them directly away from the earth's surface. A spooky noise or an + adversary's signature sound will induce motion upward, usually to + the cradle of a chandelier, a treetop, or the crest of a flagpole. + The feet of a character who is running or the wheels of a speeding + auto need never touch the ground, especially when in flight. +VI. As speed increases, objects can be in several places at once. + This is particularly true of tooth-and-claw fights, in which a + character's head may be glimpsed emerging from the cloud of + altercation at several places simultaneously. This effect is common + as well among bodies that are spinning or being throttled. A "wacky" + character has the option of self-replication only at manic high + speeds and may ricochet off walls to achieve the velocity required. + -- Esquire, "O'Donnell's Laws of Cartoon Motion", June 1980 +% +James Joyce -- an essentially private man who wished his total indifference to public notice to be universally recognized. + -- Tom Stoppard +% +James McNeill Whistler's (painter of "Whistler's Mother") failure in his West Point chemistry examination once provoked him to remark in later life, "If silicon had been a gas, I should have been a major general." +% +Jane and I got mixed up with a television show -- or as we call it back east here: TV -- a clever contraction derived from the words Terrible Vaudeville. However, it is our latest medium -- we call it a medium because nothing's well done. It was discovered, I suppose you've heard, by a man named Fulton Berle, and it has already revolutionized social grace by cutting down parlour conversation to two sentences: "What's on television?" and "Good night". + -- Goodman Ace, letter to Groucho Marx, in The Groucho + Letters, 1967 +% +Jim, it's Grace at the bank. I checked your Christmas Club account. You don't have five-hundred dollars. You have fifty. Sorry, computer foul-up! + -- "The Rockford Files" +% +Jim, it's Jack. I'm at the airport. I'm going to Tokyo and wanna pay you the five-hundred I owe you. Catch you next year when I get back! + -- "The Rockford Files" +% +Jim, this is Janelle. I'm flying tonight, so I can't make our date, and I gotta find a safe place for Daffy. He loves you, Jim! It's only two days, and you'll see. Great Danes are no problem! + -- "The Rockford Files" +% +Jim, this is Matty down at Ralph's and Mark's. Some guy named Angel Martin just ran up a fifty buck bar tab. And now he wants to charge it to you. You gonna pay it? + -- "The Rockford Files" +% +JOHN PAUL ELECTED POPE!! + +(George and Ringo miffed.) +% +Just because you like my stuff doesn't mean I owe you anything. + -- Bob Dylan +% +Just close your eyes, tap your heels together three times, and think to yourself, `There's no place like home.' + -- Glynda the Good +% +Just once I would like to persuade the audience not to wear any article of blue denim. If only they could see themselves in a pair of brown corduroys like mine instead of this awful, boring blue denim. I don't enjoy the sky or sea as much as I used to because of this Levi character. If Jesus Christ came back today, He and I would get into our brown corduroys and go to the nearest jean store and overturn the racks of blue denim. Then we'd get crucified in the morning. + -- Ian Anderson, of Jethro Tull +% +Just once, I wish we would encounter an alien menace that wasn't immune to bullets. + -- The Brigadier, "Dr. Who" +% +Lamonte Cranston once hired a new Chinese manservant. While describing his duties to the new man, Lamonte pointed to a bowl of candy on the coffee table and warned him that he was not to take any. Some days later, the new manservant was cleaning up, with no one at home, and decided to sample some of the candy. Just than, Cranston walked in, spied the manservant at the candy, and said: + "Pardon me Choy, is that the Shadow's nugate you chew?" +% + Lassie looked brilliant, in part because the farm family she lived with was made up of idiots. Remember? One of them was always getting pinned under the tractor, and Lassie was always rushing back to the farmhouse to alert the other ones. She'd whimper and tug at their sleeves, and they'd always waste precious minutes saying things: "Do you think something's wrong? Do you think she wants us to follow her? What is it, girl?", etc., as if this had never happened before, instead of every week. What with all the time these people spent pinned under the tractor, I don't see how they managed to grow any crops whatsoever. They probably got by on federal crop supports, which Lassie filed the applications for. + -- Dave Barry +% +Lay off the muses, it's a very tough dollar. + -- S.J. Perelman +% +Lensmen eat Jedi for breakfast. +% + Leslie West heads for the sticks, to Providence, Rhode Island and tries to hide behind a beard. No good. There are still too many people and too many stares, always taunting, always smirking. He moves to the outskirts of town. He finds a place to live -- huge mansion, dirt cheap, caretaker included. He plugs in his guitar and plays as loud as he wants, day and night, and there's no one to laugh or boo or even look bored. + Nobody's cut the grass in months. What's happened to that caretaker? What neighborhood people there are start to talk, and what kids there are start to get curious. A 13 year-old blond with an angelic face misses supper. Before the summer's end, four more teenagers have disappeared. The senior class president, Barnard-bound come autumn, tells Mom she's going out to a movie one night and stays out. The town's up in arms, but just before the police take action, the kids turn up. They've found a purpose. They go home for their stuff and tell the folks not to worry but they'll be going now. They're in a band. + -- Ira Kaplan +% +Life is like arriving late for a movie, having to figure out what was going on without bothering everybody with a lot of questions, and then being unexpectedly called away before you find out how it ends. +% +Like ya know? Rock 'N Roll is an esoteric language that unlocks the creativity chambers in people's brains, and like totally activates their essential hipness, which of course is like totally necessary for saving the earth, like because the first thing in saving this world, is getting rid of stupid and square attitudes and having fun. + -- Senior Year Quote +% +Linus: Hi! I thought it was you. I've been watching you from way off... You're looking great! +Snoopy: That's nice to know. The secret of life is to look good at a distance. +% +Linus: I guess it's wrong always to be worrying about tomorrow. Maybe we should think only about today. +Charlie Brown: No, that's giving up. I'm still hoping that yesterday will get better. +% +Live fast, die young, and leave a good looking corpse. + -- James Dean +% +Live from New York ... It's Saturday Night! +% +Love thy neighbor, tune thy piano. +% +Lucy: Dance, dance, dance. That is all you ever do. Can't you be serious for once? +Snoopy: She is right! I think I had better think of the more important things in life! + (pause) + Tomorrow!! +% +Luke, I'm yer father, eh. Come over to the dark side, you hoser. + -- Dave Thomas, "Strange Brew" +% +Maj. Bloodnok: Seagoon, you're a coward! +Seagoon: Only in the holiday season. +Maj. Bloodnok: Ah, another Noel Coward! +% +Mandrell: "You know what I think?" +Doctor: "Ah, ah that's a catch question. With a brain your size you + don't think, right?" + -- Dr. Who +% +Many of the characters are fools and they are always playing tricks on me and treating me badly. + -- Jorge Luis Borges, from "Writers on Writing" by Jon Winokur +% +Maryel brought her bat into Exit once and started whacking people on the dance floor. Now everyone's doing it. It's called grand slam dancing. + -- Ransford, Chicago Reader 10/7/83 +% +Mate, this parrot wouldn't VOOM if you put four million volts through it! + -- Monty Python +% +"Microwave oven? Whaddya mean, it's a microwave oven? I've been watching Channel 4 on the thing for two weeks." +% +Might as well be frank, monsieur. It would take a miracle to get you out of Casablanca and the Germans have outlawed miracles. + -- Casablanca +% +Mike: "The Fourth Dimension is a shambles?" +Bernie: "Nobody ever empties the ashtrays. People are SO inconsiderate." + -- Gary Trudeau, "Doonesbury" +% +Minnie Mouse is a slow maze learner. +% +Modern art is what happens when painters stop looking at girls and persuade themselves that they have a better idea. + -- John Ciardi +% +Mos Eisley Spaceport; you'll not find a more wretched collection of villainy and disreputable types... + -- Obi-wan Kenobi, "Star Wars" +% +Mr. Rockford, this is the Thomas Crown School of Dance and Contemporary Etiquette. We aren't going to call again! Now you want these free lessons or what? + -- "The Rockford Files" +% +Mr. Rockford? Miss Collins from the Bureau of Licenses. We got your renewal before the extended deadline but not your check. I'm sorry but at midnight you're no longer licensed as an investigator. + -- "The Rockford Files" +% +Mr. Rockford? This is Betty Joe Withers. I got four shirts of yours from the Bo Peep Cleaners by mistake. I don't know why they gave me men's shirts but they're going back. + -- "The Rockford Files" +% +Mr. Rockford? You don't know me, but I'd like to hire you. Could you call me at... My name is... uh... Never mind, forget it! + -- "The Rockford Files" +% +My advice to you, my violent friend, is to seek out gold and sit on it. + -- The Dragon to Grendel, in John Gardner's "Grendel" +% +My band career ended late in my senior year when John Cooper and I threw my amplifier out the dormitory window. We did not act in haste. First we checked to make sure the amplifier would fit through the frame, using the belt from my bathrobe to measure, then we picked up the amplifier and backed up to my bedroom door. Then we rushed forward, shouting "The WHO! The WHO!" and we launched my amplifier perfectly, as though we had been doing it all our lives, clean through the window and down onto the sidewalk, where a small but appreciative crowd had gathered. I would like to be able to say that this was a symbolic act, an effort on my part to break cleanly away from one state in my life and move on to another, but the truth is, Cooper and I really just wanted to find out what it would sound like. It sounded OK. + -- Dave Barry, "The Snake" +% +"My life is a soap opera, but who has the rights?" + -- MadameX +% +My tears stuck in their little ducts, refusing to be jerked. + -- Peter Stack, movie review + +His performance is so wooden you want to spray him with Liquid Pledge. + -- John Stark, movie review +% +No Civil War picture ever made a nickel. + -- MGM executive Irving Thalberg to Louis B. Mayer about + film rights to "Gone With the Wind". + Cerf/Navasky, "The Experts Speak" +% +No house should ever be on any hill or on anything. It should be of the hill, belonging to it. + -- Frank Lloyd Wright +% +No poet or novelist wishes he was the only one who ever lived, but most of them wish they were the only one alive, and quite a number fondly believe their wish has been granted. + -- W.H. Auden, "The Dyer's Hand" +% +No two persons ever read the same book. + -- Edmund Wilson +% +"No, `Eureka' is Greek for `This bath is too hot.'" + -- Dr. Who +% +Nobody can be exactly like me. Sometimes even I have trouble doing it. + -- Tallulah Bankhead +% +NOBODY EXPECTS THE SPANISH INQUISITION! +% +Noone ever built a statue to a critic. +% +Not all who own a harp are harpers. + -- Marcus Terentius Varro +% +Notes for a ballet, "The Spell": ... Suddenly Sigmund hears the flutter of wings, and a group of wild swans flies across the moon ... Sigmund is astounded to see that their leader is part swan and part woman -- unfortunately, divided lengthwise. She enchants Sigmund, who is careful not to make any poultry jokes. + -- Woody Allen +% +Oh Dad! We're ALL Devo! +% + "Oh sure, this costume may look silly, but it lets me get in and out of dangerous situations -- I work for a federal task force doing a survey on urban crime. Look, here's my ID, and here's a number you can call, that will put you through to our central base in Atlanta. Go ahead, call -- they'll confirm who I am. + "Unless, of course, the Astro-Zombies have destroyed it." + -- Captain Freedom +% +Oh, Aunty Em, it's so good to be home! +% +Old MacDonald had an agricultural real estate tax abatement. +% +Old musicians never die, they just decompose. +% +Once, I read that a man be never stronger than when he truly realizes how weak he is. + -- Jim Starlin, "Captain Marvel #31" +% +One big pile is better than two little piles. + -- Arlo Guthrie +% +Oprah Winfrey has an incredible talent for getting the weirdest people to talk to. And you just HAVE to watch it. "Blind, masochistic minority, crippled, depressed, government latrine diggers, and the women who love them too much on the next Oprah Winfrey." +% +Penn's aunts made great apple pies at low prices. No one else in town could compete with the pie rates of Penn's aunts. +% +People in general do not willingly read if they have anything else to amuse them. + -- S. Johnson +% +Perhaps no person can be a poet, or even enjoy poetry without a certain unsoundness of mind. + -- Thomas Macaulay +% +Plato, by the way, wanted to banish all poets from his proposed Utopia because they were liars. The truth was that Plato knew philosophers couldn't compete successfully with poets. + -- Kilgore Trout (Philip J. Farmer), "Venus on the Half Shell" +% +Playing an unamplified electric guitar is like strumming on a picnic table. + -- Dave Barry, "The Snake" +% +Please, won't somebody tell me what diddie-wa-diddie means? +% +Plots are like girdles. Hidden, they hold your interest; revealed, they're of no interest except to fetishists. Like girdles, they attempt to contain an uncontainable experience. + -- R.S. Knapp +% +Potahto' Pictures Productions Presents: + + SPUD ROGERS OF THE 25TH CENTURY: Story of an Air Force potato that's left in a rarely used chow hall for over two centuries and wakes up in a world +populated by soybean created imitations under the evil Dick Tater. Thanks to him, the soy-potatoes learn that being a 'tater is where it's at. Memorable line, "'Cause I'm just a stud spud!" + + FRIDAY THE 13TH DINER SERIES: Crazed potato who was left in a fryer too long and was charbroiled carelessly returns to wreak havoc on unsuspecting, would-be teen camp cooks. Scenes include a girl being stuffed with chives and Fleischman's Margarine and a boy served up on a side dish with beets and dressing. Definitely not for the squeamish, or those on diets that are driving them crazy. + + FRIDAY THE 13TH DINER II,III,IV,V,VI: Much, much more of the same. Except with sour cream. +% +Potahto' Pictures Productions Presents: + + THE TATERNATOR: Cyborg spud returns from the future to present-day McDonald's restaurant to kill the potatoess (girl 'tater) who will give birth to the world's largest french fry (The Dark Powers of Burger King are clearly behind this). Most quotable line: "Ah'll be baked..." + + A FISTFUL OF FRIES: Western in which our hero, The Spud with No Name, rides into a town that's deprived of carbohydrates thanks to the evil takeover +of the low-cal Scallopinni Brothers. Plenty of smokeouts, fry-em-ups, and general butter-melting by all. + + FOR A FEW FRIES MORE: Takes up where AFOF left off! Cameo by Walter Cronkite, as every man's common 'tater! +% +Prizes are for children. + -- Charles Ives, upon being given, but refusing, the Pulitzer prize +% +Producers seem to be so prejudiced against actors who've had no training. And there's no reason for it. So what if I didn't attend the Royal Academy for twelve years? I'm still a professional trying to be the best actress I can. Why doesn't anyone send me the scripts that Faye Dunaway gets? + -- Farrah Fawcett-Majors +% +Public use of any portable music system is a virtually guaranteed indicator of sociopathic tendencies. + -- Zoso +% +Publishing a volume of verse is like dropping a rose petal down the Grand Canyon and waiting for the echo. +% +Pure drivel tends to drive ordinary drivel off the TV screen. +% +Rascal, am I? Take THAT! + -- Errol Flynn +% +Recently deceased blues guitarist Stevie Ray Vaughan "comes to" after his death. He sees Jimi Hendrix sitting next to him, tuning his guitar. "Holy cow," he thinks to himself, "this guy is my idol." Over at the microphone, about to sing, are Jim Morrison and Janis Joplin, and the bassist is the late Barry Oakley of the Allman Brothers. So Stevie Ray's thinking, "Oh, wow! I've died and gone to rock and roll heaven." Just then, Karen Carpenter walks in, sits down at the drums, and says: +"'Close to You'. Hit it, boys!" + -- Told by Penn Jillette, of magic/comedy duo Penn and Teller +% +Rembrandt is not to be compared in the painting of character with our extraordinarily gifted English artist, Mr. Rippingille. + -- John Hunt, British editor, scholar and art critic + Cerf/Navasky, "The Experts Speak" +% +"Rembrandt's first name was Beauregard, which is why he never used it." + -- Dave Barry +% +Satire is tragedy plus time. + -- Lenny Bruce +% +Satire is what closes in New Haven. +% +Satire is what closes Saturday night. + -- George Kaufman +% +'Scuse me, while I kiss the sky! + -- Robert James Marshall (Jimi) Hendrix +% +She ran the gamut of emotions from 'A' to 'B'. + -- Dorothy Parker, on a Kate Hepburn performance +% +"She said, `I know you ... you cannot sing'. I said, `That's nothing, you should hear me play piano.'" + -- Morrisey +% +She was good at playing abstract confusion in the same way a midget is good at being short. + -- Clive James, on Marilyn Monroe +% +Shhh... be vewy, vewy, quiet! I'm hunting wabbits... +% +Show business is just like high school, except you get paid. + -- Martin Mull +% +Sir, it's very possible this asteroid is not stable. + -- C3P0 +% +Skill without imagination is craftsmanship and gives us many useful objects such as wickerwork picnic baskets. Imagination without skill gives us modern +art. + -- Tom Stoppard +% +Smile! You're on Candid Camera. +% +Snakes. Why did it have to be snakes? + -- Indiana Jones, "Raiders of the Lost Ark" +% +Snoopy: No problem is so big that it can't be run away from. +% +Snow White has become a camera buff. She spends hours and hours shooting pictures of the seven dwarfs and their antics. Then she mails the exposed film to a cut rate photo service. It takes weeks for the developed film to arrive in the mail, but that is all right with Snow White. She clears the table, washes the dishes and sweeps the floor, all the while singing "Someday my prints will come." +% +So do the noble fall. For they are ever caught in a trap of their own making. A trap -- walled by duty, and locked by reality. Against the greater force they must fall -- for, against that force they fight because of duty, because of obligations. And when the noble fall, the base remain. The base -- whose only purpose is the corruption of what the noble did protect. Whose only purpose is to destroy. The noble: who, even when fallen, retain a vestige of strength. For theirs is a strength born of things other than mere force. Theirs is a strength supreme... theirs is the strength -- to restore. + -- Gerry Conway, "Thor", #193 +% + So Richard and I decided to try to catch [the small shark]. With a great deal of strategy and effort and shouting, we managed to maneuver the shark, over the course of about a half-hour, to a sort of corner of the lagoon, so that it had no way to escape other than to flop up onto the land and evolve. Richard and I were inching toward it, sort of crouched over, when all of a sudden it turned around and -- I can still remember the sensation I felt at that moment, primarily in the armpit area -- headed right straight toward us. + Many people would have panicked at this point. But Richard and I were not "many people." We were experienced waders, and we kept our heads. We did exactly what the textbook says you should do when you're unarmed and a shark that is nearly two feet long turns on you in water up to your lower calves: We sprinted I would say 600 yards in the opposite direction, using a sprinting style such that the bottoms of our feet never once went below the surface of the water. We ran all the way to the far shore, and if we had been in a Warner Brothers cartoon we would have run right INTO the beach, and you would have seen these two mounds of sand racing across the island until they bonked into trees and coconuts fell onto their heads. + -- Dave Barry, "The Wonders of Sharks on TV" +% +Some men who fear that they are playing second fiddle aren't in the band at all. +% +Some performers on television appear to be horrible people, but when you finally get to know them in person, they turn out to be even worse. + -- Avery +% +"Spare no expense to save money on this one." + -- Samuel Goldwyn +% +Star Wars is adolescent nonsense; Close Encounters is obscurantist drivel; Star Trek can turn your brains to puree of bat guano; and the greatest science fiction series of all time is Doctor Who! And I'll take you all on, one-by-one or all in a bunch to back it up! + -- Harlan Ellison [... truncated: 22272 lines follow ...] From axeld at mail.berlios.de Fri Jan 5 00:04:21 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 5 Jan 2007 00:04:21 +0100 Subject: [Haiku-commits] r19704 - haiku/trunk/src/kits/tracker Message-ID: <200701042304.l04N4LR5011923@sheep.berlios.de> Author: axeld Date: 2007-01-05 00:04:20 +0100 (Fri, 05 Jan 2007) New Revision: 19704 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19704&view=rev Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp Log: Tracker now uses the name of the symlink for add-ons, instead of resolving it first. This fixes bug #602. Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp =================================================================== --- haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2007-01-04 22:22:29 UTC (rev 19703) +++ haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2007-01-04 23:04:20 UTC (rev 19704) @@ -179,9 +179,10 @@ uint32 dummy; StripShortcut(model, buffer, dummy); - if (strcmp(buffer, (const char *)castToName) == 0) + if (strcmp(buffer, (const char *)castToName) == 0) { // found match, bail out return model; + } return 0; } @@ -2720,23 +2721,25 @@ dir.Rewind(); while (dir.GetNextEntry(&entry) == B_OK) { - bool primary = false; + Model *model = new Model(&entry); - if (entry.IsSymLink()) { - // resolve symlinks if needed - entry_ref ref; - entry.GetRef(&ref); - entry.SetTo(&ref, true); + if (model->InitCheck() == B_OK && model->IsSymLink()) { + // resolve symlinks + Model* resolved = new Model(model->EntryRef(), true, true); + if (resolved->InitCheck() == B_OK) + model->SetLinkTo(resolved); + else + delete resolved; } - - Model *model = new Model(&entry); - if (model->InitCheck() != B_OK || !model->IsExecutable()) { + if (model->InitCheck() != B_OK || !model->ResolveIfLink()->IsExecutable()) { delete model; continue; } // check if it supports at least one of the selected entries + bool primary = false; + if (mimeTypes.CountItems()) { BFile file(&entry, B_READ_ONLY); if (file.InitCheck() == B_OK) { From darkwyrm at mail.berlios.de Fri Jan 5 02:44:31 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Fri, 5 Jan 2007 02:44:31 +0100 Subject: [Haiku-commits] r19705 - haiku/trunk/data/etc/fortunes Message-ID: <200701050144.l051iVeW006633@sheep.berlios.de> Author: darkwyrm Date: 2007-01-05 02:44:30 +0100 (Fri, 05 Jan 2007) New Revision: 19705 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19705&view=rev Added: haiku/trunk/data/etc/fortunes/Haiku Log: Initial checkin of haikus taken from BeDoper contest Added: haiku/trunk/data/etc/fortunes/Haiku =================================================================== --- haiku/trunk/data/etc/fortunes/Haiku 2007-01-04 23:04:20 UTC (rev 19704) +++ haiku/trunk/data/etc/fortunes/Haiku 2007-01-05 01:44:30 UTC (rev 19705) @@ -0,0 +1,84 @@ +Twenty MP3s. +Twelve movies on spinning cubes. +Be cacophony. + - Irfon-Kim Ahmad +% +Beautiful OS. +Elegance. Simplicity. +D'oh! There's no Java! + - Irfon-Kim Ahmad +% +Imagine a world +without gluttony and sloth. +Do you see Windows? + - bobrost el magnifico +% +Yellow titlebars +dot the workspaces. See my +productivity! + - Brent P. Newhall +% +The gourmet's OS +Ripe with possibility +So much unfinished + - Scot Hacker +% +I'm saving my cash +To get a special BeIA +In my cranium + - Syn.Terra +% +NetPositive weeps +Lonely, forgotten ex-love +New springtime romance + - Scott Barta +% +Evangelists +Tread carefully the Be path +Are we kooks or saints? + - Scot Hacker +% +There was a bebox +Now there is a beoven +Gass?e eat my socks + - quix at kc.rr.com +% +New BeDope Linux +Version 27.1; Wow! +AVN ownz j00. + - Irfon-Kim Ahmad +% +Co-worker re-boots; +Meanwhile all my work is done. +I go out and play! + - dave at owenville.com +% +Spongy fresh Twinkie +Jean-Louis will eat it if +You add a hot dog + - Eric Shepherd +% +Buy some freaking stock +All you stupid investors +Make lots of money + - anonymous +% +proprietary software. +My boycott remains. + - Monkey Master +% +No more Blinkenlites. +The geekport is history. +Farewell, yon BeBox. + - Tom Spindler +% +Be wa totemo +daisuki to omoimasu yo. +Be wa suki desu ka? + - bobrost el magnifico +% +the best thing about +be, incorporated, is: +damn, I'm out of space + - Leonard Richardson +% From umccullough at gmail.com Fri Jan 5 03:48:07 2007 From: umccullough at gmail.com (Urias McCullough) Date: Thu, 4 Jan 2007 18:48:07 -0800 Subject: [Haiku-commits] r19705 - haiku/trunk/data/etc/fortunes In-Reply-To: <200701050144.l051iVeW006633@sheep.berlios.de> References: <200701050144.l051iVeW006633@sheep.berlios.de> Message-ID: <1e80d8750701041848p20b515b8ncb2529a6609a28f9@mail.gmail.com> On 1/4/07, darkwyrm at BerliOS wrote: > > Author: darkwyrm > Date: 2007-01-05 02:44:30 +0100 (Fri, 05 Jan 2007) > New Revision: 19705 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19705&view=rev > > Added: > haiku/trunk/data/etc/fortunes/Haiku > Log: > Initial checkin of haikus taken from BeDoper contest > Also some submitted on the wiki: http://haiku-os.org/wiki/index.php?title=Haikus -------------- next part -------------- An HTML attachment was scrubbed... URL: From jackburton at mail.berlios.de Fri Jan 5 09:23:10 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Fri, 5 Jan 2007 09:23:10 +0100 Subject: [Haiku-commits] r19706 - haiku/trunk/src/kits/interface Message-ID: <200701050823.l058NAFo021013@sheep.berlios.de> Author: jackburton Date: 2007-01-05 09:23:09 +0100 (Fri, 05 Jan 2007) New Revision: 19706 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19706&view=rev Modified: haiku/trunk/src/kits/interface/Menu.cpp Log: Menuwindow was 10 pixels away from the screen bottom when scrolling was enabled. Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2007-01-05 01:44:30 UTC (rev 19705) +++ haiku/trunk/src/kits/interface/Menu.cpp 2007-01-05 08:23:09 UTC (rev 19706) @@ -2119,12 +2119,11 @@ // If we need scrolling, resize the window to fit the screen and // attach scrollers to our cached MenuWindow. if (dynamic_cast(Supermenu()) == NULL) { - window->ResizeTo(Bounds().Width() + 2, screen.Frame().bottom - 10); + window->ResizeTo(Bounds().Width() + 2, screen.Frame().bottom); frame.top = 0; - } - else { - // Or, in case our parent was a BMenuBar enable scrolling with - // normal size. + } else { + // Or, in case our parent was a BMenuBar enable scrolling with + // normal size. window->ResizeTo(Bounds().Width() + 2, screen.Frame().bottom - frame.top); } From jackburton at mail.berlios.de Fri Jan 5 09:42:04 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Fri, 5 Jan 2007 09:42:04 +0100 Subject: [Haiku-commits] r19707 - haiku/trunk/build/jam Message-ID: <200701050842.l058g44q023391@sheep.berlios.de> Author: jackburton Date: 2007-01-05 09:42:04 +0100 (Fri, 05 Jan 2007) New Revision: 19707 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19707&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: don't copy fortune folder to the image (temporarily), since latest change prevented it to be copied anyway, and also other files weren't copied then (termcap, teapot.data, profile), because 'fortune' is a folder now, and not a file anymore. Please someone fix this Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-05 08:23:09 UTC (rev 19706) +++ haiku/trunk/build/jam/HaikuImage 2007-01-05 08:42:04 UTC (rev 19707) @@ -186,7 +186,7 @@ AddFilesToHaikuImage beos etc artwork : $(svgFiles) ; # TODO: Use data/etc/termcap or src/libs/termcap.src? -local etcFiles = fortunes profile termcap teapot.data ; +local etcFiles = profile termcap teapot.data ; etcFiles = $(etcFiles:G=etc) ; SEARCH on $(etcFiles) = [ FDirName $(HAIKU_TOP) data etc ] ; AddFilesToHaikuImage beos etc : $(etcFiles) ; From jackburton at mail.berlios.de Fri Jan 5 11:03:33 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Fri, 5 Jan 2007 11:03:33 +0100 Subject: [Haiku-commits] r19708 - haiku/trunk/src/kits/interface Message-ID: <200701051003.l05A3XGx003356@sheep.berlios.de> Author: jackburton Date: 2007-01-05 11:03:33 +0100 (Fri, 05 Jan 2007) New Revision: 19708 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19708&view=rev Modified: haiku/trunk/src/kits/interface/Menu.cpp Log: Since Waldemar changes to menus, replicants menus didn't work anymore. That problem showed up for example during my haiku presentation at Begeistert, where I couldn't delete replicants from the desktop... grrrr!!! :-) Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2007-01-05 08:42:04 UTC (rev 19707) +++ haiku/trunk/src/kits/interface/Menu.cpp 2007-01-05 10:03:33 UTC (rev 19708) @@ -1064,11 +1064,8 @@ UnlockLooper(); } - // If sticky is false, pass 0 to the tracking function - // so the menu will stay in nonsticky mode - const bigtime_t trackTime = sticky ? system_time() : 0; int action; - BMenuItem *menuItem = _track(&action, trackTime); + BMenuItem *menuItem = _track(&action, 0); SetStickyMode(false); fExtraRect = NULL; @@ -1398,14 +1395,11 @@ SetStickyMode(false); } } else if (buttons == 0 && !IsStickyMode()) { -/* TODO: FIXME! trackTime is a hacky workaround for BMenuField. It - opens directly under your mouse pointer, so when you release the mouse - button the menu closes again because it started in non-sticky mode. */ -/* if (system_time() < trackTime + 1000000 - || (fExtraRect != NULL && fExtraRect->Contains(location))) */ - if (fExtraRect != NULL && fExtraRect->Contains(where)) + if (fExtraRect != NULL && fExtraRect->Contains(where)) { SetStickyMode(true); - else + fExtraRect = NULL; + // This code should be executed only once + } else fState = MENU_STATE_CLOSED; } } From darkwyrm at earthlink.net Fri Jan 5 12:30:29 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Fri, 05 Jan 2007 06:30:29 -0500 EST Subject: [Haiku-commits] r19705 - haiku/trunk/data/etc/fortunes In-Reply-To: <1e80d8750701041848p20b515b8ncb2529a6609a28f9@mail.gmail.com> Message-ID: <947123448-BeMail@sapphire> > Also some submitted on the wiki: > > http://haiku-os.org/wiki/index.php?title=Haikus Thanks! --DarkWyrm From darkwyrm at mail.berlios.de Fri Jan 5 12:41:19 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Fri, 5 Jan 2007 12:41:19 +0100 Subject: [Haiku-commits] r19709 - haiku/trunk/data/etc/fortunes Message-ID: <200701051141.l05BfJlB007172@sheep.berlios.de> Author: darkwyrm Date: 2007-01-05 12:41:18 +0100 (Fri, 05 Jan 2007) New Revision: 19709 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19709&view=rev Modified: haiku/trunk/data/etc/fortunes/Haiku Log: Added boot-time haikus from the wiki to the file. Thanks to Urias for this one. :^) Modified: haiku/trunk/data/etc/fortunes/Haiku =================================================================== --- haiku/trunk/data/etc/fortunes/Haiku 2007-01-05 10:03:33 UTC (rev 19708) +++ haiku/trunk/data/etc/fortunes/Haiku 2007-01-05 11:41:18 UTC (rev 19709) @@ -82,3 +82,38 @@ damn, I'm out of space - Leonard Richardson % +A new beginning. +Spring comes, the dark screen lights up. +Vivid icons bloom. + - hKey +% +Any second now, +A fresh new world, with many +Possibilities. + - hKey +% +Welcome to Haiku +Your desktop greets you warmly +Pouring out sunshine. + - nonesuch +% +Little and yellow +The once-darkened skies will part +Pouring out sunshine. + - nonesuch +% +A boot has begun +stepping up expectations. +You'll get even more. + - Meanwhile +% +You're bound to forget +this humble boot-time Haiku +by splendour to come. + - Meanwhile +% +Welcome to Haiku +Your screen will be filled with joy +In a few seconds + - TonyJackson +% From axeld at pinc-software.de Fri Jan 5 13:04:43 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Fri, 5 Jan 2007 13:04:43 +0100 (MET) Subject: [Haiku-commits] r19580 - In-Reply-To: <3957815.1167052409816.JavaMail.ngmail@webmail13> Message-ID: <3651094106-BeMail@zon> Marcus Overhagen wrote: > axeld at BerliOS wrote: > > Added EDID version 1 retrieval from VESA; doesn't do anything yet > > besides dumping the > > info to the serial line - not tested yet (as Qemu doesn't support > > DDC/EDID). > I can confirm that it works. see below. Thanks for the note! It works here on my local machines as well, but it doesn't work on my laptop, bummer. Bye, Axel. From axeld at pinc-software.de Fri Jan 5 14:15:24 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Fri, 5 Jan 2007 14:15:24 +0100 (MET) Subject: [Haiku-commits] r19685 - haiku/trunk/src/apps/bemail In-Reply-To: <1495341948-BeMail@sapphire> Message-ID: <7893226310-BeMail@zon> "DarkWyrm" wrote: > > BTW what's the difference between this class and the previous one? > I didn't forget our coding style for once, actually. This is code > that > I swiped from Capital Be and apparently I forgot that it used my > regular coding style. The find window used an ugly hack -- a > BTextView > for a 1-line text editing box, but it didn't do it very well. The > main > reason AFAICT that it did all this was to have a text editing control > which sent out update messages on each keypress. This code (style > issues aside) is much cleaner and because I wrote it to be a drop-in > replacement for BTextControl, it was dead easy to put in place. Okay, thanks for the explanation :-) Bye, Axel. From wkornewald at haiku-os.org Fri Jan 5 14:29:02 2007 From: wkornewald at haiku-os.org (Waldemar Kornewald) Date: Fri, 5 Jan 2007 14:29:02 +0100 Subject: [Haiku-commits] r19708 - haiku/trunk/src/kits/interface In-Reply-To: <200701051003.l05A3XGx003356@sheep.berlios.de> References: <200701051003.l05A3XGx003356@sheep.berlios.de> Message-ID: On 1/5/07, jackburton at BerliOS wrote: > Author: jackburton > Date: 2007-01-05 11:03:33 +0100 (Fri, 05 Jan 2007) > New Revision: 19708 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19708&view=rev > > Modified: > haiku/trunk/src/kits/interface/Menu.cpp > Log: > Since Waldemar changes to menus, replicants menus didn't work > anymore. That problem showed up for example during my haiku > presentation at Begeistert, where I couldn't delete replicants from > the desktop... grrrr!!! :-) I'm sorry. :) Bye, Waldemar Kornewald From axeld at mail.berlios.de Fri Jan 5 20:01:09 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 5 Jan 2007 20:01:09 +0100 Subject: [Haiku-commits] r19710 - haiku/trunk/src/system/kernel Message-ID: <200701051901.l05J193W018008@sheep.berlios.de> Author: axeld Date: 2007-01-05 20:01:09 +0100 (Fri, 05 Jan 2007) New Revision: 19710 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19710&view=rev Modified: haiku/trunk/src/system/kernel/scheduler.cpp Log: Our scheduler skipped over threads in about 30% of all cases - that's a bit much; it's not a penalty to be the first thread in the run queue... I've reduced it to about 12.5%, but that might still be too much. Modified: haiku/trunk/src/system/kernel/scheduler.cpp =================================================================== --- haiku/trunk/src/system/kernel/scheduler.cpp 2007-01-05 11:41:18 UTC (rev 19709) +++ haiku/trunk/src/system/kernel/scheduler.cpp 2007-01-05 19:01:09 UTC (rev 19710) @@ -181,7 +181,7 @@ prevThread = NULL; if (oldThread->cpu->disabled) { - // just select an idle thread + // CPU is disabled - just select an idle thread while (nextThread && nextThread->priority > B_IDLE_PRIORITY) { prevThread = nextThread; nextThread = nextThread->queue_next; @@ -192,13 +192,13 @@ // always extract real time threads if (nextThread->priority >= B_FIRST_REAL_TIME_PRIORITY) break; - + // never skip last non-idle normal thread if (nextThread->queue_next && nextThread->queue_next->priority == B_IDLE_PRIORITY) break; - // skip normal threads sometimes - if (_rand() > 0x3000) + // skip normal threads sometimes (roughly 12.5%) + if (_rand() > 0x1000) break; prevThread = nextThread; From axeld at mail.berlios.de Fri Jan 5 20:27:49 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 5 Jan 2007 20:27:49 +0100 Subject: [Haiku-commits] r19711 - haiku/trunk/src/system/kernel Message-ID: <200701051927.l05JRn1X020702@sheep.berlios.de> Author: axeld Date: 2007-01-05 20:27:48 +0100 (Fri, 05 Jan 2007) New Revision: 19711 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19711&view=rev Modified: haiku/trunk/src/system/kernel/signal.c Log: We always handled signals as if their SA_RESTART flag was set - but that's not the default case. Modified: haiku/trunk/src/system/kernel/signal.c =================================================================== --- haiku/trunk/src/system/kernel/signal.c 2007-01-05 19:01:09 UTC (rev 19710) +++ haiku/trunk/src/system/kernel/signal.c 2007-01-05 19:27:48 UTC (rev 19711) @@ -76,6 +76,7 @@ & ~atomic_get(&thread->sig_block_mask); struct sigaction *handler; bool reschedule = false; + bool restart = false; int32 i; // If SIGKILL[THR] are pending, we ignore other signals. @@ -110,6 +111,9 @@ TRACE(("Thread 0x%lx received signal %s\n", thread->id, sigstr[signal])); + if ((handler->sa_flags & SA_RESTART) != 0) + restart = true; + if (handler->sa_handler == SIG_IGN) { // signal is to be ignored // ToDo: apply zombie cleaning on SIGCHLD @@ -197,7 +201,10 @@ return reschedule; } - arch_check_syscall_restart(thread); + // only restart if SA_RESTART was set on at least one handler + if (restart) + arch_check_syscall_restart(thread); + return reschedule; } From bonefish at cs.tu-berlin.de Fri Jan 5 20:51:07 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Fri, 05 Jan 2007 20:51:07 +0100 Subject: [Haiku-commits] r19707 - haiku/trunk/build/jam In-Reply-To: <200701050842.l058g44q023391@sheep.berlios.de> References: <200701050842.l058g44q023391@sheep.berlios.de> Message-ID: <20070105205107.953.4@cs.tu-berlin.de> On 2007-01-05 at 09:42:04 [+0100], jackburton at BerliOS wrote: > Author: jackburton > Date: 2007-01-05 09:42:04 +0100 (Fri, 05 Jan 2007) > New Revision: 19707 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19707&view=rev > > Modified: > haiku/trunk/build/jam/HaikuImage > Log: > don't copy fortune folder to the image (temporarily), since latest change > prevented it to be copied anyway, and also other files weren't copied then > (termcap, teapot.data, profile), because 'fortune' is a folder now, and not > a file anymore. Please someone fix this If noone beats me to it, I'll look into that tomorrow. CU, Ingo From axeld at mail.berlios.de Fri Jan 5 20:53:45 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 5 Jan 2007 20:53:45 +0100 Subject: [Haiku-commits] r19712 - haiku/trunk/src/servers/input Message-ID: <200701051953.l05JrjxM023475@sheep.berlios.de> Author: axeld Date: 2007-01-05 20:53:45 +0100 (Fri, 05 Jan 2007) New Revision: 19712 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19712&view=rev Modified: haiku/trunk/src/servers/input/InputServer.cpp Log: Minor cleanup. Modified: haiku/trunk/src/servers/input/InputServer.cpp =================================================================== --- haiku/trunk/src/servers/input/InputServer.cpp 2007-01-05 19:27:48 UTC (rev 19711) +++ haiku/trunk/src/servers/input/InputServer.cpp 2007-01-05 19:53:45 UTC (rev 19712) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ @@ -1764,7 +1764,7 @@ RegisterDevices(input_device_ref** devices) { CALLED(); -}; +} BView * @@ -1774,8 +1774,11 @@ } +// #pragma mark - + + int -main() +main(int /*argc*/, char** /*argv*/) { InputServer *inputServer = new InputServer; From axeld at mail.berlios.de Fri Jan 5 20:54:35 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 5 Jan 2007 20:54:35 +0100 Subject: [Haiku-commits] r19713 - haiku/trunk/src/add-ons/input_server/filters/screensaver Message-ID: <200701051954.l05JsZOs023710@sheep.berlios.de> Author: axeld Date: 2007-01-05 20:54:35 +0100 (Fri, 05 Jan 2007) New Revision: 19713 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19713&view=rev Modified: haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.cpp Log: You must not delete a running looper - you have to quit it. Modified: haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.cpp =================================================================== --- haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.cpp 2007-01-05 19:53:45 UTC (rev 19712) +++ haiku/trunk/src/add-ons/input_server/filters/screensaver/ScreenSaverFilter.cpp 2007-01-05 19:54:35 UTC (rev 19713) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Haiku. + * Copyright 2003-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -134,7 +134,9 @@ watch_node(&fNodeRef, B_STOP_WATCHING, fController); be_roster->StopWatching(fController); - delete fController; + + if (fController->Lock()) + fController->Quit(); } From axeld at mail.berlios.de Fri Jan 5 21:16:48 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 5 Jan 2007 21:16:48 +0100 Subject: [Haiku-commits] r19714 - haiku/trunk/src/system/kernel Message-ID: <200701052016.l05KGmjY026240@sheep.berlios.de> Author: axeld Date: 2007-01-05 21:16:48 +0100 (Fri, 05 Jan 2007) New Revision: 19714 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19714&view=rev Modified: haiku/trunk/src/system/kernel/kernel.rdef Log: Removed the R5 icon from the kernel resources - it can only be compiled for Haiku. Modified: haiku/trunk/src/system/kernel/kernel.rdef =================================================================== --- haiku/trunk/src/system/kernel/kernel.rdef 2007-01-05 19:54:35 UTC (rev 19713) +++ haiku/trunk/src/system/kernel/kernel.rdef 2007-01-05 20:16:48 UTC (rev 19714) @@ -9,11 +9,9 @@ internal = 0, short_info = "Kernel", - long_info = "Kernel, Copyright 2006 Haiku Inc." + long_info = "Kernel ?2002-2007 Haiku Inc." }; -#ifdef HAIKU_TARGET_PLATFORM_HAIKU - resource vector_icon { $"6E636966060500020312023D7DDC399F12BB508D3F322647E840C051E60000FF" $"FF000002031202BD162CBA5E433BBF38BE71194B6AC04C30150000FFFF000002" @@ -30,61 +28,3 @@ $"00054AA7FE492FFD01178A00040A040102023D00050000000000003D00054AA7" $"FE492FFD" }; - -#else // HAIKU_TARGET_PLATFORM_HAIKU - -resource mini_icon array { - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFF00000000FFFFFFFF000000FFFFFF" - $"FF003F3F3F3F000000003F3F3F00FFFF" - $"FF003F3F00003F00000000003F3F00FF" - $"FF003F003F3F002FEB30003F003F00FF" - $"FF00003F3F002F2B2B2C30003F0008FF" - $"FF08003F3F002B3F2C2C2F003F0809FF" - $"FF00003F3F002F2C2C2EEB003F00FFFF" - $"003F3F003F3F002D2D2F003F003F00FF" - $"003F3F3F00003F0000003F003F3F00FF" - $"003F3F3F3F3F003F3F3F003F3F3F00FF" - $"FF003F3F3F3F3F0000003F3F3F00FFFF" - $"FFFF0000000000FFFFFF000000FFFFFF" -}; - -resource large_icon array { - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFFFFFF00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" - $"FFFFFFFFFF00003F3F3F3F3F3F3F000000FFFF00000000000000FFFFFFFFFFFF" - $"FFFFFFFF003F3F3F3F3F3F3F3F3F3F3F0000003F3F3F3F3F3F3F0000FFFFFFFF" - $"FFFFFFFF003F3F3F3F3F3F3F3F3F00003F3F3F00003F3F3F3F3F3F3F00FFFFFF" - $"FFFFFF003F3F3F3F3F3F3F3F00003F3F3F3F3F3F3F00003F3F3F3F3F00FFFFFF" - $"FFFFFF003F3F3F3F3F3F00003F3F3F00000000003F3F3F003F3F3F3F3F00FFFF" - $"FFFFFF003F3F3F3F3F003F3F3F00002FEB2F302F00003F3F003F3F3F3F00FFFF" - $"FFFFFF003F3F3F3F003F3F3F002FEB2C2B2C2D302F2F003F3F003F3F3F00FFFF" - $"FFFFFF003F3F3F003F3F3F3F002F2B2A2B2B2C2D2E2F003F3F3F003F3F00FFFF" - $"FFFFFFFF003F003F3F3F3F002F2B2B2A2B2B2B2D2D2F30003F3F3F003F00FFFF" - $"FFFFFFFF00003F3F3F3F3F002F2B2B3F2B2A2C2D2DEB30003F3F3F3F00FFFFFF" - $"FFFFFFFF00003F3F3F3F3F002F2C2B2B2A2B2C2C2E2F2F003F3F3F3F0000FFFF" - $"FFFFFF003F003F3F3F3F3F002F2D2B2C2C2B2C2D2D2F30003F3F3F003F00FFFF" - $"FFFFFF003F3F003F3F3F3F002FEB2D2D2C2C2D2DEB2F2F003F3F3F003F3F00FF" - $"FFFF003F3F3F3F003F3F3F3F00302E2C2D2D2D2F2F2F003F3F3F003F3F3F00FF" - $"FFFF003F3F3F3F3F003F3F3F002F2FEBEBEBEBEB2F2F003F3F003F3F3F3F00FF" - $"FFFF003F3F3F3F3F3F00003F3F00002F2F302F2F00003F3F003F3F3F3F3F00FF" - $"FFFF003F3F3F3F3F3F3F3F00003F3F00000000003F3F00003F3F3F3F3F3F00FF" - $"FFFF003F3F3F3F3F3F3F3F3F3F00003F3F3F3F3F00003F3F3F3F3F3F3F3F00FF" - $"FFFF003F3F3F3F3F3F3F3F3F3F3F3F00003F00003F3F3F3F3F3F3F3F3F00FFFF" - $"FFFFFF003F3F3F3F3F3F3F3F3F3F3F3F000000003F3F3F3F3F3F3F0000FFFFFF" - $"FFFFFFFF00003F3F3F3F3F3F3F000000FFFFFFFF00000000000000FFFFFFFFFF" - $"FFFFFFFFFFFF00000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" -}; - -#endif // HAIKU_TARGET_PLATFORM_HAIKU From axeld at mail.berlios.de Fri Jan 5 21:27:21 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 5 Jan 2007 21:27:21 +0100 Subject: [Haiku-commits] r19715 - haiku/trunk/src/apps/abouthaiku Message-ID: <200701052027.l05KRLI3027822@sheep.berlios.de> Author: axeld Date: 2007-01-05 21:27:20 +0100 (Fri, 05 Jan 2007) New Revision: 19715 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19715&view=rev Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp Log: Our copyright string now says 2007 - I also updated it so that we don't have to do this every year, just in case ;-) Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp =================================================================== --- haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp 2007-01-05 20:16:48 UTC (rev 19714) +++ haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp 2007-01-05 20:27:20 UTC (rev 19715) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2006, Haiku, Inc. + * Copyright (c) 2005-2007, Haiku, Inc. * Distributed under the terms of the MIT license. * * Author: @@ -30,6 +30,7 @@ #include #include +#include #define SCROLL_CREDITS_VIEW 'mviv' @@ -261,7 +262,8 @@ r.OffsetBy(0, labelHeight); r.bottom = r.top + textHeight; - sprintf(string, "%s %s", systemInfo.kernel_build_date, systemInfo.kernel_build_time); + snprintf(string, sizeof(string), "%s %s", + systemInfo.kernel_build_date, systemInfo.kernel_build_time); stringView = new BStringView(r, "kerneltext", string); fInfoView->AddChild(stringView); @@ -315,8 +317,16 @@ font.SetSize(be_bold_font->Size()); font.SetFace(B_BOLD_FACE | B_ITALIC_FACE); + time_t time = ::time(NULL); + struct tm* tm = localtime(&time); + int32 year = tm->tm_year + 1900; + if (year < 2007) + year = 2007; + snprintf(string, sizeof(string), + "Copyright " B_UTF8_COPYRIGHT "2001-%ld Haiku, Inc.\n\n", year); + fCreditsView->SetFontAndColor(be_plain_font, B_FONT_ALL, &darkgrey); - fCreditsView->Insert("Copyright " B_UTF8_COPYRIGHT "2001-2006 Haiku, Inc.\n\n"); + fCreditsView->Insert(string); fCreditsView->SetFontAndColor(&font, B_FONT_ALL, &haikuOrange); fCreditsView->Insert("Team Leads:\n"); From marcusoverhagen at mail.berlios.de Sat Jan 6 02:04:12 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Sat, 6 Jan 2007 02:04:12 +0100 Subject: [Haiku-commits] r19716 - haiku/trunk/src/system/kernel/disk_device_manager Message-ID: <200701060104.l0614CSW001104@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-06 02:04:09 +0100 (Sat, 06 Jan 2007) New Revision: 19716 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19716&view=rev Modified: haiku/trunk/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp Log: fixed error return in _Scan() function. now only returns B_OK when a device was found. Modified: haiku/trunk/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp =================================================================== --- haiku/trunk/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp 2007-01-05 20:27:20 UTC (rev 19715) +++ haiku/trunk/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp 2007-01-06 01:04:09 UTC (rev 19716) @@ -1131,7 +1131,7 @@ KDiskDeviceManager::_Scan(const char *path) { DBG(OUT("KDiskDeviceManager::_Scan(%s)\n", path)); - status_t error = B_OK; + status_t error = B_ENTRY_NOT_FOUND; struct stat st; if (lstat(path, &st) < 0) { return errno; @@ -1150,7 +1150,8 @@ || entryPath.Append(entry->d_name) != B_OK) { continue; } - _Scan(entryPath.Path()); + if (_Scan(entryPath.Path()) == B_OK) + error = B_OK; } closedir(dir); } else { @@ -1166,7 +1167,7 @@ if (!device) return B_NO_MEMORY; // init the KDiskDevice - status_t error = device->SetTo(path); + error = device->SetTo(path); // add the device if (error == B_OK && !_AddDevice(device)) error = B_NO_MEMORY; From darkwyrm at mail.berlios.de Sat Jan 6 03:27:53 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Sat, 6 Jan 2007 03:27:53 +0100 Subject: [Haiku-commits] r19717 - in haiku/trunk/headers/os/be_apps: . ServicesDaemon Message-ID: <200701060227.l062RrqA010575@sheep.berlios.de> Author: darkwyrm Date: 2007-01-06 03:27:52 +0100 (Sat, 06 Jan 2007) New Revision: 19717 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19717&view=rev Added: haiku/trunk/headers/os/be_apps/ServicesDaemon/ haiku/trunk/headers/os/be_apps/ServicesDaemon/ServicesDaemon.h Log: Added the public header to allow apps to take advantage of the services daemon's app restart capabilities Added: haiku/trunk/headers/os/be_apps/ServicesDaemon/ServicesDaemon.h =================================================================== --- haiku/trunk/headers/os/be_apps/ServicesDaemon/ServicesDaemon.h 2007-01-06 01:04:09 UTC (rev 19716) +++ haiku/trunk/headers/os/be_apps/ServicesDaemon/ServicesDaemon.h 2007-01-06 02:27:52 UTC (rev 19717) @@ -0,0 +1,12 @@ +#ifndef SERVICES_DAEMON_APP_H +#define SERVICES_DAEMON_APP_H + +#define B_SERVICES_DAEMON_SIGNATURE "application/x-vnd.Haiku-ServicesDaemon" + +// Send this message to the daemon if you would like to have your program +// restarted. The message is expected to have an attached string containing +// the signature of your app. Once sent to the daemon, it will wait until +// your app quits before relaunching it. +#define B_SERVICES_DAEMON_RESTART 'SDRS' + +#endif From stefano.ceccherini at gmail.com Sat Jan 6 12:07:09 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Sat, 6 Jan 2007 12:07:09 +0100 Subject: [Haiku-commits] r19708 - haiku/trunk/src/kits/interface In-Reply-To: References: <200701051003.l05A3XGx003356@sheep.berlios.de> Message-ID: <894b9700701060307pe4a0b3apa2195c948efaae21@mail.gmail.com> 2007/1/5, Waldemar Kornewald : > I'm sorry. :) > Don't worry, I was obviously joking :) From axeld at mail.berlios.de Sat Jan 6 12:51:22 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 6 Jan 2007 12:51:22 +0100 Subject: [Haiku-commits] r19718 - haiku/trunk/src/system/boot/platform/bios_ia32 Message-ID: <200701061151.l06BpM5S006844@sheep.berlios.de> Author: axeld Date: 2007-01-06 12:51:21 +0100 (Sat, 06 Jan 2007) New Revision: 19718 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19718&view=rev Modified: haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp Log: * Moved PXE page directory and page tables below the 1 MB limit. * Minor cleanup. Modified: haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp 2007-01-06 02:27:52 UTC (rev 19717) +++ haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp 2007-01-06 11:51:21 UTC (rev 19718) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2005, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. * Based on code written by Travis Geiselbrecht for NewOS. * * Distributed under the terms of the MIT License. @@ -27,7 +27,8 @@ * 0x10000 - ? code (up to ~500 kB) * 0x90000 1st temporary page table (identity maps 0-4 MB) * 0x91000 2nd (4-8 MB) - * 0x92000 - 0xa0000 further page tables + * 0x92000 - 0x92000 further page tables + * 0x9e000 - 0xa0000 SMP trampoline code * [0xa0000 - 0x100000 BIOS/ROM/reserved area] * 0x100000 page directory * ... boot loader heap (32 kB) @@ -63,23 +64,22 @@ static const uint32 kDefaultPageTableFlags = 0x07; // present, user, R/W static const size_t kMaxKernelSize = 0x100000; // 1 MB for the kernel -static const uint32 kPageTableRegionEnd = 0x110000; // working page directory and page table static uint32 *sPageDirectory = 0; -static addr_t sNextPhysicalAddress = 0x110000; +static addr_t sNextPhysicalAddress = 0x112000; static addr_t sNextVirtualAddress = KERNEL_BASE + kMaxKernelSize; static addr_t sMaxVirtualAddress = KERNEL_BASE + 0x400000; -static addr_t sNextPageTableAddress = 0x100000; +static addr_t sNextPageTableAddress = 0x7d000; +static const uint32 kPageTableRegionEnd = 0x8b000; + // we need to reserve 2 pages for the SMP trampoline code #else static const uint32 kDefaultPageTableFlags = 0x07; // present, user, R/W static const size_t kMaxKernelSize = 0x100000; // 1 MB for the kernel -static const uint32 kPageTableRegionEnd = 0x9e000; - // we need to reserve 2 pages for the SMP trampoline code // working page directory and page table static uint32 *sPageDirectory = 0; @@ -89,6 +89,8 @@ static addr_t sMaxVirtualAddress = KERNEL_BASE + 0x400000; static addr_t sNextPageTableAddress = 0x90000; +static const uint32 kPageTableRegionEnd = 0x9e000; + // we need to reserve 2 pages for the SMP trampoline code #endif From axeld at mail.berlios.de Sat Jan 6 13:50:01 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 6 Jan 2007 13:50:01 +0100 Subject: [Haiku-commits] r19719 - haiku/trunk/src/system/kernel Message-ID: <200701061250.l06Co1Hg015510@sheep.berlios.de> Author: axeld Date: 2007-01-06 13:50:01 +0100 (Sat, 06 Jan 2007) New Revision: 19719 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19719&view=rev Modified: haiku/trunk/src/system/kernel/scheduler.cpp Log: * Instead of choosing the next thread if we skip one, we now choose the first thread with a lower priority than the current one. * Further reduced the probability to skip a thread to roughly 4%, that makes around 13 skips per second, and about 40 msecs spend in lower priority threads per second (with a 3 msec quantum). Might still be too much, but we'll see. Modified: haiku/trunk/src/system/kernel/scheduler.cpp =================================================================== --- haiku/trunk/src/system/kernel/scheduler.cpp 2007-01-06 11:51:21 UTC (rev 19718) +++ haiku/trunk/src/system/kernel/scheduler.cpp 2007-01-06 12:50:01 UTC (rev 19719) @@ -197,12 +197,17 @@ if (nextThread->queue_next && nextThread->queue_next->priority == B_IDLE_PRIORITY) break; - // skip normal threads sometimes (roughly 12.5%) - if (_rand() > 0x1000) + // skip normal threads sometimes (roughly 4%) + if (_rand() > 0x500) break; - prevThread = nextThread; - nextThread = nextThread->queue_next; + // skip until next lower priority + int32 priority = nextThread->priority; + while (nextThread->queue_next && priority == nextThread->queue_next->priority + && nextThread->queue_next->priority > B_IDLE_PRIORITY) { + prevThread = nextThread; + nextThread = nextThread->queue_next; + } } } From darkwyrm at mail.berlios.de Sat Jan 6 14:20:02 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Sat, 6 Jan 2007 14:20:02 +0100 Subject: [Haiku-commits] r19720 - haiku/trunk/src/servers/services_daemon Message-ID: <200701061320.l06DK2TI018695@sheep.berlios.de> Author: darkwyrm Date: 2007-01-06 14:20:01 +0100 (Sat, 06 Jan 2007) New Revision: 19720 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19720&view=rev Modified: haiku/trunk/src/servers/services_daemon/ServicesDaemon.cpp haiku/trunk/src/servers/services_daemon/ServicesDaemon.h Log: Added app restart capabilities Modified: haiku/trunk/src/servers/services_daemon/ServicesDaemon.cpp =================================================================== --- haiku/trunk/src/servers/services_daemon/ServicesDaemon.cpp 2007-01-06 12:50:01 UTC (rev 19719) +++ haiku/trunk/src/servers/services_daemon/ServicesDaemon.cpp 2007-01-06 13:20:01 UTC (rev 19720) @@ -10,6 +10,7 @@ #include #include #include +#include enum { M_RELAUNCH_DESKBAR = 'rtsk', @@ -22,7 +23,7 @@ M_RELAUNCH_MIDI }; -// Time delay in microseconds - 1 seconds +// Time delay in microseconds - 1 second const bigtime_t kRelaunchDelay = 1000000; const char *gSignatures[] = { @@ -75,6 +76,11 @@ int32 dummyval; wait_for_thread(fRelauncherID, &dummyval); + + for (int32 i = 0; i < fSignatureList.CountItems(); i++) { + BString *item = (BString*) fSignatureList.ItemAt(i); + delete item; + } } @@ -87,6 +93,7 @@ return true; } + void App::MessageReceived(BMessage *msg) { @@ -96,6 +103,19 @@ if (msg->FindString("be:signature",&string) != B_OK) return; + // See if the signature belongs to an app that has requested + // a restart + for (int32 i = 0; i < fSignatureList.CountItems(); i++) { + BString *item = (BString*) fSignatureList.ItemAt(i); + if (string.Compare(*item) == 0) { + fSignatureList.RemoveItem(item); + delete item; + + be_roster->Launch(string.String()); + return; + } + } + int i = 0; while (gSignatures[i]) { // Checking to see if it's one of the supported signatures @@ -112,6 +132,12 @@ } break; } + case B_SERVICES_DAEMON_RESTART: { + BString signature; + if (msg->FindString("signature",&signature) == B_OK) + fSignatureList.AddItem(new BString(signature)); + break; + } case M_RELAUNCH_DESKBAR: { be_roster->Launch(gSignatures[msg->what - M_RELAUNCH_DESKBAR]); break; @@ -142,6 +168,7 @@ be_roster->Launch(gSignatures[msg->what - M_RELAUNCH_DESKBAR]); break; } + default: BApplication::MessageReceived(msg); } @@ -175,10 +202,11 @@ if (msg) { // Attempt to work around R5 shutdown procedures by checking for - // debug_server running state. If it's shut down, then chances are that - // the system is shutting down or has already done so. We use the - // debug server in particular because it's one of the few services - // that is available in safe mode which is closed on system shutdown. + // debug_server running state. If it's shut down, then chances + // are that the system is shutting down or has already done so. + // We use the debug server in particular because it's one of + // the few services that is available in safe mode which is + // closed on system shutdown. if (be_roster->IsRunning("application/x-vnd.Be-DBSV")) { snooze(kRelaunchDelay); @@ -193,6 +221,7 @@ return 0; } + int main(void) { Modified: haiku/trunk/src/servers/services_daemon/ServicesDaemon.h =================================================================== --- haiku/trunk/src/servers/services_daemon/ServicesDaemon.h 2007-01-06 12:50:01 UTC (rev 19719) +++ haiku/trunk/src/servers/services_daemon/ServicesDaemon.h 2007-01-06 13:20:01 UTC (rev 19720) @@ -19,6 +19,8 @@ thread_id fRelauncherID; status_t fStatus; BMessageQueue fRelaunchQueue; + + BList fSignatureList; }; From axeld at mail.berlios.de Sat Jan 6 14:26:47 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 6 Jan 2007 14:26:47 +0100 Subject: [Haiku-commits] r19721 - haiku/trunk/src/servers/app/drawing/Painter/font_support Message-ID: <200701061326.l06DQlZF019325@sheep.berlios.de> Author: axeld Date: 2007-01-06 14:26:46 +0100 (Sat, 06 Jan 2007) New Revision: 19721 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19721&view=rev Modified: haiku/trunk/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp Log: Turns out drawing text using the outline path always results in an endless loop. Since I have no clue about AGG at this point, I just disabled rendering the glyphs; instead, their bounding boxes will be shown. Modified: haiku/trunk/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp =================================================================== --- haiku/trunk/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp 2007-01-06 13:20:01 UTC (rev 19720) +++ haiku/trunk/src/servers/app/drawing/Painter/font_support/AGGTextRenderer.cpp 2007-01-06 13:26:46 UTC (rev 19721) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006, Stephan A?mus . All rights reserved. + * Copyright 2005-2007, Stephan A?mus . All rights reserved. * Distributed under the terms of the MIT License. */ @@ -29,7 +29,7 @@ #define FLIP_Y false -#define SHOW_GLYPH_BOUNDS 0 +#define SHOW_GLYPH_BOUNDS 1 #if SHOW_GLYPH_BOUNDS # include @@ -184,6 +184,7 @@ fCurves.approximation_scale(transform.scale()); +#if 0 // use a transformation behind the curves // (only if glyph->data_type == agg::glyph_data_outline) // in the pipeline for the rasterizer @@ -194,6 +195,7 @@ typedef agg::conv_transform conv_font_contour_trans_type; conv_font_contour_trans_type transformedContourOutline(fContour, transform); +#endif float falseBoldWidth = fContour.width(); double x = 0.0; @@ -295,12 +297,15 @@ case agg::glyph_data_outline: { fRasterizer.reset(); +// TODO: this currently falls into an endless loop - this is a quick fix to keep the +// app_server running - instead of the characters, their bounding boxes will be shown +#if 0 if (fContour.width() == 0.0) { fRasterizer.add_path(transformedOutline); } else { fRasterizer.add_path(transformedContourOutline); } - +#endif #if SHOW_GLYPH_BOUNDS agg::path_storage p; p.move_to(glyphBounds.left + 0.5, glyphBounds.top + 0.5); @@ -327,7 +332,7 @@ advanceY = glyph->advance_y; firstLoop = false; - }; + } // put pen location behind rendered text // (at the baseline of the virtual next glyph) From marcusoverhagen at mail.berlios.de Sat Jan 6 14:46:41 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Sat, 6 Jan 2007 14:46:41 +0100 Subject: [Haiku-commits] r19722 - in haiku/trunk/src/system/boot: . platform/pxe_ia32 Message-ID: <200701061346.l06DkfAo021374@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-06 14:46:41 +0100 (Sat, 06 Jan 2007) New Revision: 19722 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19722&view=rev Modified: haiku/trunk/src/system/boot/Jamfile haiku/trunk/src/system/boot/platform/pxe_ia32/Jamfile haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage1.S Log: Cleanup naming of PXE stage2. It no longer interferes with zbeos build process. You can build it using: TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku-loader Building the PXE stage1 using: TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku is still broken. however, it can be build using: cd src/system/boot/platform/pxe_ia32/ as -o pxe_stage1.o pxe_stage1.S ld --oformat binary --Ttext 0x7C00 -o pxe_stage1.bin pxe_stage1.o cp pxe_stage1.bin /tftpboot/pxehaiku Modified: haiku/trunk/src/system/boot/Jamfile =================================================================== --- haiku/trunk/src/system/boot/Jamfile 2007-01-06 13:26:46 UTC (rev 19721) +++ haiku/trunk/src/system/boot/Jamfile 2007-01-06 13:46:41 UTC (rev 19722) @@ -69,6 +69,9 @@ BuildZbeos zbeos : boot_loader_$(TARGET_BOOT_PLATFORM) ; +# different target for PXE, to be build with TARGET_BOOT_PLATFORM=pxe_ia32 jam pxehaiku-loader +BuildZbeos pxehaiku-loader : boot_loader_$(TARGET_BOOT_PLATFORM) ; + SubInclude HAIKU_TOP src system boot arch $(TARGET_ARCH) ; SubInclude HAIKU_TOP src system boot loader ; SubInclude HAIKU_TOP src system boot platform ; Modified: haiku/trunk/src/system/boot/platform/pxe_ia32/Jamfile =================================================================== --- haiku/trunk/src/system/boot/platform/pxe_ia32/Jamfile 2007-01-06 13:26:46 UTC (rev 19721) +++ haiku/trunk/src/system/boot/platform/pxe_ia32/Jamfile 2007-01-06 13:46:41 UTC (rev 19722) @@ -70,7 +70,7 @@ ld --oformat binary --Ttext 0x7C00 -o $(1) $(1).o } -BuildPXEstage1 pxe_stage1.bin : pxe_stage1.S ; +BuildPXEstage1 pxehaiku : pxe_stage1.S ; SEARCH on [ FGristFiles $(bios_ia32_src) ] = [ FDirName $(SUBDIR) $(DOTDOT) bios_ia32 ] ; @@ -85,7 +85,4 @@ SEARCH on stage1.bin = [ FDirName $(SUBDIR) $(DOTDOT) bios_ia32 ] ; -# Tell the build system to where stage1.bin can be found, so it can be used -# elsewhere. -# SEARCH on pxe_stage1.bin = $(SUBDIR) ; - +SEARCH on pxe_stage1.S = $(SUBDIR) ; Modified: haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage1.S =================================================================== --- haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage1.S 2007-01-06 13:26:46 UTC (rev 19721) +++ haiku/trunk/src/system/boot/platform/pxe_ia32/pxe_stage1.S 2007-01-06 13:46:41 UTC (rev 19722) @@ -467,7 +467,7 @@ ret -startmsg: .asciz "\r\nHaiku PXE bootloader version 0.1\r\n\r\n" +startmsg: .asciz "\r\nHaiku PXE bootloader version 1.0\r\n\r\n" unrealmsg: .asciz "Switch to unreal mode done\r\n" pxenvmsg: .asciz "PXENV+ data structure at " @@ -485,10 +485,10 @@ psizeis: .asciz "Packet size is " maxfsize: .asciz "Maximum TFTP file size is " maxs2size: .asciz "Maximum stage 2 file size is " -etoobig: .asciz "haiku-pxe-loader file is too large, loading aborted\r\n" -sizefailed: .asciz "\r\nCouldn't get haiku-pxe-loader file size, loading failed\r\n" -loadfailed: .asciz "\r\nLoading haiku-pxe-loader (stage 2) failed\r\n" -executing: .asciz "\r\nExecuting haiku-pxe-loader (stage 2)\r\n" +etoobig: .asciz "pxehaiku-loader file is too large, loading aborted\r\n" +sizefailed: .asciz "\r\nCouldn't get pxehaiku-loader file size, loading failed\r\n" +loadfailed: .asciz "\r\nLoading pxehaiku-loader (stage 2) failed\r\n" +executing: .asciz "\r\nExecuting pxehaiku-loader (stage 2)\r\n" colon: .asciz ":" dot: .asciz "." crlf: .asciz "\r\n" @@ -561,8 +561,8 @@ s_PXENV_TFTP_OPEN_Status: .word 0 s_PXENV_TFTP_OPEN_ServerIPAddress: .long 0 s_PXENV_TFTP_OPEN_GatewayIPAddress: .long 0 -s_PXENV_TFTP_OPEN_FileName: .asciz "haiku-pxe-loader" - .fill 111 +s_PXENV_TFTP_OPEN_FileName: .asciz "pxehaiku-loader" + .fill 112 s_PXENV_TFTP_OPEN_TFTPPort: .word (69 << 8) s_PXENV_TFTP_OPEN_PacketSize: .word 1456 @@ -570,8 +570,8 @@ s_PXENV_TFTP_GET_FSIZE_Status: .word 0 s_PXENV_TFTP_GET_FSIZE_ServerIPAddress: .long 0 s_PXENV_TFTP_GET_FSIZE_GatewayIPAddress:.long 0 -s_PXENV_TFTP_GET_FSIZE_FileName: .asciz "haiku-pxe-loader" - .fill 111 +s_PXENV_TFTP_GET_FSIZE_FileName: .asciz "pxehaiku-loader" + .fill 112 s_PXENV_TFTP_GET_FSIZE_FileSize: .long 0 s_PXENV_TFTP_READ: From marcusoverhagen at mail.berlios.de Sat Jan 6 14:54:39 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Sat, 6 Jan 2007 14:54:39 +0100 Subject: [Haiku-commits] r19723 - haiku/trunk/build/jam Message-ID: <200701061354.l06Dsd4w022120@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-06 14:54:39 +0100 (Sat, 06 Jan 2007) New Revision: 19723 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19723&view=rev Modified: haiku/trunk/build/jam/HaikuPXE Log: Removed broken dependencies, it should be possible to build pxehaiku now. Modified: haiku/trunk/build/jam/HaikuPXE =================================================================== --- haiku/trunk/build/jam/HaikuPXE 2007-01-06 13:46:41 UTC (rev 19722) +++ haiku/trunk/build/jam/HaikuPXE 2007-01-06 13:54:39 UTC (rev 19723) @@ -1,6 +0,0 @@ - -NotFile pxehaiku ; -Depends pxehaiku : pxe_stage1.bin ; - -NotFile haiku-pxe-loader ; -Depends pxehaiku : zbeos ; From axeld at mail.berlios.de Sat Jan 6 16:50:26 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 6 Jan 2007 16:50:26 +0100 Subject: [Haiku-commits] r19724 - haiku/trunk/src/bin/screen_blanker Message-ID: <200701061550.l06FoQuH032073@sheep.berlios.de> Author: axeld Date: 2007-01-06 16:50:26 +0100 (Sat, 06 Jan 2007) New Revision: 19724 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19724&view=rev Modified: haiku/trunk/src/bin/screen_blanker/ScreenBlanker.cpp Log: * Fixed missing "not" operator in all those flags changing lines; turning off the screen is now working as expected. * Only remove DPMS runners when the time is actually supported (previous code would not have always worked correctly in case the graphics card would not support all DPMS modes). Modified: haiku/trunk/src/bin/screen_blanker/ScreenBlanker.cpp =================================================================== --- haiku/trunk/src/bin/screen_blanker/ScreenBlanker.cpp 2007-01-06 13:54:39 UTC (rev 19723) +++ haiku/trunk/src/bin/screen_blanker/ScreenBlanker.cpp 2007-01-06 15:50:26 UTC (rev 19724) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Haiku. + * Copyright 2003-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -154,7 +154,7 @@ delete fStandByScreenRunner; delete fSuspendScreenRunner; delete fTurnOffScreenRunner; - + fStandByScreenRunner = fSuspendScreenRunner = fTurnOffScreenRunner = NULL; // figure out which notifiers we need and which of them are supported @@ -163,19 +163,21 @@ BScreen screen; uint32 capabilities = screen.DPMSCapabilites(); if ((capabilities & B_DPMS_OFF) == 0) - flags &= ENABLE_DPMS_OFF; + flags &= ~ENABLE_DPMS_OFF; if ((capabilities & B_DPMS_SUSPEND) == 0) - flags &= ENABLE_DPMS_SUSPEND; + flags &= ~ENABLE_DPMS_SUSPEND; if ((capabilities & B_DPMS_STAND_BY) == 0) - flags &= ENABLE_DPMS_STAND_BY; + flags &= ~ENABLE_DPMS_STAND_BY; if ((flags & ENABLE_DPMS_MASK) == 0) return; - if (fSettings.OffTime() == fSettings.SuspendTime()) - flags &= ENABLE_DPMS_SUSPEND; - if (fSettings.SuspendTime() == fSettings.StandByTime()) - flags &= ENABLE_DPMS_STAND_BY; + if (fSettings.OffTime() == fSettings.SuspendTime() + && (flags & (ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND)) == ENABLE_DPMS_OFF | ENABLE_DPMS_SUSPEND) + flags &= ~ENABLE_DPMS_SUSPEND; + if (fSettings.SuspendTime() == fSettings.StandByTime() + && (flags & (ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY)) == ENABLE_DPMS_SUSPEND | ENABLE_DPMS_STAND_BY) + flags &= ~ENABLE_DPMS_STAND_BY; // start them off again From axeld at mail.berlios.de Sat Jan 6 18:08:20 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 6 Jan 2007 18:08:20 +0100 Subject: [Haiku-commits] r19725 - in haiku/trunk: headers/private/app src/kits/interface src/servers/app Message-ID: <200701061708.l06H8Kt5006672@sheep.berlios.de> Author: axeld Date: 2007-01-06 18:08:19 +0100 (Sat, 06 Jan 2007) New Revision: 19725 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19725&view=rev Modified: haiku/trunk/headers/private/app/ServerProtocol.h haiku/trunk/src/kits/interface/Window.cpp haiku/trunk/src/servers/app/ServerWindow.cpp Log: BWindow::IsFront() was implemented incorrectly - we actually need to query the app_server for this; added a new AS_IS_FRONT_WINDOW command for this. For example, clicking on the menu bar to bring windows to front in FFM mode does work now. Modified: haiku/trunk/headers/private/app/ServerProtocol.h =================================================================== --- haiku/trunk/headers/private/app/ServerProtocol.h 2007-01-06 15:50:26 UTC (rev 19724) +++ haiku/trunk/headers/private/app/ServerProtocol.h 2007-01-06 17:08:19 UTC (rev 19725) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -92,6 +92,7 @@ AS_WINDOW_MOVE, AS_SET_SIZE_LIMITS, AS_ACTIVATE_WINDOW, + AS_IS_FRONT_WINDOW, AS_UPDATE_IF_NEEDED, // BPicture definitions Modified: haiku/trunk/src/kits/interface/Window.cpp =================================================================== --- haiku/trunk/src/kits/interface/Window.cpp 2007-01-06 15:50:26 UTC (rev 19724) +++ haiku/trunk/src/kits/interface/Window.cpp 2007-01-06 17:08:19 UTC (rev 19725) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -647,7 +647,17 @@ bool BWindow::IsFront() const { - return (IsActive() || IsModal()); + BAutolock locker(const_cast(this)); + if (!locker.IsLocked()) + return false; + + fLink->StartMessage(AS_IS_FRONT_WINDOW); + + status_t status; + if (fLink->FlushWithReply(status) == B_OK) + return status >= B_OK; + + return false; } Modified: haiku/trunk/src/servers/app/ServerWindow.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerWindow.cpp 2007-01-06 15:50:26 UTC (rev 19724) +++ haiku/trunk/src/servers/app/ServerWindow.cpp 2007-01-06 17:08:19 UTC (rev 19725) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -813,6 +813,11 @@ break; } #endif + case AS_IS_FRONT_WINDOW: + fLink.StartMessage(fDesktop->FrontWindow() == fWindowLayer ? B_OK : B_ERROR); + fLink.Flush(); + break; + case AS_GET_WORKSPACES: { STRACE(("ServerWindow %s: Message AS_GET_WORKSPACES\n", Title())); From marcusoverhagen at mail.berlios.de Sat Jan 6 18:21:30 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Sat, 6 Jan 2007 18:21:30 +0100 Subject: [Haiku-commits] r19726 - haiku/trunk/src/add-ons/kernel/bus_managers/ide Message-ID: <200701061721.l06HLUL7008214@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-06 18:21:30 +0100 (Sat, 06 Jan 2007) New Revision: 19726 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19726&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ide/sync.c Log: avoid eating interrupts (still this code is slightly insane) Modified: haiku/trunk/src/add-ons/kernel/bus_managers/ide/sync.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/ide/sync.c 2007-01-06 17:08:19 UTC (rev 19725) +++ haiku/trunk/src/add-ons/kernel/bus_managers/ide/sync.c 2007-01-06 17:21:30 UTC (rev 19726) @@ -151,7 +151,7 @@ // if no request is pending, the IRQ was fired wrongly if (bus->num_running_reqs == 0) { IDE_UNLOCK(bus); - return B_HANDLED_INTERRUPT; + return B_UNHANDLED_INTERRUPT; } bus->state = ide_state_accessing; From marcusoverhagen at mail.berlios.de Sat Jan 6 18:23:39 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Sat, 6 Jan 2007 18:23:39 +0100 Subject: [Haiku-commits] r19727 - haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112 Message-ID: <200701061723.l06HNdIH008406@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-06 18:23:39 +0100 (Sat, 06 Jan 2007) New Revision: 19727 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19727&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c Log: For interupt handling in PIO mode, use the "Task File Configuration + Status" interrupt status bit. Modified: haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-06 17:21:30 UTC (rev 19726) +++ haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-06 17:23:39 UTC (rev 19727) @@ -44,12 +44,13 @@ uint16 ctl; uint16 bmdma; uint16 sien; + uint16 stat; const char *name; } controller_channel_data[] = { - { 0x80, 0x8A, 0x00, 0x148, "Primary Channel" }, - { 0xC0, 0xCA, 0x08, 0x1C8, "Secondary Channel" }, - { 0x280, 0x28A, 0x200, 0x348, "Tertiary Channel" }, - { 0x2C0, 0x2CA, 0x208, 0x3C8, "Quaternary Channel" }, + { 0x80, 0x8A, 0x00, 0x148, 0xA0, "Primary Channel" }, + { 0xC0, 0xCA, 0x08, 0x1C8, 0xE0, "Secondary Channel" }, + { 0x280, 0x28A, 0x200, 0x348, 0x2A0, "Tertiary Channel" }, + { 0x2C0, 0x2CA, 0x208, 0x3C8, 0x2E0, "Quaternary Channel" }, }; #define SI_SYSCFG 0x48 @@ -95,6 +96,8 @@ volatile uint8 * bm_command_reg; volatile uint32 * bm_prdt_address; + volatile uint32 * stat; + area_id prd_area; prd_entry * prdt; void * prdt_phys; @@ -487,6 +490,7 @@ channel->bm_prdt_address = (volatile uint32 *)(controller->mmio_addr + controller_channel_data[chan_index].bmdma + ide_bm_prdt_address); channel->bm_status_reg = (volatile uint8 *)(controller->mmio_addr + controller_channel_data[chan_index].bmdma + ide_bm_status_reg); channel->bm_command_reg = (volatile uint8 *)(controller->mmio_addr + controller_channel_data[chan_index].bmdma + ide_bm_command_reg); + channel->stat = (volatile uint32 *)(controller->mmio_addr + controller_channel_data[chan_index].stat); channel->lost = 0; channel->dma_active = 0; @@ -812,12 +816,13 @@ controller_data *controller = arg; ide_bm_status bm_status; uint8 status; - int32 ret; + int32 result, ret; int i; FLOW("handle_interrupt\n"); - // XXX This is bogus + result = B_UNHANDLED_INTERRUPT; + for (i = 0; i < controller->channel_count; i++) { channel_data *channel = controller->channel[i]; if (!channel || channel->lost) @@ -827,16 +832,20 @@ *(uint8 *)&bm_status = *channel->bm_status_reg; if (!bm_status.interrupt) continue; + } else { + // for PIO, read the "Task File Configuration + Status" Interrupt status + if (!(*channel->stat & (1 << 11)) + continue; } // acknowledge IRQ status = *(channel->command_block + 7); ret = ide->irq_handler(channel->ide_channel, status); - if (ret != B_UNHANDLED_INTERRUPT) - return ret; + if (ret == B_INVOKE_SHEDULER || result == B_UNHANDLED_INTERRUPT) + result = ret; } - return B_UNHANDLED_INTERRUPT; + return result; } From axeld at mail.berlios.de Sat Jan 6 18:25:52 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 6 Jan 2007 18:25:52 +0100 Subject: [Haiku-commits] r19728 - haiku/trunk/headers/posix Message-ID: <200701061725.l06HPqNk008645@sheep.berlios.de> Author: axeld Date: 2007-01-06 18:25:52 +0100 (Sat, 06 Jan 2007) New Revision: 19728 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19728&view=rev Modified: haiku/trunk/headers/posix/fcntl.h Log: * Added a note that the flock() definitions are misplaced here. * Some cleanup. Modified: haiku/trunk/headers/posix/fcntl.h =================================================================== --- haiku/trunk/headers/posix/fcntl.h 2007-01-06 17:23:39 UTC (rev 19727) +++ haiku/trunk/headers/posix/fcntl.h 2007-01-06 17:25:52 UTC (rev 19728) @@ -1,6 +1,7 @@ -/* -** Distributed under the terms of the Haiku License. -*/ +/* + * Copyright 2002-2007, Haiku Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ #ifndef _FCNTL_H #define _FCNTL_H @@ -17,9 +18,11 @@ #define F_GETFL 0x0008 /* get file status flags and access mode */ #define F_SETFL 0x0010 /* set file status flags */ #define F_GETLK 0x0020 /* get locking information */ -#define F_RDLCK 0x0040 /* read or shared lock */ #define F_SETLK 0x0080 /* set locking information */ #define F_SETLKW 0x0100 /* as above, but waits if blocked */ + +/* advisory locking types */ +#define F_RDLCK 0x0040 /* read or shared lock */ #define F_UNLCK 0x0200 /* unlock */ #define F_WRLCK 0x0400 /* write or exclusive lock */ @@ -50,7 +53,7 @@ #define O_RSYNC 0x00020000 /* read synchronized I/O file integrity */ #define O_DSYNC 0x00040000 /* write synchronized I/O data integrity */ -// ToDo: currently not implemented additions: +// TODO: currently not implemented additions: #define O_NOFOLLOW 0x00080000 /* should we implement this? it's similar to O_NOTRAVERSE but will fail on symlinks */ #define O_NOCACHE 0x00100000 /* doesn't use the file system cache if possible */ @@ -71,6 +74,7 @@ pid_t l_pid; }; +/* for use with flock() - TODO: this should be moved to sys/file.h *if* we'll support flock() one day */ #define LOCK_SH 0x01 /* shared file lock */ #define LOCK_EX 0x02 /* exclusive file lock */ #define LOCK_NB 0x04 /* don't block when locking */ From marcusoverhagen at mail.berlios.de Sat Jan 6 18:43:26 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Sat, 6 Jan 2007 18:43:26 +0100 Subject: [Haiku-commits] r19729 - haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112 Message-ID: <200701061743.l06HhQ3V004606@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-06 18:43:24 +0100 (Sat, 06 Jan 2007) New Revision: 19729 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19729&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c Log: Forgot to save that before compiling, but now it does... Modified: haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-06 17:25:52 UTC (rev 19728) +++ haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-06 17:43:24 UTC (rev 19729) @@ -834,14 +834,14 @@ continue; } else { // for PIO, read the "Task File Configuration + Status" Interrupt status - if (!(*channel->stat & (1 << 11)) + if (!(*channel->stat & (1 << 11))) continue; } // acknowledge IRQ status = *(channel->command_block + 7); ret = ide->irq_handler(channel->ide_channel, status); - if (ret == B_INVOKE_SHEDULER || result == B_UNHANDLED_INTERRUPT) + if (ret == B_INVOKE_SCHEDULER || result == B_UNHANDLED_INTERRUPT) result = ret; } From mmlr at mail.berlios.de Sat Jan 6 19:05:06 2007 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Sat, 6 Jan 2007 19:05:06 +0100 Subject: [Haiku-commits] r19730 - haiku/trunk/src/add-ons/kernel/busses/usb Message-ID: <200701061805.l06I56So032002@sheep.berlios.de> Author: mmlr Date: 2007-01-06 19:05:05 +0100 (Sat, 06 Jan 2007) New Revision: 19730 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19730&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/usb/ehci.cpp haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp Log: * Fixed spinlock usage in EHCI and UHCI drivers * Fixed UHCI to allow for empty transfer buffers * Extended the check for still linked transfer descriptors when removing a chain There remain UHCI bugs that will cause transfers outgoing transfers to fail. I'll have to review / rewrite the UHCI driver. Modified: haiku/trunk/src/add-ons/kernel/busses/usb/ehci.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/usb/ehci.cpp 2007-01-06 17:43:24 UTC (rev 19729) +++ haiku/trunk/src/add-ons/kernel/busses/usb/ehci.cpp 2007-01-06 18:05:05 UTC (rev 19730) @@ -762,7 +762,7 @@ int32 EHCI::Interrupt() { - spinlock lock = 0; + static spinlock lock = 0; acquire_spinlock(&lock); // check if any interrupt was generated Modified: haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp 2007-01-06 17:43:24 UTC (rev 19729) +++ haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp 2007-01-06 18:05:05 UTC (rev 19730) @@ -226,6 +226,8 @@ element->link_log = descriptor; element->link_phy = descriptor->this_phy | TD_DEPTH_FIRST; + if (fQueueHead->element_phy & QH_TERMINATE) + fQueueHead->element_phy = descriptor->this_phy; TRACE(("usb_uhci: appended transfer to queue\n")); } @@ -247,11 +249,9 @@ if ((lastDescriptor->link_phy & TD_TERMINATE) > 0) { // it is the only chain in this queue fQueueTop = NULL; - fQueueHead->element_phy = QH_TERMINATE; } else { // there are still linked transfers fQueueTop = (uhci_td *)lastDescriptor->link_log; - fQueueHead->element_phy = fQueueTop->this_phy & TD_LINK_MASK; } } else { // unlink the chain @@ -265,16 +265,17 @@ element = (uhci_td *)element->link_log; } + } - element = firstDescriptor; - while (element && element != lastDescriptor) { - if ((fQueueHead->element_phy & TD_LINK_MASK) == element->this_phy) { - fQueueHead->element_phy = lastDescriptor->link_phy; - break; - } + uhci_td *element = firstDescriptor; + while (element && element != lastDescriptor->link_log) { + if ((fQueueHead->element_phy & TD_LINK_MASK) == element->this_phy) { + fQueueHead->element_phy = lastDescriptor->link_phy; + TRACE_ERROR(("uhci: queue element pointer still pointing to removed chain\n")); + break; + } - element = (uhci_td *)element->link_log; - } + element = (uhci_td *)element->link_log; } lastDescriptor->link_log = NULL; @@ -357,8 +358,8 @@ fPCIInfo->function, PCI_command, 2, command); // make sure we gain control of the UHCI controller instead of the BIOS - sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device, fPCIInfo->function, - PCI_LEGSUP, 2, PCI_LEGSUP_USBPIRQDEN); + sPCIModule->write_pci_config(fPCIInfo->bus, fPCIInfo->device, + fPCIInfo->function, PCI_LEGSUP, 2, PCI_LEGSUP_USBPIRQDEN); // disable interrupts WriteReg16(UHCI_USBINTR, 0); @@ -523,9 +524,6 @@ if (transfer->TransferPipe()->Type() & USB_OBJECT_CONTROL_PIPE) return SubmitRequest(transfer); - if (transfer->VectorCount() == 0) - return B_BAD_VALUE; - Pipe *pipe = transfer->TransferPipe(); bool directionIn = (pipe->Direction() == Pipe::In); @@ -714,7 +712,7 @@ if (fLastTransfer) fLastTransfer->link = data; - else + if (!fFirstTransfer) fFirstTransfer = data; fLastTransfer = data; @@ -1073,7 +1071,7 @@ int32 UHCI::Interrupt() { - spinlock lock = 0; + static spinlock lock = 0; acquire_spinlock(&lock); // Check if we really had an interrupt @@ -1259,6 +1257,8 @@ { size_t packetSize = pipe->MaxPacketSize(); int32 descriptorCount = (bufferSize + packetSize - 1) / packetSize; + if (descriptorCount == 0) + descriptorCount = 1; bool dataToggle = pipe->DataToggle(); uhci_td *firstDescriptor = NULL; From axeld at mail.berlios.de Sat Jan 6 19:06:38 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 6 Jan 2007 19:06:38 +0100 Subject: [Haiku-commits] r19731 - in haiku/trunk: headers/os/support src/kits/support Message-ID: <200701061806.l06I6cq5032118@sheep.berlios.de> Author: axeld Date: 2007-01-06 19:06:38 +0100 (Sat, 06 Jan 2007) New Revision: 19731 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19731&view=rev Modified: haiku/trunk/headers/os/support/String.h haiku/trunk/src/kits/support/String.cpp Log: Cleanup. Modified: haiku/trunk/headers/os/support/String.h =================================================================== --- haiku/trunk/headers/os/support/String.h 2007-01-06 18:05:05 UTC (rev 19730) +++ haiku/trunk/headers/os/support/String.h 2007-01-06 18:06:38 UTC (rev 19731) @@ -1,360 +1,281 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2003, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: String.h -// Author(s): Stefano Ceccherini (burton666 at libero.it) -// Description: String class supporting common string operations. -//------------------------------------------------------------------------------ - - - +/* + * Copyright 2001-2007, Haiku Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ #ifndef __BSTRING__ #define __BSTRING__ + #include #include #include + class BString { -public: - BString(); - BString(const char *); - BString(const BString &); - BString(const char *, int32 maxLength); - - ~BString(); - -/*---- Access --------------------------------------------------------------*/ - const char *String() const; - /* returns null-terminated string */ + public: + BString(); + BString(const char* string); + BString(const BString& string); + BString(const char* string, int32 maxLength); + ~BString(); - int32 Length() const; - /* length of corresponding string */ + // Access + const char* String() const; - int32 CountChars() const; - /* returns number of UTF8 characters in string */ -/*---- Assignment ----------------------------------------------------------*/ - BString &operator=(const BString &); - BString &operator=(const char *); - BString &operator=(char); - - BString &SetTo(const char *); - BString &SetTo(const char *, int32 length); + int32 Length() const; + // length of corresponding string + int32 CountChars() const; + // returns number of UTF8 characters in string - BString &SetTo(const BString &from); - BString &Adopt(BString &from); - /* leaves empty, avoiding a copy */ - - BString &SetTo(const BString &, int32 length); - BString &Adopt(BString &from, int32 length); - /* leaves empty, avoiding a copy */ - - BString &SetTo(char, int32 count); + // Assignment + BString& operator=(const BString& string); + BString& operator=(const char* string); + BString& operator=(char c); -/*---- Substring copying ---------------------------------------------------*/ - BString &CopyInto(BString &into, int32 fromOffset, - int32 length) const; - /* returns ref as it's result; doesn't do - * anything if is - */ + BString& SetTo(const char* string); + BString& SetTo(const char* string, int32 maxLength); - void CopyInto(char *into, int32 fromOffset, + BString& SetTo(const BString& string); + BString& Adopt(BString& from); + + BString& SetTo(const BString& string, int32 maxLength); + BString& Adopt(BString& from, int32 maxLength); + + BString& SetTo(char c, int32 count); + + // Substring copying + BString& CopyInto(BString& into, int32 fromOffset, int32 length) const; - /* caller guarantees that is large enough */ + void CopyInto(char* into, int32 fromOffset, + int32 length) const; -/*---- Appending -----------------------------------------------------------*/ - BString &operator+=(const BString &); - BString &operator+=(const char *); - BString &operator+=(char); - - BString &Append(const BString &); - BString &Append(const char *); + // Appending + BString& operator+=(const BString& string); + BString& operator+=(const char* string); + BString& operator+=(char c); - BString &Append(const BString &, int32 length); - BString &Append(const char *, int32 length); - BString &Append(char, int32 count); + BString& Append(const BString& string); + BString& Append(const char* string); -/*---- Prepending ----------------------------------------------------------*/ - BString &Prepend(const char *); - BString &Prepend(const BString &); - BString &Prepend(const char *, int32); - BString &Prepend(const BString &, int32); - BString &Prepend(char, int32 count); + BString& Append(const BString& string, int32 length); + BString& Append(const char* string, int32 length); + BString& Append(char c, int32 count); -/*---- Inserting ----------------------------------------------------------*/ - BString &Insert(const char *, int32 pos); - BString &Insert(const char *, int32 length, int32 pos); - BString &Insert(const char *, int32 fromOffset, + // Prepending + BString& Prepend(const char* string); + BString& Prepend(const BString& string); + BString& Prepend(const char* string, int32 length); + BString& Prepend(const BString& string, int32 length); + BString& Prepend(char c, int32 count); + + // Inserting + BString& Insert(const char* string, int32 pos); + BString& Insert(const char* string, int32 length, int32 pos); + BString& Insert(const char* string, int32 fromOffset, int32 length, int32 pos); - BString &Insert(const BString &, int32 pos); - BString &Insert(const BString &, int32 length, int32 pos); - BString &Insert(const BString &, int32 fromOffset, + BString& Insert(const BString& string, int32 pos); + BString& Insert(const BString& string, int32 length, int32 pos); + BString& Insert(const BString& string, int32 fromOffset, int32 length, int32 pos); - BString &Insert(char, int32 count, int32 pos); + BString& Insert(char, int32 count, int32 pos); -/*---- Removing -----------------------------------------------------------*/ - BString &Truncate(int32 newLength, bool lazy = true); - /* pass false in to ensure freeing up the - * truncated memory - */ - - BString &Remove(int32 from, int32 length); + // Removing + BString& Truncate(int32 newLength, bool lazy = true); + BString& Remove(int32 from, int32 length); - BString &RemoveFirst(const BString &); - BString &RemoveLast(const BString &); - BString &RemoveAll(const BString &); + BString& RemoveFirst(const BString& string); + BString& RemoveLast(const BString& string); + BString& RemoveAll(const BString& string); - BString &RemoveFirst(const char *); - BString &RemoveLast(const char *); - BString &RemoveAll(const char *); - - BString &RemoveSet(const char *setOfCharsToRemove); - - BString &MoveInto(BString &into, int32 from, int32 length); - void MoveInto(char *into, int32 from, int32 length); - /* caller guarantees that is large enough */ + BString& RemoveFirst(const char* string); + BString& RemoveLast(const char* string); + BString& RemoveAll(const char* string); + BString& RemoveSet(const char* setOfCharsToRemove); -/*---- Compare functions ---------------------------------------------------*/ - bool operator<(const BString &) const; - bool operator<=(const BString &) const; - bool operator==(const BString &) const; - bool operator>=(const BString &) const; - bool operator>(const BString &) const; - bool operator!=(const BString &) const; - - bool operator<(const char *) const; - bool operator<=(const char *) const; - bool operator==(const char *) const; - bool operator>=(const char *) const; - bool operator>(const char *) const; - bool operator!=(const char *) const; - -/*---- strcmp-style compare functions --------------------------------------*/ - int Compare(const BString &) const; - int Compare(const char *) const; - int Compare(const BString &, int32 n) const; - int Compare(const char *, int32 n) const; - int ICompare(const BString &) const; - int ICompare(const char *) const; - int ICompare(const BString &, int32 n) const; - int ICompare(const char *, int32 n) const; - -/*---- Searching -----------------------------------------------------------*/ - int32 FindFirst(const BString &) const; - int32 FindFirst(const char *) const; - int32 FindFirst(const BString &, int32 fromOffset) const; - int32 FindFirst(const char *, int32 fromOffset) const; - int32 FindFirst(char) const; - int32 FindFirst(char, int32 fromOffset) const; + BString& MoveInto(BString& into, int32 from, int32 length); + void MoveInto(char* into, int32 from, int32 length); - int32 FindLast(const BString &) const; - int32 FindLast(const char *) const; - int32 FindLast(const BString &, int32 beforeOffset) const; - int32 FindLast(const char *, int32 beforeOffset) const; - int32 FindLast(char) const; - int32 FindLast(char, int32 beforeOffset) const; + // Compare functions + bool operator<(const BString& string) const; + bool operator<=(const BString& string) const; + bool operator==(const BString& string) const; + bool operator>=(const BString& string) const; + bool operator>(const BString& string) const; + bool operator!=(const BString& string) const; - int32 IFindFirst(const BString &) const; - int32 IFindFirst(const char *) const; - int32 IFindFirst(const BString &, int32 fromOffset) const; - int32 IFindFirst(const char *, int32 fromOffset) const; + bool operator<(const char* string) const; + bool operator<=(const char* string) const; + bool operator==(const char* string) const; + bool operator>=(const char* string) const; + bool operator>(const char* string) const; + bool operator!=(const char* string) const; - int32 IFindLast(const BString &) const; - int32 IFindLast(const char *) const; - int32 IFindLast(const BString &, int32 beforeOffset) const; - int32 IFindLast(const char *, int32 beforeOffset) const; + // strcmp()-style compare functions + int Compare(const BString& string) const; + int Compare(const char* string) const; + int Compare(const BString& string, int32 length) const; + int Compare(const char* string, int32 length) const; + int ICompare(const BString& string) const; + int ICompare(const char* string) const; + int ICompare(const BString& string, int32 length) const; + int ICompare(const char* string, int32 length) const; -/*---- Replacing -----------------------------------------------------------*/ + // Searching + int32 FindFirst(const BString& string) const; + int32 FindFirst(const char* string) const; + int32 FindFirst(const BString& string, int32 fromOffset) const; + int32 FindFirst(const char* string, int32 fromOffset) const; + int32 FindFirst(char c) const; + int32 FindFirst(char c, int32 fromOffset) const; - BString &ReplaceFirst(char replaceThis, char withThis); - BString &ReplaceLast(char replaceThis, char withThis); - BString &ReplaceAll(char replaceThis, char withThis, + int32 FindLast(const BString& string) const; + int32 FindLast(const char* string) const; + int32 FindLast(const BString& string, int32 beforeOffset) const; + int32 FindLast(const char* string, int32 beforeOffset) const; + int32 FindLast(char c) const; + int32 FindLast(char c, int32 beforeOffset) const; + + int32 IFindFirst(const BString& string) const; + int32 IFindFirst(const char* string) const; + int32 IFindFirst(const BString& string, int32 fromOffset) const; + int32 IFindFirst(const char* string, int32 fromOffset) const; + + int32 IFindLast(const BString& string) const; + int32 IFindLast(const char* string) const; + int32 IFindLast(const BString& string, int32 beforeOffset) const; + int32 IFindLast(const char* string, int32 beforeOffset) const; + + // Replacing + BString& ReplaceFirst(char replaceThis, char withThis); + BString& ReplaceLast(char replaceThis, char withThis); + BString& ReplaceAll(char replaceThis, char withThis, int32 fromOffset = 0); - BString &Replace(char replaceThis, char withThis, + BString& Replace(char replaceThis, char withThis, int32 maxReplaceCount, int32 fromOffset = 0); - BString &ReplaceFirst(const char *replaceThis, - const char *withThis); - BString &ReplaceLast(const char *replaceThis, - const char *withThis); - BString &ReplaceAll(const char *replaceThis, - const char *withThis, int32 fromOffset = 0); - BString &Replace(const char *replaceThis, const char *withThis, + BString& ReplaceFirst(const char* replaceThis, + const char* withThis); + BString& ReplaceLast(const char* replaceThis, + const char* withThis); + BString& ReplaceAll(const char* replaceThis, + const char* withThis, int32 fromOffset = 0); + BString& Replace(const char* replaceThis, const char* withThis, int32 maxReplaceCount, int32 fromOffset = 0); - BString &IReplaceFirst(char replaceThis, char withThis); - BString &IReplaceLast(char replaceThis, char withThis); - BString &IReplaceAll(char replaceThis, char withThis, + BString& IReplaceFirst(char replaceThis, char withThis); + BString& IReplaceLast(char replaceThis, char withThis); + BString& IReplaceAll(char replaceThis, char withThis, int32 fromOffset = 0); - BString &IReplace(char replaceThis, char withThis, + BString& IReplace(char replaceThis, char withThis, int32 maxReplaceCount, int32 fromOffset = 0); - BString &IReplaceFirst(const char *replaceThis, - const char *withThis); - BString &IReplaceLast(const char *replaceThis, - const char *withThis); - BString &IReplaceAll(const char *replaceThis, - const char *withThis, int32 fromOffset = 0); - BString &IReplace(const char *replaceThis, const char *withThis, + BString& IReplaceFirst(const char* replaceThis, + const char* withThis); + BString& IReplaceLast(const char* replaceThis, + const char* withThis); + BString& IReplaceAll(const char* replaceThis, + const char* withThis, int32 fromOffset = 0); + BString& IReplace(const char* replaceThis, const char* withThis, int32 maxReplaceCount, int32 fromOffset = 0); - - BString &ReplaceSet(const char *setOfChars, char with); - BString &ReplaceSet(const char *setOfChars, const char *with); -/*---- Unchecked char access -----------------------------------------------*/ - char operator[](int32 index) const; - char &operator[](int32 index); -/*---- Checked char access -------------------------------------------------*/ - char ByteAt(int32 index) const; + BString& ReplaceSet(const char* setOfChars, char with); + BString& ReplaceSet(const char* setOfChars, const char *with); -/*---- Fast low-level manipulation -----------------------------------------*/ - char *LockBuffer(int32 maxLength); - - /* Make room for characters to be added by C-string like manipulation. - * Returns the equivalent of String(), includes space for - * trailing zero while used as C-string, it is illegal to call other - * BString routines that rely on data/length consistency until - * UnlockBuffer sets things up again. - */ + // Unchecked char access + char operator[](int32 index) const; + char& operator[](int32 index); - BString &UnlockBuffer(int32 length = -1); - - /* Finish using BString as C-string, adjusting length. If no length - * passed in, strlen of internal data is used to determine it. - * BString is in consistent state after this. - */ - -/*---- Upercase<->Lowercase ------------------------------------------------*/ - BString &ToLower(); - BString &ToUpper(); + // Checked char access + char ByteAt(int32 index) const; - BString &Capitalize(); - /* Converts first character to upper-case, rest to - * lower-case - */ + // Fast low-level manipulation + char* LockBuffer(int32 maxLength); + BString& UnlockBuffer(int32 length = -1); - BString &CapitalizeEachWord(); - /* Converts first character in each - * non-alphabethycal-character-separated - * word to upper-case, rest to lower-case - */ -/*----- Escaping and Deescaping --------------------------------------------*/ - BString &CharacterEscape(const char *original, - const char *setOfCharsToEscape, char escapeWith); - /* copies original into , escaping characters - * specified in by prepending - * them with - */ - BString &CharacterEscape(const char *setOfCharsToEscape, + // Upercase <-> Lowercase + BString& ToLower(); + BString& ToUpper(); + + BString& Capitalize(); + BString& CapitalizeEachWord(); + + // Escaping and De-escaping + BString& CharacterEscape(const char* original, + const char* setOfCharsToEscape, char escapeWith); + BString& CharacterEscape(const char* setOfCharsToEscape, char escapeWith); - /* escapes characters specified in - * by prepending them with - */ - BString &CharacterDeescape(const char *original, char escapeChar); - /* copy into the string removing the escaping - * characters - */ - BString &CharacterDeescape(char escapeChar); - /* remove the escaping characters from - * the string - */ + BString& CharacterDeescape(const char* original, char escapeChar); + BString& CharacterDeescape(char escapeChar); -/*---- Simple sprintf replacement calls ------------------------------------*/ -/*---- Slower than sprintf but type and overflow safe ----------------------*/ - BString &operator<<(const char *); - BString &operator<<(const BString &); - BString &operator<<(char); - BString &operator<<(int); - BString &operator<<(unsigned int); - BString &operator<<(uint32); - BString &operator<<(int32); - BString &operator<<(uint64); - BString &operator<<(int64); - BString &operator<<(float); - /* float output hardcodes %.2f style formatting */ - -/*----- Private or reserved ------------------------------------------------*/ -private: - void _Init(const char *, int32); - void _DoAssign(const char *, int32); - void _DoAppend(const char *, int32); - char *_GrowBy(int32); - char *_OpenAtBy(int32, int32); - char *_ShrinkAtBy(int32, int32); - void _DoPrepend(const char *, int32); - - int32 _FindAfter(const char *, int32, int32) const; - int32 _IFindAfter(const char *, int32, int32) const; - int32 _ShortFindAfter(const char *, int32) const; - int32 _FindBefore(const char *, int32, int32) const; - int32 _IFindBefore(const char *, int32, int32) const; - BString &_DoReplace(const char *, const char *, int32, int32, - bool); - void _SetLength(int32); + // Slower than sprintf() but type and overflow safe + BString& operator<<(const char* string); + BString& operator<<(const BString& string); + BString& operator<<(char c); + BString& operator<<(int value); + BString& operator<<(unsigned int value); + BString& operator<<(uint32 value); + BString& operator<<(int32 value); + BString& operator<<(uint64 value); + BString& operator<<(int64 value); + BString& operator<<(float value); + // float output hardcodes %.2f style formatting + private: + void _Init(const char *, int32); + void _DoAssign(const char *, int32); + void _DoAppend(const char *, int32); + char* _GrowBy(int32); + char* _OpenAtBy(int32, int32); + char* _ShrinkAtBy(int32, int32); + void _DoPrepend(const char *, int32); + + int32 _FindAfter(const char *, int32, int32) const; + int32 _IFindAfter(const char *, int32, int32) const; + int32 _ShortFindAfter(const char *, int32) const; + int32 _FindBefore(const char *, int32, int32) const; + int32 _IFindBefore(const char *, int32, int32) const; + BString& _DoReplace(const char *, const char *, int32, int32, + bool); + void _SetLength(int32); + #if DEBUG - void _SetUsingAsCString(bool); - void _AssertNotUsingAsCString() const; + void _SetUsingAsCString(bool); + void _AssertNotUsingAsCString() const; #else - void _SetUsingAsCString(bool) {} - void _AssertNotUsingAsCString() const {} + void _SetUsingAsCString(bool) {} + void _AssertNotUsingAsCString() const {} #endif - char *_Alloc( int32); + char* _Alloc(int32 size); - struct PosVect; - void _ReplaceAtPositions( const PosVect* positions, - int32 searchLen, - const char* with, - int32 withLen); + class PosVect; + void _ReplaceAtPositions(const PosVect* positions, + int32 searchLength, const char* with, int32 withLen); -protected: - char *_privateData; + protected: + char* fPrivateData; }; -/*----- Comutative compare operators --------------------------------------*/ -bool operator<(const char *, const BString &); -bool operator<=(const char *, const BString &); -bool operator==(const char *, const BString &); -bool operator>(const char *, const BString &); -bool operator>=(const char *, const BString &); -bool operator!=(const char *, const BString &); +// Commutative compare operators +bool operator<(const char* a, const BString& b); +bool operator<=(const char* a, const BString& b); +bool operator==(const char* a, const BString& b); +bool operator>(const char* a, const BString& b); +bool operator>=(const char* a, const BString& b); +bool operator!=(const char* a, const BString& b); -/*----- Non-member compare for sorting, etc. ------------------------------*/ -int Compare(const BString &, const BString &); -int ICompare(const BString &, const BString &); -int Compare(const BString *, const BString *); -int ICompare(const BString *, const BString *); +// Non-member compare for sorting, etc. +int Compare(const BString& a, const BString& b); +int ICompare(const BString& a, const BString& b); +int Compare(const BString* a, const BString* b); +int ICompare(const BString* a, const BString* b); - - -/*-------------------------------------------------------------------------*/ -/*---- No user serviceable parts after this -------------------------------*/ - inline int32 BString::Length() const { - return _privateData ? (*((int32 *)_privateData - 1) & 0x7fffffff) : 0; + return fPrivateData ? (*((int32 *)fPrivateData - 1) & 0x7fffffff) : 0; /* the most significant bit is reserved; accessing * it in any way will cause the computer to explode */ @@ -363,29 +284,29 @@ inline const char * BString::String() const { - if (!_privateData) + if (!fPrivateData) return ""; - return _privateData; + return fPrivateData; } inline BString & -BString::SetTo(const char *str) +BString::SetTo(const char *string) { - return operator=(str); + return operator=(string); } inline char BString::operator[](int32 index) const { - return _privateData[index]; + return fPrivateData[index]; } inline char BString::ByteAt(int32 index) const { - if (!_privateData || index < 0 || index > Length()) + if (!fPrivateData || index < 0 || index > Length()) return 0; - return _privateData[index]; + return fPrivateData[index]; } inline BString & Modified: haiku/trunk/src/kits/support/String.cpp =================================================================== --- haiku/trunk/src/kits/support/String.cpp 2007-01-06 18:05:05 UTC (rev 19730) +++ haiku/trunk/src/kits/support/String.cpp 2007-01-06 18:06:38 UTC (rev 19731) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2001-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -31,6 +31,52 @@ #define REPLACE_ALL 0x7FFFFFFF +// helper macro that is used to fall into debugger if a given param check fails: +#ifdef DEBUG + #define CHECK_PARAM( expr, msg) \ + if (!(expr)) \ + debugger( msg) + + #define CHECK_PARAM_RET( expr, msg, retval) \ + if (!(expr)) \ + debugger( msg) + + #define CHECK_PARAM_VOID( expr, msg) \ + if (!(expr)) \ + debugger( msg) +#else + #define CHECK_PARAM( expr, msg) \ + if (!(expr)) \ + return *this + + #define CHECK_PARAM_RET( expr, msg, retval) \ + if (!(expr)) \ + return (retval); + + #define CHECK_PARAM_VOID( expr, msg) +#endif + + +//! helper class for BString::_ReplaceAtPositions(): +class BString::PosVect { + public: + PosVect(); + ~PosVect(); + + bool Add(int32 pos); + + inline int32 ItemAt(int32 index) const + { return fBuffer[index]; } + inline int32 CountItems() const + { return fSize; } + + private: + int32 fSize; + int32 fBufferSize; + int32* fBuffer; +}; + + const char *B_EMPTY_STRING = ""; @@ -45,18 +91,20 @@ } -// helper function, returns length of given string (but clamps to given maximum): +//! helper function, returns length of given string (but clamps to given maximum): static inline int32 strlen_clamp(const char* str, int32 max) -{ // this should yield 0 for max<0: - int32 len=0; - while( len Author: mmlr Date: 2007-01-06 19:10:15 +0100 (Sat, 06 Jan 2007) New Revision: 19732 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19732&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/Hub.cpp haiku/trunk/src/add-ons/kernel/bus_managers/usb/PhysicalMemoryAllocator.cpp haiku/trunk/src/add-ons/kernel/bus_managers/usb/PhysicalMemoryAllocator.h haiku/trunk/src/add-ons/kernel/bus_managers/usb/Stack.cpp Log: * Added some more debug output to the hub code * Report and clear yet unhandled port changes in hubs * Fixed the way devices that vanish on port reset are handled * Added a status field to the memory allocator and check it creating it Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/Hub.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/Hub.cpp 2007-01-06 18:06:38 UTC (rev 19731) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/Hub.cpp 2007-01-06 18:10:15 UTC (rev 19732) @@ -117,12 +117,6 @@ if (result < B_OK) return result; - if ((fPortStatus[index].status & PORT_STATUS_CONNECTION) == 0) { - // device disappeared, this is no error - TRACE(("USB Hub: device disappeared on reset\n")); - return B_OK; - } - if (fPortStatus[index].change & C_PORT_RESET) { // reset is done break; @@ -151,13 +145,21 @@ Hub::Explore() { for (int32 i = 0; i < fHubDescriptor.num_ports; i++) { + if (i >= 8) { + TRACE(("USB Hub: hub supports more ports than we do (%d)\n", fHubDescriptor.num_ports)); + fHubDescriptor.num_ports = 8; + continue; + } + status_t result = UpdatePortStatus(i); if (result < B_OK) continue; #ifdef TRACE_USB - if (fPortStatus[i].change) + if (fPortStatus[i].change) { TRACE(("USB Hub: port %d: status: 0x%04x; change: 0x%04x\n", i, fPortStatus[i].status, fPortStatus[i].change)); + TRACE(("USB Hub: device at port %d: 0x%08x\n", i, fChildren[i])); + } #endif if (fPortStatus[i].change & PORT_STATUS_CONNECTION) { @@ -184,6 +186,7 @@ if ((fPortStatus[i].status & PORT_STATUS_CONNECTION) == 0) { // device has vanished after reset, ignore + TRACE(("USB Hub: device disappeared on reset\n")); continue; } @@ -211,12 +214,42 @@ // Device removed... TRACE(("USB Hub Explore(): Device removed\n")); if (fChildren[i]) { + TRACE(("USB Hub: removing device 0x%08x\n", fChildren[i])); GetStack()->NotifyDeviceChange(fChildren[i], false); delete fChildren[i]; fChildren[i] = NULL; } } } + + // other port changes we do not really handle, report and clear them + if (fPortStatus[i].change & PORT_STATUS_ENABLE) { + TRACE_ERROR(("USB Hub Explore(): port %ld %sabled\n", i, (fPortStatus[i].status & PORT_STATUS_ENABLE) ? "en" : "dis")); + DefaultPipe()->SendRequest(USB_REQTYPE_CLASS | USB_REQTYPE_OTHER_OUT, + USB_REQUEST_CLEAR_FEATURE, C_PORT_ENABLE, i + 1, + 0, NULL, 0, NULL); + } + + if (fPortStatus[i].change & PORT_STATUS_SUSPEND) { + TRACE_ERROR(("USB Hub Explore(): port %ld is %ssuspended\n", i, (fPortStatus[i].status & PORT_STATUS_SUSPEND) ? "" : "not ")); + DefaultPipe()->SendRequest(USB_REQTYPE_CLASS | USB_REQTYPE_OTHER_OUT, + USB_REQUEST_CLEAR_FEATURE, C_PORT_SUSPEND, i + 1, + 0, NULL, 0, NULL); + } + + if (fPortStatus[i].change & PORT_STATUS_OVER_CURRENT) { + TRACE_ERROR(("USB Hub Explore(): port %ld is %sin an over current state\n", i, (fPortStatus[i].status & PORT_STATUS_OVER_CURRENT) ? "" : "not ")); + DefaultPipe()->SendRequest(USB_REQTYPE_CLASS | USB_REQTYPE_OTHER_OUT, + USB_REQUEST_CLEAR_FEATURE, C_PORT_OVER_CURRENT, i + 1, + 0, NULL, 0, NULL); + } + + if (fPortStatus[i].change & PORT_RESET) { + TRACE_ERROR(("USB Hub Explore(): port %ld was reset\n", i)); + DefaultPipe()->SendRequest(USB_REQTYPE_CLASS | USB_REQTYPE_OTHER_OUT, + USB_REQUEST_CLEAR_FEATURE, C_PORT_RESET, i + 1, + 0, NULL, 0, NULL); + } } // explore down the tree if we have hubs connected Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/PhysicalMemoryAllocator.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/PhysicalMemoryAllocator.cpp 2007-01-06 18:06:38 UTC (rev 19731) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/PhysicalMemoryAllocator.cpp 2007-01-06 18:10:15 UTC (rev 19732) @@ -26,7 +26,8 @@ PhysicalMemoryAllocator::PhysicalMemoryAllocator(const char *name, size_t minSize, size_t maxSize, uint32 minCountPerBlock) - : fOverhead(0) + : fOverhead(0), + fStatus(B_NO_INIT) { fName = strdup(name); if (benaphore_init(&fLock, fName) < B_OK) { @@ -84,6 +85,7 @@ } fPhysicalBase = physicalEntry.address; + fStatus = B_OK; } Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/PhysicalMemoryAllocator.h =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/PhysicalMemoryAllocator.h 2007-01-06 18:06:38 UTC (rev 19731) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/PhysicalMemoryAllocator.h 2007-01-06 18:10:15 UTC (rev 19732) @@ -21,6 +21,8 @@ uint32 minCountPerBlock); ~PhysicalMemoryAllocator(); + status_t InitCheck() { return fStatus; }; + status_t Allocate(size_t size, void **logicalAddress, void **physicalAddress); @@ -43,6 +45,7 @@ size_t fOverhead; size_t fManagedMemory; + status_t fStatus; benaphore fLock; area_id fArea; Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/Stack.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/Stack.cpp 2007-01-06 18:06:38 UTC (rev 19731) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/Stack.cpp 2007-01-06 18:10:15 UTC (rev 19732) @@ -36,8 +36,9 @@ fAllocator = new(std::nothrow) PhysicalMemoryAllocator("USB Stack Allocator", 8, B_PAGE_SIZE * 4, 64); - if (!fAllocator) { + if (!fAllocator || fAllocator->InitCheck() < B_OK) { TRACE_ERROR(("usb stack: failed to allocate the allocator\n")); + delete fAllocator; return; } From bonefish at mail.berlios.de Sat Jan 6 21:52:49 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Sat, 6 Jan 2007 21:52:49 +0100 Subject: [Haiku-commits] r19733 - haiku/trunk/build/jam Message-ID: <200701062052.l06KqnAA008478@sheep.berlios.de> Author: bonefish Date: 2007-01-06 21:52:49 +0100 (Sat, 06 Jan 2007) New Revision: 19733 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19733&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: Added fortune files to the image. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-06 18:10:15 UTC (rev 19732) +++ haiku/trunk/build/jam/HaikuImage 2007-01-06 20:52:49 UTC (rev 19733) @@ -191,6 +191,14 @@ SEARCH on $(etcFiles) = [ FDirName $(HAIKU_TOP) data etc ] ; AddFilesToHaikuImage beos etc : $(etcFiles) ; +local fortuneFiles = Art Computers Education Food Fortunes Goedel Haiku + Humorists Kids Law "Linux cookies" Love Magic Medicine Miscellaneous + News "One Liners" "OS Fortunes" Pets Platitudes Riddles "Songs & Poems" + Sports "Tech Support Excuses" ; +fortuneFiles = $(fortuneFiles:G=etc!fortunes) ; +SEARCH on $(fortuneFiles) = [ FDirName $(HAIKU_TOP) data etc fortunes ] ; +AddFilesToHaikuImage beos etc fortunes : $(fortuneFiles) ; + local fontDir = [ FDirName $(HAIKU_TOP) data etc fonts ] ; local psFonts = [ Glob $(fontDir)/psfonts : *.afm *.pfb ] ; local ttFonts = [ Glob $(fontDir)/ttfonts : *.ttf ] ; From darkwyrm at mail.berlios.de Sat Jan 6 22:18:17 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Sat, 6 Jan 2007 22:18:17 +0100 Subject: [Haiku-commits] r19734 - in haiku/trunk/src/apps: . resedit Message-ID: <200701062118.l06LIHuU011733@sheep.berlios.de> Author: darkwyrm Date: 2007-01-06 22:18:16 +0100 (Sat, 06 Jan 2007) New Revision: 19734 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19734&view=rev Added: haiku/trunk/src/apps/resedit/ haiku/trunk/src/apps/resedit/App.cpp haiku/trunk/src/apps/resedit/App.h haiku/trunk/src/apps/resedit/Editor.h haiku/trunk/src/apps/resedit/Jamfile haiku/trunk/src/apps/resedit/PreviewColumn.cpp haiku/trunk/src/apps/resedit/PreviewColumn.h haiku/trunk/src/apps/resedit/ResView.cpp haiku/trunk/src/apps/resedit/ResView.h haiku/trunk/src/apps/resedit/ResWindow.cpp haiku/trunk/src/apps/resedit/ResWindow.h haiku/trunk/src/apps/resedit/ResourceData.cpp haiku/trunk/src/apps/resedit/ResourceData.h haiku/trunk/src/apps/resedit/ResourceRoster.cpp haiku/trunk/src/apps/resedit/ResourceRoster.h Modified: haiku/trunk/src/apps/Jamfile Log: Initial checkin of a resource editor similar in style to QuickRes -- Resourcer's code is too difficult to maintain and the others on BeBits are either not good or the author could not be contacted. This is currently a work-in-progress - right now it can only view resources and attributes. Haiku target builds but R5 is broken because of a linking issue that will hopefully be resolved shortly. Modified: haiku/trunk/src/apps/Jamfile =================================================================== --- haiku/trunk/src/apps/Jamfile 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/Jamfile 2007-01-06 21:18:16 UTC (rev 19734) @@ -22,6 +22,7 @@ SubInclude HAIKU_TOP src apps powerstatus ; SubInclude HAIKU_TOP src apps processcontroller ; SubInclude HAIKU_TOP src apps pulse ; +SubInclude HAIKU_TOP src apps resedit ; SubInclude HAIKU_TOP src apps showimage ; SubInclude HAIKU_TOP src apps soundrecorder ; SubInclude HAIKU_TOP src apps stylededit ; Added: haiku/trunk/src/apps/resedit/App.cpp =================================================================== --- haiku/trunk/src/apps/resedit/App.cpp 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/App.cpp 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#include "App.h" +#include "ResWindow.h" +#include + +int +main(void) +{ + App app; + app.Run(); + return 0; +} + + +App::App(void) + : BApplication("application/x-vnd.Haiku-ResEdit"), + fWindowCount(0) +{ + fOpenPanel = new BFilePanel(); + fSavePanel = new BFilePanel(B_SAVE_PANEL); +} + + +App::~App(void) +{ + delete fOpenPanel; + delete fSavePanel; +} + + +void +App::ReadyToRun(void) +{ + if (fWindowCount < 1) { + ResWindow *win = new ResWindow(BRect(50,100,600,400)); + win->Show(); + } +} + + +void +App::MessageReceived(BMessage *msg) +{ + switch(msg->what) { + case M_REGISTER_WINDOW: { + fWindowCount++; + break; + } + case M_UNREGISTER_WINDOW: { + fWindowCount--; + if (fWindowCount == 0) + PostMessage(B_QUIT_REQUESTED); + break; + } + case M_SHOW_OPEN_PANEL: { + // Don't do anything if it's already open + if (fOpenPanel->IsShowing()) + break; + fOpenPanel->Show(); + break; + } + default: + BApplication::MessageReceived(msg); + } +} + + +void +App::RefsReceived(BMessage *msg) +{ + entry_ref ref; + int32 i=0; + while (msg->FindRef("refs",i,&ref) == B_OK) { + ResWindow *win = new ResWindow(BRect(50,100,600,400),&ref); + win->Show(); + i++; + } +} + + +bool +App::QuitRequested(void) +{ + for (int32 i = 0; i < CountWindows(); i++) { + BWindow *win = WindowAt(i); + if (fOpenPanel->Window() == win || fSavePanel->Window() == win) + continue; + + if (!win->QuitRequested()) + return false; + } + + return true; +} + Added: haiku/trunk/src/apps/resedit/App.h =================================================================== --- haiku/trunk/src/apps/resedit/App.h 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/App.h 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#ifndef APP_H +#define APP_H + +#include +#include + +enum { + M_REGISTER_WINDOW = 'regw', + M_UNREGISTER_WINDOW, + M_SHOW_OPEN_PANEL, + M_SHOW_SAVE_PANEL +}; + +class App : public BApplication +{ +public: + App(void); + ~App(void); + void MessageReceived(BMessage *msg); + void RefsReceived(BMessage *msg); + void ReadyToRun(void); + bool QuitRequested(void); + +private: + uint32 fWindowCount; + BFilePanel *fOpenPanel, *fSavePanel; +}; + +#endif Added: haiku/trunk/src/apps/resedit/Editor.h =================================================================== --- haiku/trunk/src/apps/resedit/Editor.h 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/Editor.h 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#ifndef EDITOR_H +#define EDITOR_H + +class Editor +{ +public: + Editor(void); + virtual ~Editor(void); + virtual BView * GetConfigView(void); + virtual void LoadData(unsigned char *data, const size_t &length); + virtual unsigned char * SaveData(size_t *data); +}; + +#endif Added: haiku/trunk/src/apps/resedit/Jamfile =================================================================== --- haiku/trunk/src/apps/resedit/Jamfile 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/Jamfile 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,15 @@ +SubDir HAIKU_TOP src apps resedit ; + +SetSubDirSupportedPlatformsBeOSCompatible ; + +UsePrivateHeaders shared interface ; + +Application ResEdit : + App.cpp + PreviewColumn.cpp + ResourceData.cpp + ResourceRoster.cpp + ResView.cpp + ResWindow.cpp + : be tracker translation +; Added: haiku/trunk/src/apps/resedit/PreviewColumn.cpp =================================================================== --- haiku/trunk/src/apps/resedit/PreviewColumn.cpp 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/PreviewColumn.cpp 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#include "PreviewColumn.h" +#include + +PreviewColumn::PreviewColumn(const char *title, float width, + float minWidth, float maxWidth) + : BTitledColumn(title, width, minWidth, maxWidth) +{ +} + +void +PreviewColumn::DrawField(BField* field, BRect rect, BView* parent) +{ + BIntegerField *intField = dynamic_cast(field); + BStringField *strField = dynamic_cast(field); + BBitmapField *bmpField = dynamic_cast(field); + + if (intField) { + float width = rect.Width() - 16; + BString string; + string << intField->Value(); + parent->TruncateString(&string, B_TRUNCATE_MIDDLE, width + 2); + DrawString(string.String(), parent, rect); + } else if (strField) { + float width = rect.Width() - 16; + if (width != strField->Width()) { + BString out_string(strField->String()); + + parent->TruncateString(&out_string, B_TRUNCATE_END, width + 2); + strField->SetClippedString(out_string.String()); + strField->SetWidth(width); + } + DrawString(strField->ClippedString(), parent, rect); + } else if (bmpField) { + const BBitmap *bitmap = bmpField->Bitmap(); + + if (bitmap != NULL) { + // Scale the bitmap down to completely fit within the field's height + BRect drawrect(bitmap->Bounds().OffsetToCopy(rect.LeftTop())); + if (drawrect.Height() > rect.Height()) { + drawrect = rect; + drawrect.right = drawrect.left + + (bitmap->Bounds().Width() * + (rect.Height() / bitmap->Bounds().Height())); + } + + parent->SetDrawingMode(B_OP_ALPHA); + parent->DrawBitmap(bitmap, bitmap->Bounds(), drawrect); + parent->SetDrawingMode(B_OP_COPY); + + BString out; + out << bitmap->Bounds().IntegerWidth() << " x " + << bitmap->Bounds().IntegerHeight() << " x " + << (int32(bitmap->BytesPerRow() / bitmap->Bounds().Width()) * 8); + + BRect stringrect = rect; + stringrect.right -= 10; + stringrect.left = stringrect.right - parent->StringWidth(out.String()); + if (stringrect.left < drawrect.right + 5) + stringrect.left = drawrect.right + 5; + + parent->TruncateString(&out, B_TRUNCATE_END, stringrect.Width()); + DrawString(out.String(), parent, stringrect); + } + } +} Added: haiku/trunk/src/apps/resedit/PreviewColumn.h =================================================================== --- haiku/trunk/src/apps/resedit/PreviewColumn.h 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/PreviewColumn.h 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#ifndef PREVIEW_COLUMN_H +#define PREVIEW_COLUMN_H + +#include + +class PreviewColumn : public BTitledColumn +{ +public: + PreviewColumn(const char *title, float width, + float minWidth, float maxWidth); + void DrawField(BField* field, BRect rect, BView* parent); +}; + +#endif Added: haiku/trunk/src/apps/resedit/ResView.cpp =================================================================== --- haiku/trunk/src/apps/resedit/ResView.cpp 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/ResView.cpp 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,218 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#include "ResView.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "App.h" +#include "ResourceData.h" +#include "ResWindow.h" +#include "PreviewColumn.h" + +static int32 sUntitled = 1; + +ResourceRoster gResRoster; + +enum { + M_NEW_FILE = 'nwfl', + M_OPEN_FILE, + M_SAVE_FILE, + M_SAVE_FILE_AS, + M_QUIT +}; + +ResView::ResView(const BRect &frame, const char *name, const int32 &resize, + const int32 &flags, const entry_ref *ref) + : BView(frame, name, resize, flags), + fIsDirty(false) +{ + SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + if (ref) { + fRef = new entry_ref; + *fRef = *ref; + fFileName = fRef->name; + } else { + fRef = NULL; + fFileName = "Untitled "; + fFileName << sUntitled; + sUntitled++; + } + + BMenu *menu = new BMenu("File"); + menu->AddItem(new BMenuItem("New?", new BMessage(M_NEW_FILE), 'N')); + menu->AddSeparatorItem(); + menu->AddItem(new BMenuItem("Open?", new BMessage(M_OPEN_FILE), 'O')); + menu->AddItem(new BMenuItem("Quit", new BMessage(M_QUIT), 'Q')); + + BRect r(Bounds()); + r.bottom = 16; + fBar = new BMenuBar(r, "bar"); + AddChild(fBar); + + fBar->AddItem(menu); + + r = Bounds(); + r.top = fBar->Frame().bottom + 4; + fListView = new BColumnListView(r, "gridview", B_FOLLOW_ALL, B_WILL_DRAW, + B_FANCY_BORDER); + AddChild(fListView); + + rgb_color white = { 255,255,255,255 }; + fListView->SetColor(B_COLOR_BACKGROUND, white); + fListView->SetColor(B_COLOR_SELECTION, ui_color(B_MENU_BACKGROUND_COLOR)); + + float width = be_plain_font->StringWidth("00000") + 20; + fListView->AddColumn(new BStringColumn("ID",width,width,100,B_TRUNCATE_END),0); + + fListView->AddColumn(new BStringColumn("Type",width,width,100,B_TRUNCATE_END),1); + fListView->AddColumn(new BStringColumn("Name",150,50,300,B_TRUNCATE_END),2); + fListView->AddColumn(new PreviewColumn("Data",150,50,300),3); + + width = be_plain_font->StringWidth("1000 bytes") + 20; + fListView->AddColumn(new BSizeColumn("Size",width,10,100),4); + + if (ref) + OpenFile(*ref); +} + + +ResView::~ResView(void) +{ + delete fRef; +} + + +void +ResView::AttachedToWindow(void) +{ + for(int32 i = 0; i < fBar->CountItems(); i++) + fBar->SubmenuAt(i)->SetTargetForItems(this); +} + + +void +ResView::MessageReceived(BMessage *msg) +{ + switch (msg->what) { + case M_NEW_FILE: { + BRect r(100,100,400,400); + if (Window()) + r = Window()->Frame().OffsetByCopy(10,10); + ResWindow *win = new ResWindow(r); + win->Show(); + break; + } + case M_OPEN_FILE: { + be_app->PostMessage(M_SHOW_OPEN_PANEL); + break; + } + case M_QUIT: { + be_app->PostMessage(B_QUIT_REQUESTED); + break; + } + default: + BView::MessageReceived(msg); + } +} + + +void +ResView::OpenFile(const entry_ref &ref) +{ + // Add all the 133t resources and attributes of the file + + BFile file(&ref, B_READ_ONLY); + if (fResources.SetTo(&file) != B_OK) + return; + file.Unset(); + + fResources.PreloadResourceType(); + + int32 index = 0; + ResourceData data; + BRow *row; + while (data.SetFromResource(index, fResources)) { + row = new BRow(); + row->SetField(new BStringField(data.GetIDString()),0); + row->SetField(new BStringField(data.GetTypeString()),1); + row->SetField(new BStringField(data.GetName()),2); + BField *field = gResRoster.MakeFieldForType(data.GetType(), + data.GetData(), + data.GetLength()); + if (field) + row->SetField(field,3); + row->SetField(new BSizeField(data.GetLength()),4); + fListView->AddRow(row); + index++; + } + +//debugger(""); + BNode node; + if (node.SetTo(&ref) == B_OK) { + char attrName[B_ATTR_NAME_LENGTH]; + node.RewindAttrs(); + while (node.GetNextAttrName(attrName) == B_OK) { + if (data.SetFromAttribute(attrName, node)) { + row = new BRow(); + row->SetField(new BStringField(data.GetIDString()),0); + row->SetField(new BStringField(data.GetTypeString()),1); + row->SetField(new BStringField(data.GetName()),2); + BField *field = gResRoster.MakeFieldForType(data.GetType(), + data.GetData(), + data.GetLength()); + if (field) + row->SetField(field,3); + row->SetField(new BSizeField(data.GetLength()),4); + fListView->AddRow(row); + } + } + } +} + + +const void * +ResView::LoadResource(const type_code &type, const int32 &id, size_t *out_size) +{ + return fResources.LoadResource(type, id, out_size); +} + + +const void * +ResView::LoadResource(const type_code &type, const char *name, size_t *out_size) +{ + return fResources.LoadResource(type, name, out_size); +} + + +status_t +ResView::AddResource(const type_code &type, const int32 &id, const void *data, + const size_t &data_size, const char *name) +{ + return fResources.AddResource(type, id, data, data_size, name); +} + + +bool +ResView::HasResource(const type_code &type, const int32 &id) +{ + return fResources.HasResource(type, id); +} + + +bool +ResView::HasResource(const type_code &type, const char *name) +{ + return fResources.HasResource(type, name); +} + Added: haiku/trunk/src/apps/resedit/ResView.h =================================================================== --- haiku/trunk/src/apps/resedit/ResView.h 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/ResView.h 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#ifndef RESVIEW_H +#define RESVIEW_H + +#include +#include +#include +#include +#include +#include +#include "ResourceRoster.h" + +class ResView : public BView +{ +public: + ResView(const BRect &frame, const char *name, + const int32 &resize, const int32 &flags, + const entry_ref *ref = NULL); + ~ResView(void); + void AttachedToWindow(void); + void MessageReceived(BMessage *msg); + + const char * Filename(void) const { return fFileName.String(); } + bool IsDirty(void) const { return fIsDirty; } + + void OpenFile(const entry_ref &ref); + + // BResources mirror API + const void * LoadResource(const type_code &type, const int32 &id, + size_t *out_size); + const void * LoadResource(const type_code &type, const char *name, + size_t *out_size); + status_t AddResource(const type_code &type, const int32 &id, + const void *data, const size_t &data_size, + const char *name = NULL); + bool HasResource(const type_code &type, const int32 &id); + bool HasResource(const type_code &type, const char *name); + +private: + BColumnListView *fListView; + entry_ref *fRef; + BString fFileName; + BMenuBar *fBar; + bool fIsDirty; + + BResources fResources; +}; + +extern ResourceRoster gResRoster; + +#endif Added: haiku/trunk/src/apps/resedit/ResWindow.cpp =================================================================== --- haiku/trunk/src/apps/resedit/ResWindow.cpp 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/ResWindow.cpp 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#include "ResWindow.h" +#include "ResView.h" +#include "App.h" + +ResWindow::ResWindow(const BRect &rect, const entry_ref *ref) + : BWindow(rect,"", B_DOCUMENT_WINDOW, B_ASYNCHRONOUS_CONTROLS) +{ + be_app->PostMessage(M_REGISTER_WINDOW); + + ResView *child = new ResView(Bounds(), "resview", B_FOLLOW_ALL, B_WILL_DRAW, ref); + AddChild(child); + + SetTitle(child->Filename()); +} + + +ResWindow::~ResWindow(void) +{ +} + + +bool +ResWindow::QuitRequested(void) +{ + be_app->PostMessage(M_UNREGISTER_WINDOW); + return true; +} + + Added: haiku/trunk/src/apps/resedit/ResWindow.h =================================================================== --- haiku/trunk/src/apps/resedit/ResWindow.h 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/ResWindow.h 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#ifndef RESWIN_H +#define RESWIN_H + +#include + +class ResWindow : public BWindow +{ +public: + ResWindow(const BRect &rect, + const entry_ref *ref=NULL); + ~ResWindow(void); + bool QuitRequested(void); +}; + +#endif Added: haiku/trunk/src/apps/resedit/ResourceData.cpp =================================================================== --- haiku/trunk/src/apps/resedit/ResourceData.cpp 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/ResourceData.cpp 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#include "ResourceData.h" +#include + +ResourceData::ResourceData(void) + : fType(0), + fTypeString("Invalid"), + fID(-1), + fIDString("Invalid"), + fName(""), + fData(NULL), + fLength(0), + fFree(false) +{ +} + + +ResourceData::ResourceData(const type_code &code, const int32 &id, + const char *name, char *data, + const size_t &length) + : fType(code), + fID(id), + fName(name), + fData(data), + fLength(length), + fFree(false) +{ + fIDString = ""; + fIDString << fID; + MakeTypeString(); +} + + +ResourceData::ResourceData(const ResourceData &data) +{ + *this = data; +} + + +ResourceData::~ResourceData(void) +{ + if (fFree) + free(fData); +} + + +ResourceData & +ResourceData::operator=(const ResourceData &data) +{ + fType = data.fType; + fTypeString = data.fTypeString; + fID = data.fID; + fIDString = data.fIDString; + fName = data.fName; + fLength = data.fLength; + fFree = data.fFree; + + // This is an attribute, so we need to allocate and free the data + if (fFree) { + fData = data.fData; + } + return *this; +} + +bool +ResourceData::SetFromResource(const int32 &index, BResources &res) +{ + char *name; + if (!res.GetResourceInfo(index, (type_code*)&fType, &fID, + (const char **)&name, &fLength)) { + *this = ResourceData(); + return false; + } + fName = name; + MakeTypeString(); + fIDString = ""; + fIDString << fID; + fFree = false; + fData = (char *)res.LoadResource(fType,fID,&fLength); + + return true; +} + + +bool +ResourceData::SetFromAttribute(const char *name, BNode &node) +{ + attr_info info; + if (node.GetAttrInfo(name, &info) != B_OK) { + *this = ResourceData(); + return false; + } + + fType = info.type; + fID = -1; + fIDString = "(attr)"; + fName = name; + fLength = info.size; + fFree = true; + + MakeTypeString(); + + fData = (char *)malloc(fLength); + if (fData) { + ssize_t size = node.ReadAttr(name, info.type, 0, (void*)fData, fLength); + if (size >= 0) { + fLength = (size_t) size; + return true; + } + } + + *this = ResourceData(); + return false; +} + + +void +ResourceData::SetTo(const type_code &code, const int32 &id, + const char *name, char *data, const size_t &length) +{ + fType = code; + fID = id; + fName = name; + fData = data; + fLength = length; + + MakeTypeString(); +} + + +void +ResourceData::MakeTypeString(void) +{ + char typestring[7]; + char *typeptr = (char *) &fType; + typestring[0] = '\''; + typestring[1] = typeptr[3]; + typestring[2] = typeptr[2]; + typestring[3] = typeptr[1]; + typestring[4] = typeptr[0]; + typestring[5] = '\''; + typestring[6] = '\0'; + fTypeString = typestring; +} + Added: haiku/trunk/src/apps/resedit/ResourceData.h =================================================================== --- haiku/trunk/src/apps/resedit/ResourceData.h 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/ResourceData.h 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#ifndef RESOURCE_DATA_H +#define RESOURCE_DATA_H + +#include +#include +#include +#include + +class ResourceData +{ +public: + ResourceData(void); + ResourceData(const type_code &code, const int32 &id, + const char *name, char *data, + const size_t &length); + ResourceData(const ResourceData &data); + ~ResourceData(void); + void SetTo(const type_code &code, const int32 &id, + const char *name, char *data, const size_t &length); + ResourceData & operator=(const ResourceData &data); + + bool SetFromResource(const int32 &index, BResources &res); + bool SetFromAttribute(const char *name, BNode &node); + + type_code GetType(void) const { return fType; } + const char * GetTypeString(void) const { return fTypeString.String(); } + int32 GetID(void) const { return fID; } + const char * GetIDString(void) const { return fIDString.String(); } + const char * GetName(void) const { return fName.String(); } + char * GetData(void) { return fData; } + size_t GetLength(void) const { return fLength; } + + bool IsAttribute(void) const { return fFree; } + +private: + void MakeTypeString(void); + + int32 fType; + BString fTypeString; + int32 fID; + BString fIDString; + BString fName; + char *fData; + size_t fLength; + bool fFree; +}; + +#endif Added: haiku/trunk/src/apps/resedit/ResourceRoster.cpp =================================================================== --- haiku/trunk/src/apps/resedit/ResourceRoster.cpp 2007-01-06 20:52:49 UTC (rev 19733) +++ haiku/trunk/src/apps/resedit/ResourceRoster.cpp 2007-01-06 21:18:16 UTC (rev 19734) @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2005-2006, Haiku, Inc. + * Distributed under the terms of the MIT license. + * + * Author: + * DarkWyrm + */ +#include "ResourceRoster.h" +#include +#include +#include +#include +#include +#include +#include +#include + +// For the MakeFieldForType temp code +#include +#include +#include +#include +#include + +class EditorInfo +{ +public: + EditorInfo(const image_id &id, const char *name, + create_editor *allocator); + ~EditorInfo(void); + + status_t ID(void) const { return fID; } + const char * Name(void) const { return fName.String(); } + Editor * Instantiate(void); + +private: + image_id fID; + BString fName; + create_editor * fAllocator; +}; + +EditorInfo::EditorInfo(const image_id &id, const char *name, + create_editor *allocator) + : fID(id), + fName(name), + fAllocator(allocator) +{ +} + + +EditorInfo::~EditorInfo(void) +{ +} + + +Editor * +EditorInfo::Instantiate(void) +{ + return fAllocator(); +} + + +ResourceRoster::ResourceRoster(void) +{ +} + + +ResourceRoster::~ResourceRoster(void) +{ +} + + +BField * +ResourceRoster::MakeFieldForType(const int32 &type, const char *data, + const size_t &length) +{ + // temporary code until editors are done + switch (type) { + case B_MIME_STRING_TYPE: + return new BStringField(data); + case B_GIF_FORMAT: + case B_PPM_FORMAT: + case B_TGA_FORMAT: + case B_BMP_FORMAT: + case B_TIFF_FORMAT: + case B_PNG_FORMAT: + case B_JPEG_FORMAT: { + BMemoryIO memio(data,length); + BBitmap *bitmap = BTranslationUtils::GetBitmap(&memio); + if (bitmap) { + // XXX WARNING! WARNING! Known memory leak + // This is temp code, so it's OK for the moment + BBitmapField *field = new BBitmapField(bitmap); + return field; + } + break; + } + default: + return NULL; + } + + return NULL; +} + + [... truncated: 81 lines follow ...] From geist at foobox.com Sun Jan 7 09:52:57 2007 From: geist at foobox.com (Travis Geiselbrecht) Date: Sun, 7 Jan 2007 00:52:57 -0800 Subject: [Haiku-commits] r19719 - haiku/trunk/src/system/kernel In-Reply-To: <200701061250.l06Co1Hg015510@sheep.berlios.de> References: <200701061250.l06Co1Hg015510@sheep.berlios.de> Message-ID: Oh that's interesting it wasn't skipping the entire priority queue. I'm pretty sure it was that way in newos, and definitely was that way in beos. Must have been changed in the changes since the fork. IIRC, the beos scheduler skipped a pretty large percentage of the time, which seemed a bit aggressive when I first saw it. Also, IIRC it did something different on SMP machines, but I really don't remember what it was. Some tweak to the percentage of skips. I'd like to rewrite this scheduler to at least have per cpu run queues at some point in time, but it's definitely something worth thinking about a bunch before diving off into it. If anyone has any ideas, I'd love to hear em. Travis On Jan 6, 2007, at 4:50 AM, axeld at BerliOS wrote: > Author: axeld > Date: 2007-01-06 13:50:01 +0100 (Sat, 06 Jan 2007) > New Revision: 19719 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19719&view=rev > > Modified: > haiku/trunk/src/system/kernel/scheduler.cpp > Log: > * Instead of choosing the next thread if we skip one, we now choose > the first thread > with a lower priority than the current one. > * Further reduced the probability to skip a thread to roughly 4%, > that makes around > 13 skips per second, and about 40 msecs spend in lower priority > threads per second > (with a 3 msec quantum). Might still be too much, but we'll see. > > > Modified: haiku/trunk/src/system/kernel/scheduler.cpp > =================================================================== > --- haiku/trunk/src/system/kernel/scheduler.cpp 2007-01-06 11:51:21 > UTC (rev 19718) > +++ haiku/trunk/src/system/kernel/scheduler.cpp 2007-01-06 12:50:01 > UTC (rev 19719) > @@ -197,12 +197,17 @@ > if (nextThread->queue_next && nextThread->queue_next->priority > == B_IDLE_PRIORITY) > break; > > - // skip normal threads sometimes (roughly 12.5%) > - if (_rand() > 0x1000) > + // skip normal threads sometimes (roughly 4%) > + if (_rand() > 0x500) > break; > > - prevThread = nextThread; > - nextThread = nextThread->queue_next; > + // skip until next lower priority > + int32 priority = nextThread->priority; > + while (nextThread->queue_next && priority == nextThread- > >queue_next->priority > + && nextThread->queue_next->priority > B_IDLE_PRIORITY) { > + prevThread = nextThread; > + nextThread = nextThread->queue_next; > + } > } > } > > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits From bga at mail.berlios.de Sun Jan 7 17:03:19 2007 From: bga at mail.berlios.de (bga at BerliOS) Date: Sun, 7 Jan 2007 17:03:19 +0100 Subject: [Haiku-commits] r19735 - in haiku/trunk/src: apps/abouthaiku apps/bemail apps/cdplayer apps/clock apps/deskbar apps/deskcalc apps/diskprobe apps/expander apps/fontdemo apps/glteapot apps/icon-o-matic apps/installer apps/magnify apps/mediaplayer apps/midiplayer apps/people apps/processcontroller apps/pulse apps/showimage apps/soundrecorder apps/stylededit apps/terminal apps/tracker apps/workspaces preferences/backgrounds preferences/datatranslations Message-ID: <200701071603.l07G3JAo026113@sheep.berlios.de> Author: bga Date: 2007-01-07 17:03:13 +0100 (Sun, 07 Jan 2007) New Revision: 19735 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19735&view=rev Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef haiku/trunk/src/apps/bemail/BeMail.rdef haiku/trunk/src/apps/cdplayer/CDPlayer.rdef haiku/trunk/src/apps/clock/Clock.rdef haiku/trunk/src/apps/deskbar/Deskbar.rdef haiku/trunk/src/apps/deskcalc/DeskCalc.rdef haiku/trunk/src/apps/diskprobe/DiskProbe.rdef haiku/trunk/src/apps/expander/Expander.rdef haiku/trunk/src/apps/fontdemo/FontDemo.rdef haiku/trunk/src/apps/glteapot/GLTeapot.rdef haiku/trunk/src/apps/icon-o-matic/Icon-O-Matic.rdef haiku/trunk/src/apps/installer/Installer.rdef haiku/trunk/src/apps/magnify/Magnify.rdef haiku/trunk/src/apps/mediaplayer/MediaPlayer.rdef haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef haiku/trunk/src/apps/people/People.rdef haiku/trunk/src/apps/processcontroller/ProcessController.rdef haiku/trunk/src/apps/pulse/Pulse.rdef haiku/trunk/src/apps/showimage/ShowImage.rdef haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef haiku/trunk/src/apps/stylededit/StyledEdit.rdef haiku/trunk/src/apps/terminal/Terminal.rdef haiku/trunk/src/apps/tracker/Tracker.rdef haiku/trunk/src/apps/workspaces/Workspaces.rdef haiku/trunk/src/preferences/backgrounds/Backgrounds.rdef haiku/trunk/src/preferences/datatranslations/DataTranslations.rdef Log: - Cleaned up soeveral Copyright strings. - Shuffled the resource app_flags entry as it somehow fixed corrupt version/description;icons for several files here. It seems this entry must be the last one before the icons. Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef =================================================================== --- haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -11,7 +11,7 @@ internal = 0, short_info = "AboutHaiku", - long_info = "AboutHaiku ?2005-2006 Haiku, Inc." + long_info = "AboutHaiku ?2005-207 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; Modified: haiku/trunk/src/apps/bemail/BeMail.rdef =================================================================== --- haiku/trunk/src/apps/bemail/BeMail.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/bemail/BeMail.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -19,7 +19,7 @@ internal = 3, short_info = "BeMail", - long_info = "BeMail ?2005-2006 Haiku" + long_info = "BeMail ?2005-2007 Haiku, Inc." }; resource large_icon { Modified: haiku/trunk/src/apps/cdplayer/CDPlayer.rdef =================================================================== --- haiku/trunk/src/apps/cdplayer/CDPlayer.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/cdplayer/CDPlayer.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource app_signature "application/x-vnd.Haiku-CDPlayer"; -resource app_flags B_SINGLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -15,9 +13,11 @@ internal = 0, short_info = "CDPlayer", - long_info = "CDPlayer ?2005-2006 Haiku" + long_info = "CDPlayer ?2005-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + resource large_icon { $"FFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" $"FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" Modified: haiku/trunk/src/apps/clock/Clock.rdef =================================================================== --- haiku/trunk/src/apps/clock/Clock.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/clock/Clock.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource app_signature "application/x-vnd.Haiku-Clock"; -resource app_flags B_SINGLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -12,9 +10,11 @@ internal = 0, short_info = "Clock", - long_info = "Clock ?2006 Haiku" + long_info = "Clock ?2006-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { Modified: haiku/trunk/src/apps/deskbar/Deskbar.rdef =================================================================== --- haiku/trunk/src/apps/deskbar/Deskbar.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/deskbar/Deskbar.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -8,8 +8,8 @@ variety = B_APPV_FINAL, internal = 0, short_info = "Deskbar", - long_info = "Deskbar 5.2.1 ?1991-2001 Be Inc.,\n" - "?2006 Haiku" + long_info = "Deskbar 5.2.1 ?1991-2001 Be, Inc.,\n" + "?2006-2007 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; Modified: haiku/trunk/src/apps/deskcalc/DeskCalc.rdef =================================================================== --- haiku/trunk/src/apps/deskcalc/DeskCalc.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/deskcalc/DeskCalc.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource app_signature "application/x-vnd.Haiku-DeskCalc"; -resource app_flags B_SINGLE_LAUNCH; - resource app_version { major = 2, middle = 1, @@ -12,9 +10,11 @@ internal = 1, short_info = "DeskCalc", - long_info = "DeskCalc ?2006 Haiku" + long_info = "DeskCalc ?2006-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { Modified: haiku/trunk/src/apps/diskprobe/DiskProbe.rdef =================================================================== --- haiku/trunk/src/apps/diskprobe/DiskProbe.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/diskprobe/DiskProbe.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource(1, "BEOS:APP_SIG") #'MIMS' "application/x-vnd.Haiku-DiskProbe"; -resource app_flags B_SINGLE_LAUNCH; - resource(1, "BEOS:FILE_TYPES") message { "types" = "application/octet-stream" }; @@ -16,9 +14,11 @@ internal = 3, short_info = "DiskProbe", - long_info = "DiskProbe ?2004-2006 Haiku" + long_info = "DiskProbe ?2004-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { Modified: haiku/trunk/src/apps/expander/Expander.rdef =================================================================== --- haiku/trunk/src/apps/expander/Expander.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/expander/Expander.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource app_signature "application/x-vnd.Haiku-Expander"; -resource app_flags B_MULTIPLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -12,9 +10,11 @@ internal = 0, short_info = "Expander", - long_info = "Expander ?2004-2006 Haiku" + long_info = "Expander ?2004-2007 Haiku, Inc." }; +resource app_flags B_MULTIPLE_LAUNCH; + resource(1, "BEOS:FILE_TYPES") message { "types" = "application/x-gzip", "types" = "application/x-tar", Modified: haiku/trunk/src/apps/fontdemo/FontDemo.rdef =================================================================== --- haiku/trunk/src/apps/fontdemo/FontDemo.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/fontdemo/FontDemo.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -4,8 +4,6 @@ resource app_signature "application/x-vnd.Haiku-FontDemo"; -resource app_flags B_SINGLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -15,9 +13,11 @@ internal = 0, short_info = "FontDemo", - long_info = "FontDemo ?2006 Haiku" + long_info = "FontDemo ?2006-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + resource large_icon array { $"FFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" $"FFFFFFFFFFFFFFFFFFFFFFFF008C8C0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" Modified: haiku/trunk/src/apps/glteapot/GLTeapot.rdef =================================================================== --- haiku/trunk/src/apps/glteapot/GLTeapot.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/glteapot/GLTeapot.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource app_signature "application/x-vnd.Haiku-GLTeapot"; -resource app_flags B_SINGLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -15,9 +13,11 @@ internal = 0, short_info = "GLTeapot", - long_info = "GLTeapot ?2006 Haiku" + long_info = "GLTeapot ?2006-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + resource large_icon array { $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" Modified: haiku/trunk/src/apps/icon-o-matic/Icon-O-Matic.rdef =================================================================== --- haiku/trunk/src/apps/icon-o-matic/Icon-O-Matic.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/icon-o-matic/Icon-O-Matic.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -16,7 +16,7 @@ internal = 0, short_info = "Icon-O-Matic", - long_info = "Icon-O-Matic ?2006 Haiku" + long_info = "Icon-O-Matic ?2006-2007 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; Modified: haiku/trunk/src/apps/installer/Installer.rdef =================================================================== --- haiku/trunk/src/apps/installer/Installer.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/installer/Installer.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -10,7 +10,7 @@ internal = 0, short_info = "Installer", - long_info = "Installer ?2005-2006 Haiku" + long_info = "Installer ?2005-2007 Haiku, Inc." }; resource app_flags B_EXCLUSIVE_LAUNCH; Modified: haiku/trunk/src/apps/magnify/Magnify.rdef =================================================================== --- haiku/trunk/src/apps/magnify/Magnify.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/magnify/Magnify.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -10,7 +10,7 @@ internal = 0, short_info = "Magnify", - long_info = "Magnify ?2006 Haiku" + long_info = "Magnify ?2006-2007 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; Modified: haiku/trunk/src/apps/mediaplayer/MediaPlayer.rdef =================================================================== --- haiku/trunk/src/apps/mediaplayer/MediaPlayer.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/mediaplayer/MediaPlayer.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -8,7 +8,7 @@ variety = B_APPV_BETA, internal = 0, short_info = "MediaPlayer", - long_info = "MediaPlayer ?2006 Haiku" + long_info = "MediaPlayer ?2006-2007 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; Modified: haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef =================================================================== --- haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource app_signature "application/x-vnd.Haiku-MidiPlayer"; -resource app_flags B_SINGLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -10,13 +8,15 @@ variety = B_APPV_BETA, internal = 0, short_info = "MidiPlayer", - long_info = "MidiPlayer ?2004-2006 Haiku" + long_info = "MidiPlayer ?2004-2007 Haiku, Inc." }; resource file_types message { "types" = "audio/x-midi" }; +resource app_flags B_SINGLE_LAUNCH; + resource large_icon array { $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" Modified: haiku/trunk/src/apps/people/People.rdef =================================================================== --- haiku/trunk/src/apps/people/People.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/people/People.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource(1, "BEOS:APP_SIG") #'MIMS' "application/x-vnd.Be-PEPL"; -resource app_flags B_SINGLE_LAUNCH; - resource(1, "BEOS:FILE_TYPES") message { "types" = "application/x-person" }; @@ -16,9 +14,11 @@ internal = 0, short_info = "People", - long_info = "People ?2005-2006 Haiku" + long_info = "People ?2005-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { Modified: haiku/trunk/src/apps/processcontroller/ProcessController.rdef =================================================================== --- haiku/trunk/src/apps/processcontroller/ProcessController.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/processcontroller/ProcessController.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -10,8 +10,8 @@ internal = 0, short_info = "ProcessController", - long_info = "ProcessController ?1997-2001, G.E. Berenger,\n" - "?2006 Haiku" + long_info = "ProcessController ?1997-2001 G.E. Berenger,\n" + "?2006-2007 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; Modified: haiku/trunk/src/apps/pulse/Pulse.rdef =================================================================== --- haiku/trunk/src/apps/pulse/Pulse.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/pulse/Pulse.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource app_signature "application/x-vnd.Haiku-Pulse"; -resource app_flags B_SINGLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -12,9 +10,11 @@ internal = 0, short_info = "Pulse", - long_info = "Pulse ?2005-2006 Haiku" + long_info = "Pulse ?2005-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { Modified: haiku/trunk/src/apps/showimage/ShowImage.rdef =================================================================== --- haiku/trunk/src/apps/showimage/ShowImage.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/showimage/ShowImage.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -4,8 +4,6 @@ resource app_signature "application/x-vnd.Haiku-ShowImage"; -resource app_flags B_SINGLE_LAUNCH; - resource file_types message { "types" = "image" }; @@ -19,9 +17,11 @@ internal = 0, short_info = "ShowImage", - long_info = "ShowImage ?2003-2006 Haiku" + long_info = "ShowImage ?2003-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { Modified: haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef =================================================================== --- haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource app_signature "application/x-vnd.Haiku-SoundRecorder"; -resource app_flags B_SINGLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -10,7 +8,7 @@ variety = B_APPV_BETA, internal = 0, short_info = "SoundRecorder", - long_info = "SoundRecorder ?2005-2006 Haiku" + long_info = "SoundRecorder ?2005-2007 Haiku, Inc." }; resource file_types message { @@ -24,6 +22,8 @@ "types" = "audio/riff" }; +resource app_flags B_SINGLE_LAUNCH; + #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { Modified: haiku/trunk/src/apps/stylededit/StyledEdit.rdef =================================================================== --- haiku/trunk/src/apps/stylededit/StyledEdit.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/stylededit/StyledEdit.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -13,7 +13,7 @@ internal = 0, short_info = "StyledEdit", - long_info = "StyledEdit ?2002-2006 Haiku" + long_info = "StyledEdit ?2002-2007 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; Modified: haiku/trunk/src/apps/terminal/Terminal.rdef =================================================================== --- haiku/trunk/src/apps/terminal/Terminal.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/terminal/Terminal.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -4,8 +4,6 @@ resource app_signature "application/x-vnd.Haiku-Terminal"; -resource app_flags B_MULTIPLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -15,9 +13,11 @@ internal = 1, short_info = "Terminal", - long_info = "Terminal ?2002-2006 Haiku Inc." + long_info = "Terminal ?2002-2007 Haiku Inc." }; +resource app_flags B_MULTIPLE_LAUNCH; + resource file_types message { "types" = "application/x-vnd.Be-pref" }; Modified: haiku/trunk/src/apps/tracker/Tracker.rdef =================================================================== --- haiku/trunk/src/apps/tracker/Tracker.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/tracker/Tracker.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -8,8 +8,8 @@ variety = B_APPV_FINAL, internal = 0, short_info = "Tracker", - long_info = "Tracker 5.2.1 ?1991-2001 Be Inc.,\n" - "?2006 Haiku" + long_info = "Tracker 5.2.1 ?1991-2001 Be, Inc.,\n" + "?2006-2007 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; Modified: haiku/trunk/src/apps/workspaces/Workspaces.rdef =================================================================== --- haiku/trunk/src/apps/workspaces/Workspaces.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/apps/workspaces/Workspaces.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -10,7 +10,7 @@ internal = 0, short_info = "Workspaces", - long_info = "Workspaces ?2002-2006 Haiku" + long_info = "Workspaces ?2002-2007 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; Modified: haiku/trunk/src/preferences/backgrounds/Backgrounds.rdef =================================================================== --- haiku/trunk/src/preferences/backgrounds/Backgrounds.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/preferences/backgrounds/Backgrounds.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -18,8 +18,6 @@ resource app_flags B_SINGLE_LAUNCH; -resource file_types message; - resource large_icon { $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" $"FFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFF0000000000FFFFFFFFFFFFFFFF" Modified: haiku/trunk/src/preferences/datatranslations/DataTranslations.rdef =================================================================== --- haiku/trunk/src/preferences/datatranslations/DataTranslations.rdef 2007-01-06 21:18:16 UTC (rev 19734) +++ haiku/trunk/src/preferences/datatranslations/DataTranslations.rdef 2007-01-07 16:03:13 UTC (rev 19735) @@ -1,8 +1,6 @@ resource app_signature "application/x-vnd.Haiku-Translations"; -resource app_flags B_SINGLE_LAUNCH; - resource app_version { major = 1, middle = 0, @@ -15,9 +13,11 @@ internal = 0, short_info = "DataTranslations", - long_info = "DataTranslations ?2002-2006 Haiku" + long_info = "DataTranslations ?2002-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + resource large_icon array { $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000FFFFFFFFFF" $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000232323230000FFFFFF" From fekdahl at gmail.com Sun Jan 7 17:08:32 2007 From: fekdahl at gmail.com (Fredrik Ekdahl) Date: Sun, 07 Jan 2007 17:08:32 +0100 Subject: [Haiku-commits] r19735 - in haiku/trunk/src: apps/abouthaiku apps/bemail apps/cdplayer apps/clock apps/deskbar apps/deskcalc apps/diskprobe apps/expander apps/fontdemo apps/glteapot apps/icon-o-matic apps/installer apps/magnify apps/mediaplayer apps/midiplayer apps/people apps/processcontroller apps/pulse apps/showimage apps/soundrecorder apps/stylededit apps/terminal apps/tracker apps/workspaces preferences/backgrounds preferences/datatranslations In-Reply-To: <200701071603.l07G3JAo026113@sheep.berlios.de> References: <200701071603.l07G3JAo026113@sheep.berlios.de> Message-ID: <45A11B00.3060003@gmail.com> bga at BerliOS skrev: > Author: bga > Date: 2007-01-07 17:03:13 +0100 (Sun, 07 Jan 2007) > New Revision: 19735 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19735&view=rev > > Modified: > haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef > haiku/trunk/src/apps/bemail/BeMail.rdef > haiku/trunk/src/apps/cdplayer/CDPlayer.rdef > haiku/trunk/src/apps/clock/Clock.rdef > haiku/trunk/src/apps/deskbar/Deskbar.rdef > haiku/trunk/src/apps/deskcalc/DeskCalc.rdef > haiku/trunk/src/apps/diskprobe/DiskProbe.rdef > haiku/trunk/src/apps/expander/Expander.rdef > haiku/trunk/src/apps/fontdemo/FontDemo.rdef > haiku/trunk/src/apps/glteapot/GLTeapot.rdef > haiku/trunk/src/apps/icon-o-matic/Icon-O-Matic.rdef > haiku/trunk/src/apps/installer/Installer.rdef > haiku/trunk/src/apps/magnify/Magnify.rdef > haiku/trunk/src/apps/mediaplayer/MediaPlayer.rdef > haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef > haiku/trunk/src/apps/people/People.rdef > haiku/trunk/src/apps/processcontroller/ProcessController.rdef > haiku/trunk/src/apps/pulse/Pulse.rdef > haiku/trunk/src/apps/showimage/ShowImage.rdef > haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef > haiku/trunk/src/apps/stylededit/StyledEdit.rdef > haiku/trunk/src/apps/terminal/Terminal.rdef > haiku/trunk/src/apps/tracker/Tracker.rdef > haiku/trunk/src/apps/workspaces/Workspaces.rdef > haiku/trunk/src/preferences/backgrounds/Backgrounds.rdef > haiku/trunk/src/preferences/datatranslations/DataTranslations.rdef > Log: > - Cleaned up soeveral Copyright strings. > - Shuffled the resource app_flags entry as it somehow fixed corrupt version/description;icons for several files here. It seems this entry must be the last one before the icons. > > > > Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef > =================================================================== > --- haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef 2007-01-06 21:18:16 UTC (rev 19734) > +++ haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef 2007-01-07 16:03:13 UTC (rev 19735) > @@ -11,7 +11,7 @@ > internal = 0, > > short_info = "AboutHaiku", > - long_info = "AboutHaiku ?2005-2006 Haiku, Inc." > + long_info = "AboutHaiku ?2005-207 Haiku, Inc." > }; > "?2005-207" ? :) /Fredrik Ekdahl From bga at bug-br.org.br Sun Jan 7 17:12:15 2007 From: bga at bug-br.org.br (Bruno G. Albuquerque) Date: Sun, 07 Jan 2007 14:12:15 -0200 BRST Subject: [Haiku-commits] =?iso-8859-15?q?r19735_-_in_haiku/trunk/src=3A_ap?= =?iso-8859-15?q?ps/abouthaiku_apps/bemail_apps/cdplayer_apps/clock_apps/d?= =?iso-8859-15?q?eskbar_apps/deskcalc_apps/diskprobe_apps/expander_apps/fo?= =?iso-8859-15?q?ntdemo_apps/glteapot_apps/icon-o-matic_apps/installer_app?= =?iso-8859-15?q?s/magnify_apps/mediaplayer_apps/midiplayer_apps/people_ap?= =?iso-8859-15?q?ps/processcontroller_apps/pulse_apps/showimage_apps/sound?= =?iso-8859-15?q?recorder_apps/stylededit_apps/terminal_apps/tracker_apps/?= =?iso-8859-15?q?workspaces__preferences/backgrounds_preferences/datatrans?= =?iso-8859-15?q?lations?= In-Reply-To: <45A11B00.3060003@gmail.com> Message-ID: <74376298672-BeMail@guglielmo> On Sun, 07 Jan 2007 17:08:32 +0100, Fredrik Ekdahl said: > "?2005-207" ? :) Ops. Thanks for the heads-up. Will fix it. -Bruno -- Fortune Cookie Says: Psychotherapy is the theory that the patient will probably get well anyhow and is certainly a damn fool. -- H. L. Mencken From bga at mail.berlios.de Sun Jan 7 17:12:39 2007 From: bga at mail.berlios.de (bga at BerliOS) Date: Sun, 7 Jan 2007 17:12:39 +0100 Subject: [Haiku-commits] r19736 - haiku/trunk/src/apps/abouthaiku Message-ID: <200701071612.l07GCdxj026901@sheep.berlios.de> Author: bga Date: 2007-01-07 17:12:39 +0100 (Sun, 07 Jan 2007) New Revision: 19736 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19736&view=rev Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef Log: Ops... Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef =================================================================== --- haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef 2007-01-07 16:03:13 UTC (rev 19735) +++ haiku/trunk/src/apps/abouthaiku/AboutHaiku.rdef 2007-01-07 16:12:39 UTC (rev 19736) @@ -11,7 +11,7 @@ internal = 0, short_info = "AboutHaiku", - long_info = "AboutHaiku ?2005-207 Haiku, Inc." + long_info = "AboutHaiku ?2005-2007 Haiku, Inc." }; resource app_flags B_SINGLE_LAUNCH; From marcusoverhagen at arcor.de Sun Jan 7 17:35:05 2007 From: marcusoverhagen at arcor.de (Marcus Overhagen) Date: Sun, 7 Jan 2007 17:35:05 +0100 (CET) Subject: [Haiku-commits] r19735 - in haiku/trunk/src: apps/abouthaiku In-Reply-To: <200701071603.l07G3JAo026113@sheep.berlios.de> References: <200701071603.l07G3JAo026113@sheep.berlios.de> Message-ID: <28703521.1168187705738.JavaMail.ngmail@webmail15> bga wrote: > - Shuffled the resource app_flags entry as it somehow fixed corrupt > version/description;icons for several files here. It seems this entry must > be the last one before the icons. This looks like a bug to me. There shouldn't be any required order of resources. regards Marcus Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: g?nstig und schnell mit DSL - das All-Inclusive-Paket f?r clevere Doppel-Sparer, nur 44,85 ? inkl. DSL- und ISDN-Grundgeb?hr! http://www.arcor.de/rd/emf-dsl-2 From axeld at pinc-software.de Sun Jan 7 17:44:38 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 7 Jan 2007 17:44:38 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19735_-_in_haiku/trunk/src=3A_ap?= =?iso-8859-15?q?ps/abouthaiku_apps/bemail_apps/cdplayer_apps/clock?= =?iso-8859-15?q?_apps/deskbar_apps/deskcalc_apps/diskprobe_apps/ex?= =?iso-8859-15?q?pander_apps/fontdemo_apps/glteapot_apps/icon-o-mat?= =?iso-8859-15?q?ic_apps/installer_apps/magnify_apps/mediaplayer_ap?= =?iso-8859-15?q?ps/midiplayer_apps/people_apps/processcontroller_a?= =?iso-8859-15?q?pps/pulse_apps/showimage_apps/soundrecorder_apps/s?= =?iso-8859-15?q?tylededit_apps/terminal_apps/tracker_apps/workspac?= =?iso-8859-15?q?es_preferences/backgrounds_preferences/datatransla?= =?iso-8859-15?q?tions?= In-Reply-To: <200701071603.l07G3JAo026113@sheep.berlios.de> Message-ID: <8553835653-BeMail@zon> bga at BerliOS wrote: > - Shuffled the resource app_flags entry as it somehow fixed corrupt > version/description;icons > for several files here. It seems this > entry > must be the last one before the icons. If something like this happens, it's a bug, and should be fixed instead of being worked around, though. Where did you have problems with version info? > - long_info = "AboutHaiku ?2005-2006 Haiku, Inc." + long_info = "AboutHaiku ?2005-207 Haiku, Inc." Eeek :-)) Bye, Axel. From bga at bug-br.org.br Sun Jan 7 18:28:09 2007 From: bga at bug-br.org.br (Bruno G. Albuquerque) Date: Sun, 07 Jan 2007 15:28:09 -0200 BRST Subject: [Haiku-commits] r19735 - in haiku/trunk/src: apps/abouthaiku In-Reply-To: <28703521.1168187705738.JavaMail.ngmail@webmail15> Message-ID: <78930674097-BeMail@guglielmo> On Sun, 7 Jan 2007 17:35:05 +0100 (CET), Marcus Overhagen said: > > - Shuffled the resource app_flags entry as it somehow fixed corrupt > > version/description;icons for several files here. It seems this > > entry must > > be the last one before the icons. > > This looks like a bug to me. There shouldn't be any required order of > resources. Yep, it is mostly liklelly a bug in our resource compiler. Before changing the order of the resources, I would get corrupt version and description (short and long) and no icon would be attached as attributes (with standard bitmap icons not even as a resource. Vector icons are correctly added as resources). I would look into this myself but I am a bit of a hurry to get this working correctly so I went the easiest way (as it also does not have any side-effects). -Bruno -- Fortune Cookie Says: Absentee, n.: A person with an income who has had the forethought to remove himself from the sphere of exaction. -- Ambrose Bierce, "The Devil's Dictionary" From bga at bug-br.org.br Sun Jan 7 18:32:34 2007 From: bga at bug-br.org.br (Bruno G. Albuquerque) Date: Sun, 07 Jan 2007 15:32:34 -0200 BRST Subject: [Haiku-commits] =?iso-8859-15?q?r19735_-_in_haiku/trunk/src=3A_ap?= =?iso-8859-15?q?ps/abouthaiku_apps/bemail_apps/cdplayer_apps/clock_apps/d?= =?iso-8859-15?q?eskbar_apps/deskcalc_apps/diskprobe_apps/expander_apps/fo?= =?iso-8859-15?q?ntdemo_apps/glteapot_apps/icon-o-matic_apps/installer_app?= =?iso-8859-15?q?s/magnify_apps/mediaplayer_apps/midiplayer_apps/people_ap?= =?iso-8859-15?q?ps/processcontroller_apps/pulse_apps/showimage_apps/sound?= =?iso-8859-15?q?recorder_apps/stylededit_apps/terminal_apps/tracker_apps/?= =?iso-8859-15?q?workspaces_preferences/backgrounds_preferences/datatransl?= =?iso-8859-15?q?ations?= In-Reply-To: <8553835653-BeMail@zon> Message-ID: <79195865355-BeMail@guglielmo> On Sun, 7 Jan 2007 17:44:38 +0100 (MET), Axel D?rfler said: > If something like this happens, it's a bug, and should be fixed > instead > of being worked around, though. Sure, but check my previous email. :P And the workaround has no side effects (in fact, some executablesd already used the sttributes in the order I am using). > Where did you have problems with version info? The first signal is that when you boot you notice some executables have no icons. If you force identify them, they will get an icon from the resources (if it has a vector icon) but won't get any icon if only bitmap icons were associated with it. When opening the application with the filetypes add-on, I see something like this: Version: 0.0.0/0 Short Description: "" (empty) Long Description: ` [][]) This was supposed to be the info for ShowImage. -Bruno -- Fortune Cookie Says: Documentation is the castor oil of programming. Managers know it must be good because the programmers hate it so much. From axeld at pinc-software.de Sun Jan 7 19:01:11 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 7 Jan 2007 19:01:11 +0100 (MET) Subject: [Haiku-commits] r19735 - in haiku/trunk/src: apps/abouthaiku apps/bemail apps/cdplayer apps/clock apps/deskbar apps/deskcalc apps/diskprobe apps/expander apps/fontdemo apps/glteapot apps/icon-o-matic apps/installer apps/magnify apps/mediaplayer apps/midiplayer apps/people apps/processcontroller apps/pulse apps/showimage apps/soundrecorder apps/stylededit apps/terminal apps/tracker apps/workspaces preferences/backgrounds preferences/datatranslations In-Reply-To: <79195865355-BeMail@guglielmo> Message-ID: <13147436104-BeMail@zon> "Bruno G. Albuquerque" wrote: > > Where did you have problems with version info? > The first signal is that when you boot you notice some executables > have > no icons. If you force identify them, they will get an icon from the > resources (if it has a vector icon) but won't get any icon if only > bitmap icons were associated with it. > > When opening the application with the filetypes add-on, I see > something > like this: > > Version: 0.0.0/0 > Short Description: "" (empty) > Long Description: ` [][]) > > This was supposed to be the info for ShowImage. Okay, thanks! Since I already worked a bit on rc, I'll try to look into it later today. Bye, Axel. From axeld at pinc-software.de Sun Jan 7 19:29:06 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 7 Jan 2007 19:29:06 +0100 (MET) Subject: [Haiku-commits] r19735 - in haiku/trunk/src: apps/abouthaiku apps/bemail apps/cdplayer apps/clock apps/deskbar apps/deskcalc apps/diskprobe apps/expander apps/fontdemo apps/glteapot apps/icon-o-matic apps/installer apps/magnify apps/mediaplayer apps/midiplayer apps/people apps/processcontroller apps/pulse apps/showimage apps/soundrecorder apps/stylededit apps/terminal apps/tracker apps/workspaces preferences/backgrounds preferences/datatranslations In-Reply-To: <79195865355-BeMail@guglielmo> Message-ID: <14821667286-BeMail@zon> "Bruno G. Albuquerque" wrote: > > Where did you have problems with version info? > The first signal is that when you boot you notice some executables > have > no icons. If you force identify them, they will get an icon from the > resources (if it has a vector icon) but won't get any icon if only > bitmap icons were associated with it. > > When opening the application with the filetypes add-on, I see > something > like this: > > Version: 0.0.0/0 > Short Description: "" (empty) > Long Description: ` [][]) > > This was supposed to be the info for ShowImage. Okay, second try: I did not updated my working copy with your changes, but I cannot reproduce any of the problems you're observing. Do you build under Linux or BeOS when experiencing those problems? Have you rebuild the entire tree in the not so distant future? Bye, Axel. From bga at bug-br.org.br Sun Jan 7 19:33:29 2007 From: bga at bug-br.org.br (Bruno G. Albuquerque) Date: Sun, 07 Jan 2007 16:33:29 -0200 BRST Subject: [Haiku-commits] r19735 - in haiku/trunk/src: apps/abouthaiku apps/bemail apps/cdplayer apps/clock apps/deskbar apps/deskcalc apps/diskprobe apps/expander apps/fontdemo apps/glteapot apps/icon-o-matic apps/installer apps/magnify apps/mediaplayer apps/midiplayer apps/people apps/processcontroller apps/pulse apps/showimage apps/soundrecorder apps/stylededit apps/terminal apps/tracker apps/workspaces preferences/backgrounds preferences/datatranslations In-Reply-To: <14821667286-BeMail@zon> Message-ID: <2443305073-BeMail@guglielmo> On Sun, 7 Jan 2007 19:29:06 +0100 (MET), Axel D?rfler said: > Okay, second try: I did not updated my working copy with your > changes, > but I cannot reproduce any of the problems you're observing. Do you > build under Linux or BeOS when experiencing those problems? Have you > rebuild the entire tree in the not so distant future? Building under BeOS but I noticed a similar problem when building under Linux. Also yes, it was a full build and to a real empty partition (using jam -q haiku-install). -Bruno -- Fortune Cookie Says: I'm a Lisp variable -- bind me! From axeld at mail.berlios.de Sun Jan 7 19:45:53 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 7 Jan 2007 19:45:53 +0100 Subject: [Haiku-commits] r19737 - haiku/trunk/src/add-ons/kernel/drivers/network/sis900 Message-ID: <200701071845.l07IjrUU025617@sheep.berlios.de> Author: axeld Date: 2007-01-07 19:45:52 +0100 (Sun, 07 Jan 2007) New Revision: 19737 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19737&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/network/sis900/sis900.c Log: Added another PHY provided by Bernd - thanks! Modified: haiku/trunk/src/add-ons/kernel/drivers/network/sis900/sis900.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/sis900/sis900.c 2007-01-07 16:12:39 UTC (rev 19736) +++ haiku/trunk/src/add-ons/kernel/drivers/network/sis900/sis900.c 2007-01-07 18:45:52 UTC (rev 19737) @@ -37,6 +37,9 @@ #define PHY_ID1_ICS_1893 0xff40 #define PHY_ID0_REALTEK_8201 0x0000 #define PHY_ID1_REALTEK_8201 0x8200 +#define PHY_ID0_VIA_6103 0x0101 +#define PHY_ID1_VIA_6103 0x8f20 + #define MII_HOME 0x0001 #define MII_LAN 0x0002 @@ -59,6 +62,8 @@ 0x2000, 0x5C20, MII_LAN | MII_HOME}, {"Realtek RTL8201 PHY", PHY_ID0_REALTEK_8201, PHY_ID1_REALTEK_8201, MII_LAN}, + {"VIA 6103 PHY", + PHY_ID0_VIA_6103, PHY_ID1_VIA_6103, MII_LAN}, {NULL, 0, 0, 0} }; From mmlr at mail.berlios.de Mon Jan 8 04:16:30 2007 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Mon, 8 Jan 2007 04:16:30 +0100 Subject: [Haiku-commits] r19738 - haiku/trunk/src/add-ons/kernel/busses/usb Message-ID: <200701080316.l083GUXP023545@sheep.berlios.de> Author: mmlr Date: 2007-01-08 04:16:29 +0100 (Mon, 08 Jan 2007) New Revision: 19738 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19738&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp haiku/trunk/src/add-ons/kernel/busses/usb/uhci.h haiku/trunk/src/add-ons/kernel/busses/usb/uhci_hardware.h Log: * Reworked transfer queuing so that each transfer is grouped with it's own queue head * Fixed max packet size under bandwidth reclamation * Increased the thread priority of the finisher thread so that USB input devices should be more responsible under load * Added a comment to clarify the queue concept The queue management should now be less complex and less error prone. The max packet size is now set to 64 bytes which is the maximum size allowed. Transfers that caused babble errors before should now work. Modified: haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp 2007-01-07 18:45:52 UTC (rev 19737) +++ haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp 2007-01-08 03:16:29 UTC (rev 19738) @@ -41,7 +41,7 @@ host_controller_info uhci_module = { { - "busses/usb/uhci/nielx", + "busses/usb/uhci/v1", 0, uhci_std_ops }, @@ -194,7 +194,6 @@ fQueueHead->link_phy = fStrayDescriptor->this_phy; fQueueHead->link_log = fStrayDescriptor; - fQueueHead->element_phy = QH_TERMINATE; Unlock(); return B_OK; @@ -202,33 +201,26 @@ status_t -Queue::AppendDescriptorChain(uhci_td *descriptor) +Queue::AppendTransfer(uhci_qh *transfer) { - TRACE(("usb_uhci: appending descriptor chain\n")); - if (!Lock()) return B_ERROR; -#ifdef TRACE_USB - print_descriptor_chain(descriptor); -#endif + transfer->link_log = NULL; + transfer->link_phy = fQueueHead->link_phy; - if (fQueueTop == NULL) { - // the queue is empty, make this the first element - fQueueTop = descriptor; - fQueueHead->element_phy = descriptor->this_phy; - TRACE(("usb_uhci: first transfer in queue\n")); + if (!fQueueTop) { + // the list is empty, make this the first element + fQueueTop = transfer; + fQueueHead->element_phy = transfer->this_phy | QH_NEXT_IS_QH; } else { - // there are transfers linked, append to the queue - uhci_td *element = fQueueTop; - while ((element->link_phy & TD_TERMINATE) == 0) - element = (uhci_td *)element->link_log; + // append the transfer queue to the list + uhci_qh *element = fQueueTop; + while (element && element->link_log) + element = (uhci_qh *)element->link_log; - element->link_log = descriptor; - element->link_phy = descriptor->this_phy | TD_DEPTH_FIRST; - if (fQueueHead->element_phy & QH_TERMINATE) - fQueueHead->element_phy = descriptor->this_phy; - TRACE(("usb_uhci: appended transfer to queue\n")); + element->link_log = transfer; + element->link_phy = transfer->this_phy | QH_NEXT_IS_QH; } Unlock(); @@ -237,56 +229,40 @@ status_t -Queue::RemoveDescriptorChain(uhci_td *firstDescriptor, uhci_td *lastDescriptor) +Queue::RemoveTransfer(uhci_qh *transfer) { - TRACE(("usb_uhci: removing descriptor chain\n")); - if (!Lock()) return B_ERROR; - if (fQueueTop == firstDescriptor) { - // it is the first chain in this queue - if ((lastDescriptor->link_phy & TD_TERMINATE) > 0) { - // it is the only chain in this queue - fQueueTop = NULL; + if (fQueueTop == transfer) { + // this was the top element + fQueueTop = (uhci_qh *)transfer->link_log; + if (!fQueueTop) { + // this was the only element, terminate this queue + fQueueHead->element_phy = QH_TERMINATE; } else { - // there are still linked transfers - fQueueTop = (uhci_td *)lastDescriptor->link_log; + // there are elements left, adjust the element pointer + fQueueHead->element_phy = transfer->link_phy; } + + Unlock(); + return B_OK; } else { - // unlink the chain - uhci_td *element = fQueueTop; + uhci_qh *element = fQueueTop; while (element) { - if (element->link_log == firstDescriptor) { - element->link_log = lastDescriptor->link_log; - element->link_phy = lastDescriptor->link_phy; - break; + if (element->link_log == transfer) { + element->link_log = transfer->link_log; + element->link_phy = transfer->link_phy; + Unlock(); + return B_OK; } - element = (uhci_td *)element->link_log; + element = (uhci_qh *)element->link_log; } } - uhci_td *element = firstDescriptor; - while (element && element != lastDescriptor->link_log) { - if ((fQueueHead->element_phy & TD_LINK_MASK) == element->this_phy) { - fQueueHead->element_phy = lastDescriptor->link_phy; - TRACE_ERROR(("uhci: queue element pointer still pointing to removed chain\n")); - break; - } - - element = (uhci_td *)element->link_log; - } - - lastDescriptor->link_log = NULL; - lastDescriptor->link_phy = TD_TERMINATE; - -#ifdef TRACE_USB - print_descriptor_chain(firstDescriptor); -#endif - Unlock(); - return B_OK; + return B_BAD_VALUE; } @@ -385,6 +361,14 @@ WriteReg32(UHCI_FRBASEADD, (uint32)physicalAddress); WriteReg16(UHCI_FRNUM, 0); + // Set the max packet size for bandwidth reclamation to 64 bytes + WriteReg16(UHCI_USBCMD, ReadReg16(UHCI_USBCMD) | UHCI_USBCMD_MAXP); + + // we will create four queues: + // 0: interrupt transfers + // 1: low speed control transfers + // 2: full speed control transfers + // 3: bulk transfers fQueueCount = 4; fQueues = new(std::nothrow) Queue *[fQueueCount]; if (!fQueues) { @@ -419,7 +403,7 @@ // Create the finisher service thread fFinishThread = spawn_kernel_thread(FinishThread, - "uhci finish thread", B_NORMAL_PRIORITY, (void *)this); + "uhci finish thread", B_URGENT_DISPLAY_PRIORITY, (void *)this); resume_thread(fFinishThread); // Install the interrupt handler @@ -547,25 +531,25 @@ transfer->VectorCount()); } - Queue *queue = fQueues[3]; - if (pipe->Type() & USB_OBJECT_INTERRUPT_PIPE) - queue = fQueues[2]; + Queue *queue = NULL; + if (pipe->Type() & USB_OBJECT_INTERRUPT_PIPE) { + // use interrupt queue + queue = fQueues[0]; + } else { + // use bulk queue + queue = fQueues[3]; + } - result = AddPendingTransfer(transfer, queue, firstDescriptor, - firstDescriptor, lastDescriptor, directionIn); + uhci_qh *transferQueue = CreateTransferQueue(firstDescriptor); + result = AddPendingTransfer(transfer, queue, transferQueue, + firstDescriptor, firstDescriptor, directionIn); if (result < B_OK) { TRACE_ERROR(("usb_uhci: failed to add pending transfer\n")); FreeDescriptorChain(firstDescriptor); + FreeTransferQueue(transferQueue); return result; } - result = queue->AppendDescriptorChain(firstDescriptor); - if (result < B_OK) { - TRACE_ERROR(("usb_uhci: failed to append descriptor chain\n")); - FreeDescriptorChain(firstDescriptor); - return result; - } - return B_OK; } @@ -625,18 +609,22 @@ LinkDescriptors(setupDescriptor, statusDescriptor); } - status_t result = AddPendingTransfer(transfer, fQueues[1], setupDescriptor, - dataDescriptor, statusDescriptor, directionIn); - if (result < B_OK) { - TRACE_ERROR(("usb_uhci: failed to add pending transfer\n")); - FreeDescriptorChain(setupDescriptor); - return result; + Queue *queue = NULL; + if (pipe->Speed() == USB_SPEED_LOWSPEED) { + // use the low speed control queue + queue = fQueues[1]; + } else { + // use the full speed control queue + queue = fQueues[2]; } - result = fQueues[1]->AppendDescriptorChain(setupDescriptor); + uhci_qh *transferQueue = CreateTransferQueue(setupDescriptor); + status_t result = AddPendingTransfer(transfer, queue, transferQueue, + setupDescriptor, dataDescriptor, directionIn); if (result < B_OK) { - TRACE_ERROR(("usb_uhci: failed to append descriptor chain\n")); + TRACE_ERROR(("usb_uhci: failed to add pending transfer\n")); FreeDescriptorChain(setupDescriptor); + FreeTransferQueue(transferQueue); return result; } @@ -646,18 +634,21 @@ status_t UHCI::AddPendingTransfer(Transfer *transfer, Queue *queue, - uhci_td *firstDescriptor, uhci_td *dataDescriptor, uhci_td *lastDescriptor, + uhci_qh *transferQueue, uhci_td *firstDescriptor, uhci_td *dataDescriptor, bool directionIn) { + if (!transfer || !queue || !transferQueue || !firstDescriptor) + return B_BAD_VALUE; + transfer_data *data = new(std::nothrow) transfer_data(); if (!data) return B_NO_MEMORY; data->transfer = transfer; data->queue = queue; + data->transfer_queue = transferQueue; data->first_descriptor = firstDescriptor; data->data_descriptor = dataDescriptor; - data->last_descriptor = lastDescriptor; data->user_area = -1; data->incoming = directionIn; data->link = NULL; @@ -718,6 +709,7 @@ fLastTransfer = data; Unlock(); + queue->AppendTransfer(data->transfer_queue); return B_OK; } @@ -764,7 +756,7 @@ } if (status & TD_ERROR_MASK) { - TRACE_ERROR(("usb_uhci: td (0x%08lx) error: 0x%08lx\n", descriptor->this_phy, status)); + TRACE_ERROR(("usb_uhci: td (0x%08lx) error: status: 0x%08lx; token: 0x%08lx;\n", descriptor->this_phy, status, descriptor->token)); // an error occured. we have to remove the // transfer from the queue and clean up @@ -803,25 +795,21 @@ callbackStatus = B_DEV_STALLED; } - transfer->queue->RemoveDescriptorChain( - transfer->first_descriptor, - transfer->last_descriptor); - + transfer->queue->RemoveTransfer(transfer->transfer_queue); FreeDescriptorChain(transfer->first_descriptor); + FreeTransferQueue(transfer->transfer_queue); transfer->transfer->Finished(callbackStatus, 0); transferDone = true; break; } // either all descriptors are done, or we have a short packet - if (descriptor == transfer->last_descriptor + if ((descriptor->link_phy & TD_TERMINATE) || (descriptor->status & TD_STATUS_ACTLEN_MASK) < (descriptor->token >> TD_TOKEN_MAXLEN_SHIFT)) { TRACE(("usb_uhci: td (0x%08lx) ok\n", descriptor->this_phy)); // we got through without errors so we are finished - transfer->queue->RemoveDescriptorChain( - transfer->first_descriptor, - transfer->last_descriptor); + transfer->queue->RemoveTransfer(transfer->transfer_queue); size_t actualLength = 0; uint8 lastDataToggle = 0; @@ -863,6 +851,7 @@ } FreeDescriptorChain(transfer->first_descriptor); + FreeTransferQueue(transfer->transfer_queue); transfer->transfer->TransferPipe()->SetDataToggle(lastDataToggle == 0); transfer->transfer->Finished(B_OK, actualLength); transferDone = true; @@ -1206,6 +1195,31 @@ } +uhci_qh * +UHCI::CreateTransferQueue(uhci_td *descriptor) +{ + uhci_qh *queueHead; + void *physicalAddress; + if (fStack->AllocateChunk((void **)&queueHead, + &physicalAddress, sizeof(uhci_qh)) < B_OK) + return NULL; + + queueHead->this_phy = (addr_t)physicalAddress; + queueHead->element_phy = descriptor->this_phy; + return queueHead; +} + + +void +UHCI::FreeTransferQueue(uhci_qh *queueHead) +{ + if (!queueHead) + return; + + fStack->FreeChunk(queueHead, (void *)queueHead->this_phy, sizeof(uhci_qh)); +} + + uhci_td * UHCI::CreateDescriptor(Pipe *pipe, uint8 direction, size_t bufferSize) { @@ -1219,7 +1233,9 @@ } result->this_phy = (addr_t)physicalAddress; - result->status = TD_STATUS_ACTIVE | TD_CONTROL_3_ERRORS | TD_CONTROL_SPD; + result->status = TD_STATUS_ACTIVE | TD_CONTROL_3_ERRORS; + if (direction == TD_TOKEN_IN) + result->status |= TD_CONTROL_SPD; if (pipe->Speed() == USB_SPEED_LOWSPEED) result->status |= TD_CONTROL_LOWSPEED; Modified: haiku/trunk/src/add-ons/kernel/busses/usb/uhci.h =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/usb/uhci.h 2007-01-07 18:45:52 UTC (rev 19737) +++ haiku/trunk/src/add-ons/kernel/busses/usb/uhci.h 2007-01-08 03:16:29 UTC (rev 19738) @@ -32,10 +32,8 @@ status_t LinkTo(Queue *other); status_t TerminateByStrayDescriptor(); - status_t AppendDescriptorChain(uhci_td *descriptor); - status_t RemoveDescriptorChain( - uhci_td *firstDescriptor, - uhci_td *lastDescriptor); + status_t AppendTransfer(uhci_qh *transfer); + status_t RemoveTransfer(uhci_qh *transfer); addr_t PhysicalAddress(); @@ -46,7 +44,7 @@ Stack *fStack; uhci_qh *fQueueHead; uhci_td *fStrayDescriptor; - uhci_td *fQueueTop; + uhci_qh *fQueueTop; benaphore fLock; }; @@ -54,9 +52,9 @@ typedef struct transfer_data_s { Transfer *transfer; Queue *queue; + uhci_qh *transfer_queue; uhci_td *first_descriptor; uhci_td *data_descriptor; - uhci_td *last_descriptor; area_id user_area; bool incoming; transfer_data_s *link; @@ -93,13 +91,17 @@ // Transfer functions status_t AddPendingTransfer(Transfer *transfer, Queue *queue, + uhci_qh *transferQueue, uhci_td *firstDescriptor, uhci_td *dataDescriptor, - uhci_td *lastDescriptor, bool directionIn); static int32 FinishThread(void *data); void FinishTransfers(); + // Transfer queue functions + uhci_qh *CreateTransferQueue(uhci_td *descriptor); + void FreeTransferQueue(uhci_qh *queueHead); + // Descriptor functions uhci_td *CreateDescriptor(Pipe *pipe, uint8 direction, Modified: haiku/trunk/src/add-ons/kernel/busses/usb/uhci_hardware.h =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/usb/uhci_hardware.h 2007-01-07 18:45:52 UTC (rev 19737) +++ haiku/trunk/src/add-ons/kernel/busses/usb/uhci_hardware.h 2007-01-08 03:16:29 UTC (rev 19738) @@ -40,6 +40,7 @@ #define UHCI_USBCMD_FGR 0x10 // Force Global resume #define UHCI_USBCMD_SWDBG 0x20 // Software Debug #define UHCI_USBCMD_CF 0x40 // Configure Flag +#define UHCI_USBCMD_MAXP 0x80 // Max packet //USBSTS #define UHCI_USBSTS_USBINT 0x1 // USB interrupt From axeld at mail.berlios.de Mon Jan 8 13:14:07 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 8 Jan 2007 13:14:07 +0100 Subject: [Haiku-commits] r19739 - in haiku/trunk: headers/private/kernel/boot src/system/boot/loader src/system/boot/platform/bios_ia32 Message-ID: <200701081214.l08CE7c9015333@sheep.berlios.de> Author: axeld Date: 2007-01-08 13:14:06 +0100 (Mon, 08 Jan 2007) New Revision: 19739 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19739&view=rev Modified: haiku/trunk/headers/private/kernel/boot/addr_range.h haiku/trunk/src/system/boot/loader/kernel_args.cpp haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp Log: * Instead of its home-brewn solution, mmu_init() now uses the functions declared in addr_range.h to add ranges to the arrays. This fixes the crashing bug reported by Larry Baydak. * Added some more exported functions to kernel_args.cpp (prototypes are in addr_range.h). * TODO: let the PPC/OpenFirmware implementation use those as well. Modified: haiku/trunk/headers/private/kernel/boot/addr_range.h =================================================================== --- haiku/trunk/headers/private/kernel/boot/addr_range.h 2007-01-08 03:16:29 UTC (rev 19738) +++ haiku/trunk/headers/private/kernel/boot/addr_range.h 2007-01-08 12:14:06 UTC (rev 19739) @@ -1,7 +1,7 @@ /* -** Copyright 2004, Axel D?rfler, axeld at pinc-software.de. All rights reserved. -** Distributed under the terms of the Haiku License. -*/ + * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Distributed under the terms of the MIT License. + */ #ifndef KERNEL_BOOT_ADDR_RANGE_H #define KERNEL_BOOT_ADDR_RANGE_H @@ -14,10 +14,22 @@ addr_t size; } addr_range; + #ifdef __cplusplus -extern "C" +extern "C" { #endif + status_t insert_address_range(addr_range *ranges, uint32 *_numRanges, uint32 maxRanges, addr_t start, uint32 size); +status_t remove_addr_range(addr_range *ranges, uint32 *_numRanges, uint32 maxRanges, + addr_t start, uint32 size); +status_t insert_physical_memory_range(addr_t start, uint32 size); +status_t insert_physical_allocated_range(addr_t start, uint32 size); +status_t insert_virtual_allocated_range(addr_t start, uint32 size); + +#ifdef __cplusplus +} +#endif + #endif /* KERNEL_BOOT_ADDR_RANGE_H */ Modified: haiku/trunk/src/system/boot/loader/kernel_args.cpp =================================================================== --- haiku/trunk/src/system/boot/loader/kernel_args.cpp 2007-01-08 03:16:29 UTC (rev 19738) +++ haiku/trunk/src/system/boot/loader/kernel_args.cpp 2007-01-08 12:14:06 UTC (rev 19739) @@ -36,6 +36,18 @@ } +static status_t +add_kernel_args_range(void *start, uint32 size) +{ + return insert_address_range(gKernelArgs.kernel_args_range, + &gKernelArgs.num_kernel_args_ranges, MAX_KERNEL_ARGS_RANGE, + (addr_t)start, size); +} + + +// #pragma mark - addr_range utility + + /** Inserts the specified (start, size) pair (aka range) in the * addr_range array. * It will extend existing ranges in order to have as little @@ -122,15 +134,82 @@ } -static status_t -add_kernel_args_range(void *start, uint32 size) +extern "C" status_t +remove_address_range(addr_range *ranges, uint32 *_numRanges, uint32 maxRanges, + addr_t start, uint32 size) { - return insert_address_range(gKernelArgs.kernel_args_range, - &gKernelArgs.num_kernel_args_ranges, MAX_KERNEL_ARGS_RANGE, - (addr_t)start, size); + uint32 numRanges = *_numRanges; + + addr_t end = ROUNDUP(start + size, B_PAGE_SIZE); + start = ROUNDOWN(start, B_PAGE_SIZE); + + for (uint32 i = 0; i < numRanges; i++) { + addr_t rangeStart = ranges[i].start; + addr_t rangeEnd = rangeStart + ranges[i].size; + + if (start <= rangeStart) { + if (end <= rangeStart) { + // no intersection + } else if (end >= rangeEnd) { + // remove the complete range + remove_range_index(ranges, numRanges, i); + i--; + } else { + // remove the head of the range + ranges[i].start = end; + ranges[i].size = rangeEnd - end; + } + } else if (end >= rangeEnd) { + if (start < rangeEnd) { + // remove the tail + ranges[i].size = start - rangeStart; + } // else: no intersection + } else { + // rangeStart < start < end < rangeEnd + // The ugly case: We have to remove something from the middle of + // the range. We keep the head of the range and insert its tail + // as a new range. + ranges[i].size = start - rangeStart; + return insert_address_range(ranges, _numRanges, maxRanges, + end, rangeEnd - end); + } + } + + *_numRanges = numRanges; + return B_OK; } +status_t +insert_physical_memory_range(addr_t start, uint32 size) +{ + return insert_address_range(gKernelArgs.physical_memory_range, + &gKernelArgs.num_physical_memory_ranges, MAX_PHYSICAL_MEMORY_RANGE, + start, size); +} + + +status_t +insert_physical_allocated_range(addr_t start, uint32 size) +{ + return insert_address_range(gKernelArgs.physical_allocated_range, + &gKernelArgs.num_physical_allocated_ranges, MAX_PHYSICAL_ALLOCATED_RANGE, + start, size); +} + + +status_t +insert_virtual_allocated_range(addr_t start, uint32 size) +{ + return insert_address_range(gKernelArgs.virtual_allocated_range, + &gKernelArgs.num_virtual_allocated_ranges, MAX_VIRTUAL_ALLOCATED_RANGE, + start, size); +} + + +// #pragma mark - kernel_args allocations + + /** This function can be used to allocate memory that is going * to be passed over to the kernel. For example, the preloaded_image * structures are allocated this way. Modified: haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp 2007-01-08 03:16:29 UTC (rev 19738) +++ haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp 2007-01-08 12:14:06 UTC (rev 19739) @@ -9,7 +9,6 @@ #include "mmu.h" #include "bios.h" -#include #include #include #include @@ -18,6 +17,8 @@ #include #include +#include + #include @@ -279,8 +280,9 @@ gKernelArgs.arch_args.phys_pgdir = (uint32)sPageDirectory; // clear out the pgdir - for (int32 i = 0; i < 1024; i++) + for (int32 i = 0; i < 1024; i++) { sPageDirectory[i] = 0; + } // Identity map the first 8 MB of memory so that their // physical and virtual address are the same. @@ -553,41 +555,39 @@ // figure out the memory map if (extMemoryCount > 0) { - uint32 i; - gKernelArgs.num_physical_memory_ranges = 0; - for (i = 0; i < extMemoryCount; i++) { + for (uint32 i = 0; i < extMemoryCount; i++) { + // Type 1 is available memory if (extMemoryBlock[i].type == 1) { - // round everything up to page boundaries, exclusive of pages it partially occupies + // round everything up to page boundaries, exclusive of pages + // it partially occupies extMemoryBlock[i].length -= (extMemoryBlock[i].base_addr % B_PAGE_SIZE) ? (B_PAGE_SIZE - (extMemoryBlock[i].base_addr % B_PAGE_SIZE)) : 0; extMemoryBlock[i].base_addr = ROUNDUP(extMemoryBlock[i].base_addr, B_PAGE_SIZE); extMemoryBlock[i].length = ROUNDOWN(extMemoryBlock[i].length, B_PAGE_SIZE); - // this is mem we can use - if (gKernelArgs.num_physical_memory_ranges == 0) { - gKernelArgs.physical_memory_range[0].start = (addr_t)extMemoryBlock[i].base_addr; - gKernelArgs.physical_memory_range[0].size = (addr_t)extMemoryBlock[i].length; - gKernelArgs.num_physical_memory_ranges++; - } else { - // we might have to extend the previous hole - addr_t previous_end = gKernelArgs.physical_memory_range[gKernelArgs.num_physical_memory_ranges - 1].start - + gKernelArgs.physical_memory_range[gKernelArgs.num_physical_memory_ranges - 1].size; + if (gKernelArgs.num_physical_memory_ranges > 0) { + // we might want to extend a previous hole + addr_t previousEnd = gKernelArgs.physical_memory_range[ + gKernelArgs.num_physical_memory_ranges - 1].start + + gKernelArgs.physical_memory_range[ + gKernelArgs.num_physical_memory_ranges - 1].size; + addr_t holeSize = extMemoryBlock[i].base_addr - previousEnd; - if (previous_end <= extMemoryBlock[i].base_addr - && ((extMemoryBlock[i].base_addr - previous_end) < 0x100000)) { - // extend the previous buffer - gKernelArgs.physical_memory_range[gKernelArgs.num_physical_memory_ranges - 1].size += - (extMemoryBlock[i].base_addr - previous_end) + - extMemoryBlock[i].length; - - // mark the gap between the two allocated ranges in use - gKernelArgs.physical_allocated_range[gKernelArgs.num_physical_allocated_ranges].start = previous_end; - gKernelArgs.physical_allocated_range[gKernelArgs.num_physical_allocated_ranges].size = extMemoryBlock[i].base_addr - previous_end; - gKernelArgs.num_physical_allocated_ranges++; + // if the hole is smaller than 1 MB, we try to mark the memory + // as allocated and extend the previous memory range + if (previousEnd <= extMemoryBlock[i].base_addr + && holeSize < 0x100000 + && insert_physical_allocated_range(previousEnd, + extMemoryBlock[i].base_addr - previousEnd) == B_OK) { + gKernelArgs.physical_memory_range[ + gKernelArgs.num_physical_memory_ranges - 1].size += holeSize; } } + + insert_physical_memory_range(extMemoryBlock[i].base_addr, + extMemoryBlock[i].length); } } } else { From axeld at mail.berlios.de Mon Jan 8 13:15:00 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 8 Jan 2007 13:15:00 +0100 Subject: [Haiku-commits] r19740 - haiku/trunk/headers/private/kernel/boot/platform/bios_ia32 Message-ID: <200701081215.l08CF0kE020340@sheep.berlios.de> Author: axeld Date: 2007-01-08 13:14:58 +0100 (Mon, 08 Jan 2007) New Revision: 19740 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19740&view=rev Modified: haiku/trunk/headers/private/kernel/boot/platform/bios_ia32/platform_kernel_args.h Log: Enlarged all memory range arrays to 6, just in case. Modified: haiku/trunk/headers/private/kernel/boot/platform/bios_ia32/platform_kernel_args.h =================================================================== --- haiku/trunk/headers/private/kernel/boot/platform/bios_ia32/platform_kernel_args.h 2007-01-08 12:14:06 UTC (rev 19739) +++ haiku/trunk/headers/private/kernel/boot/platform/bios_ia32/platform_kernel_args.h 2007-01-08 12:14:58 UTC (rev 19740) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2003-2007, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. */ #ifndef KERNEL_BOOT_PLATFORM_BIOS_IA32_KERNEL_ARGS_H @@ -16,9 +16,9 @@ // must match SMP_MAX_CPUS in arch_smp.h #define MAX_BOOT_CPUS 4 -#define MAX_PHYSICAL_MEMORY_RANGE 4 -#define MAX_PHYSICAL_ALLOCATED_RANGE 4 -#define MAX_VIRTUAL_ALLOCATED_RANGE 4 +#define MAX_PHYSICAL_MEMORY_RANGE 6 +#define MAX_PHYSICAL_ALLOCATED_RANGE 6 +#define MAX_VIRTUAL_ALLOCATED_RANGE 6 #define MAX_SERIAL_PORTS 4 From axeld at mail.berlios.de Mon Jan 8 16:41:57 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 8 Jan 2007 16:41:57 +0100 Subject: [Haiku-commits] r19741 - haiku/trunk/src/add-ons/kernel/network/stack Message-ID: <200701081541.l08FfvH0000613@sheep.berlios.de> Author: axeld Date: 2007-01-08 16:41:56 +0100 (Mon, 08 Jan 2007) New Revision: 19741 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19741&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp haiku/trunk/src/add-ons/kernel/network/stack/interfaces.h haiku/trunk/src/add-ons/kernel/network/stack/net_socket.cpp Log: * Introduced a reader_thread member to the private net_device_interface. * When shutting down an interface, we now wait until its reader thread is gone, too; this is necessary in case the kernel unloads the networking stack before the reader thread had a chance to exit. * Added some debug output to net_socket in case you ask for unknown options. Modified: haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2007-01-08 12:14:58 UTC (rev 19740) +++ haiku/trunk/src/add-ons/kernel/network/stack/datalink.cpp 2007-01-08 15:41:56 UTC (rev 19741) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -520,13 +520,13 @@ char name[B_OS_NAME_LENGTH]; snprintf(name, sizeof(name), "%s reader", device->name); - thread_id thread = spawn_kernel_thread(device_reader_thread, name, + deviceInterface->reader_thread = spawn_kernel_thread(device_reader_thread, name, B_REAL_TIME_DISPLAY_PRIORITY - 10, deviceInterface); - if (thread < B_OK) - return thread; + if (deviceInterface->reader_thread < B_OK) + return deviceInterface->reader_thread; device->flags |= IFF_UP; - resume_thread(thread); + resume_thread(deviceInterface->reader_thread); deviceInterface->up_count = 1; return B_OK; @@ -552,6 +552,10 @@ device->flags &= ~IFF_UP; protocol->device_module->down(protocol->device); + + // make sure the reader thread is gone before shutting down the interface + status_t status; + wait_for_thread(deviceInterface->reader_thread, &status); } Modified: haiku/trunk/src/add-ons/kernel/network/stack/interfaces.h =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/interfaces.h 2007-01-08 12:14:58 UTC (rev 19740) +++ haiku/trunk/src/add-ons/kernel/network/stack/interfaces.h 2007-01-08 15:41:56 UTC (rev 19741) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -34,6 +34,7 @@ const char *name; struct net_device_module_info *module; struct net_device *device; + thread_id reader_thread; uint32 up_count; // a device can be brought up by more than one interface int32 ref_count; Modified: haiku/trunk/src/add-ons/kernel/network/stack/net_socket.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/net_socket.cpp 2007-01-08 12:14:58 UTC (rev 19740) +++ haiku/trunk/src/add-ons/kernel/network/stack/net_socket.cpp 2007-01-08 15:41:56 UTC (rev 19741) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -716,6 +716,7 @@ break; } + dprintf("socket_getsockopt: unknown option %d\n", option); return ENOPROTOOPT; } @@ -996,6 +997,7 @@ break; } + dprintf("socket_setsockopt: unknown option %d\n", option); return ENOPROTOOPT; } From axeld at mail.berlios.de Mon Jan 8 17:04:16 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 8 Jan 2007 17:04:16 +0100 Subject: [Haiku-commits] r19742 - haiku/trunk/src/servers/net Message-ID: <200701081604.l08G4GGr003376@sheep.berlios.de> Author: axeld Date: 2007-01-08 17:04:16 +0100 (Mon, 08 Jan 2007) New Revision: 19742 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19742&view=rev Modified: haiku/trunk/src/servers/net/NetServer.cpp Log: * The networking stack now removes all invalid interfaces during startup (those where there is either no address or MAC address [ethernet only]). * _ConfigureInterfaces() now notices if a network device that has a configuration is gone and memorizes this configuration. * If a new device pops up, and there is an existing configuration for a device no longer available, that configuration will be used for the new device, allowing you to easily move your Haiku image to a new system without losing its network settings - it does not yet test if the IP address is already in use in the local network, though (in which case a configuration using DHCP would be preferrable). Modified: haiku/trunk/src/servers/net/NetServer.cpp =================================================================== --- haiku/trunk/src/servers/net/NetServer.cpp 2007-01-08 15:41:56 UTC (rev 19741) +++ haiku/trunk/src/servers/net/NetServer.cpp 2007-01-08 16:04:16 UTC (rev 19742) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -48,14 +48,17 @@ virtual void MessageReceived(BMessage* message); private: + bool _IsValidInterface(int socket, const char* name); + void _RemoveInvalidInterfaces(int socket); bool _TestForInterface(int socket, const char* name); status_t _ConfigureInterface(int socket, BMessage& interface, bool fromMessage = false); bool _QuitLooperForDevice(const char* device); BLooper* _LooperForDevice(const char* device); status_t _ConfigureDevice(int socket, const char* path); - void _ConfigureDevices(int socket, const char* path); - void _ConfigureInterfaces(int socket); + void _ConfigureDevices(int socket, const char* path, + BMessage* suggestedInterface = NULL); + void _ConfigureInterfaces(int socket, BMessage* _missingDevice = NULL); void _BringUpInterfaces(); void _StartServices(); @@ -324,7 +327,112 @@ } +/*! + Checks if an interface is valid, that is, if it has an address in any + family, and, in case of ethernet, a hardware MAC address. +*/ bool +NetServer::_IsValidInterface(int socket, const char* name) +{ + ifreq request; + if (!prepare_request(request, name)) + return B_ERROR; + + // check if it has an address + + int32 addresses = 0; + + for (int32 i = 0; kFamilies[i].family >= 0; i++) { + int familySocket = ::socket(kFamilies[i].family, SOCK_DGRAM, 0); + if (familySocket < 0) + continue; + + if (ioctl(familySocket, SIOCGIFADDR, &request, sizeof(struct ifreq)) == 0) { + if (request.ifr_addr.sa_family == kFamilies[i].family) + addresses++; + } + + close(familySocket); + } + + if (addresses == 0) + return false; + + // check if it has a hardware address, too, in case of ethernet + + if (ioctl(socket, SIOCGIFPARAM, &request, sizeof(struct ifreq)) < 0) + return false; + + int linkSocket = ::socket(AF_LINK, SOCK_DGRAM, 0); + if (linkSocket < 0) + return false; + + prepare_request(request, request.ifr_parameter.device); + if (ioctl(linkSocket, SIOCGIFADDR, &request, sizeof(struct ifreq)) < 0) { + close(linkSocket); + return false; + } + + close(linkSocket); + + sockaddr_dl &link = *(sockaddr_dl *)&request.ifr_addr; + if (link.sdl_type == IFT_ETHER && link.sdl_alen < 6) + return false; + + return true; +} + + +void +NetServer::_RemoveInvalidInterfaces(int socket) +{ + // get a list of all interfaces + + ifconf config; + config.ifc_len = sizeof(config.ifc_value); + if (ioctl(socket, SIOCGIFCOUNT, &config, sizeof(struct ifconf)) < 0) + return; + + uint32 count = (uint32)config.ifc_value; + if (count == 0) { + // there are no interfaces yet + return; + } + + void *buffer = malloc(count * sizeof(struct ifreq)); + if (buffer == NULL) { + fprintf(stderr, "%s: Out of memory.\n", Name()); + return; + } + + config.ifc_len = count * sizeof(struct ifreq); + config.ifc_buf = buffer; + if (ioctl(socket, SIOCGIFCONF, &config, sizeof(struct ifconf)) < 0) + return; + + ifreq *interface = (ifreq *)buffer; + + for (uint32 i = 0; i < count; i++) { + if (!_IsValidInterface(socket, interface->ifr_name)) { + // remove invalid interface + ifreq request; + if (!prepare_request(request, interface->ifr_name)) + return; + + if (ioctl(socket, SIOCDIFADDR, &request, sizeof(request)) < 0) { + fprintf(stderr, "%s: Could not delete interface %s: %s\n", + Name(), interface->ifr_name, strerror(errno)); + } + } + + interface = (ifreq *)((addr_t)interface + IF_NAMESIZE + interface->ifr_addr.sa_len); + } + + free(buffer); +} + + +bool NetServer::_TestForInterface(int socket, const char* name) { // get a list of all interfaces @@ -642,7 +750,6 @@ status_t NetServer::_ConfigureDevice(int socket, const char* path) { - // bring interface up, but don't configure it just yet BMessage interface; interface.AddString("device", path); @@ -656,7 +763,8 @@ void -NetServer::_ConfigureDevices(int socket, const char* startPath) +NetServer::_ConfigureDevices(int socket, const char* startPath, + BMessage* suggestedInterface) { BDirectory directory(startPath); BEntry entry; @@ -670,19 +778,26 @@ || entry.GetStat(&stat) != B_OK) continue; - if (S_ISBLK(stat.st_mode) || S_ISCHR(stat.st_mode)) - _ConfigureDevice(socket, path.Path()); - else if (entry.IsDirectory()) - _ConfigureDevices(socket, path.Path()); + if (S_ISBLK(stat.st_mode) || S_ISCHR(stat.st_mode)) { + if (suggestedInterface != NULL + && suggestedInterface->RemoveName("device") == B_OK + && suggestedInterface->AddString("device", path.Path()) == B_OK + && _ConfigureInterface(socket, *suggestedInterface) == B_OK) + suggestedInterface = NULL; + else + _ConfigureDevice(socket, path.Path()); + } else if (entry.IsDirectory()) + _ConfigureDevices(socket, path.Path(), suggestedInterface); } } void -NetServer::_ConfigureInterfaces(int socket) +NetServer::_ConfigureInterfaces(int socket, BMessage* _missingDevice) { BMessage interface; uint32 cookie = 0; + bool missing = false; while (fSettings.GetNextInterface(cookie, interface) == B_OK) { const char *device; if (interface.FindString("device", &device) != B_OK) @@ -691,8 +806,13 @@ if (!strncmp(device, "/dev/net/", 9)) { // it's a kernel device, check if it's present BEntry entry(device); - if (!entry.Exists()) + if (!entry.Exists()) { + if (!missing && _missingDevice != NULL) { + *_missingDevice = interface; + missing = true; + } continue; + } } _ConfigureInterface(socket, interface); @@ -712,9 +832,12 @@ return; } + _RemoveInvalidInterfaces(socket); + // First, we look into the settings, and try to bring everything up from there - _ConfigureInterfaces(socket); + BMessage missingDevice; + _ConfigureInterfaces(socket, &missingDevice); // check configuration @@ -735,7 +858,8 @@ if (!_TestForInterface(socket, "/dev/net/")) { // there is no driver configured - see if there is one and try to use it - _ConfigureDevices(socket, "/dev/net"); + _ConfigureDevices(socket, "/dev/net", + missingDevice.HasString("device") ? &missingDevice : NULL); } close(socket); From axeld at pinc-software.de Mon Jan 8 17:18:35 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Mon, 8 Jan 2007 17:18:35 +0100 (MET) Subject: [Haiku-commits] r19719 - haiku/trunk/src/system/kernel In-Reply-To: Message-ID: <23525876026-BeMail@zon> Travis Geiselbrecht wrote: > Oh that's interesting it wasn't skipping the entire priority queue. > I'm pretty sure it was that way in newos, and definitely was that way > in beos. Must have been changed in the changes since the fork. Yes, quite some people have tampered with the scheduling in the past. > IIRC, the beos scheduler skipped a pretty large percentage of the > time, which seemed a bit aggressive when I first saw it. Also, IIRC > it did something different on SMP machines, but I really don't > remember what it was. Some tweak to the percentage of skips. > > I'd like to rewrite this scheduler to at least have per cpu run > queues at some point in time, but it's definitely something worth > thinking about a bunch before diving off into it. If anyone has any > ideas, I'd love to hear em. I don't have any ideas there; I haven't even thought about how to do this yet, nor have I had a deep look at other existing schedulers. Bye, Axel. From axeld at mail.berlios.de Mon Jan 8 18:44:34 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 8 Jan 2007 18:44:34 +0100 Subject: [Haiku-commits] r19743 - haiku/trunk/src/system/boot/platform/bios_ia32 Message-ID: <200701081744.l08HiYtX009487@sheep.berlios.de> Author: axeld Date: 2007-01-08 18:44:32 +0100 (Mon, 08 Jan 2007) New Revision: 19743 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19743&view=rev Modified: haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp Log: We now ignore all memory beyond the 4 GB barrier in 32-bit mode. Modified: haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp 2007-01-08 16:04:16 UTC (rev 19742) +++ haiku/trunk/src/system/boot/platform/bios_ia32/mmu.cpp 2007-01-08 17:44:32 UTC (rev 19743) @@ -567,6 +567,12 @@ extMemoryBlock[i].base_addr = ROUNDUP(extMemoryBlock[i].base_addr, B_PAGE_SIZE); extMemoryBlock[i].length = ROUNDOWN(extMemoryBlock[i].length, B_PAGE_SIZE); + // we ignore all memory beyond 4 GB + if (extMemoryBlock[i].base_addr > 0xffffffffULL) + continue; + if (extMemoryBlock[i].base_addr + extMemoryBlock[i].length > 0xffffffffULL) + extMemoryBlock[i].length = 0x100000000ULL - extMemoryBlock[i].base_addr; + if (gKernelArgs.num_physical_memory_ranges > 0) { // we might want to extend a previous hole addr_t previousEnd = gKernelArgs.physical_memory_range[ From korli at mail.berlios.de Mon Jan 8 20:38:13 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 8 Jan 2007 20:38:13 +0100 Subject: [Haiku-commits] r19744 - in haiku/vendor/coreutils/current: . doc lib man src Message-ID: <200701081938.l08JcDJI001782@sheep.berlios.de> Author: korli Date: 2007-01-08 20:29:59 +0100 (Mon, 08 Jan 2007) New Revision: 19744 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19744&view=rev Added: haiku/vendor/coreutils/current/ChangeLog-2005 haiku/vendor/coreutils/current/bootstrap haiku/vendor/coreutils/current/bootstrap.conf haiku/vendor/coreutils/current/doc/fdl.texi haiku/vendor/coreutils/current/lib/allocsa.valgrind haiku/vendor/coreutils/current/lib/at-func.c haiku/vendor/coreutils/current/lib/base64.c haiku/vendor/coreutils/current/lib/base64.h haiku/vendor/coreutils/current/lib/buffer-lcm.c haiku/vendor/coreutils/current/lib/buffer-lcm.h haiku/vendor/coreutils/current/lib/close-stream.c haiku/vendor/coreutils/current/lib/close-stream.h haiku/vendor/coreutils/current/lib/config.hin haiku/vendor/coreutils/current/lib/dirchownmod.c haiku/vendor/coreutils/current/lib/dirchownmod.h haiku/vendor/coreutils/current/lib/euidaccess-stat.c haiku/vendor/coreutils/current/lib/euidaccess-stat.h haiku/vendor/coreutils/current/lib/fchmodat.c haiku/vendor/coreutils/current/lib/fcntl_.h haiku/vendor/coreutils/current/lib/fstatat.c haiku/vendor/coreutils/current/lib/gnulib.mk haiku/vendor/coreutils/current/lib/i-ring.c haiku/vendor/coreutils/current/lib/i-ring.h haiku/vendor/coreutils/current/lib/inet_ntop.c haiku/vendor/coreutils/current/lib/inet_ntop.h haiku/vendor/coreutils/current/lib/inttypes_.h haiku/vendor/coreutils/current/lib/isapipe.c haiku/vendor/coreutils/current/lib/isapipe.h haiku/vendor/coreutils/current/lib/lchmod.h haiku/vendor/coreutils/current/lib/memxfrm.c haiku/vendor/coreutils/current/lib/memxfrm.h haiku/vendor/coreutils/current/lib/mkancesdirs.c haiku/vendor/coreutils/current/lib/mkancesdirs.h haiku/vendor/coreutils/current/lib/mkdirat.c haiku/vendor/coreutils/current/lib/mkstemp.h haiku/vendor/coreutils/current/lib/openat-priv.h haiku/vendor/coreutils/current/lib/openat-proc.c haiku/vendor/coreutils/current/lib/rand-isaac.c haiku/vendor/coreutils/current/lib/rand-isaac.h haiku/vendor/coreutils/current/lib/randint.c haiku/vendor/coreutils/current/lib/randint.h haiku/vendor/coreutils/current/lib/randperm.c haiku/vendor/coreutils/current/lib/randperm.h haiku/vendor/coreutils/current/lib/randread.c haiku/vendor/coreutils/current/lib/randread.h haiku/vendor/coreutils/current/lib/rename-dest-slash.c haiku/vendor/coreutils/current/lib/same-inode.h haiku/vendor/coreutils/current/lib/savewd.c haiku/vendor/coreutils/current/lib/savewd.h haiku/vendor/coreutils/current/lib/sha256.c haiku/vendor/coreutils/current/lib/sha256.h haiku/vendor/coreutils/current/lib/sha512.c haiku/vendor/coreutils/current/lib/sha512.h haiku/vendor/coreutils/current/lib/snprintf.c haiku/vendor/coreutils/current/lib/snprintf.h haiku/vendor/coreutils/current/lib/socket_.h haiku/vendor/coreutils/current/lib/stat_.h haiku/vendor/coreutils/current/lib/stdint_.h haiku/vendor/coreutils/current/lib/stpcpy.h haiku/vendor/coreutils/current/lib/strpbrk.h haiku/vendor/coreutils/current/lib/tempname.h haiku/vendor/coreutils/current/lib/u64.h haiku/vendor/coreutils/current/lib/uinttostr.c haiku/vendor/coreutils/current/lib/wcwidth.h haiku/vendor/coreutils/current/lib/xmemxfrm.c haiku/vendor/coreutils/current/lib/xmemxfrm.h haiku/vendor/coreutils/current/lib/xstrtold.c haiku/vendor/coreutils/current/man/base64.1 haiku/vendor/coreutils/current/man/base64.x haiku/vendor/coreutils/current/man/sha224sum.1 haiku/vendor/coreutils/current/man/sha224sum.x haiku/vendor/coreutils/current/man/sha256sum.1 haiku/vendor/coreutils/current/man/sha256sum.x haiku/vendor/coreutils/current/man/sha384sum.1 haiku/vendor/coreutils/current/man/sha384sum.x haiku/vendor/coreutils/current/man/sha512sum.1 haiku/vendor/coreutils/current/man/sha512sum.x haiku/vendor/coreutils/current/man/shuf.1 haiku/vendor/coreutils/current/man/shuf.x haiku/vendor/coreutils/current/src/base64.c haiku/vendor/coreutils/current/src/c99-to-c89.diff haiku/vendor/coreutils/current/src/shuf.c Removed: haiku/vendor/coreutils/current/Makefile haiku/vendor/coreutils/current/announce-gen haiku/vendor/coreutils/current/config.h haiku/vendor/coreutils/current/config.hin haiku/vendor/coreutils/current/doc/Makefile haiku/vendor/coreutils/current/doc/doclicense.texi haiku/vendor/coreutils/current/lib/Makefile haiku/vendor/coreutils/current/lib/README haiku/vendor/coreutils/current/lib/strstr.c haiku/vendor/coreutils/current/lib/strstr.h haiku/vendor/coreutils/current/man/Makefile haiku/vendor/coreutils/current/src/Makefile haiku/vendor/coreutils/current/src/checksum.h haiku/vendor/coreutils/current/src/md5.c haiku/vendor/coreutils/current/src/sha1sum.c haiku/vendor/coreutils/current/stamp-h1 Modified: haiku/vendor/coreutils/current/ABOUT-NLS haiku/vendor/coreutils/current/AUTHORS haiku/vendor/coreutils/current/COPYING haiku/vendor/coreutils/current/ChangeLog haiku/vendor/coreutils/current/GNUmakefile haiku/vendor/coreutils/current/INSTALL haiku/vendor/coreutils/current/Makefile.am haiku/vendor/coreutils/current/Makefile.cfg haiku/vendor/coreutils/current/Makefile.in haiku/vendor/coreutils/current/Makefile.maint haiku/vendor/coreutils/current/NEWS haiku/vendor/coreutils/current/README haiku/vendor/coreutils/current/THANKS haiku/vendor/coreutils/current/THANKS-to-translators haiku/vendor/coreutils/current/TODO haiku/vendor/coreutils/current/aclocal.m4 haiku/vendor/coreutils/current/configure haiku/vendor/coreutils/current/configure.ac haiku/vendor/coreutils/current/doc/ChangeLog haiku/vendor/coreutils/current/doc/Makefile.am haiku/vendor/coreutils/current/doc/Makefile.in haiku/vendor/coreutils/current/doc/coreutils.info haiku/vendor/coreutils/current/doc/coreutils.texi haiku/vendor/coreutils/current/doc/getdate.texi haiku/vendor/coreutils/current/doc/perm.texi haiku/vendor/coreutils/current/doc/stamp-vti haiku/vendor/coreutils/current/doc/version.texi haiku/vendor/coreutils/current/lib/ChangeLog haiku/vendor/coreutils/current/lib/Makefile.am haiku/vendor/coreutils/current/lib/Makefile.in haiku/vendor/coreutils/current/lib/TODO haiku/vendor/coreutils/current/lib/__fpending.c haiku/vendor/coreutils/current/lib/__fpending.h haiku/vendor/coreutils/current/lib/acl.c haiku/vendor/coreutils/current/lib/acl.h haiku/vendor/coreutils/current/lib/alloca.c haiku/vendor/coreutils/current/lib/alloca_.h haiku/vendor/coreutils/current/lib/allocsa.c haiku/vendor/coreutils/current/lib/allocsa.h haiku/vendor/coreutils/current/lib/argmatch.c haiku/vendor/coreutils/current/lib/asnprintf.c haiku/vendor/coreutils/current/lib/asprintf.c haiku/vendor/coreutils/current/lib/atexit.c haiku/vendor/coreutils/current/lib/backupfile.c haiku/vendor/coreutils/current/lib/basename.c haiku/vendor/coreutils/current/lib/c-strtod.c haiku/vendor/coreutils/current/lib/calloc.c haiku/vendor/coreutils/current/lib/canon-host.c haiku/vendor/coreutils/current/lib/canonicalize.c haiku/vendor/coreutils/current/lib/canonicalize.h haiku/vendor/coreutils/current/lib/chdir-long.c haiku/vendor/coreutils/current/lib/chown.c haiku/vendor/coreutils/current/lib/cloexec.c haiku/vendor/coreutils/current/lib/closeout.c haiku/vendor/coreutils/current/lib/closeout.h haiku/vendor/coreutils/current/lib/config.charset haiku/vendor/coreutils/current/lib/creat-safer.c haiku/vendor/coreutils/current/lib/cycle-check.c haiku/vendor/coreutils/current/lib/cycle-check.h haiku/vendor/coreutils/current/lib/diacrit.c haiku/vendor/coreutils/current/lib/dirfd.c haiku/vendor/coreutils/current/lib/dirfd.h haiku/vendor/coreutils/current/lib/dirname.c haiku/vendor/coreutils/current/lib/dirname.h haiku/vendor/coreutils/current/lib/dup-safer.c haiku/vendor/coreutils/current/lib/dup2.c haiku/vendor/coreutils/current/lib/error.c haiku/vendor/coreutils/current/lib/error.h haiku/vendor/coreutils/current/lib/euidaccess.c haiku/vendor/coreutils/current/lib/exclude.c haiku/vendor/coreutils/current/lib/exclude.h haiku/vendor/coreutils/current/lib/exit.h haiku/vendor/coreutils/current/lib/exitfail.c haiku/vendor/coreutils/current/lib/fchown-stub.c haiku/vendor/coreutils/current/lib/fd-reopen.c haiku/vendor/coreutils/current/lib/fd-safer.c haiku/vendor/coreutils/current/lib/file-type.c haiku/vendor/coreutils/current/lib/fileblocks.c haiku/vendor/coreutils/current/lib/filemode.c haiku/vendor/coreutils/current/lib/filemode.h haiku/vendor/coreutils/current/lib/filenamecat.c haiku/vendor/coreutils/current/lib/fnmatch.c haiku/vendor/coreutils/current/lib/fnmatch_loop.c haiku/vendor/coreutils/current/lib/fopen-safer.c haiku/vendor/coreutils/current/lib/fprintftime.c haiku/vendor/coreutils/current/lib/fprintftime.h haiku/vendor/coreutils/current/lib/free.c haiku/vendor/coreutils/current/lib/fsusage.c haiku/vendor/coreutils/current/lib/fsusage.h haiku/vendor/coreutils/current/lib/ftruncate.c haiku/vendor/coreutils/current/lib/fts-cycle.c haiku/vendor/coreutils/current/lib/fts.c haiku/vendor/coreutils/current/lib/fts_.h haiku/vendor/coreutils/current/lib/full-write.c haiku/vendor/coreutils/current/lib/gai_strerror.c haiku/vendor/coreutils/current/lib/getaddrinfo.c haiku/vendor/coreutils/current/lib/getaddrinfo.h haiku/vendor/coreutils/current/lib/getcwd.c haiku/vendor/coreutils/current/lib/getdate.c haiku/vendor/coreutils/current/lib/getdate.y haiku/vendor/coreutils/current/lib/getdelim.c haiku/vendor/coreutils/current/lib/getgroups.c haiku/vendor/coreutils/current/lib/gethostname.c haiku/vendor/coreutils/current/lib/gethrxtime.c haiku/vendor/coreutils/current/lib/gethrxtime.h haiku/vendor/coreutils/current/lib/getline.c haiku/vendor/coreutils/current/lib/getloadavg.c haiku/vendor/coreutils/current/lib/getndelim2.c haiku/vendor/coreutils/current/lib/getndelim2.h haiku/vendor/coreutils/current/lib/getopt.c haiku/vendor/coreutils/current/lib/getopt1.c haiku/vendor/coreutils/current/lib/getopt_.h haiku/vendor/coreutils/current/lib/getpagesize.h haiku/vendor/coreutils/current/lib/getpass.c haiku/vendor/coreutils/current/lib/gettext.h haiku/vendor/coreutils/current/lib/gettime.c haiku/vendor/coreutils/current/lib/gettimeofday.c haiku/vendor/coreutils/current/lib/getugroups.c haiku/vendor/coreutils/current/lib/getusershell.c haiku/vendor/coreutils/current/lib/group-member.c haiku/vendor/coreutils/current/lib/hard-locale.c haiku/vendor/coreutils/current/lib/hash-pjw.c haiku/vendor/coreutils/current/lib/hash.c haiku/vendor/coreutils/current/lib/human.c haiku/vendor/coreutils/current/lib/human.h haiku/vendor/coreutils/current/lib/idcache.c haiku/vendor/coreutils/current/lib/intprops.h haiku/vendor/coreutils/current/lib/inttostr.c haiku/vendor/coreutils/current/lib/inttostr.h haiku/vendor/coreutils/current/lib/lchown.c haiku/vendor/coreutils/current/lib/lchown.h haiku/vendor/coreutils/current/lib/linebuffer.c haiku/vendor/coreutils/current/lib/localcharset.c haiku/vendor/coreutils/current/lib/long-options.c haiku/vendor/coreutils/current/lib/lstat.c haiku/vendor/coreutils/current/lib/malloc.c haiku/vendor/coreutils/current/lib/mbchar.c haiku/vendor/coreutils/current/lib/mbchar.h haiku/vendor/coreutils/current/lib/mbswidth.c haiku/vendor/coreutils/current/lib/md5.c haiku/vendor/coreutils/current/lib/md5.h haiku/vendor/coreutils/current/lib/memcasecmp.c haiku/vendor/coreutils/current/lib/memchr.c haiku/vendor/coreutils/current/lib/memcmp.c haiku/vendor/coreutils/current/lib/memcoll.c haiku/vendor/coreutils/current/lib/memcpy.c haiku/vendor/coreutils/current/lib/memmove.c haiku/vendor/coreutils/current/lib/memrchr.c haiku/vendor/coreutils/current/lib/mkdir-p.c haiku/vendor/coreutils/current/lib/mkdir-p.h haiku/vendor/coreutils/current/lib/mkdir.c haiku/vendor/coreutils/current/lib/mkstemp-safer.c haiku/vendor/coreutils/current/lib/mkstemp.c haiku/vendor/coreutils/current/lib/mktime.c haiku/vendor/coreutils/current/lib/modechange.c haiku/vendor/coreutils/current/lib/modechange.h haiku/vendor/coreutils/current/lib/mountlist.c haiku/vendor/coreutils/current/lib/nanosleep.c haiku/vendor/coreutils/current/lib/obstack.c haiku/vendor/coreutils/current/lib/obstack.h haiku/vendor/coreutils/current/lib/open-safer.c haiku/vendor/coreutils/current/lib/openat-die.c haiku/vendor/coreutils/current/lib/openat.c haiku/vendor/coreutils/current/lib/openat.h haiku/vendor/coreutils/current/lib/physmem.c haiku/vendor/coreutils/current/lib/pipe-safer.c haiku/vendor/coreutils/current/lib/posixtm.c haiku/vendor/coreutils/current/lib/posixver.c haiku/vendor/coreutils/current/lib/printf-args.c haiku/vendor/coreutils/current/lib/printf-args.h haiku/vendor/coreutils/current/lib/printf-parse.c haiku/vendor/coreutils/current/lib/putenv.c haiku/vendor/coreutils/current/lib/quote.c haiku/vendor/coreutils/current/lib/quotearg.c haiku/vendor/coreutils/current/lib/quotearg.h haiku/vendor/coreutils/current/lib/raise.c haiku/vendor/coreutils/current/lib/readlink.c haiku/vendor/coreutils/current/lib/readtokens.c haiku/vendor/coreutils/current/lib/readtokens0.c haiku/vendor/coreutils/current/lib/readutmp.c haiku/vendor/coreutils/current/lib/readutmp.h haiku/vendor/coreutils/current/lib/realloc.c haiku/vendor/coreutils/current/lib/regcomp.c haiku/vendor/coreutils/current/lib/regex.c haiku/vendor/coreutils/current/lib/regex.h haiku/vendor/coreutils/current/lib/regex_internal.c haiku/vendor/coreutils/current/lib/regex_internal.h haiku/vendor/coreutils/current/lib/regexec.c haiku/vendor/coreutils/current/lib/rename.c haiku/vendor/coreutils/current/lib/rmdir.c haiku/vendor/coreutils/current/lib/root-dev-ino.c haiku/vendor/coreutils/current/lib/root-dev-ino.h haiku/vendor/coreutils/current/lib/rpmatch.c haiku/vendor/coreutils/current/lib/safe-read.c haiku/vendor/coreutils/current/lib/same.c haiku/vendor/coreutils/current/lib/save-cwd.c haiku/vendor/coreutils/current/lib/savedir.c haiku/vendor/coreutils/current/lib/savedir.h haiku/vendor/coreutils/current/lib/setenv.c haiku/vendor/coreutils/current/lib/settime.c haiku/vendor/coreutils/current/lib/sha1.c haiku/vendor/coreutils/current/lib/sha1.h haiku/vendor/coreutils/current/lib/sig2str.c haiku/vendor/coreutils/current/lib/stat-macros.h haiku/vendor/coreutils/current/lib/stdbool_.h haiku/vendor/coreutils/current/lib/stdio--.h haiku/vendor/coreutils/current/lib/stdio-safer.h haiku/vendor/coreutils/current/lib/stdlib--.h haiku/vendor/coreutils/current/lib/stpcpy.c haiku/vendor/coreutils/current/lib/strcase.h haiku/vendor/coreutils/current/lib/strcasecmp.c haiku/vendor/coreutils/current/lib/strcspn.c haiku/vendor/coreutils/current/lib/strdup.c haiku/vendor/coreutils/current/lib/strftime.c haiku/vendor/coreutils/current/lib/strintcmp.c haiku/vendor/coreutils/current/lib/stripslash.c haiku/vendor/coreutils/current/lib/strncasecmp.c haiku/vendor/coreutils/current/lib/strndup.c haiku/vendor/coreutils/current/lib/strndup.h haiku/vendor/coreutils/current/lib/strnlen.c haiku/vendor/coreutils/current/lib/strnlen1.c haiku/vendor/coreutils/current/lib/strnlen1.h haiku/vendor/coreutils/current/lib/strnumcmp-in.h haiku/vendor/coreutils/current/lib/strnumcmp.c haiku/vendor/coreutils/current/lib/strpbrk.c haiku/vendor/coreutils/current/lib/strtod.c haiku/vendor/coreutils/current/lib/strtoimax.c haiku/vendor/coreutils/current/lib/strtol.c haiku/vendor/coreutils/current/lib/strtoll.c haiku/vendor/coreutils/current/lib/strverscmp.c haiku/vendor/coreutils/current/lib/t-fpending.c haiku/vendor/coreutils/current/lib/tempname.c haiku/vendor/coreutils/current/lib/time_r.c haiku/vendor/coreutils/current/lib/time_r.h haiku/vendor/coreutils/current/lib/unicodeio.c haiku/vendor/coreutils/current/lib/unlinkdir.c haiku/vendor/coreutils/current/lib/unsetenv.c haiku/vendor/coreutils/current/lib/userspec.c haiku/vendor/coreutils/current/lib/utime.c haiku/vendor/coreutils/current/lib/utimecmp.c haiku/vendor/coreutils/current/lib/utimens.c haiku/vendor/coreutils/current/lib/vasnprintf.c haiku/vendor/coreutils/current/lib/vasprintf.c haiku/vendor/coreutils/current/lib/vasprintf.h haiku/vendor/coreutils/current/lib/verify.h haiku/vendor/coreutils/current/lib/version-etc-fsf.c haiku/vendor/coreutils/current/lib/version-etc.c haiku/vendor/coreutils/current/lib/xalloc-die.c haiku/vendor/coreutils/current/lib/xalloc.h haiku/vendor/coreutils/current/lib/xfts.c haiku/vendor/coreutils/current/lib/xgetcwd.c haiku/vendor/coreutils/current/lib/xgethostname.c haiku/vendor/coreutils/current/lib/xmalloc.c haiku/vendor/coreutils/current/lib/xmemcoll.c haiku/vendor/coreutils/current/lib/xnanosleep.c haiku/vendor/coreutils/current/lib/xreadlink.c haiku/vendor/coreutils/current/lib/xstrndup.c haiku/vendor/coreutils/current/lib/xstrtod.c haiku/vendor/coreutils/current/lib/xstrtod.h haiku/vendor/coreutils/current/lib/xstrtoimax.c haiku/vendor/coreutils/current/lib/xstrtol.c haiku/vendor/coreutils/current/lib/xstrtol.h haiku/vendor/coreutils/current/lib/xstrtoumax.c haiku/vendor/coreutils/current/lib/xtime.h haiku/vendor/coreutils/current/lib/yesno.c haiku/vendor/coreutils/current/man/Makefile.am haiku/vendor/coreutils/current/man/Makefile.in haiku/vendor/coreutils/current/man/basename.1 haiku/vendor/coreutils/current/man/basename.x haiku/vendor/coreutils/current/man/cat.1 haiku/vendor/coreutils/current/man/chgrp.1 haiku/vendor/coreutils/current/man/chmod.1 haiku/vendor/coreutils/current/man/chmod.x haiku/vendor/coreutils/current/man/chown.1 haiku/vendor/coreutils/current/man/chown.x haiku/vendor/coreutils/current/man/chroot.1 haiku/vendor/coreutils/current/man/chroot.x haiku/vendor/coreutils/current/man/cksum.1 haiku/vendor/coreutils/current/man/comm.1 haiku/vendor/coreutils/current/man/cp.1 haiku/vendor/coreutils/current/man/csplit.1 haiku/vendor/coreutils/current/man/cut.1 haiku/vendor/coreutils/current/man/date.1 haiku/vendor/coreutils/current/man/dd.1 haiku/vendor/coreutils/current/man/df.1 haiku/vendor/coreutils/current/man/df.x haiku/vendor/coreutils/current/man/dir.1 haiku/vendor/coreutils/current/man/dircolors.1 haiku/vendor/coreutils/current/man/dirname.1 haiku/vendor/coreutils/current/man/dirname.x haiku/vendor/coreutils/current/man/du.1 haiku/vendor/coreutils/current/man/du.x haiku/vendor/coreutils/current/man/echo.1 haiku/vendor/coreutils/current/man/env.1 haiku/vendor/coreutils/current/man/expand.1 haiku/vendor/coreutils/current/man/expr.1 haiku/vendor/coreutils/current/man/factor.1 haiku/vendor/coreutils/current/man/false.1 haiku/vendor/coreutils/current/man/fmt.1 haiku/vendor/coreutils/current/man/fold.1 haiku/vendor/coreutils/current/man/groups.1 haiku/vendor/coreutils/current/man/head.1 haiku/vendor/coreutils/current/man/hostid.1 haiku/vendor/coreutils/current/man/hostname.1 haiku/vendor/coreutils/current/man/id.1 haiku/vendor/coreutils/current/man/install.1 haiku/vendor/coreutils/current/man/join.1 haiku/vendor/coreutils/current/man/kill.1 haiku/vendor/coreutils/current/man/kill.x haiku/vendor/coreutils/current/man/link.1 haiku/vendor/coreutils/current/man/link.x haiku/vendor/coreutils/current/man/ln.1 haiku/vendor/coreutils/current/man/ln.x haiku/vendor/coreutils/current/man/logname.1 haiku/vendor/coreutils/current/man/ls.1 haiku/vendor/coreutils/current/man/md5sum.1 haiku/vendor/coreutils/current/man/mkdir.1 haiku/vendor/coreutils/current/man/mkdir.x haiku/vendor/coreutils/current/man/mkfifo.1 haiku/vendor/coreutils/current/man/mkfifo.x haiku/vendor/coreutils/current/man/mknod.1 haiku/vendor/coreutils/current/man/mknod.x haiku/vendor/coreutils/current/man/mv.1 haiku/vendor/coreutils/current/man/mv.x haiku/vendor/coreutils/current/man/nice.1 haiku/vendor/coreutils/current/man/nice.x haiku/vendor/coreutils/current/man/nl.1 haiku/vendor/coreutils/current/man/nohup.1 haiku/vendor/coreutils/current/man/od.1 haiku/vendor/coreutils/current/man/paste.1 haiku/vendor/coreutils/current/man/pathchk.1 haiku/vendor/coreutils/current/man/pinky.1 haiku/vendor/coreutils/current/man/pr.1 haiku/vendor/coreutils/current/man/printenv.1 haiku/vendor/coreutils/current/man/printf.1 haiku/vendor/coreutils/current/man/ptx.1 haiku/vendor/coreutils/current/man/pwd.1 haiku/vendor/coreutils/current/man/pwd.x haiku/vendor/coreutils/current/man/readlink.1 haiku/vendor/coreutils/current/man/readlink.x haiku/vendor/coreutils/current/man/rm.1 haiku/vendor/coreutils/current/man/rm.x haiku/vendor/coreutils/current/man/rmdir.1 haiku/vendor/coreutils/current/man/rmdir.x haiku/vendor/coreutils/current/man/seq.1 haiku/vendor/coreutils/current/man/sha1sum.1 haiku/vendor/coreutils/current/man/shred.1 haiku/vendor/coreutils/current/man/sleep.1 haiku/vendor/coreutils/current/man/sleep.x haiku/vendor/coreutils/current/man/sort.1 haiku/vendor/coreutils/current/man/split.1 haiku/vendor/coreutils/current/man/stat.1 haiku/vendor/coreutils/current/man/stat.x haiku/vendor/coreutils/current/man/stty.1 haiku/vendor/coreutils/current/man/su.1 haiku/vendor/coreutils/current/man/sum.1 haiku/vendor/coreutils/current/man/sync.1 haiku/vendor/coreutils/current/man/sync.x haiku/vendor/coreutils/current/man/tac.1 haiku/vendor/coreutils/current/man/tail.1 haiku/vendor/coreutils/current/man/tee.1 haiku/vendor/coreutils/current/man/test.1 haiku/vendor/coreutils/current/man/touch.1 haiku/vendor/coreutils/current/man/tr.1 haiku/vendor/coreutils/current/man/true.1 haiku/vendor/coreutils/current/man/tsort.1 haiku/vendor/coreutils/current/man/tty.1 haiku/vendor/coreutils/current/man/uname.1 haiku/vendor/coreutils/current/man/uname.x haiku/vendor/coreutils/current/man/unexpand.1 haiku/vendor/coreutils/current/man/uniq.1 haiku/vendor/coreutils/current/man/unlink.1 haiku/vendor/coreutils/current/man/unlink.x haiku/vendor/coreutils/current/man/uptime.1 haiku/vendor/coreutils/current/man/users.1 haiku/vendor/coreutils/current/man/vdir.1 haiku/vendor/coreutils/current/man/wc.1 haiku/vendor/coreutils/current/man/wc.x haiku/vendor/coreutils/current/man/who.1 haiku/vendor/coreutils/current/man/whoami.1 haiku/vendor/coreutils/current/man/yes.1 haiku/vendor/coreutils/current/src/Makefile.am haiku/vendor/coreutils/current/src/Makefile.in haiku/vendor/coreutils/current/src/basename.c haiku/vendor/coreutils/current/src/cat.c haiku/vendor/coreutils/current/src/chgrp.c haiku/vendor/coreutils/current/src/chmod.c haiku/vendor/coreutils/current/src/chown-core.c haiku/vendor/coreutils/current/src/chown.c haiku/vendor/coreutils/current/src/cksum.c haiku/vendor/coreutils/current/src/copy.c haiku/vendor/coreutils/current/src/copy.h haiku/vendor/coreutils/current/src/cp.c haiku/vendor/coreutils/current/src/csplit.c haiku/vendor/coreutils/current/src/cut.c haiku/vendor/coreutils/current/src/date.c haiku/vendor/coreutils/current/src/dcgen haiku/vendor/coreutils/current/src/dd.c haiku/vendor/coreutils/current/src/df.c haiku/vendor/coreutils/current/src/dircolors.c haiku/vendor/coreutils/current/src/dircolors.h haiku/vendor/coreutils/current/src/dircolors.hin haiku/vendor/coreutils/current/src/dirname.c haiku/vendor/coreutils/current/src/du.c haiku/vendor/coreutils/current/src/echo.c haiku/vendor/coreutils/current/src/expand.c haiku/vendor/coreutils/current/src/expr.c haiku/vendor/coreutils/current/src/extract-magic haiku/vendor/coreutils/current/src/fmt.c haiku/vendor/coreutils/current/src/fold.c haiku/vendor/coreutils/current/src/groups.sh haiku/vendor/coreutils/current/src/head.c haiku/vendor/coreutils/current/src/install.c haiku/vendor/coreutils/current/src/join.c haiku/vendor/coreutils/current/src/kill.c haiku/vendor/coreutils/current/src/link.c haiku/vendor/coreutils/current/src/ln.c haiku/vendor/coreutils/current/src/ls.c haiku/vendor/coreutils/current/src/md5sum.c haiku/vendor/coreutils/current/src/mkdir.c haiku/vendor/coreutils/current/src/mkfifo.c haiku/vendor/coreutils/current/src/mknod.c haiku/vendor/coreutils/current/src/mv.c haiku/vendor/coreutils/current/src/nice.c haiku/vendor/coreutils/current/src/nl.c haiku/vendor/coreutils/current/src/nohup.c haiku/vendor/coreutils/current/src/od.c haiku/vendor/coreutils/current/src/paste.c haiku/vendor/coreutils/current/src/pathchk.c haiku/vendor/coreutils/current/src/pinky.c haiku/vendor/coreutils/current/src/pr.c haiku/vendor/coreutils/current/src/printf.c haiku/vendor/coreutils/current/src/ptx.c haiku/vendor/coreutils/current/src/pwd.c haiku/vendor/coreutils/current/src/readlink.c haiku/vendor/coreutils/current/src/remove.c haiku/vendor/coreutils/current/src/remove.h haiku/vendor/coreutils/current/src/rm.c haiku/vendor/coreutils/current/src/rmdir.c haiku/vendor/coreutils/current/src/seq.c haiku/vendor/coreutils/current/src/setuidgid.c haiku/vendor/coreutils/current/src/shred.c haiku/vendor/coreutils/current/src/sleep.c haiku/vendor/coreutils/current/src/sort.c haiku/vendor/coreutils/current/src/split.c haiku/vendor/coreutils/current/src/stat.c haiku/vendor/coreutils/current/src/stty.c haiku/vendor/coreutils/current/src/su.c haiku/vendor/coreutils/current/src/system.h haiku/vendor/coreutils/current/src/tac-pipe.c haiku/vendor/coreutils/current/src/tac.c haiku/vendor/coreutils/current/src/tail.c haiku/vendor/coreutils/current/src/tee.c haiku/vendor/coreutils/current/src/test.c haiku/vendor/coreutils/current/src/tr.c haiku/vendor/coreutils/current/src/uname.c haiku/vendor/coreutils/current/src/unexpand.c haiku/vendor/coreutils/current/src/uniq.c haiku/vendor/coreutils/current/src/unlink.c haiku/vendor/coreutils/current/src/uptime.c haiku/vendor/coreutils/current/src/wc.c haiku/vendor/coreutils/current/src/wheel-gen.pl haiku/vendor/coreutils/current/src/who.c Log: updating coreutils vendor with version 6.7 (with c99-to-c89.diff patch) Modified: haiku/vendor/coreutils/current/ABOUT-NLS =================================================================== --- haiku/vendor/coreutils/current/ABOUT-NLS 2007-01-08 17:44:32 UTC (rev 19743) +++ haiku/vendor/coreutils/current/ABOUT-NLS 2007-01-08 19:29:59 UTC (rev 19744) @@ -1,10 +1,11 @@ -Notes on the Free Translation Project -************************************* +1 Notes on the Free Translation Project +*************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all -together, so that will gradually become able to speak many languages. -A few packages already provide translations for their messages. +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, @@ -15,15 +16,15 @@ Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and -work at translations should contact the appropriate team. +work on translations can contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. -Quick configuration advice -========================== +1.1 Quick configuration advice +============================== If you want to exploit the full power of internationalization, you should configure it using @@ -45,8 +46,8 @@ you have installed a recent copy of the GNU gettext package with the included `libintl'. -INSTALL Matters -=============== +1.2 INSTALL Matters +=================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such @@ -55,27 +56,27 @@ By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already -provides the GNU `gettext' functions. If not, the GNU `gettext' own -library will be used. This library is wholly contained within this -package, usually in the `intl/' subdirectory, so prior installation of -the GNU `gettext' package is _not_ required. Installers may use -special options at configuration time for changing the default -behaviour. The commands: +provides the GNU `gettext' functions. If not, the included GNU +`gettext' library will be used. This library is wholly contained +within this package, usually in the `intl/' subdirectory, so prior +installation of the GNU `gettext' package is _not_ required. +Installers may use special options at configuration time for changing +the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls -will respectively bypass any pre-existing `gettext' to use the +will, respectively, bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and -will decide to use this. This might be not what is desirable. You -should use the more recent version of the GNU `gettext' library. I.e. -if the file `intl/VERSION' shows that the library which comes with this -package is more recent, you should use +will decide to use this. This might not be desirable. You should use +the more recent version of the GNU `gettext' library. I.e. if the file +`intl/VERSION' shows that the library which comes with this package is +more recent, you should use ./configure --with-included-gettext @@ -86,7 +87,7 @@ emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. - Internationalized packages have usually many `po/LL.po' files, where + Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed @@ -95,8 +96,8 @@ `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. -Using This Package -================== +1.3 Using This Package +====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate @@ -117,8 +118,8 @@ language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of -locales supported by your system for your country by running the command -`locale -a | grep '^LL''. +locales supported by your system for your language by running the +command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you @@ -131,14 +132,21 @@ read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. -Translating Teams -================= +1.4 Translating Teams +===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also @@ -167,519 +175,905 @@ the terminology in use. Proven linguistic skill are praised more than programming skill, here. -Available Packages -================== +1.5 Available Packages +====================== Languages are not equally supported in all packages. The following -matrix shows the current state of internationalization, as of December -2003. The matrix shows, in regard of each package, for which languages +matrix shows the current state of internationalization, as of July +2006. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. - Ready PO files am az be bg ca cs da de el en en_GB eo es - +-------------------------------------------+ - a2ps | [] [] [] [] | - aegis | () | - ant-phone | () | - anubis | | - ap-utils | | - bash | [] [] [] [] | - batchelor | | - bfd | [] [] | - binutils | [] [] | - bison | [] [] [] | - bluez-pin | [] [] | - clisp | | - clisp | [] [] [] | - coreutils | [] [] [] [] | - cpio | [] [] [] | - darkstat | [] () [] | - diffutils | [] [] [] [] [] [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] | - error | [] [] [] [] [] | - fetchmail | [] () [] [] [] [] | - fileutils | [] [] [] | - findutils | [] [] [] [] [] [] [] | - flex | [] [] [] [] | - fslint | | - gas | [] | - gawk | [] [] [] [] | - gbiff | [] | - gcal | [] | - gcc | [] [] | - gettext | [] [] [] [] [] | - gettext-examples | [] [] [] | - gettext-runtime | [] [] [] [] [] | - gettext-tools | [] [] [] | - gimp-print | [] [] [] [] [] | - gliv | | - glunarclock | [] [] | - gnubiff | [] | - gnucash | [] () [] [] | - gnucash-glossary | [] () [] | - gnupg | [] () [] [] [] [] | - gpe-aerial | [] | - gpe-beam | [] [] | - gpe-calendar | [] [] | - gpe-clock | [] [] | - gpe-conf | [] [] | - gpe-contacts | [] [] | - gpe-edit | [] | - gpe-go | [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] | - gpe-sketchbook | [] [] | - gpe-su | [] [] | - gpe-taskmanager | [] [] | - gpe-timesheet | [] | - gpe-today | [] [] | - gpe-todo | [] [] | - gphoto2 | [] [] [] [] | - gprof | [] [] [] | - gpsdrive | () () () | - gramadoir | [] | - grep | [] [] [] [] [] [] | - gretl | [] | - gtick | () | - hello | [] [] [] [] [] [] | - id-utils | [] [] | - indent | [] [] [] [] | - jpilot | [] [] [] | - jtag | | - jwhois | [] | - kbd | [] [] [] [] [] | - latrine | () | - ld | [] [] | - libc | [] [] [] [] [] [] | - libgpewidget | [] [] | - libiconv | [] [] [] [] [] | - lifelines | [] () | - lilypond | [] | - lingoteach | | - lingoteach_lessons | () () | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailutils | [] [] | - make | [] [] [] | - man-db | [] () [] [] () | - minicom | [] [] [] | - mysecretdiary | [] [] [] | - nano | [] () [] [] [] | - nano_1_0 | [] () [] [] [] | - opcodes | [] | - parted | [] [] [] [] [] | - ptx | [] [] [] [] [] | - python | | - radius | [] | - recode | [] [] [] [] [] [] [] | - rpm | [] [] | - screem | | - scrollkeeper | [] [] [] [] [] [] | - sed | [] [] [] [] [] | - sh-utils | [] [] [] | - shared-mime-info | | - sharutils | [] [] [] [] [] [] | - silky | () | - skencil | [] () [] | - sketch | [] () [] | - soundtracker | [] [] [] | - sp | [] | - tar | [] [] [] [] | - texinfo | [] [] [] | - textutils | [] [] [] [] | - tin | () () | - tuxpaint | [] [] [] [] [] [] [] | - util-linux | [] [] [] [] [] | - vorbis-tools | [] [] [] [] | - wastesedge | () | - wdiff | [] [] [] [] | - wget | [] [] [] [] [] [] | - xchat | [] [] [] [] | - xfree86_xkb_xml | [] | - xpad | [] | - +-------------------------------------------+ - am az be bg ca cs da de el en en_GB eo es - 0 0 8 3 37 38 56 73 15 1 5 12 64 + Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo + +----------------------------------------------------+ + GNUnet | [] | + a2ps | [] [] [] [] [] | + aegis | () | + ant-phone | () | + anubis | [] | + ap-utils | | + aspell | [] [] [] [] | + bash | [] [] [] | + batchelor | [] | + bfd | | + bibshelf | [] | + binutils | [] | + bison | [] [] | + bison-runtime | [] | + bluez-pin | [] [] [] [] [] | + cflow | [] | + clisp | [] [] | + console-tools | [] [] | + coreutils | [] [] [] [] | + cpio | | + cpplib | [] [] [] | + cryptonit | [] | + darkstat | [] () [] | + dialog | [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] | + doodle | [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] | + fetchmail | [] [] () [] | + fileutils | [] [] | + findutils | [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | | + gawk | [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] [] [] | + gip | [] | + gliv | [] | + glunarclock | [] | + gmult | [] [] | + gnubiff | () | + gnucash | () () [] | + gnucash-glossary | [] () | + gnuedu | | + gnulib | [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | | + gpe-edit | [] | + gpe-filemanager | | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-package | | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | | + gphoto2 | [] [] [] [] | + gprof | [] [] | + gpsdrive | () () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] | + gretl | | + gsasl | | + gss | | + gst-plugins | [] [] [] [] | + gst-plugins-base | [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] [] | + gtick | [] () | + gtkam | [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] | + id-utils | [] [] | + impost | | + indent | [] [] [] | + iso_3166 | [] [] | + iso_3166_1 | [] [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | [] | + iso_4217 | [] | + iso_639 | [] [] | + jpilot | [] | + jtag | | + jwhois | | + kbd | [] [] [] [] | + keytouch | | + keytouch-editor | | + keytouch-keyboa... | | + latrine | () | + ld | [] | + leafpad | [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] | + libgpg-error | [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] | + libgsasl | | + libiconv | [] [] | + libidn | [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] | + make | [] [] | + man-db | [] () [] [] | + minicom | [] [] [] | + mysecretdiary | [] [] | + nano | [] [] () [] | + nano_1_0 | [] () [] [] | + opcodes | [] | + parted | | + pilot-qof | [] | + psmisc | [] | + pwdutils | | + python | | + qof | | + radius | [] | + recode | [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] [] | + sharutils | [] [] [] [] [] [] | + shishi | | + silky | | + skencil | [] () | + sketch | [] () | + solfege | | + soundtracker | [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] | + texinfo | [] [] [] | + textutils | [] [] [] | + tin | () () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] | + xchat | [] [] [] [] [] | + xkeyboard-config | | + xpad | [] [] | + +----------------------------------------------------+ + af am ar az be bg bs ca cs cy da de el en en_GB eo + 11 0 1 2 8 21 1 42 43 2 62 99 18 1 16 16 - et fa fi fr ga gl he hr hu id is it ja - +----------------------------------------+ - a2ps | [] [] [] () | - aegis | | - ant-phone | | - anubis | [] | - ap-utils | [] | - bash | [] [] | - batchelor | [] | - bfd | [] | - binutils | [] [] | - bison | [] [] [] [] | - bluez-pin | [] [] [] [] [] | - clisp | | - clisp | [] | - coreutils | [] [] [] [] [] [] | - cpio | [] [] [] | - darkstat | () [] [] [] | - diffutils | [] [] [] [] [] [] [] | - e2fsprogs | | - enscript | [] [] | - error | [] [] [] [] | - fetchmail | [] | - fileutils | [] [] [] [] [] [] | - findutils | [] [] [] [] [] [] [] [] [] [] | - flex | [] [] | - fslint | | - gas | [] | - gawk | [] [] [] | - gbiff | | - gcal | [] | - gcc | [] | - gettext | [] [] | - gettext-examples | [] [] | - gettext-runtime | [] [] [] [] | - gettext-tools | [] [] | - gimp-print | [] [] | - gliv | () | - glunarclock | [] [] [] [] | - gnubiff | | - gnucash | () [] | - gnucash-glossary | [] | - gnupg | [] [] [] [] [] [] [] | - gpe-aerial | [] | - gpe-beam | [] | - gpe-calendar | [] [] [] | - gpe-clock | [] | - gpe-conf | [] | - gpe-contacts | [] [] | - gpe-edit | [] [] | - gpe-go | [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] [] | - gpe-sketchbook | [] | - gpe-su | [] | - gpe-taskmanager | [] | - gpe-timesheet | [] [] [] | - gpe-today | [] [] | - gpe-todo | [] [] | - gphoto2 | [] [] [] | - gprof | [] [] | - gpsdrive | () [] () () | - gramadoir | [] | - grep | [] [] [] [] [] [] [] [] [] [] [] | - gretl | [] | - gtick | [] [] | - hello | [] [] [] [] [] [] [] [] [] [] [] [] | - id-utils | [] [] [] [] | - indent | [] [] [] [] [] [] [] [] [] | - jpilot | [] () | - jtag | | - jwhois | [] [] [] [] | - kbd | [] | - latrine | | - ld | [] | - libc | [] [] [] [] [] | - libgpewidget | [] [] [] [] | - libiconv | [] [] [] [] [] [] [] [] [] | - lifelines | () | - lilypond | [] | - lingoteach | [] [] | - lingoteach_lessons | | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailutils | | - make | [] [] [] [] [] | - man-db | () () | - minicom | [] [] [] [] | - mysecretdiary | [] [] | - nano | [] [] [] [] | - nano_1_0 | [] [] [] [] | - opcodes | [] | - parted | [] [] [] | - ptx | [] [] [] [] [] [] [] | - python | | - radius | [] | - recode | [] [] [] [] [] [] | - rpm | | - screem | | - scrollkeeper | [] | - sed | [] [] [] [] [] [] [] [] [] | - sh-utils | [] [] [] [] [] [] [] | - shared-mime-info | [] | - sharutils | [] [] [] [] [] | - silky | [] () | - skencil | [] | - sketch | [] | - soundtracker | [] [] [] [] | - sp | [] () | - tar | [] [] [] [] [] [] [] [] [] | - texinfo | [] [] [] [] | - textutils | [] [] [] [] [] | - tin | [] () | - tuxpaint | [] [] [] [] [] [] [] [] | - util-linux | [] [] [] [] () [] | - vorbis-tools | [] | - wastesedge | () | - wdiff | [] [] [] [] [] [] | - wget | [] [] [] [] [] [] [] | - xchat | [] [] [] | - xfree86_xkb_xml | | - xpad | [] | - +----------------------------------------+ - et fa fi fr ga gl he hr hu id is it ja - 21 1 25 86 24 24 8 10 38 31 1 23 32 + es et eu fa fi fr ga gl gu he hi hr hu id is it + +--------------------------------------------------+ + GNUnet | | + a2ps | [] [] [] () | + aegis | | + ant-phone | [] | + anubis | [] | + ap-utils | [] [] | + aspell | [] [] [] | + bash | [] [] [] | + batchelor | [] [] | + bfd | [] | + bibshelf | [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] [] [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + cflow | | + clisp | [] [] | + console-tools | | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cpplib | [] [] | + cryptonit | [] | + darkstat | [] () [] [] [] | + dialog | [] [] [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] [] [] [] | + doodle | [] [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] [] | + findutils | [] [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | [] [] | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] [] | + gcc | [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] | + gip | [] [] [] | + gliv | () | + glunarclock | [] [] [] | + gmult | [] [] [] | + gnubiff | () () | + gnucash | () () () | + gnucash-glossary | [] [] | + gnuedu | [] | + gnulib | [] [] [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] | + gpe-contacts | [] [] | + gpe-edit | [] [] [] [] | + gpe-filemanager | [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | () () [] () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] [] [] | + gsasl | [] | + gss | [] | + gst-plugins | [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] [] | + gstreamer | [] [] [] | + gtick | [] [] [] [] [] | + gtkam | [] [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] [] | + impost | [] [] | + indent | [] [] [] [] [] [] [] [] [] [] | + iso_3166 | [] [] [] | + iso_3166_1 | [] [] [] [] [] [] [] | + iso_3166_2 | [] | + iso_3166_3 | [] | + iso_4217 | [] [] [] [] | + iso_639 | [] [] [] [] [] | + jpilot | [] [] | + jtag | [] | + jwhois | [] [] [] [] [] | + kbd | [] [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + latrine | [] [] [] | + ld | [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] [] [] | + libgpg-error | | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] | + libgsasl | [] [] | + libiconv | [] | + libidn | [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] [] | + lynx | [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] | + man-db | () | + minicom | [] [] [] [] | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] [] | + nano_1_0 | [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] | + pilot-qof | | + psmisc | [] [] [] | + pwdutils | | + python | | + qof | | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] [] | + shared-mime-info | [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] [] [] | + shishi | | + silky | [] | + skencil | [] [] | + sketch | [] [] | + solfege | [] | + soundtracker | [] [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] | + tar | [] [] [] [] [] [] | + texinfo | [] [] | + textutils | [] [] [] [] [] | + tin | [] () | + tp-robot | [] [] [] [] | + tuxpaint | [] [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux | [] [] [] [] [] [] [] | + vorbis-tools | [] [] | + wastesedge | () | + wdiff | [] [] [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] [] | + xchat | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] | + xpad | [] [] [] | + +--------------------------------------------------+ + es et eu fa fi fr ga gl gu he hi hr hu id is it + 89 21 16 2 41 119 61 14 1 8 1 6 61 30 0 53 - ko lg lt lv ms nb nl nn no pl pt pt_BR ro - +-------------------------------------------+ - a2ps | () [] [] () () [] [] | - aegis | () () | - ant-phone | [] [] | - anubis | [] [] [] [] [] | - ap-utils | [] () [] | - bash | [] [] | - batchelor | [] | - bfd | [] | - binutils | | - bison | [] [] [] [] | - bluez-pin | [] [] [] | - clisp | | - clisp | [] | - coreutils | [] | - cpio | [] [] [] [] [] | - darkstat | [] [] [] [] | - diffutils | [] [] [] [] | - e2fsprogs | [] | - enscript | [] [] [] | - error | [] [] [] | - fetchmail | [] [] () | - fileutils | [] [] | - findutils | [] [] [] [] [] | - flex | [] [] [] [] | - fslint | [] [] | - gas | | - gawk | [] [] [] | - gbiff | [] [] | - gcal | | - gcc | | - gettext | [] [] [] | - gettext-examples | [] [] | - gettext-runtime | [] [] [] | - gettext-tools | [] [] [] | - gimp-print | [] | - gliv | [] [] [] | - glunarclock | [] [] [] | - gnubiff | | - gnucash | [] [] () | - gnucash-glossary | [] [] | - gnupg | [] | - gpe-aerial | [] [] [] | - gpe-beam | [] [] [] | - gpe-calendar | [] [] [] | - gpe-clock | [] [] [] | - gpe-conf | [] [] [] | - gpe-contacts | [] [] [] | - gpe-edit | [] [] [] | - gpe-go | [] [] | - gpe-login | [] [] [] | - gpe-ownerinfo | [] [] [] | - gpe-sketchbook | [] [] [] | - gpe-su | [] [] [] | - gpe-taskmanager | [] [] [] | - gpe-timesheet | [] [] [] | - gpe-today | [] [] [] | - gpe-todo | [] [] [] | - gphoto2 | [] | - gprof | [] [] | - gpsdrive | () () () [] | - gramadoir | [] | - grep | [] [] [] [] | - gretl | | - gtick | [] [] | - hello | [] [] [] [] [] [] [] [] [] [] | - id-utils | [] [] [] | - indent | [] [] [] | - jpilot | () () | - jtag | | - jwhois | [] [] [] [] | - kbd | [] [] [] | - latrine | [] | - ld | | - libc | [] [] [] [] [] | - libgpewidget | [] [] [] | - libiconv | [] [] [] [] | - lifelines | | - lilypond | | - lingoteach | | - lingoteach_lessons | | - lynx | [] [] | - m4 | [] [] [] [] | - mailutils | [] [] | - make | [] [] [] [] | - man-db | [] | - minicom | [] [] [] | - mysecretdiary | [] [] [] | - nano | [] [] [] [] | - nano_1_0 | [] [] [] [] [] | - opcodes | [] [] | - parted | [] [] [] [] | - ptx | [] [] [] [] [] [] [] | - python | | - radius | [] | - recode | [] [] [] | - rpm | [] [] | - screem | | - scrollkeeper | [] [] [] [] | - sed | [] [] [] | - sh-utils | [] | - shared-mime-info | [] | - sharutils | [] | - silky | | - skencil | [] [] | - sketch | [] [] | - soundtracker | | - sp | | - tar | [] [] [] [] [] [] | - texinfo | [] [] [] | - textutils | [] [] | - tin | | - tuxpaint | [] [] [] [] [] [] [] [] [] | - util-linux | [] [] | - vorbis-tools | [] [] | - wastesedge | | - wdiff | [] [] [] [] | - wget | [] [] | - xchat | [] [] | - xfree86_xkb_xml | [] | - xpad | [] [] | - +-------------------------------------------+ - ko lg lt lv ms nb nl nn no pl pt pt_BR ro - 12 0 1 2 12 10 60 4 4 38 25 35 76 + ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no + +--------------------------------------------------+ + GNUnet | | + a2ps | () [] [] () | + aegis | () | + ant-phone | [] | + anubis | [] [] [] | + ap-utils | [] | + aspell | [] [] | + bash | [] | + batchelor | [] [] | + bfd | | + bibshelf | [] | + binutils | | + bison | [] [] [] | + bison-runtime | [] [] [] | + bluez-pin | [] [] [] | + cflow | | + clisp | [] | + console-tools | | + coreutils | [] | + cpio | | + cpplib | [] | + cryptonit | [] | + darkstat | [] [] | + dialog | [] [] | + diffutils | [] [] [] | + doodle | | + e2fsprogs | [] | + enscript | [] | + error | [] | + fetchmail | [] [] | + fileutils | [] [] | + findutils | [] | + flex | [] [] | + fslint | [] [] | + gas | | + gawk | [] [] | + gbiff | [] | + gcal | | + gcc | | + gettext-examples | [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] | + gip | [] [] | + gliv | [] | + glunarclock | [] [] | + gmult | [] [] | + gnubiff | | + gnucash | () () | + gnucash-glossary | [] | + gnuedu | | + gnulib | [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | [] | + gpe-edit | [] [] | + gpe-filemanager | [] | + gpe-go | [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] | + gpe-package | [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] [] | + gpe-timesheet | [] | + gpe-today | [] | + gpe-todo | | + gphoto2 | [] [] | + gprof | | + gpsdrive | () () () | + gramadoir | () | + grep | [] [] [] | + gretl | | + gsasl | [] | + gss | | + gst-plugins | [] | + gst-plugins-base | | + gst-plugins-good | [] | + gstreamer | [] | + gtick | [] | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] | + gutenprint | | + hello | [] [] [] [] [] [] [] [] | + id-utils | [] | + impost | | + indent | [] [] | + iso_3166 | [] | + iso_3166_1 | [] [] | + iso_3166_2 | [] | + iso_3166_3 | [] | + iso_4217 | [] [] [] | + iso_639 | [] [] | + jpilot | () () () | + jtag | | + jwhois | [] | + kbd | [] | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | | [... truncated: 174223 lines follow ...] From korli at mail.berlios.de Mon Jan 8 20:47:38 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 8 Jan 2007 20:47:38 +0100 Subject: [Haiku-commits] r19745 - haiku/vendor/coreutils Message-ID: <200701081947.l08JlcI9002692@sheep.berlios.de> Author: korli Date: 2007-01-08 20:47:38 +0100 (Mon, 08 Jan 2007) New Revision: 19745 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19745&view=rev Added: haiku/vendor/coreutils/6.7/ Log: tagging coreutils-6.7 Copied: haiku/vendor/coreutils/6.7 (from rev 19744, haiku/vendor/coreutils/current) From korli at mail.berlios.de Mon Jan 8 21:57:28 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 8 Jan 2007 21:57:28 +0100 Subject: [Haiku-commits] r19746 - in haiku/trunk/headers/posix: . arpa Message-ID: <200701082057.l08KvSrf010404@sheep.berlios.de> Author: korli Date: 2007-01-08 21:57:28 +0100 (Mon, 08 Jan 2007) New Revision: 19746 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19746&view=rev Modified: haiku/trunk/headers/posix/arpa/inet.h haiku/trunk/headers/posix/netdb.h Log: replaced size_t with socklen_t where appropriate following POSIX Axel, I hope you don't mind :) Modified: haiku/trunk/headers/posix/arpa/inet.h =================================================================== --- haiku/trunk/headers/posix/arpa/inet.h 2007-01-08 19:47:38 UTC (rev 19745) +++ haiku/trunk/headers/posix/arpa/inet.h 2007-01-08 20:57:28 UTC (rev 19746) @@ -97,7 +97,7 @@ int inet_cidr_pton(int, const char *, void *, int *); char *inet_ntoa(struct in_addr); int inet_pton(int, const char *, void *); -const char *inet_ntop(int, const void *, char *, size_t); +const char *inet_ntop(int, const void *, char *, socklen_t); u_int inet_nsap_addr(const char *, u_char *, int); char *inet_nsap_ntoa(int, const u_char *, char *); Modified: haiku/trunk/headers/posix/netdb.h =================================================================== --- haiku/trunk/headers/posix/netdb.h 2007-01-08 19:47:38 UTC (rev 19745) +++ haiku/trunk/headers/posix/netdb.h 2007-01-08 20:57:28 UTC (rev 19746) @@ -259,8 +259,8 @@ void setservent __P((int)); int getaddrinfo __P((const char *, const char *, const struct addrinfo *, struct addrinfo **)); -int getnameinfo __P((const struct sockaddr *, size_t, char *, - size_t, char *, size_t, int)); +int getnameinfo __P((const struct sockaddr *, socklen_t, char *, + socklen_t, char *, socklen_t, int)); void freeaddrinfo __P((struct addrinfo *)); const char *gai_strerror __P((int)); struct hostent *getipnodebyname __P((const char *, int, int, int *)); From axeld at pinc-software.de Mon Jan 8 22:42:52 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Mon, 8 Jan 2007 22:42:52 +0100 (MET) Subject: [Haiku-commits] r19746 - in haiku/trunk/headers/posix: . arpa In-Reply-To: <200701082057.l08KvSrf010404@sheep.berlios.de> Message-ID: <42988381599-BeMail@zon> korli at BerliOS wrote: > Log: > replaced size_t with socklen_t where appropriate following POSIX > Axel, I hope you don't mind :) Not at all, thanks for doing so! :-) Bye, Axel. From korli at mail.berlios.de Mon Jan 8 23:33:13 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 8 Jan 2007 23:33:13 +0100 Subject: [Haiku-commits] r19747 - in haiku/trunk/src/bin/coreutils: . doc lib lib/sys man src Message-ID: <200701082233.l08MXD5l023995@sheep.berlios.de> Author: korli Date: 2007-01-08 23:25:11 +0100 (Mon, 08 Jan 2007) New Revision: 19747 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19747&view=rev Added: haiku/trunk/src/bin/coreutils/ChangeLog-2005 haiku/trunk/src/bin/coreutils/bootstrap haiku/trunk/src/bin/coreutils/bootstrap.conf haiku/trunk/src/bin/coreutils/doc/fdl.texi haiku/trunk/src/bin/coreutils/lib/alloca.h haiku/trunk/src/bin/coreutils/lib/allocsa.valgrind haiku/trunk/src/bin/coreutils/lib/at-func.c haiku/trunk/src/bin/coreutils/lib/base64.c haiku/trunk/src/bin/coreutils/lib/base64.h haiku/trunk/src/bin/coreutils/lib/buffer-lcm.c haiku/trunk/src/bin/coreutils/lib/buffer-lcm.h haiku/trunk/src/bin/coreutils/lib/close-stream.c haiku/trunk/src/bin/coreutils/lib/close-stream.h haiku/trunk/src/bin/coreutils/lib/config.h haiku/trunk/src/bin/coreutils/lib/config.hin haiku/trunk/src/bin/coreutils/lib/configmake.h haiku/trunk/src/bin/coreutils/lib/dirchownmod.c haiku/trunk/src/bin/coreutils/lib/dirchownmod.h haiku/trunk/src/bin/coreutils/lib/euidaccess-stat.c haiku/trunk/src/bin/coreutils/lib/euidaccess-stat.h haiku/trunk/src/bin/coreutils/lib/fchmodat.c haiku/trunk/src/bin/coreutils/lib/fcntl.h haiku/trunk/src/bin/coreutils/lib/fcntl_.h haiku/trunk/src/bin/coreutils/lib/fstatat.c haiku/trunk/src/bin/coreutils/lib/gnulib.mk haiku/trunk/src/bin/coreutils/lib/i-ring.c haiku/trunk/src/bin/coreutils/lib/i-ring.h haiku/trunk/src/bin/coreutils/lib/inet_ntop.c haiku/trunk/src/bin/coreutils/lib/inet_ntop.h haiku/trunk/src/bin/coreutils/lib/inttypes.h haiku/trunk/src/bin/coreutils/lib/inttypes_.h haiku/trunk/src/bin/coreutils/lib/isapipe.c haiku/trunk/src/bin/coreutils/lib/isapipe.h haiku/trunk/src/bin/coreutils/lib/lchmod.h haiku/trunk/src/bin/coreutils/lib/memxfrm.c haiku/trunk/src/bin/coreutils/lib/memxfrm.h haiku/trunk/src/bin/coreutils/lib/mkancesdirs.c haiku/trunk/src/bin/coreutils/lib/mkancesdirs.h haiku/trunk/src/bin/coreutils/lib/mkdirat.c haiku/trunk/src/bin/coreutils/lib/mkstemp.h haiku/trunk/src/bin/coreutils/lib/openat-priv.h haiku/trunk/src/bin/coreutils/lib/openat-proc.c haiku/trunk/src/bin/coreutils/lib/rand-isaac.c haiku/trunk/src/bin/coreutils/lib/rand-isaac.h haiku/trunk/src/bin/coreutils/lib/randint.c haiku/trunk/src/bin/coreutils/lib/randint.h haiku/trunk/src/bin/coreutils/lib/randperm.c haiku/trunk/src/bin/coreutils/lib/randperm.h haiku/trunk/src/bin/coreutils/lib/randread.c haiku/trunk/src/bin/coreutils/lib/randread.h haiku/trunk/src/bin/coreutils/lib/rename-dest-slash.c haiku/trunk/src/bin/coreutils/lib/same-inode.h haiku/trunk/src/bin/coreutils/lib/savewd.c haiku/trunk/src/bin/coreutils/lib/savewd.h haiku/trunk/src/bin/coreutils/lib/sha256.c haiku/trunk/src/bin/coreutils/lib/sha256.h haiku/trunk/src/bin/coreutils/lib/sha512.c haiku/trunk/src/bin/coreutils/lib/sha512.h haiku/trunk/src/bin/coreutils/lib/snprintf.c haiku/trunk/src/bin/coreutils/lib/snprintf.h haiku/trunk/src/bin/coreutils/lib/socket_.h haiku/trunk/src/bin/coreutils/lib/stat_.h haiku/trunk/src/bin/coreutils/lib/stdint.h haiku/trunk/src/bin/coreutils/lib/stdint_.h haiku/trunk/src/bin/coreutils/lib/stpcpy.h haiku/trunk/src/bin/coreutils/lib/strpbrk.h haiku/trunk/src/bin/coreutils/lib/sys/ haiku/trunk/src/bin/coreutils/lib/sys/stat.h haiku/trunk/src/bin/coreutils/lib/tempname.h haiku/trunk/src/bin/coreutils/lib/u64.h haiku/trunk/src/bin/coreutils/lib/uinttostr.c haiku/trunk/src/bin/coreutils/lib/wcwidth.h haiku/trunk/src/bin/coreutils/lib/xmemxfrm.c haiku/trunk/src/bin/coreutils/lib/xmemxfrm.h haiku/trunk/src/bin/coreutils/lib/xstrtold.c haiku/trunk/src/bin/coreutils/man/base64.1 haiku/trunk/src/bin/coreutils/man/base64.x haiku/trunk/src/bin/coreutils/man/sha224sum.1 haiku/trunk/src/bin/coreutils/man/sha224sum.x haiku/trunk/src/bin/coreutils/man/sha256sum.1 haiku/trunk/src/bin/coreutils/man/sha256sum.x haiku/trunk/src/bin/coreutils/man/sha384sum.1 haiku/trunk/src/bin/coreutils/man/sha384sum.x haiku/trunk/src/bin/coreutils/man/sha512sum.1 haiku/trunk/src/bin/coreutils/man/sha512sum.x haiku/trunk/src/bin/coreutils/man/shuf.1 haiku/trunk/src/bin/coreutils/man/shuf.x haiku/trunk/src/bin/coreutils/src/base64.c haiku/trunk/src/bin/coreutils/src/c99-to-c89.diff haiku/trunk/src/bin/coreutils/src/md5sum-md5sum.c haiku/trunk/src/bin/coreutils/src/md5sum-sha1sum.c haiku/trunk/src/bin/coreutils/src/md5sum-sha224sum.c haiku/trunk/src/bin/coreutils/src/md5sum-sha256sum.c haiku/trunk/src/bin/coreutils/src/md5sum-sha384sum.c haiku/trunk/src/bin/coreutils/src/md5sum-sha512sum.c haiku/trunk/src/bin/coreutils/src/shuf.c Removed: haiku/trunk/src/bin/coreutils/Makefile haiku/trunk/src/bin/coreutils/announce-gen haiku/trunk/src/bin/coreutils/config.h haiku/trunk/src/bin/coreutils/config.hin haiku/trunk/src/bin/coreutils/doc/Makefile haiku/trunk/src/bin/coreutils/doc/doclicense.texi haiku/trunk/src/bin/coreutils/lib/Makefile haiku/trunk/src/bin/coreutils/lib/README haiku/trunk/src/bin/coreutils/lib/strstr.c haiku/trunk/src/bin/coreutils/lib/strstr.h haiku/trunk/src/bin/coreutils/man/Makefile haiku/trunk/src/bin/coreutils/src/Makefile haiku/trunk/src/bin/coreutils/src/checksum.h haiku/trunk/src/bin/coreutils/src/localedir.h haiku/trunk/src/bin/coreutils/src/md5.c haiku/trunk/src/bin/coreutils/src/sha1sum.c haiku/trunk/src/bin/coreutils/stamp-h1 Modified: haiku/trunk/src/bin/coreutils/ABOUT-NLS haiku/trunk/src/bin/coreutils/AUTHORS haiku/trunk/src/bin/coreutils/COPYING haiku/trunk/src/bin/coreutils/ChangeLog haiku/trunk/src/bin/coreutils/GNUmakefile haiku/trunk/src/bin/coreutils/INSTALL haiku/trunk/src/bin/coreutils/Makefile.am haiku/trunk/src/bin/coreutils/Makefile.cfg haiku/trunk/src/bin/coreutils/Makefile.in haiku/trunk/src/bin/coreutils/Makefile.maint haiku/trunk/src/bin/coreutils/NEWS haiku/trunk/src/bin/coreutils/README haiku/trunk/src/bin/coreutils/THANKS haiku/trunk/src/bin/coreutils/THANKS-to-translators haiku/trunk/src/bin/coreutils/TODO haiku/trunk/src/bin/coreutils/aclocal.m4 haiku/trunk/src/bin/coreutils/configure haiku/trunk/src/bin/coreutils/configure.ac haiku/trunk/src/bin/coreutils/doc/ChangeLog haiku/trunk/src/bin/coreutils/doc/Makefile.am haiku/trunk/src/bin/coreutils/doc/Makefile.in haiku/trunk/src/bin/coreutils/doc/coreutils.info haiku/trunk/src/bin/coreutils/doc/coreutils.texi haiku/trunk/src/bin/coreutils/doc/getdate.texi haiku/trunk/src/bin/coreutils/doc/perm.texi haiku/trunk/src/bin/coreutils/doc/stamp-vti haiku/trunk/src/bin/coreutils/doc/version.texi haiku/trunk/src/bin/coreutils/lib/ChangeLog haiku/trunk/src/bin/coreutils/lib/Jamfile haiku/trunk/src/bin/coreutils/lib/Makefile.am haiku/trunk/src/bin/coreutils/lib/Makefile.in haiku/trunk/src/bin/coreutils/lib/TODO haiku/trunk/src/bin/coreutils/lib/__fpending.c haiku/trunk/src/bin/coreutils/lib/__fpending.h haiku/trunk/src/bin/coreutils/lib/acl.c haiku/trunk/src/bin/coreutils/lib/acl.h haiku/trunk/src/bin/coreutils/lib/alloca.c haiku/trunk/src/bin/coreutils/lib/alloca_.h haiku/trunk/src/bin/coreutils/lib/allocsa.c haiku/trunk/src/bin/coreutils/lib/allocsa.h haiku/trunk/src/bin/coreutils/lib/argmatch.c haiku/trunk/src/bin/coreutils/lib/asnprintf.c haiku/trunk/src/bin/coreutils/lib/asprintf.c haiku/trunk/src/bin/coreutils/lib/atexit.c haiku/trunk/src/bin/coreutils/lib/backupfile.c haiku/trunk/src/bin/coreutils/lib/basename.c haiku/trunk/src/bin/coreutils/lib/c-strtod.c haiku/trunk/src/bin/coreutils/lib/calloc.c haiku/trunk/src/bin/coreutils/lib/canon-host.c haiku/trunk/src/bin/coreutils/lib/canonicalize.c haiku/trunk/src/bin/coreutils/lib/canonicalize.h haiku/trunk/src/bin/coreutils/lib/chdir-long.c haiku/trunk/src/bin/coreutils/lib/chown.c haiku/trunk/src/bin/coreutils/lib/cloexec.c haiku/trunk/src/bin/coreutils/lib/closeout.c haiku/trunk/src/bin/coreutils/lib/closeout.h haiku/trunk/src/bin/coreutils/lib/config.charset haiku/trunk/src/bin/coreutils/lib/creat-safer.c haiku/trunk/src/bin/coreutils/lib/cycle-check.c haiku/trunk/src/bin/coreutils/lib/cycle-check.h haiku/trunk/src/bin/coreutils/lib/diacrit.c haiku/trunk/src/bin/coreutils/lib/dirfd.c haiku/trunk/src/bin/coreutils/lib/dirfd.h haiku/trunk/src/bin/coreutils/lib/dirname.c haiku/trunk/src/bin/coreutils/lib/dirname.h haiku/trunk/src/bin/coreutils/lib/dup-safer.c haiku/trunk/src/bin/coreutils/lib/dup2.c haiku/trunk/src/bin/coreutils/lib/error.c haiku/trunk/src/bin/coreutils/lib/error.h haiku/trunk/src/bin/coreutils/lib/euidaccess.c haiku/trunk/src/bin/coreutils/lib/exclude.c haiku/trunk/src/bin/coreutils/lib/exclude.h haiku/trunk/src/bin/coreutils/lib/exit.h haiku/trunk/src/bin/coreutils/lib/exitfail.c haiku/trunk/src/bin/coreutils/lib/fchown-stub.c haiku/trunk/src/bin/coreutils/lib/fd-reopen.c haiku/trunk/src/bin/coreutils/lib/fd-safer.c haiku/trunk/src/bin/coreutils/lib/file-type.c haiku/trunk/src/bin/coreutils/lib/fileblocks.c haiku/trunk/src/bin/coreutils/lib/filemode.c haiku/trunk/src/bin/coreutils/lib/filemode.h haiku/trunk/src/bin/coreutils/lib/filenamecat.c haiku/trunk/src/bin/coreutils/lib/fnmatch.c haiku/trunk/src/bin/coreutils/lib/fnmatch.h haiku/trunk/src/bin/coreutils/lib/fnmatch_loop.c haiku/trunk/src/bin/coreutils/lib/fopen-safer.c haiku/trunk/src/bin/coreutils/lib/fprintftime.c haiku/trunk/src/bin/coreutils/lib/fprintftime.h haiku/trunk/src/bin/coreutils/lib/free.c haiku/trunk/src/bin/coreutils/lib/fsusage.c haiku/trunk/src/bin/coreutils/lib/fsusage.h haiku/trunk/src/bin/coreutils/lib/ftruncate.c haiku/trunk/src/bin/coreutils/lib/fts-cycle.c haiku/trunk/src/bin/coreutils/lib/fts.c haiku/trunk/src/bin/coreutils/lib/fts_.h haiku/trunk/src/bin/coreutils/lib/full-write.c haiku/trunk/src/bin/coreutils/lib/gai_strerror.c haiku/trunk/src/bin/coreutils/lib/getaddrinfo.c haiku/trunk/src/bin/coreutils/lib/getaddrinfo.h haiku/trunk/src/bin/coreutils/lib/getcwd.c haiku/trunk/src/bin/coreutils/lib/getdate.c haiku/trunk/src/bin/coreutils/lib/getdate.y haiku/trunk/src/bin/coreutils/lib/getdelim.c haiku/trunk/src/bin/coreutils/lib/getgroups.c haiku/trunk/src/bin/coreutils/lib/gethostname.c haiku/trunk/src/bin/coreutils/lib/gethrxtime.c haiku/trunk/src/bin/coreutils/lib/gethrxtime.h haiku/trunk/src/bin/coreutils/lib/getline.c haiku/trunk/src/bin/coreutils/lib/getloadavg.c haiku/trunk/src/bin/coreutils/lib/getndelim2.c haiku/trunk/src/bin/coreutils/lib/getndelim2.h haiku/trunk/src/bin/coreutils/lib/getopt.c haiku/trunk/src/bin/coreutils/lib/getopt1.c haiku/trunk/src/bin/coreutils/lib/getopt_.h haiku/trunk/src/bin/coreutils/lib/getpagesize.h haiku/trunk/src/bin/coreutils/lib/getpass.c haiku/trunk/src/bin/coreutils/lib/gettext.h haiku/trunk/src/bin/coreutils/lib/gettime.c haiku/trunk/src/bin/coreutils/lib/gettimeofday.c haiku/trunk/src/bin/coreutils/lib/getugroups.c haiku/trunk/src/bin/coreutils/lib/getusershell.c haiku/trunk/src/bin/coreutils/lib/group-member.c haiku/trunk/src/bin/coreutils/lib/hard-locale.c haiku/trunk/src/bin/coreutils/lib/hash-pjw.c haiku/trunk/src/bin/coreutils/lib/hash.c haiku/trunk/src/bin/coreutils/lib/human.c haiku/trunk/src/bin/coreutils/lib/human.h haiku/trunk/src/bin/coreutils/lib/idcache.c haiku/trunk/src/bin/coreutils/lib/intprops.h haiku/trunk/src/bin/coreutils/lib/inttostr.c haiku/trunk/src/bin/coreutils/lib/inttostr.h haiku/trunk/src/bin/coreutils/lib/lchown.c haiku/trunk/src/bin/coreutils/lib/lchown.h haiku/trunk/src/bin/coreutils/lib/linebuffer.c haiku/trunk/src/bin/coreutils/lib/localcharset.c haiku/trunk/src/bin/coreutils/lib/long-options.c haiku/trunk/src/bin/coreutils/lib/lstat.c haiku/trunk/src/bin/coreutils/lib/malloc.c haiku/trunk/src/bin/coreutils/lib/mbchar.c haiku/trunk/src/bin/coreutils/lib/mbchar.h haiku/trunk/src/bin/coreutils/lib/mbswidth.c haiku/trunk/src/bin/coreutils/lib/md5.c haiku/trunk/src/bin/coreutils/lib/md5.h haiku/trunk/src/bin/coreutils/lib/memcasecmp.c haiku/trunk/src/bin/coreutils/lib/memchr.c haiku/trunk/src/bin/coreutils/lib/memcmp.c haiku/trunk/src/bin/coreutils/lib/memcoll.c haiku/trunk/src/bin/coreutils/lib/memcpy.c haiku/trunk/src/bin/coreutils/lib/memmove.c haiku/trunk/src/bin/coreutils/lib/memrchr.c haiku/trunk/src/bin/coreutils/lib/mkdir-p.c haiku/trunk/src/bin/coreutils/lib/mkdir-p.h haiku/trunk/src/bin/coreutils/lib/mkdir.c haiku/trunk/src/bin/coreutils/lib/mkstemp-safer.c haiku/trunk/src/bin/coreutils/lib/mkstemp.c haiku/trunk/src/bin/coreutils/lib/mktime.c haiku/trunk/src/bin/coreutils/lib/modechange.c haiku/trunk/src/bin/coreutils/lib/modechange.h haiku/trunk/src/bin/coreutils/lib/mountlist.c haiku/trunk/src/bin/coreutils/lib/nanosleep.c haiku/trunk/src/bin/coreutils/lib/obstack.c haiku/trunk/src/bin/coreutils/lib/obstack.h haiku/trunk/src/bin/coreutils/lib/open-safer.c haiku/trunk/src/bin/coreutils/lib/openat-die.c haiku/trunk/src/bin/coreutils/lib/openat.c haiku/trunk/src/bin/coreutils/lib/openat.h haiku/trunk/src/bin/coreutils/lib/physmem.c haiku/trunk/src/bin/coreutils/lib/pipe-safer.c haiku/trunk/src/bin/coreutils/lib/posixtm.c haiku/trunk/src/bin/coreutils/lib/posixver.c haiku/trunk/src/bin/coreutils/lib/printf-args.c haiku/trunk/src/bin/coreutils/lib/printf-args.h haiku/trunk/src/bin/coreutils/lib/printf-parse.c haiku/trunk/src/bin/coreutils/lib/putenv.c haiku/trunk/src/bin/coreutils/lib/quote.c haiku/trunk/src/bin/coreutils/lib/quotearg.c haiku/trunk/src/bin/coreutils/lib/quotearg.h haiku/trunk/src/bin/coreutils/lib/raise.c haiku/trunk/src/bin/coreutils/lib/readlink.c haiku/trunk/src/bin/coreutils/lib/readtokens.c haiku/trunk/src/bin/coreutils/lib/readtokens0.c haiku/trunk/src/bin/coreutils/lib/readutmp.c haiku/trunk/src/bin/coreutils/lib/readutmp.h haiku/trunk/src/bin/coreutils/lib/realloc.c haiku/trunk/src/bin/coreutils/lib/regcomp.c haiku/trunk/src/bin/coreutils/lib/regex.c haiku/trunk/src/bin/coreutils/lib/regex.h haiku/trunk/src/bin/coreutils/lib/regex_internal.c haiku/trunk/src/bin/coreutils/lib/regex_internal.h haiku/trunk/src/bin/coreutils/lib/regexec.c haiku/trunk/src/bin/coreutils/lib/rename.c haiku/trunk/src/bin/coreutils/lib/rmdir.c haiku/trunk/src/bin/coreutils/lib/root-dev-ino.c haiku/trunk/src/bin/coreutils/lib/root-dev-ino.h haiku/trunk/src/bin/coreutils/lib/rpmatch.c haiku/trunk/src/bin/coreutils/lib/safe-read.c haiku/trunk/src/bin/coreutils/lib/same.c haiku/trunk/src/bin/coreutils/lib/save-cwd.c haiku/trunk/src/bin/coreutils/lib/savedir.c haiku/trunk/src/bin/coreutils/lib/savedir.h haiku/trunk/src/bin/coreutils/lib/setenv.c haiku/trunk/src/bin/coreutils/lib/settime.c haiku/trunk/src/bin/coreutils/lib/sha1.c haiku/trunk/src/bin/coreutils/lib/sha1.h haiku/trunk/src/bin/coreutils/lib/sig2str.c haiku/trunk/src/bin/coreutils/lib/stat-macros.h haiku/trunk/src/bin/coreutils/lib/stdbool_.h haiku/trunk/src/bin/coreutils/lib/stdio--.h haiku/trunk/src/bin/coreutils/lib/stdio-safer.h haiku/trunk/src/bin/coreutils/lib/stdlib--.h haiku/trunk/src/bin/coreutils/lib/stpcpy.c haiku/trunk/src/bin/coreutils/lib/strcase.h haiku/trunk/src/bin/coreutils/lib/strcasecmp.c haiku/trunk/src/bin/coreutils/lib/strcspn.c haiku/trunk/src/bin/coreutils/lib/strdup.c haiku/trunk/src/bin/coreutils/lib/strftime.c haiku/trunk/src/bin/coreutils/lib/strintcmp.c haiku/trunk/src/bin/coreutils/lib/stripslash.c haiku/trunk/src/bin/coreutils/lib/strncasecmp.c haiku/trunk/src/bin/coreutils/lib/strndup.c haiku/trunk/src/bin/coreutils/lib/strndup.h haiku/trunk/src/bin/coreutils/lib/strnlen.c haiku/trunk/src/bin/coreutils/lib/strnlen1.c haiku/trunk/src/bin/coreutils/lib/strnlen1.h haiku/trunk/src/bin/coreutils/lib/strnumcmp-in.h haiku/trunk/src/bin/coreutils/lib/strnumcmp.c haiku/trunk/src/bin/coreutils/lib/strpbrk.c haiku/trunk/src/bin/coreutils/lib/strtod.c haiku/trunk/src/bin/coreutils/lib/strtoimax.c haiku/trunk/src/bin/coreutils/lib/strtol.c haiku/trunk/src/bin/coreutils/lib/strtoll.c haiku/trunk/src/bin/coreutils/lib/strverscmp.c haiku/trunk/src/bin/coreutils/lib/t-fpending.c haiku/trunk/src/bin/coreutils/lib/tempname.c haiku/trunk/src/bin/coreutils/lib/time_r.c haiku/trunk/src/bin/coreutils/lib/time_r.h haiku/trunk/src/bin/coreutils/lib/unicodeio.c haiku/trunk/src/bin/coreutils/lib/unlinkdir.c haiku/trunk/src/bin/coreutils/lib/unsetenv.c haiku/trunk/src/bin/coreutils/lib/userspec.c haiku/trunk/src/bin/coreutils/lib/utime.c haiku/trunk/src/bin/coreutils/lib/utimecmp.c haiku/trunk/src/bin/coreutils/lib/utimens.c haiku/trunk/src/bin/coreutils/lib/vasnprintf.c haiku/trunk/src/bin/coreutils/lib/vasprintf.c haiku/trunk/src/bin/coreutils/lib/vasprintf.h haiku/trunk/src/bin/coreutils/lib/verify.h haiku/trunk/src/bin/coreutils/lib/version-etc-fsf.c haiku/trunk/src/bin/coreutils/lib/version-etc.c haiku/trunk/src/bin/coreutils/lib/xalloc-die.c haiku/trunk/src/bin/coreutils/lib/xalloc.h haiku/trunk/src/bin/coreutils/lib/xfts.c haiku/trunk/src/bin/coreutils/lib/xgetcwd.c haiku/trunk/src/bin/coreutils/lib/xgethostname.c haiku/trunk/src/bin/coreutils/lib/xmalloc.c haiku/trunk/src/bin/coreutils/lib/xmemcoll.c haiku/trunk/src/bin/coreutils/lib/xnanosleep.c haiku/trunk/src/bin/coreutils/lib/xreadlink.c haiku/trunk/src/bin/coreutils/lib/xstrndup.c haiku/trunk/src/bin/coreutils/lib/xstrtod.c haiku/trunk/src/bin/coreutils/lib/xstrtod.h haiku/trunk/src/bin/coreutils/lib/xstrtoimax.c haiku/trunk/src/bin/coreutils/lib/xstrtol.c haiku/trunk/src/bin/coreutils/lib/xstrtol.h haiku/trunk/src/bin/coreutils/lib/xstrtoumax.c haiku/trunk/src/bin/coreutils/lib/xtime.h haiku/trunk/src/bin/coreutils/lib/yesno.c haiku/trunk/src/bin/coreutils/man/Makefile.am haiku/trunk/src/bin/coreutils/man/Makefile.in haiku/trunk/src/bin/coreutils/man/basename.1 haiku/trunk/src/bin/coreutils/man/basename.x haiku/trunk/src/bin/coreutils/man/cat.1 haiku/trunk/src/bin/coreutils/man/chgrp.1 haiku/trunk/src/bin/coreutils/man/chmod.1 haiku/trunk/src/bin/coreutils/man/chmod.x haiku/trunk/src/bin/coreutils/man/chown.1 haiku/trunk/src/bin/coreutils/man/chown.x haiku/trunk/src/bin/coreutils/man/chroot.1 haiku/trunk/src/bin/coreutils/man/chroot.x haiku/trunk/src/bin/coreutils/man/cksum.1 haiku/trunk/src/bin/coreutils/man/comm.1 haiku/trunk/src/bin/coreutils/man/cp.1 haiku/trunk/src/bin/coreutils/man/csplit.1 haiku/trunk/src/bin/coreutils/man/cut.1 haiku/trunk/src/bin/coreutils/man/date.1 haiku/trunk/src/bin/coreutils/man/dd.1 haiku/trunk/src/bin/coreutils/man/df.1 haiku/trunk/src/bin/coreutils/man/df.x haiku/trunk/src/bin/coreutils/man/dir.1 haiku/trunk/src/bin/coreutils/man/dircolors.1 haiku/trunk/src/bin/coreutils/man/dirname.1 haiku/trunk/src/bin/coreutils/man/dirname.x haiku/trunk/src/bin/coreutils/man/du.1 haiku/trunk/src/bin/coreutils/man/du.x haiku/trunk/src/bin/coreutils/man/echo.1 haiku/trunk/src/bin/coreutils/man/env.1 haiku/trunk/src/bin/coreutils/man/expand.1 haiku/trunk/src/bin/coreutils/man/expr.1 haiku/trunk/src/bin/coreutils/man/factor.1 haiku/trunk/src/bin/coreutils/man/false.1 haiku/trunk/src/bin/coreutils/man/fmt.1 haiku/trunk/src/bin/coreutils/man/fold.1 haiku/trunk/src/bin/coreutils/man/groups.1 haiku/trunk/src/bin/coreutils/man/head.1 haiku/trunk/src/bin/coreutils/man/hostid.1 haiku/trunk/src/bin/coreutils/man/hostname.1 haiku/trunk/src/bin/coreutils/man/id.1 haiku/trunk/src/bin/coreutils/man/install.1 haiku/trunk/src/bin/coreutils/man/join.1 haiku/trunk/src/bin/coreutils/man/kill.1 haiku/trunk/src/bin/coreutils/man/kill.x haiku/trunk/src/bin/coreutils/man/link.1 haiku/trunk/src/bin/coreutils/man/link.x haiku/trunk/src/bin/coreutils/man/ln.1 haiku/trunk/src/bin/coreutils/man/ln.x haiku/trunk/src/bin/coreutils/man/logname.1 haiku/trunk/src/bin/coreutils/man/ls.1 haiku/trunk/src/bin/coreutils/man/md5sum.1 haiku/trunk/src/bin/coreutils/man/mkdir.1 haiku/trunk/src/bin/coreutils/man/mkdir.x haiku/trunk/src/bin/coreutils/man/mkfifo.1 haiku/trunk/src/bin/coreutils/man/mkfifo.x haiku/trunk/src/bin/coreutils/man/mknod.1 haiku/trunk/src/bin/coreutils/man/mknod.x haiku/trunk/src/bin/coreutils/man/mv.1 haiku/trunk/src/bin/coreutils/man/mv.x haiku/trunk/src/bin/coreutils/man/nice.1 haiku/trunk/src/bin/coreutils/man/nice.x haiku/trunk/src/bin/coreutils/man/nl.1 haiku/trunk/src/bin/coreutils/man/nohup.1 haiku/trunk/src/bin/coreutils/man/od.1 haiku/trunk/src/bin/coreutils/man/paste.1 haiku/trunk/src/bin/coreutils/man/pathchk.1 haiku/trunk/src/bin/coreutils/man/pinky.1 haiku/trunk/src/bin/coreutils/man/pr.1 haiku/trunk/src/bin/coreutils/man/printenv.1 haiku/trunk/src/bin/coreutils/man/printf.1 haiku/trunk/src/bin/coreutils/man/ptx.1 haiku/trunk/src/bin/coreutils/man/pwd.1 haiku/trunk/src/bin/coreutils/man/pwd.x haiku/trunk/src/bin/coreutils/man/readlink.1 haiku/trunk/src/bin/coreutils/man/readlink.x haiku/trunk/src/bin/coreutils/man/rm.1 haiku/trunk/src/bin/coreutils/man/rm.x haiku/trunk/src/bin/coreutils/man/rmdir.1 haiku/trunk/src/bin/coreutils/man/rmdir.x haiku/trunk/src/bin/coreutils/man/seq.1 haiku/trunk/src/bin/coreutils/man/sha1sum.1 haiku/trunk/src/bin/coreutils/man/shred.1 haiku/trunk/src/bin/coreutils/man/sleep.1 haiku/trunk/src/bin/coreutils/man/sleep.x haiku/trunk/src/bin/coreutils/man/sort.1 haiku/trunk/src/bin/coreutils/man/split.1 haiku/trunk/src/bin/coreutils/man/stat.1 haiku/trunk/src/bin/coreutils/man/stat.x haiku/trunk/src/bin/coreutils/man/stty.1 haiku/trunk/src/bin/coreutils/man/su.1 haiku/trunk/src/bin/coreutils/man/sum.1 haiku/trunk/src/bin/coreutils/man/sync.1 haiku/trunk/src/bin/coreutils/man/sync.x haiku/trunk/src/bin/coreutils/man/tac.1 haiku/trunk/src/bin/coreutils/man/tail.1 haiku/trunk/src/bin/coreutils/man/tee.1 haiku/trunk/src/bin/coreutils/man/test.1 haiku/trunk/src/bin/coreutils/man/touch.1 haiku/trunk/src/bin/coreutils/man/tr.1 haiku/trunk/src/bin/coreutils/man/true.1 haiku/trunk/src/bin/coreutils/man/tsort.1 haiku/trunk/src/bin/coreutils/man/tty.1 haiku/trunk/src/bin/coreutils/man/uname.1 haiku/trunk/src/bin/coreutils/man/uname.x haiku/trunk/src/bin/coreutils/man/unexpand.1 haiku/trunk/src/bin/coreutils/man/uniq.1 haiku/trunk/src/bin/coreutils/man/unlink.1 haiku/trunk/src/bin/coreutils/man/unlink.x haiku/trunk/src/bin/coreutils/man/uptime.1 haiku/trunk/src/bin/coreutils/man/users.1 haiku/trunk/src/bin/coreutils/man/vdir.1 haiku/trunk/src/bin/coreutils/man/wc.1 haiku/trunk/src/bin/coreutils/man/wc.x haiku/trunk/src/bin/coreutils/man/who.1 haiku/trunk/src/bin/coreutils/man/whoami.1 haiku/trunk/src/bin/coreutils/man/yes.1 haiku/trunk/src/bin/coreutils/src/Jamfile haiku/trunk/src/bin/coreutils/src/Makefile.am haiku/trunk/src/bin/coreutils/src/Makefile.in haiku/trunk/src/bin/coreutils/src/basename.c haiku/trunk/src/bin/coreutils/src/cat.c haiku/trunk/src/bin/coreutils/src/chgrp.c haiku/trunk/src/bin/coreutils/src/chmod.c haiku/trunk/src/bin/coreutils/src/chown-core.c haiku/trunk/src/bin/coreutils/src/chown.c haiku/trunk/src/bin/coreutils/src/cksum.c haiku/trunk/src/bin/coreutils/src/copy.c haiku/trunk/src/bin/coreutils/src/copy.h haiku/trunk/src/bin/coreutils/src/coreutils.rdef haiku/trunk/src/bin/coreutils/src/cp.c haiku/trunk/src/bin/coreutils/src/csplit.c haiku/trunk/src/bin/coreutils/src/cut.c haiku/trunk/src/bin/coreutils/src/date.c haiku/trunk/src/bin/coreutils/src/dcgen haiku/trunk/src/bin/coreutils/src/dd.c haiku/trunk/src/bin/coreutils/src/df.c haiku/trunk/src/bin/coreutils/src/dircolors.c haiku/trunk/src/bin/coreutils/src/dircolors.h haiku/trunk/src/bin/coreutils/src/dircolors.hin haiku/trunk/src/bin/coreutils/src/dirname.c haiku/trunk/src/bin/coreutils/src/du.c haiku/trunk/src/bin/coreutils/src/echo.c haiku/trunk/src/bin/coreutils/src/expand.c haiku/trunk/src/bin/coreutils/src/expr.c haiku/trunk/src/bin/coreutils/src/extract-magic haiku/trunk/src/bin/coreutils/src/fmt.c haiku/trunk/src/bin/coreutils/src/fold.c haiku/trunk/src/bin/coreutils/src/groups.sh haiku/trunk/src/bin/coreutils/src/head.c haiku/trunk/src/bin/coreutils/src/install.c haiku/trunk/src/bin/coreutils/src/join.c haiku/trunk/src/bin/coreutils/src/kill.c haiku/trunk/src/bin/coreutils/src/link.c haiku/trunk/src/bin/coreutils/src/ln.c haiku/trunk/src/bin/coreutils/src/ls.c haiku/trunk/src/bin/coreutils/src/md5sum.c haiku/trunk/src/bin/coreutils/src/mkdir.c haiku/trunk/src/bin/coreutils/src/mkfifo.c haiku/trunk/src/bin/coreutils/src/mknod.c haiku/trunk/src/bin/coreutils/src/mv.c haiku/trunk/src/bin/coreutils/src/nice.c haiku/trunk/src/bin/coreutils/src/nl.c haiku/trunk/src/bin/coreutils/src/nohup.c haiku/trunk/src/bin/coreutils/src/od.c haiku/trunk/src/bin/coreutils/src/paste.c haiku/trunk/src/bin/coreutils/src/pathchk.c haiku/trunk/src/bin/coreutils/src/pinky.c haiku/trunk/src/bin/coreutils/src/pr.c haiku/trunk/src/bin/coreutils/src/printf.c haiku/trunk/src/bin/coreutils/src/ptx.c haiku/trunk/src/bin/coreutils/src/pwd.c haiku/trunk/src/bin/coreutils/src/readlink.c haiku/trunk/src/bin/coreutils/src/remove.c haiku/trunk/src/bin/coreutils/src/remove.h haiku/trunk/src/bin/coreutils/src/rm.c haiku/trunk/src/bin/coreutils/src/rmdir.c haiku/trunk/src/bin/coreutils/src/seq.c haiku/trunk/src/bin/coreutils/src/setuidgid.c haiku/trunk/src/bin/coreutils/src/shred.c haiku/trunk/src/bin/coreutils/src/sleep.c haiku/trunk/src/bin/coreutils/src/sort.c haiku/trunk/src/bin/coreutils/src/split.c haiku/trunk/src/bin/coreutils/src/stat.c haiku/trunk/src/bin/coreutils/src/stty.c haiku/trunk/src/bin/coreutils/src/su.c haiku/trunk/src/bin/coreutils/src/system.h haiku/trunk/src/bin/coreutils/src/tac-pipe.c haiku/trunk/src/bin/coreutils/src/tac.c haiku/trunk/src/bin/coreutils/src/tail.c haiku/trunk/src/bin/coreutils/src/tee.c haiku/trunk/src/bin/coreutils/src/test.c haiku/trunk/src/bin/coreutils/src/tr.c haiku/trunk/src/bin/coreutils/src/uname.c haiku/trunk/src/bin/coreutils/src/unexpand.c haiku/trunk/src/bin/coreutils/src/uniq.c haiku/trunk/src/bin/coreutils/src/unlink.c haiku/trunk/src/bin/coreutils/src/uptime.c haiku/trunk/src/bin/coreutils/src/wc.c haiku/trunk/src/bin/coreutils/src/wheel-gen.pl haiku/trunk/src/bin/coreutils/src/who.c Log: merging coreutils-6.7 into trunk to be smart with our build system, I added some md5sum-*.c files for each checksum type Modified: haiku/trunk/src/bin/coreutils/ABOUT-NLS =================================================================== --- haiku/trunk/src/bin/coreutils/ABOUT-NLS 2007-01-08 20:57:28 UTC (rev 19746) +++ haiku/trunk/src/bin/coreutils/ABOUT-NLS 2007-01-08 22:25:11 UTC (rev 19747) @@ -1,10 +1,11 @@ -Notes on the Free Translation Project -************************************* +1 Notes on the Free Translation Project +*************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all -together, so that will gradually become able to speak many languages. -A few packages already provide translations for their messages. +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, @@ -15,15 +16,15 @@ Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and -work at translations should contact the appropriate team. +work on translations can contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. -Quick configuration advice -========================== +1.1 Quick configuration advice +============================== If you want to exploit the full power of internationalization, you should configure it using @@ -45,8 +46,8 @@ you have installed a recent copy of the GNU gettext package with the included `libintl'. -INSTALL Matters -=============== +1.2 INSTALL Matters +=================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such @@ -55,27 +56,27 @@ By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already -provides the GNU `gettext' functions. If not, the GNU `gettext' own -library will be used. This library is wholly contained within this -package, usually in the `intl/' subdirectory, so prior installation of -the GNU `gettext' package is _not_ required. Installers may use -special options at configuration time for changing the default -behaviour. The commands: +provides the GNU `gettext' functions. If not, the included GNU +`gettext' library will be used. This library is wholly contained +within this package, usually in the `intl/' subdirectory, so prior +installation of the GNU `gettext' package is _not_ required. +Installers may use special options at configuration time for changing +the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls -will respectively bypass any pre-existing `gettext' to use the +will, respectively, bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and -will decide to use this. This might be not what is desirable. You -should use the more recent version of the GNU `gettext' library. I.e. -if the file `intl/VERSION' shows that the library which comes with this -package is more recent, you should use +will decide to use this. This might not be desirable. You should use +the more recent version of the GNU `gettext' library. I.e. if the file +`intl/VERSION' shows that the library which comes with this package is +more recent, you should use ./configure --with-included-gettext @@ -86,7 +87,7 @@ emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. - Internationalized packages have usually many `po/LL.po' files, where + Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed @@ -95,8 +96,8 @@ `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. -Using This Package -================== +1.3 Using This Package +====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate @@ -117,8 +118,8 @@ language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of -locales supported by your system for your country by running the command -`locale -a | grep '^LL''. +locales supported by your system for your language by running the +command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you @@ -131,14 +132,21 @@ read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. + Special advice for Norwegian users: The language code for Norwegian +bokma*l changed from `no' to `nb' recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under `nb' and some older ones under `no', it's recommended +for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and +older translations are used. + In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. -Translating Teams -================= +1.4 Translating Teams +===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also @@ -167,519 +175,905 @@ the terminology in use. Proven linguistic skill are praised more than programming skill, here. -Available Packages -================== +1.5 Available Packages +====================== Languages are not equally supported in all packages. The following -matrix shows the current state of internationalization, as of December -2003. The matrix shows, in regard of each package, for which languages +matrix shows the current state of internationalization, as of July +2006. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. - Ready PO files am az be bg ca cs da de el en en_GB eo es - +-------------------------------------------+ - a2ps | [] [] [] [] | - aegis | () | - ant-phone | () | - anubis | | - ap-utils | | - bash | [] [] [] [] | - batchelor | | - bfd | [] [] | - binutils | [] [] | - bison | [] [] [] | - bluez-pin | [] [] | - clisp | | - clisp | [] [] [] | - coreutils | [] [] [] [] | - cpio | [] [] [] | - darkstat | [] () [] | - diffutils | [] [] [] [] [] [] [] | - e2fsprogs | [] [] | - enscript | [] [] [] [] | - error | [] [] [] [] [] | - fetchmail | [] () [] [] [] [] | - fileutils | [] [] [] | - findutils | [] [] [] [] [] [] [] | - flex | [] [] [] [] | - fslint | | - gas | [] | - gawk | [] [] [] [] | - gbiff | [] | - gcal | [] | - gcc | [] [] | - gettext | [] [] [] [] [] | - gettext-examples | [] [] [] | - gettext-runtime | [] [] [] [] [] | - gettext-tools | [] [] [] | - gimp-print | [] [] [] [] [] | - gliv | | - glunarclock | [] [] | - gnubiff | [] | - gnucash | [] () [] [] | - gnucash-glossary | [] () [] | - gnupg | [] () [] [] [] [] | - gpe-aerial | [] | - gpe-beam | [] [] | - gpe-calendar | [] [] | - gpe-clock | [] [] | - gpe-conf | [] [] | - gpe-contacts | [] [] | - gpe-edit | [] | - gpe-go | [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] | - gpe-sketchbook | [] [] | - gpe-su | [] [] | - gpe-taskmanager | [] [] | - gpe-timesheet | [] | - gpe-today | [] [] | - gpe-todo | [] [] | - gphoto2 | [] [] [] [] | - gprof | [] [] [] | - gpsdrive | () () () | - gramadoir | [] | - grep | [] [] [] [] [] [] | - gretl | [] | - gtick | () | - hello | [] [] [] [] [] [] | - id-utils | [] [] | - indent | [] [] [] [] | - jpilot | [] [] [] | - jtag | | - jwhois | [] | - kbd | [] [] [] [] [] | - latrine | () | - ld | [] [] | - libc | [] [] [] [] [] [] | - libgpewidget | [] [] | - libiconv | [] [] [] [] [] | - lifelines | [] () | - lilypond | [] | - lingoteach | | - lingoteach_lessons | () () | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailutils | [] [] | - make | [] [] [] | - man-db | [] () [] [] () | - minicom | [] [] [] | - mysecretdiary | [] [] [] | - nano | [] () [] [] [] | - nano_1_0 | [] () [] [] [] | - opcodes | [] | - parted | [] [] [] [] [] | - ptx | [] [] [] [] [] | - python | | - radius | [] | - recode | [] [] [] [] [] [] [] | - rpm | [] [] | - screem | | - scrollkeeper | [] [] [] [] [] [] | - sed | [] [] [] [] [] | - sh-utils | [] [] [] | - shared-mime-info | | - sharutils | [] [] [] [] [] [] | - silky | () | - skencil | [] () [] | - sketch | [] () [] | - soundtracker | [] [] [] | - sp | [] | - tar | [] [] [] [] | - texinfo | [] [] [] | - textutils | [] [] [] [] | - tin | () () | - tuxpaint | [] [] [] [] [] [] [] | - util-linux | [] [] [] [] [] | - vorbis-tools | [] [] [] [] | - wastesedge | () | - wdiff | [] [] [] [] | - wget | [] [] [] [] [] [] | - xchat | [] [] [] [] | - xfree86_xkb_xml | [] | - xpad | [] | - +-------------------------------------------+ - am az be bg ca cs da de el en en_GB eo es - 0 0 8 3 37 38 56 73 15 1 5 12 64 + Ready PO files af am ar az be bg bs ca cs cy da de el en en_GB eo + +----------------------------------------------------+ + GNUnet | [] | + a2ps | [] [] [] [] [] | + aegis | () | + ant-phone | () | + anubis | [] | + ap-utils | | + aspell | [] [] [] [] | + bash | [] [] [] | + batchelor | [] | + bfd | | + bibshelf | [] | + binutils | [] | + bison | [] [] | + bison-runtime | [] | + bluez-pin | [] [] [] [] [] | + cflow | [] | + clisp | [] [] | + console-tools | [] [] | + coreutils | [] [] [] [] | + cpio | | + cpplib | [] [] [] | + cryptonit | [] | + darkstat | [] () [] | + dialog | [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] | + doodle | [] | + e2fsprogs | [] [] | + enscript | [] [] [] [] | + error | [] [] [] [] | + fetchmail | [] [] () [] | + fileutils | [] [] | + findutils | [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | | + gawk | [] [] [] | + gbiff | [] | + gcal | [] | + gcc | [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] [] [] | + gip | [] | + gliv | [] | + glunarclock | [] | + gmult | [] [] | + gnubiff | () | + gnucash | () () [] | + gnucash-glossary | [] () | + gnuedu | | + gnulib | [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | [] [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | | + gpe-edit | [] | + gpe-filemanager | | + gpe-go | [] | + gpe-login | [] [] | + gpe-ownerinfo | [] [] | + gpe-package | | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] | + gpe-timesheet | [] | + gpe-today | [] [] | + gpe-todo | | + gphoto2 | [] [] [] [] | + gprof | [] [] | + gpsdrive | () () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] | + gretl | | + gsasl | | + gss | | + gst-plugins | [] [] [] [] | + gst-plugins-base | [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] [] | + gtick | [] () | + gtkam | [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] | + id-utils | [] [] | + impost | | + indent | [] [] [] | + iso_3166 | [] [] | + iso_3166_1 | [] [] [] [] [] | + iso_3166_2 | | + iso_3166_3 | [] | + iso_4217 | [] | + iso_639 | [] [] | + jpilot | [] | + jtag | | + jwhois | | + kbd | [] [] [] [] | + keytouch | | + keytouch-editor | | + keytouch-keyboa... | | + latrine | () | + ld | [] | + leafpad | [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] | + libgpg-error | [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] | + libgsasl | | + libiconv | [] [] | + libidn | [] [] | + lifelines | [] () | + lilypond | [] | + lingoteach | | + lynx | [] [] [] [] | + m4 | [] [] [] [] | + mailutils | [] | + make | [] [] | + man-db | [] () [] [] | + minicom | [] [] [] | + mysecretdiary | [] [] | + nano | [] [] () [] | + nano_1_0 | [] () [] [] | + opcodes | [] | + parted | | + pilot-qof | [] | + psmisc | [] | + pwdutils | | + python | | + qof | | + radius | [] | + recode | [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] [] [] [] [] [] | + sed | [] [] [] | + sh-utils | [] [] | + shared-mime-info | [] [] [] | + sharutils | [] [] [] [] [] [] | + shishi | | + silky | | + skencil | [] () | + sketch | [] () | + solfege | | + soundtracker | [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] [] | + tar | [] | + texinfo | [] [] [] | + textutils | [] [] [] | + tin | () () | + tp-robot | [] | + tuxpaint | [] [] [] [] [] | + unicode-han-tra... | | + unicode-transla... | | + util-linux | [] [] [] [] | + vorbis-tools | [] [] [] [] | + wastesedge | () | + wdiff | [] [] [] [] | + wget | [] [] | + xchat | [] [] [] [] [] | + xkeyboard-config | | + xpad | [] [] | + +----------------------------------------------------+ + af am ar az be bg bs ca cs cy da de el en en_GB eo + 11 0 1 2 8 21 1 42 43 2 62 99 18 1 16 16 - et fa fi fr ga gl he hr hu id is it ja - +----------------------------------------+ - a2ps | [] [] [] () | - aegis | | - ant-phone | | - anubis | [] | - ap-utils | [] | - bash | [] [] | - batchelor | [] | - bfd | [] | - binutils | [] [] | - bison | [] [] [] [] | - bluez-pin | [] [] [] [] [] | - clisp | | - clisp | [] | - coreutils | [] [] [] [] [] [] | - cpio | [] [] [] | - darkstat | () [] [] [] | - diffutils | [] [] [] [] [] [] [] | - e2fsprogs | | - enscript | [] [] | - error | [] [] [] [] | - fetchmail | [] | - fileutils | [] [] [] [] [] [] | - findutils | [] [] [] [] [] [] [] [] [] [] | - flex | [] [] | - fslint | | - gas | [] | - gawk | [] [] [] | - gbiff | | - gcal | [] | - gcc | [] | - gettext | [] [] | - gettext-examples | [] [] | - gettext-runtime | [] [] [] [] | - gettext-tools | [] [] | - gimp-print | [] [] | - gliv | () | - glunarclock | [] [] [] [] | - gnubiff | | - gnucash | () [] | - gnucash-glossary | [] | - gnupg | [] [] [] [] [] [] [] | - gpe-aerial | [] | - gpe-beam | [] | - gpe-calendar | [] [] [] | - gpe-clock | [] | - gpe-conf | [] | - gpe-contacts | [] [] | - gpe-edit | [] [] | - gpe-go | [] | - gpe-login | [] [] | - gpe-ownerinfo | [] [] [] | - gpe-sketchbook | [] | - gpe-su | [] | - gpe-taskmanager | [] | - gpe-timesheet | [] [] [] | - gpe-today | [] [] | - gpe-todo | [] [] | - gphoto2 | [] [] [] | - gprof | [] [] | - gpsdrive | () [] () () | - gramadoir | [] | - grep | [] [] [] [] [] [] [] [] [] [] [] | - gretl | [] | - gtick | [] [] | - hello | [] [] [] [] [] [] [] [] [] [] [] [] | - id-utils | [] [] [] [] | - indent | [] [] [] [] [] [] [] [] [] | - jpilot | [] () | - jtag | | - jwhois | [] [] [] [] | - kbd | [] | - latrine | | - ld | [] | - libc | [] [] [] [] [] | - libgpewidget | [] [] [] [] | - libiconv | [] [] [] [] [] [] [] [] [] | - lifelines | () | - lilypond | [] | - lingoteach | [] [] | - lingoteach_lessons | | - lynx | [] [] [] [] | - m4 | [] [] [] [] | - mailutils | | - make | [] [] [] [] [] | - man-db | () () | - minicom | [] [] [] [] | - mysecretdiary | [] [] | - nano | [] [] [] [] | - nano_1_0 | [] [] [] [] | - opcodes | [] | - parted | [] [] [] | - ptx | [] [] [] [] [] [] [] | - python | | - radius | [] | - recode | [] [] [] [] [] [] | - rpm | | - screem | | - scrollkeeper | [] | - sed | [] [] [] [] [] [] [] [] [] | - sh-utils | [] [] [] [] [] [] [] | - shared-mime-info | [] | - sharutils | [] [] [] [] [] | - silky | [] () | - skencil | [] | - sketch | [] | - soundtracker | [] [] [] [] | - sp | [] () | - tar | [] [] [] [] [] [] [] [] [] | - texinfo | [] [] [] [] | - textutils | [] [] [] [] [] | - tin | [] () | - tuxpaint | [] [] [] [] [] [] [] [] | - util-linux | [] [] [] [] () [] | - vorbis-tools | [] | - wastesedge | () | - wdiff | [] [] [] [] [] [] | - wget | [] [] [] [] [] [] [] | - xchat | [] [] [] | - xfree86_xkb_xml | | - xpad | [] | - +----------------------------------------+ - et fa fi fr ga gl he hr hu id is it ja - 21 1 25 86 24 24 8 10 38 31 1 23 32 + es et eu fa fi fr ga gl gu he hi hr hu id is it + +--------------------------------------------------+ + GNUnet | | + a2ps | [] [] [] () | + aegis | | + ant-phone | [] | + anubis | [] | + ap-utils | [] [] | + aspell | [] [] [] | + bash | [] [] [] | + batchelor | [] [] | + bfd | [] | + bibshelf | [] [] [] | + binutils | [] [] [] | + bison | [] [] [] [] [] [] | + bison-runtime | [] [] [] [] [] | + bluez-pin | [] [] [] [] [] | + cflow | | + clisp | [] [] | + console-tools | | + coreutils | [] [] [] [] [] [] | + cpio | [] [] [] | + cpplib | [] [] | + cryptonit | [] | + darkstat | [] () [] [] [] | + dialog | [] [] [] [] [] [] [] [] | + diffutils | [] [] [] [] [] [] [] [] [] | + doodle | [] [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] | + error | [] [] [] [] [] | + fetchmail | [] | + fileutils | [] [] [] [] [] [] | + findutils | [] [] [] [] | + flex | [] [] [] | + fslint | [] | + gas | [] [] | + gawk | [] [] [] [] | + gbiff | [] | + gcal | [] [] | + gcc | [] | + gettext-examples | [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] | + gimp-print | [] [] | + gip | [] [] [] | + gliv | () | + glunarclock | [] [] [] | + gmult | [] [] [] | + gnubiff | () () | + gnucash | () () () | + gnucash-glossary | [] [] | + gnuedu | [] | + gnulib | [] [] [] [] [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] [] | + gpe-beam | [] [] | + gpe-calendar | [] [] [] [] | + gpe-clock | [] [] [] [] | + gpe-conf | [] | + gpe-contacts | [] [] | + gpe-edit | [] [] [] [] | + gpe-filemanager | [] | + gpe-go | [] [] [] | + gpe-login | [] [] [] | + gpe-ownerinfo | [] [] [] [] [] | + gpe-package | [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] [] [] | + gpe-taskmanager | [] [] [] | + gpe-timesheet | [] [] [] [] | + gpe-today | [] [] [] [] | + gpe-todo | [] | + gphoto2 | [] [] [] [] [] | + gprof | [] [] [] [] | + gpsdrive | () () [] () | + gramadoir | [] [] | + grep | [] [] [] [] [] [] [] [] [] [] [] [] | + gretl | [] [] [] | + gsasl | [] | + gss | [] | + gst-plugins | [] [] [] | + gst-plugins-base | [] [] | + gst-plugins-good | [] [] [] | + gstreamer | [] [] [] | + gtick | [] [] [] [] [] | + gtkam | [] [] [] [] | + gtkorphan | [] [] | + gtkspell | [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] [] [] [] [] [] [] [] [] [] [] | + id-utils | [] [] [] [] [] | + impost | [] [] | + indent | [] [] [] [] [] [] [] [] [] [] | + iso_3166 | [] [] [] | + iso_3166_1 | [] [] [] [] [] [] [] | + iso_3166_2 | [] | + iso_3166_3 | [] | + iso_4217 | [] [] [] [] | + iso_639 | [] [] [] [] [] | + jpilot | [] [] | + jtag | [] | + jwhois | [] [] [] [] [] | + kbd | [] [] | + keytouch | [] | + keytouch-editor | [] | + keytouch-keyboa... | [] | + latrine | [] [] [] | + ld | [] [] | + leafpad | [] [] [] [] [] [] | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgpewidget | [] [] [] [] [] | + libgpg-error | | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] | + libgsasl | [] [] | + libiconv | [] | + libidn | [] [] | + lifelines | () | + lilypond | [] | + lingoteach | [] [] [] | + lynx | [] [] [] | + m4 | [] [] [] [] | + mailutils | [] [] | + make | [] [] [] [] [] [] [] [] | + man-db | () | + minicom | [] [] [] [] | + mysecretdiary | [] [] [] | + nano | [] () [] [] [] [] | + nano_1_0 | [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] | + pilot-qof | | + psmisc | [] [] [] | + pwdutils | | + python | | + qof | | + radius | [] [] | + recode | [] [] [] [] [] [] [] [] | + rpm | [] [] | + screem | | + scrollkeeper | [] [] [] | + sed | [] [] [] [] [] | + sh-utils | [] [] [] [] [] [] [] | + shared-mime-info | [] [] [] [] [] [] | + sharutils | [] [] [] [] [] [] [] [] | + shishi | | + silky | [] | + skencil | [] [] | + sketch | [] [] | + solfege | [] | + soundtracker | [] [] [] | + sp | [] | + stardict | [] | + system-tools-ba... | [] [] [] [] [] [] [] [] | + tar | [] [] [] [] [] [] | + texinfo | [] [] | + textutils | [] [] [] [] [] | + tin | [] () | + tp-robot | [] [] [] [] | + tuxpaint | [] [] | + unicode-han-tra... | | + unicode-transla... | [] [] | + util-linux | [] [] [] [] [] [] [] | + vorbis-tools | [] [] | + wastesedge | () | + wdiff | [] [] [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] [] | + xchat | [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] | + xpad | [] [] [] | + +--------------------------------------------------+ + es et eu fa fi fr ga gl gu he hi hr hu id is it + 89 21 16 2 41 119 61 14 1 8 1 6 61 30 0 53 - ko lg lt lv ms nb nl nn no pl pt pt_BR ro - +-------------------------------------------+ - a2ps | () [] [] () () [] [] | - aegis | () () | - ant-phone | [] [] | - anubis | [] [] [] [] [] | - ap-utils | [] () [] | - bash | [] [] | - batchelor | [] | - bfd | [] | - binutils | | - bison | [] [] [] [] | - bluez-pin | [] [] [] | - clisp | | - clisp | [] | - coreutils | [] | - cpio | [] [] [] [] [] | - darkstat | [] [] [] [] | - diffutils | [] [] [] [] | - e2fsprogs | [] | - enscript | [] [] [] | - error | [] [] [] | - fetchmail | [] [] () | - fileutils | [] [] | - findutils | [] [] [] [] [] | - flex | [] [] [] [] | - fslint | [] [] | - gas | | - gawk | [] [] [] | - gbiff | [] [] | - gcal | | - gcc | | - gettext | [] [] [] | - gettext-examples | [] [] | - gettext-runtime | [] [] [] | - gettext-tools | [] [] [] | - gimp-print | [] | - gliv | [] [] [] | - glunarclock | [] [] [] | - gnubiff | | - gnucash | [] [] () | - gnucash-glossary | [] [] | - gnupg | [] | - gpe-aerial | [] [] [] | - gpe-beam | [] [] [] | - gpe-calendar | [] [] [] | - gpe-clock | [] [] [] | - gpe-conf | [] [] [] | - gpe-contacts | [] [] [] | - gpe-edit | [] [] [] | - gpe-go | [] [] | - gpe-login | [] [] [] | - gpe-ownerinfo | [] [] [] | - gpe-sketchbook | [] [] [] | - gpe-su | [] [] [] | - gpe-taskmanager | [] [] [] | - gpe-timesheet | [] [] [] | - gpe-today | [] [] [] | - gpe-todo | [] [] [] | - gphoto2 | [] | - gprof | [] [] | - gpsdrive | () () () [] | - gramadoir | [] | - grep | [] [] [] [] | - gretl | | - gtick | [] [] | - hello | [] [] [] [] [] [] [] [] [] [] | - id-utils | [] [] [] | - indent | [] [] [] | - jpilot | () () | - jtag | | - jwhois | [] [] [] [] | - kbd | [] [] [] | - latrine | [] | - ld | | - libc | [] [] [] [] [] | - libgpewidget | [] [] [] | - libiconv | [] [] [] [] | - lifelines | | - lilypond | | - lingoteach | | - lingoteach_lessons | | - lynx | [] [] | - m4 | [] [] [] [] | - mailutils | [] [] | - make | [] [] [] [] | - man-db | [] | - minicom | [] [] [] | - mysecretdiary | [] [] [] | - nano | [] [] [] [] | - nano_1_0 | [] [] [] [] [] | - opcodes | [] [] | - parted | [] [] [] [] | - ptx | [] [] [] [] [] [] [] | - python | | - radius | [] | - recode | [] [] [] | - rpm | [] [] | - screem | | - scrollkeeper | [] [] [] [] | - sed | [] [] [] | - sh-utils | [] | - shared-mime-info | [] | - sharutils | [] | - silky | | - skencil | [] [] | - sketch | [] [] | - soundtracker | | - sp | | - tar | [] [] [] [] [] [] | - texinfo | [] [] [] | - textutils | [] [] | - tin | | - tuxpaint | [] [] [] [] [] [] [] [] [] | - util-linux | [] [] | - vorbis-tools | [] [] | - wastesedge | | - wdiff | [] [] [] [] | - wget | [] [] | - xchat | [] [] | - xfree86_xkb_xml | [] | - xpad | [] [] | - +-------------------------------------------+ - ko lg lt lv ms nb nl nn no pl pt pt_BR ro - 12 0 1 2 12 10 60 4 4 38 25 35 76 + ja ko ku ky lg lt lv mk mn ms mt nb ne nl nn no + +--------------------------------------------------+ + GNUnet | | + a2ps | () [] [] () | + aegis | () | + ant-phone | [] | + anubis | [] [] [] | + ap-utils | [] | + aspell | [] [] | + bash | [] | + batchelor | [] [] | + bfd | | + bibshelf | [] | + binutils | | + bison | [] [] [] | + bison-runtime | [] [] [] | + bluez-pin | [] [] [] | + cflow | | + clisp | [] | + console-tools | | + coreutils | [] | + cpio | | + cpplib | [] | + cryptonit | [] | + darkstat | [] [] | + dialog | [] [] | + diffutils | [] [] [] | + doodle | | + e2fsprogs | [] | + enscript | [] | + error | [] | + fetchmail | [] [] | + fileutils | [] [] | + findutils | [] | + flex | [] [] | + fslint | [] [] | + gas | | + gawk | [] [] | + gbiff | [] | + gcal | | + gcc | | + gettext-examples | [] [] | + gettext-runtime | [] [] [] | + gettext-tools | [] [] | + gimp-print | [] [] | + gip | [] [] | + gliv | [] | + glunarclock | [] [] | + gmult | [] [] | + gnubiff | | + gnucash | () () | + gnucash-glossary | [] | + gnuedu | | + gnulib | [] [] [] [] | + gnunet-gtk | | + gnutls | | + gpe-aerial | [] | + gpe-beam | [] | + gpe-calendar | [] | + gpe-clock | [] [] | + gpe-conf | [] [] | + gpe-contacts | [] | + gpe-edit | [] [] | + gpe-filemanager | [] | + gpe-go | [] [] | + gpe-login | [] [] | + gpe-ownerinfo | [] | + gpe-package | [] | + gpe-sketchbook | [] [] | + gpe-su | [] [] | + gpe-taskmanager | [] [] [] | + gpe-timesheet | [] | + gpe-today | [] | + gpe-todo | | + gphoto2 | [] [] | + gprof | | + gpsdrive | () () () | + gramadoir | () | + grep | [] [] [] | + gretl | | + gsasl | [] | + gss | | + gst-plugins | [] | + gst-plugins-base | | + gst-plugins-good | [] | + gstreamer | [] | + gtick | [] | + gtkam | [] | + gtkorphan | [] | + gtkspell | [] [] | + gutenprint | | + hello | [] [] [] [] [] [] [] [] | + id-utils | [] | + impost | | + indent | [] [] | + iso_3166 | [] | + iso_3166_1 | [] [] | + iso_3166_2 | [] | + iso_3166_3 | [] | + iso_4217 | [] [] [] | + iso_639 | [] [] | + jpilot | () () () | + jtag | | + jwhois | [] | + kbd | [] | + keytouch | [] | + keytouch-editor | | + keytouch-keyboa... | | [... truncated: 153484 lines follow ...] From korli at mail.berlios.de Mon Jan 8 23:49:23 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 8 Jan 2007 23:49:23 +0100 Subject: [Haiku-commits] r19748 - in haiku/trunk/src/bin/coreutils/lib: . sys Message-ID: <200701082249.l08MnNHB025543@sheep.berlios.de> Author: korli Date: 2007-01-08 23:49:23 +0100 (Mon, 08 Jan 2007) New Revision: 19748 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19748&view=rev Modified: haiku/trunk/src/bin/coreutils/lib/Jamfile haiku/trunk/src/bin/coreutils/lib/fcntl.h haiku/trunk/src/bin/coreutils/lib/inttypes.h haiku/trunk/src/bin/coreutils/lib/stdint.h haiku/trunk/src/bin/coreutils/lib/sys/stat.h Log: hopefully fix the build Modified: haiku/trunk/src/bin/coreutils/lib/Jamfile =================================================================== --- haiku/trunk/src/bin/coreutils/lib/Jamfile 2007-01-08 22:25:11 UTC (rev 19747) +++ haiku/trunk/src/bin/coreutils/lib/Jamfile 2007-01-08 22:49:23 UTC (rev 19748) @@ -1,4 +1,4 @@ -SubDir HAIKU_TOP src bin coreutils6 lib ; +SubDir HAIKU_TOP src bin coreutils lib ; # filter warnings we don't want here TARGET_WARNING_CCFLAGS = [ FFilter $(TARGET_WARNING_CCFLAGS) Modified: haiku/trunk/src/bin/coreutils/lib/fcntl.h =================================================================== --- haiku/trunk/src/bin/coreutils/lib/fcntl.h 2007-01-08 22:25:11 UTC (rev 19747) +++ haiku/trunk/src/bin/coreutils/lib/fcntl.h 2007-01-08 22:49:23 UTC (rev 19748) @@ -25,7 +25,7 @@ #include #include #include -#include "///boot/home/svnhaiku/trunk/headers/posix/fcntl.h" +#include_next "fcntl.h" #if !defined O_DIRECT && defined O_DIRECTIO /* Tru64 spells it `O_DIRECTIO'. */ Modified: haiku/trunk/src/bin/coreutils/lib/inttypes.h =================================================================== --- haiku/trunk/src/bin/coreutils/lib/inttypes.h 2007-01-08 22:25:11 UTC (rev 19747) +++ haiku/trunk/src/bin/coreutils/lib/inttypes.h 2007-01-08 22:49:23 UTC (rev 19748) @@ -22,7 +22,7 @@ which in turn includes this file. */ #if ! defined INTTYPES_H || defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H # if 1 -# include "///boot/home/svnhaiku/trunk/headers/posix/inttypes.h" +# include_next "inttypes.h" # endif #endif Modified: haiku/trunk/src/bin/coreutils/lib/stdint.h =================================================================== --- haiku/trunk/src/bin/coreutils/lib/stdint.h 2007-01-08 22:25:11 UTC (rev 19747) +++ haiku/trunk/src/bin/coreutils/lib/stdint.h 2007-01-08 22:49:23 UTC (rev 19748) @@ -44,7 +44,7 @@ Include it before , since any "#include " in would reinclude us, skipping our contents because _GL_STDINT_H is defined. */ -# include "///boot/home/svnhaiku/trunk/headers/posix/stdint.h" +# include_next "stdint.h" #endif /* defines some of the stdint.h types as well, on glibc, Modified: haiku/trunk/src/bin/coreutils/lib/sys/stat.h =================================================================== --- haiku/trunk/src/bin/coreutils/lib/sys/stat.h 2007-01-08 22:25:11 UTC (rev 19747) +++ haiku/trunk/src/bin/coreutils/lib/sys/stat.h 2007-01-08 22:49:23 UTC (rev 19748) @@ -24,7 +24,7 @@ /* This file is supposed to be used on platforms where is incomplete. It is intended to provide definitions and prototypes needed by an application. Start with what the system provides. */ -#include "///boot/home/svnhaiku/trunk/headers/posix/sys/stat.h" +#include_next "sys/stat.h" #ifndef S_IFMT # define S_IFMT 0170000 From darkwyrm at mail.berlios.de Tue Jan 9 00:10:08 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 9 Jan 2007 00:10:08 +0100 Subject: [Haiku-commits] r19749 - haiku/trunk/src/apps/resedit Message-ID: <200701082310.l08NA8kC027700@sheep.berlios.de> Author: darkwyrm Date: 2007-01-09 00:10:08 +0100 (Tue, 09 Jan 2007) New Revision: 19749 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19749&view=rev Modified: haiku/trunk/src/apps/resedit/Jamfile Log: Fixed R5 build target. Thanks to Axel for the Jamfile help. :^) Modified: haiku/trunk/src/apps/resedit/Jamfile =================================================================== --- haiku/trunk/src/apps/resedit/Jamfile 2007-01-08 22:49:23 UTC (rev 19748) +++ haiku/trunk/src/apps/resedit/Jamfile 2007-01-08 23:10:08 UTC (rev 19749) @@ -4,8 +4,15 @@ UsePrivateHeaders shared interface ; +if $(TARGET_PLATFORM) = r5 { + +SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits interface ] ; + Application ResEdit : App.cpp + ColumnListView.cpp + ColumnTypes.cpp + ColorTools.cpp PreviewColumn.cpp ResourceData.cpp ResourceRoster.cpp @@ -13,3 +20,17 @@ ResWindow.cpp : be tracker translation ; + +} else { + +Application ResEdit : + App.cpp + PreviewColumn.cpp + ResourceData.cpp + ResourceRoster.cpp + ResView.cpp + ResWindow.cpp + : be tracker translation +; + +} From fekdahl at gmail.com Tue Jan 9 00:17:12 2007 From: fekdahl at gmail.com (Fredrik Ekdahl) Date: Tue, 09 Jan 2007 00:17:12 +0100 Subject: [Haiku-commits] r19748 - in haiku/trunk/src/bin/coreutils/lib: . sys In-Reply-To: <200701082249.l08MnNHB025543@sheep.berlios.de> References: <200701082249.l08MnNHB025543@sheep.berlios.de> Message-ID: <45A2D0F8.6080608@gmail.com> korli at BerliOS skrev: > Author: korli > Date: 2007-01-08 23:49:23 +0100 (Mon, 08 Jan 2007) > New Revision: 19748 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19748&view=rev > > Modified: > haiku/trunk/src/bin/coreutils/lib/Jamfile > haiku/trunk/src/bin/coreutils/lib/fcntl.h > haiku/trunk/src/bin/coreutils/lib/inttypes.h > haiku/trunk/src/bin/coreutils/lib/stdint.h > haiku/trunk/src/bin/coreutils/lib/sys/stat.h > Log: > hopefully fix the build > The build is broken. I hope this is the relevant part of the error message: Cc generated/objects/haiku/x86/release/bin/coreutils/lib/memcasecmp.o In file included from src/bin/coreutils/lib/mbswidth.c:45: src/bin/coreutils/lib/wcwidth.h:63: error: static declaration of 'wcwidth' follows non-static declaration headers/posix/wchar.h:83: error: previous declaration of 'wcwidth' was here /media/data/develop/haiku/trunk/generated/cross-tools/bin/i586-pc-haiku-gcc -O -Wpointer-arith -Wcast-align -nostdinc -Wno-multichar -DHAVE_CONFIG_H -c "src/bin/coreutils/lib/mbswidth.c" -D__HAIKU__ -D__INTEL__ -DARCH_x86 -DHAIKU_TARGET_PLATFORM_HAIKU -iquote src/bin/coreutils/lib -iquote generated/objects/common/bin/coreutils/lib -iquote generated/objects/linux/x86/common/bin/coreutils/lib -iquote generated/objects/haiku/x86/common/bin/coreutils/lib -idirafter src/bin/coreutils/lib -idirafter headers -idirafter headers/posix -idirafter headers/gnu -idirafter headers/glibc -idirafter headers/os -idirafter headers/os/add-ons -idirafter headers/os/add-ons/file_system -idirafter headers/os/add-ons/graphics -idirafter headers/os/add-ons/input_server -idirafter headers/os/add-ons/registrar -idirafter headers/os/add-ons/screen_saver -idirafter headers/os/add-ons/tracker -idirafter headers/os/app -idirafter headers/os/device -idirafter headers/os/drivers -idirafter headers/os/game -idirafter headers/os/interface -idirafter headers/os/kernel -idirafter headers/os/media -idirafter headers/os/mail -idirafter headers/os/midi -idirafter headers/os/midi2 -idirafter headers/os/net -idirafter headers/os/opengl -idirafter headers/os/storage -idirafter headers/os/support -idirafter headers/os/translation -idirafter headers/private/. -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2 -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2/i586-pc-haiku -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2/backward -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2/ext -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/include -o "generated/objects/haiku/x86/release/bin/coreutils/lib/mbswidth.o" ; ...failed Cc generated/objects/haiku/x86/release/bin/coreutils/lib/mbswidth.o ... ...removing generated/objects/haiku/x86/release/bin/coreutils/lib/mbswidth.o ...skipped libfetish.a for lack of libfetish.a(mbswidth.o)... ...skipped basename for lack of libfetish.a... ...skipped haiku.image-copy-files-dummy-beos/bin for lack of basename... ...skipped haiku.image for lack of haiku.image-copy-files... ...failed updating 1 target(s)... ...skipped 4 target(s)... ...updated 546 target(s)... /Fredrik Ekdahl From korli at mail.berlios.de Tue Jan 9 00:28:29 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 9 Jan 2007 00:28:29 +0100 Subject: [Haiku-commits] r19750 - haiku/trunk/src/add-ons/accelerants/matrox Message-ID: <200701082328.l08NSTPr029500@sheep.berlios.de> Author: korli Date: 2007-01-09 00:28:29 +0100 (Tue, 09 Jan 2007) New Revision: 19750 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19750&view=rev Modified: haiku/trunk/src/add-ons/accelerants/matrox/ProposeDisplayMode.c Log: fix a warning Modified: haiku/trunk/src/add-ons/accelerants/matrox/ProposeDisplayMode.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/matrox/ProposeDisplayMode.c 2007-01-08 23:10:08 UTC (rev 19749) +++ haiku/trunk/src/add-ons/accelerants/matrox/ProposeDisplayMode.c 2007-01-08 23:28:29 UTC (rev 19750) @@ -7,6 +7,8 @@ Rudolf Cornelissen 9/2002-5/2006 */ +#include + #define MODULE_BIT 0x00400000 #include "acc_std.h" From darkwyrm at mail.berlios.de Tue Jan 9 00:42:38 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Tue, 9 Jan 2007 00:42:38 +0100 Subject: [Haiku-commits] r19751 - haiku/trunk/src/apps/resedit Message-ID: <200701082342.l08NgcQL024756@sheep.berlios.de> Author: darkwyrm Date: 2007-01-09 00:42:37 +0100 (Tue, 09 Jan 2007) New Revision: 19751 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19751&view=rev Modified: haiku/trunk/src/apps/resedit/Jamfile Log: Jamfile code cleanup, also courtesy of Axel Modified: haiku/trunk/src/apps/resedit/Jamfile =================================================================== --- haiku/trunk/src/apps/resedit/Jamfile 2007-01-08 23:28:29 UTC (rev 19750) +++ haiku/trunk/src/apps/resedit/Jamfile 2007-01-08 23:42:37 UTC (rev 19751) @@ -4,15 +4,17 @@ UsePrivateHeaders shared interface ; -if $(TARGET_PLATFORM) = r5 { +local columnViewSources ; +if $(TARGET_PLATFORM) != haiku { + columnViewSources = ColumnListView.cpp ColumnTypes.cpp ColorTools.cpp ; +} + SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src kits interface ] ; Application ResEdit : + $(columnViewSources) App.cpp - ColumnListView.cpp - ColumnTypes.cpp - ColorTools.cpp PreviewColumn.cpp ResourceData.cpp ResourceRoster.cpp @@ -20,17 +22,3 @@ ResWindow.cpp : be tracker translation ; - -} else { - -Application ResEdit : - App.cpp - PreviewColumn.cpp - ResourceData.cpp - ResourceRoster.cpp - ResView.cpp - ResWindow.cpp - : be tracker translation -; - -} From korli at mail.berlios.de Tue Jan 9 00:55:13 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 9 Jan 2007 00:55:13 +0100 Subject: [Haiku-commits] r19752 - haiku/trunk/src/bin/coreutils/lib Message-ID: <200701082355.l08NtD8o009755@sheep.berlios.de> Author: korli Date: 2007-01-09 00:55:08 +0100 (Tue, 09 Jan 2007) New Revision: 19752 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19752&view=rev Modified: haiku/trunk/src/bin/coreutils/lib/config.h Log: should fix the gcc4 build Modified: haiku/trunk/src/bin/coreutils/lib/config.h =================================================================== --- haiku/trunk/src/bin/coreutils/lib/config.h 2007-01-08 23:42:37 UTC (rev 19751) +++ haiku/trunk/src/bin/coreutils/lib/config.h 2007-01-08 23:55:08 UTC (rev 19752) @@ -1365,7 +1365,7 @@ #define HAVE_WCTYPE_H 1 /* Define to 1 if you have the `wcwidth' function. */ -/* #undef HAVE_WCWIDTH */ +#define HAVE_WCWIDTH 1 /* Define to 1 if you have the header file. */ /* #undef HAVE_WINSOCK2_H */ From fekdahl at gmail.com Tue Jan 9 01:08:42 2007 From: fekdahl at gmail.com (Fredrik Ekdahl) Date: Tue, 09 Jan 2007 01:08:42 +0100 Subject: [Haiku-commits] r19752 - haiku/trunk/src/bin/coreutils/lib In-Reply-To: <200701082355.l08NtD8o009755@sheep.berlios.de> References: <200701082355.l08NtD8o009755@sheep.berlios.de> Message-ID: <45A2DD0A.4090609@gmail.com> korli at BerliOS skrev: > Author: korli > Date: 2007-01-09 00:55:08 +0100 (Tue, 09 Jan 2007) > New Revision: 19752 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19752&view=rev > > Modified: > haiku/trunk/src/bin/coreutils/lib/config.h > Log: > should fix the gcc4 build > Thanks! Compiles without problems now. /Fredrik Ekdahl From laplace at mail.berlios.de Tue Jan 9 22:29:03 2007 From: laplace at mail.berlios.de (laplace at BerliOS) Date: Tue, 9 Jan 2007 22:29:03 +0100 Subject: [Haiku-commits] r19753 - haiku/trunk/src/add-ons/accelerants/nvidia Message-ID: <200701092129.l09LT3Di026129@sheep.berlios.de> Author: laplace Date: 2007-01-09 22:29:02 +0100 (Tue, 09 Jan 2007) New Revision: 19753 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19753&view=rev Modified: haiku/trunk/src/add-ons/accelerants/nvidia/ProposeDisplayMode.c Log: Changed display mode settings of resolution 1920x1200. The reduced pixel clock is required by some monitors to display a sharp image. The settings are provided by Hartmut Reh, who has testet them on various hardware configurations. Thanks a lot! E.g. see http://www.jwdt.com/~paysan/dell2405fpw.html. Modified: haiku/trunk/src/add-ons/accelerants/nvidia/ProposeDisplayMode.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/nvidia/ProposeDisplayMode.c 2007-01-08 23:55:08 UTC (rev 19752) +++ haiku/trunk/src/add-ons/accelerants/nvidia/ProposeDisplayMode.c 2007-01-09 21:29:02 UTC (rev 19753) @@ -86,7 +86,7 @@ /* 16:10 panel mode; 1.764M pixels */ { { 147100, 1680, 1784, 1968, 2256, 1050, 1051, 1054, 1087, T_POSITIVE_SYNC}, B_CMAP8, 1680, 1050, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1680X1050) */ /* 16:10 panel mode; 2.304M pixels */ -{ { 193200, 1920, 2048, 2256, 2592, 1200, 1201, 1204, 1242, T_POSITIVE_SYNC}, B_CMAP8, 1920, 1200, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1920X1200) */ +{ { 154000, 1920, 1968, 2000, 2080, 1200, 1203, 1209, 1235, T_POSITIVE_SYNC}, B_CMAP8, 1920, 1200, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1920X1200) */ /* 16:9 panel mode; 1280x720 */ { { 74520, 1280, 1368, 1424, 1656, 720, 724, 730, 750, T_POSITIVE_SYNC}, B_CMAP8, 1280, 720, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X720) */ }; From korli at mail.berlios.de Tue Jan 9 23:35:51 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 9 Jan 2007 23:35:51 +0100 Subject: [Haiku-commits] r19754 - haiku/trunk/src/data/etc/timezones Message-ID: <200701092235.l09MZpn0004830@sheep.berlios.de> Author: korli Date: 2007-01-09 23:35:49 +0100 (Tue, 09 Jan 2007) New Revision: 19754 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19754&view=rev Modified: haiku/trunk/src/data/etc/timezones/africa haiku/trunk/src/data/etc/timezones/antarctica haiku/trunk/src/data/etc/timezones/asia haiku/trunk/src/data/etc/timezones/australasia haiku/trunk/src/data/etc/timezones/backward haiku/trunk/src/data/etc/timezones/europe haiku/trunk/src/data/etc/timezones/iso3166.tab haiku/trunk/src/data/etc/timezones/northamerica haiku/trunk/src/data/etc/timezones/southamerica haiku/trunk/src/data/etc/timezones/yearistype.sh haiku/trunk/src/data/etc/timezones/zone.tab Log: update from tzdata2007a.tar.gz Modified: haiku/trunk/src/data/etc/timezones/africa =================================================================== --- haiku/trunk/src/data/etc/timezones/africa 2007-01-09 21:29:02 UTC (rev 19753) +++ haiku/trunk/src/data/etc/timezones/africa 2007-01-09 22:35:49 UTC (rev 19754) @@ -1,4 +1,4 @@ -# @(#)africa 8.3 +# @(#)africa 8.7 #
 
 # This data is by no means authoritative; if you think you know better,
@@ -211,7 +211,14 @@
 # IATA (after 1990) says transitions are at 0:00.
 # Go with IATA starting in 1995, except correct 1995 entry from 09-30 to 09-29.
 Rule	Egypt	1995	max	-	Apr	lastFri	 0:00s	1:00	S
-Rule	Egypt	1995	max	-	Sep	lastThu	23:00s	0	-
+Rule	Egypt	1995	2005	-	Sep	lastThu	23:00s	0	-
+# From Steffen Thorsen (2006-09-19):
+# The Egyptian Gazette, issue 41,090 (2006-09-18), page 1, reports:
+# Egypt will turn back clocks by one hour at the midnight of Thursday
+# after observing the daylight saving time since May.
+# http://news.gom.com.eg/gazette/pdf/2006/09/18/01.pdf
+Rule	Egypt	2006	only	-	Sep	21	23:00s	0	-
+Rule	Egypt	2007	max	-	Sep	lastThu	23:00s	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Africa/Cairo	2:05:00 -	LMT	1900 Oct
@@ -225,8 +232,8 @@
 
 # Eritrea
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone	Africa/Asmera	2:35:32 -	LMT	1870
-			2:35:32	-	AMT	1890	      # Asmera Mean Time
+Zone	Africa/Asmara	2:35:32 -	LMT	1870
+			2:35:32	-	AMT	1890	      # Asmara Mean Time
 			2:35:20	-	ADMT	1936 May 5    # Adis Dera MT
 			3:00	-	EAT
 

Modified: haiku/trunk/src/data/etc/timezones/antarctica
===================================================================
--- haiku/trunk/src/data/etc/timezones/antarctica	2007-01-09 21:29:02 UTC (rev 19753)
+++ haiku/trunk/src/data/etc/timezones/antarctica	2007-01-09 22:35:49 UTC (rev 19754)
@@ -1,4 +1,4 @@
-# @(#)antarctica	8.2
+# @(#)antarctica	8.3
 # 
 
 # From Paul Eggert (1999-11-15):
@@ -33,19 +33,27 @@
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	ArgAQ	1964	1966	-	Mar	 1	0:00	0	-
 Rule	ArgAQ	1964	1966	-	Oct	15	0:00	1:00	S
-Rule	ArgAQ	1967	only	-	Apr	 1	0:00	0	-
+Rule	ArgAQ	1967	only	-	Apr	 2	0:00	0	-
 Rule	ArgAQ	1967	1968	-	Oct	Sun>=1	0:00	1:00	S
 Rule	ArgAQ	1968	1969	-	Apr	Sun>=1	0:00	0	-
 Rule	ArgAQ	1974	only	-	Jan	23	0:00	1:00	S
 Rule	ArgAQ	1974	only	-	May	 1	0:00	0	-
-Rule	ArgAQ	1974	1976	-	Oct	Sun>=1	0:00	1:00	S
-Rule	ArgAQ	1975	1977	-	Apr	Sun>=1	0:00	0	-
-Rule	ChileAQ	1966	1997	-	Oct	Sun>=9	0:00	1:00	S
-Rule	ChileAQ	1967	1998	-	Mar	Sun>=9	0:00	0	-
-Rule	ChileAQ	1998	only	-	Sep	27	0:00	1:00	S
-Rule	ChileAQ	1999	only	-	Apr	 4	0:00	0	-
-Rule	ChileAQ	1999	max	-	Oct	Sun>=9	0:00	1:00	S
-Rule	ChileAQ	2000	max	-	Mar	Sun>=9	0:00	0	-
+Rule	ChileAQ	1972	1986	-	Mar	Sun>=9	3:00u	0	-
+Rule	ChileAQ	1974	1987	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	ChileAQ	1987	only	-	Apr	12	3:00u	0	-
+Rule	ChileAQ	1988	1989	-	Mar	Sun>=9	3:00u	0	-
+Rule	ChileAQ	1988	only	-	Oct	Sun>=1	4:00u	1:00	S
+Rule	ChileAQ	1989	only	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	ChileAQ	1990	only	-	Mar	18	3:00u	0	-
+Rule	ChileAQ	1990	only	-	Sep	16	4:00u	1:00	S
+Rule	ChileAQ	1991	1996	-	Mar	Sun>=9	3:00u	0	-
+Rule	ChileAQ	1991	1997	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	ChileAQ	1997	only	-	Mar	30	3:00u	0	-
+Rule	ChileAQ	1998	only	-	Mar	Sun>=9	3:00u	0	-
+Rule	ChileAQ	1998	only	-	Sep	27	4:00u	1:00	S
+Rule	ChileAQ	1999	only	-	Apr	 4	3:00u	0	-
+Rule	ChileAQ	1999	max	-	Oct	Sun>=9	4:00u	1:00	S
+Rule	ChileAQ	2000	max	-	Mar	Sun>=9	3:00u	0	-
 
 
 # Argentina - year-round bases

Modified: haiku/trunk/src/data/etc/timezones/asia
===================================================================
--- haiku/trunk/src/data/etc/timezones/asia	2007-01-09 21:29:02 UTC (rev 19753)
+++ haiku/trunk/src/data/etc/timezones/asia	2007-01-09 22:35:49 UTC (rev 19754)
@@ -1,4 +1,4 @@
-# @(#)asia	8.3
+# @(#)asia	8.8
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -212,14 +212,27 @@
 Rule	PRC	1986	only	-	May	 4	0:00	1:00	D
 Rule	PRC	1986	1991	-	Sep	Sun>=11	0:00	0	S
 Rule	PRC	1987	1991	-	Apr	Sun>=10	0:00	1:00	D
-#
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-#
+
 # From Anthony Fok (2001-12-20):
 # BTW, I did some research on-line and found some info regarding these five
 # historic timezones from some Taiwan websites.  And yes, there are official
-# Chinese names for these locales (before 1949):
+# Chinese names for these locales (before 1949).
+# 
+# From Jesper Norgaard Welen (2006-07-14):
+# I have investigated the timezones around 1970 on the
+# http://www.astro.com/atlas site [with provinces and county
+# boundaries summarized below]....  A few other exceptions were two
+# counties on the Sichuan side of the Xizang-Sichuan border,
+# counties Dege and Baiyu which lies on the Sichuan side and are
+# therefore supposed to be GMT+7, Xizang region being GMT+6, but Dege
+# county is GMT+8 according to astro.com while Baiyu county is GMT+6
+# (could be true), for the moment I am assuming that those two
+# counties are mistakes in the astro.com data.
+
+
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 # Changbai Time ("Long-white Time", Long-white = Heilongjiang area)
+# Heilongjiang (except Mohe county), Jilin
 Zone	Asia/Harbin	8:26:44	-	LMT	1928 # or Haerbin
 			8:30	-	CHAT	1932 Mar # Changbai Time
 			8:00	-	CST	1940
@@ -227,18 +240,35 @@
 			8:30	-	CHAT	1980 May
 			8:00	PRC	C%sT
 # Zhongyuan Time ("Central plain Time")
+# most of China
 Zone	Asia/Shanghai	8:05:52	-	LMT	1928
 			8:00	Shang	C%sT	1949
 			8:00	PRC	C%sT
 # Long-shu Time (probably due to Long and Shu being two names of that area)
+# Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
+# most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
+# counties Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing,
+# Yangchun, Yangjiang, Yu'nan, and Yunfu.
 Zone	Asia/Chongqing	7:06:20	-	LMT	1928 # or Chungking
 			7:00	-	LONT	1980 May # Long-shu Time
 			8:00	PRC	C%sT
 # Xin-zang Time ("Xinjiang-Tibet Time")
+# The Gansu counties Aksay, Anxi, Dunhuang, Subei; west Qinghai;
+# the Guangdong counties  Xuwen, Haikang, Suixi, Lianjiang,
+# Zhanjiang, Wuchuan, Huazhou, Gaozhou, Maoming, Dianbai, and Xinyi;
+# east Tibet, including Lhasa, Chamdo, Shigaise, Jimsar, Shawan and Hutubi;
+# east Xinjiang, including Urumqi, Turpan, Karamay, Korla, Minfeng, Jinghe,
+# Wusu, Qiemo, Xinyan, Wulanwusu, Jinghe, Yumin, Tacheng, Tuoli, Emin,
+# Shihezi, Changji, Yanqi, Heshuo, Tuokexun, Tulufan, Shanshan, Hami,
+# Fukang, Kuitun, Kumukuli, Miquan, Qitai, and Turfan.
 Zone	Asia/Urumqi	5:50:20	-	LMT	1928 # or Urumchi
 			6:00	-	URUT	1980 May # Urumqi Time
 			8:00	PRC	C%sT
 # Kunlun Time
+# West Tibet, including Pulan, Aheqi, Shufu, Shule;
+# West Xinjiang, including Aksu, Atushi, Yining, Hetian, Cele, Luopu, Nileke,
+# Zhaosu, Tekesi, Gongliu, Chabuchaer, Huocheng, Bole, Pishan, Suiding,
+# and Yarkand.
 Zone	Asia/Kashgar	5:03:56	-	LMT	1928 # or Kashi or Kaxgar
 			5:30	-	KAST	1940	 # Kashgar Time
 			5:00	-	KAST	1980 May
@@ -923,6 +953,10 @@
 # For Jordan I have received multiple independent user reports every year
 # about DST end dates, as the end-rule is different every year.
 #
+# From Steffen Thorsen (2006-10-01), after a heads-up from Hilal Malawi:
+# http://www.petranews.gov.jo/nepras/2006/Sep/05/4000.htm
+# "Jordan will switch to winter time on Friday, October 27".
+#
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Jordan	1973	only	-	Jun	6	0:00	1:00	S
 Rule	Jordan	1973	1975	-	Oct	1	0:00	0	-
@@ -949,7 +983,8 @@
 Rule	Jordan	2000	max	-	Mar	lastThu	0:00s	1:00	S
 Rule	Jordan	2003	only	-	Oct	24	0:00s	0	-
 Rule	Jordan	2004	only	-	Oct	15	0:00s	0	-
-Rule	Jordan	2005	max	-	Sep	lastFri	0:00s	0	-
+Rule	Jordan	2005	only	-	Sep	lastFri	0:00s	0	-
+Rule	Jordan	2006	max	-	Oct	lastFri	0:00s	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Amman	2:23:44 -	LMT	1931
 			2:00	Jordan	EE%sT
@@ -1076,10 +1111,12 @@
 
 # Korea (North and South)
 
-# From Guy Harris:
-# According to someone at the Korean Times in San Francisco,
-# Daylight Savings Time was not observed until 1987.  He did not know
-# at what time of day DST starts or ends.
+# From Annie I. Bang (2006-07-10) in
+# :
+# The Ministry of Commerce, Industry and Energy has already
+# commissioned a research project [to reintroduce DST] and has said
+# the system may begin as early as 2008....  Korea ran a daylight
+# saving program from 1949-61 but stopped it during the 1950-53 Korean War.
 
 # From Shanks & Pottenger:
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -1436,6 +1473,23 @@
 # there is a good chance next year's end date will be around two weeks
 # earlier--the same goes for Jordan.
 
+# From Steffen Thorsen (2006-08-17):
+# I was informed by a user in Bethlehem that in Bethlehem it started the
+# same day as Israel, and after checking with other users in the area, I
+# was informed that they started DST one day after Israel.  I was not
+# able to find any authoritative sources at the time, nor details if
+# Gaza changed as well, but presumed Gaza to follow the same rules as
+# the West Bank.
+
+# From Steffen Thorsen (2006-09-26):
+# according to the Palestine News Network (2006-09-19):
+# http://english.pnn.ps/index.php?option=com_content&task=view&id=596&Itemid=5
+# > The Council of Ministers announced that this year its winter schedule
+# > will begin early, as of midnight Thursday.  It is also time to turn
+# > back the clocks for winter.  Friday will begin an hour late this week.
+# I guess it is likely that next year's date will be moved as well,
+# because of the Ramadan.
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -1445,10 +1499,13 @@
 Rule EgyptAsia	1959	1965	-	Sep	30	3:00	0	-
 Rule EgyptAsia	1966	only	-	Oct	 1	3:00	0	-
 
-Rule Palestine	1999	max	-	Apr	Fri>=15	0:00	1:00	S
+Rule Palestine	1999	2005	-	Apr	Fri>=15	0:00	1:00	S
 Rule Palestine	1999	2003	-	Oct	Fri>=15	0:00	0	-
 Rule Palestine	2004	only	-	Oct	 1	1:00	0	-
-Rule Palestine	2005	max	-	Oct	 4	2:00	0	-
+Rule Palestine	2005	only	-	Oct	 4	2:00	0	-
+Rule Palestine	2006	max	-	Apr	 1	0:00	1:00	S
+Rule Palestine	2006	only	-	Sep	22	0:00	0	-
+Rule Palestine	2007	max	-	Oct	Fri>=15	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct
@@ -1467,6 +1524,20 @@
 # be immediately followed by 1845-01-01.  Robert H. van Gent has a
 # transcript of the decree in .
 # The rest of the data are from Shanks & Pottenger.
+
+# From Paul Eggert (2006-04-25):
+# Tomorrow's Manila Standard reports that the Philippines Department of
+# Trade and Industry is considering adopting DST this June when the
+# rainy season begins.  See
+# .
+# For now, we'll ignore this, since it's not definite and we lack details.
+#
+# From Jesper Norgaard Welen (2006-04-26):
+# ... claims that Philippines had DST last time in 1990:
+# http://story.philippinetimes.com/p.x/ct/9/id/145be20cc6b121c0/cid/3e5bbccc730d258c/
+# [a story dated 2006-04-25 by Cris Larano of Dow Jones Newswires,
+# but no details]
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Phil	1936	only	-	Nov	1	0:00	1:00	S
 Rule	Phil	1937	only	-	Feb	1	0:00	0	-
@@ -1531,6 +1602,44 @@
 # 0030 hrs on April 15, 2006 (midnight of April 14, 2006 +30 minutes)
 # at present, become 2400 hours of April 14, 2006 (midnight of April 14, 2006).
 
+# From Peter Apps and Ranga Sirila of Reuters (2006-04-12) in:
+# 
+# [The Tamil Tigers] never accepted the original 1996 time change and simply
+# kept their clocks set five and a half hours ahead of Greenwich Mean
+# Time (GMT), in line with neighbor India.
+# From Paul Eggert (2006-04-18):
+# People who live in regions under Tamil control can use TZ='Asia/Calcutta',
+# as that zone has agreed with the Tamil areas since our cutoff date of 1970.
+
+# From K Sethu (2006-04-25):
+# I think the abbreviation LKT originated from the world of computers at
+# the time of or subsequent to the time zone changes by SL Government
+# twice in 1996 and probably SL Government or its standardization
+# agencies never declared an abbreviation as a national standard.
+#
+# I recollect before the recent change the government annoucemments
+# mentioning it as simply changing Sri Lanka Standard Time or Sri Lanka
+# Time and no mention was made about the abbreviation.
+#
+# If we look at Sri Lanka Department of Government's "Official News
+# Website of Sri Lanka" ... http://www.news.lk/ we can see that they
+# use SLT as abbreviation in time stamp at the beginning of each news
+# item....
+#
+# Within Sri Lanka I think LKT is well known among computer users and
+# adminsitrators.  In my opinion SLT may not be a good choice because the
+# nation's largest telcom / internet operator Sri Lanka Telcom is well
+# known by that abbreviation - simply as SLT (there IP domains are
+# slt.lk and sltnet.lk).
+#
+# But if indeed our government has adopted SLT as standard abbreviation
+# (that we have not known so far) then  it is better that it be used for
+# all computers.
+
+# From Paul Eggert (2006-04-25):
+# One possibility is that we wait for a bit for the dust to settle down
+# and then see what people actually say in practice.
+
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Colombo	5:19:24 -	LMT	1880
 			5:19:32	-	MMT	1906	# Moratuwa Mean Time
@@ -1575,11 +1684,18 @@
 # IATA SSIM (1998-02) says 1998-04-02;
 # (1998-09) says 1999-03-29 and 1999-09-29; (1999-02) says 1999-04-02,
 # 2000-04-02, and 2001-04-02; (1999-09) says 2000-03-31 and 2001-03-31;
-# ignore all these claims and go with Shanks & Pottenger.
+# (2006) says 2006-03-31 and 2006-09-22;
+# for now ignore all these claims and go with Shanks & Pottenger,
+# except for the 2006-09-22 claim (which seems right for Ramadan).
 Rule	Syria	1994	1996	-	Apr	 1	0:00	1:00	S
-Rule	Syria	1994	max	-	Oct	 1	0:00	0	-
+Rule	Syria	1994	2005	-	Oct	 1	0:00	0	-
 Rule	Syria	1997	1998	-	Mar	lastMon	0:00	1:00	S
 Rule	Syria	1999	max	-	Apr	 1	0:00	1:00	S
+# From Stephen Colebourne (2006-09-18):
+# According to IATA data, Syria will change DST on 21st September [21:00 UTC]
+# this year [only]....  This is probably related to Ramadan, like Egypt.
+Rule	Syria	2006	only	-	Sep	22	0:00	0	-
+Rule	Syria	2007	max	-	Oct	 1	0:00	0	-
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Damascus	2:25:12 -	LMT	1920	# Dimashq
 			2:00	Syria	EE%sT

Modified: haiku/trunk/src/data/etc/timezones/australasia
===================================================================
--- haiku/trunk/src/data/etc/timezones/australasia	2007-01-09 21:29:02 UTC (rev 19753)
+++ haiku/trunk/src/data/etc/timezones/australasia	2007-01-09 22:35:49 UTC (rev 19754)
@@ -1,4 +1,4 @@
-# @(#)australasia	8.2
+# @(#)australasia	8.5
 # 
 
 # This file also includes Pacific islands.
@@ -29,15 +29,24 @@
 			 9:00	-	CST	1899 May
 			 9:30	Aus	CST
 # Western Australia
+#
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	AW	1974	only	-	Oct	lastSun	2:00s	1:00	-
+Rule	AW	1975	only	-	Mar	Sun>=1	2:00s	0	-
+Rule	AW	1983	only	-	Oct	lastSun	2:00s	1:00	-
+Rule	AW	1984	only	-	Mar	Sun>=1	2:00s	0	-
+Rule	AW	1991	only	-	Nov	17	2:00s	1:00	-
+Rule	AW	1992	only	-	Mar	Sun>=1	2:00s	0	-
+Rule	AW	2006	only	-	Dec	 3	2:00s	1:00	-
+Rule	AW	2007	2009	-	Mar	lastSun	2:00s	0	-
+Rule	AW	2007	2008	-	Oct	lastSun	2:00s	1:00	-
 Zone Australia/Perth	 7:43:24 -	LMT	1895 Dec
 			 8:00	Aus	WST	1943 Jul
-			 8:00	-	WST	1974 Oct lastSun 2:00s
-			 8:00	1:00	WST	1975 Mar Sun>=1 2:00s
-			 8:00	-	WST	1983 Oct lastSun 2:00s
-			 8:00	1:00	WST	1984 Mar Sun>=1 2:00s
-			 8:00	-	WST	1991 Nov 17 2:00s
-			 8:00	1:00	WST	1992 Mar Sun>=1 2:00s
-			 8:00	-	WST
+			 8:00	AW	WST
+Zone Australia/Eucla	 8:35:28 -	LMT	1895 Dec
+			 8:45	Aus	CWST	1943 Jul
+			 8:45	AW	CWST
+
 # Queensland
 #
 # From Alex Livingston (1996-11-01):
@@ -193,16 +202,16 @@
 #
 # Ashmore Is, Cartier
 # no indigenous inhabitants; only seasonal caretakers
-# like Australia/Perth, says Turner
+# no times are set
 #
 # Coral Sea Is
 # no indigenous inhabitants; only meteorologists
-# no information
+# no times are set
 #
 # Macquarie
 # permanent occupation (scientific station) since 1948;
 # sealing and penguin oil station operated 1888/1917
-# like Australia/Hobart, says Turner
+# like Australia/Hobart
 
 # Christmas
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
@@ -534,6 +543,7 @@
 #		std dst
 #		LMT	Local Mean Time
 #	  8:00	WST WST	Western Australia
+#	  8:45	CWST CWST Central Western Australia*
 #	  9:00	JST	Japan
 #	  9:30	CST CST	Central Australia
 #	 10:00	EST EST	Eastern Australia
@@ -587,6 +597,12 @@
 #	WST	for any place operating at a GMTOFF of 8:00
 #	EST	for any place operating at a GMTOFF of 10:00
 
+# From Chuck Soper (2006-06-01):
+# I recently found this Australian government web page on time zones:
+# 
+# And this government web page lists time zone names and abbreviations:
+# 
+
 # From Paul Eggert (2001-04-05), summarizing a long discussion about "EST"
 # versus "AEST" etc.:
 #
@@ -800,38 +816,52 @@
 # From Arthur David Olson (1992-03-08):
 # The chosen rules the union of the 1971/1972 change and the 1989-1992 changes.
 
+# From Christopher Hunt (2006-11-21), after an advance warning
+# from Jesper Norgaard Welen (2006-11-01):
+# WA are trialing DST for three years. 
+# 
+
 # From Rives McDow (2002-04-09):
 # The most interesting region I have found consists of three towns on the
-# southern coast of Australia, population 10 at last report, along with
-# 50,000 sheep, about 100 kilometers long and 40 kilometers into the
-# continent.  The primary town is Madura, with the other towns being
-# Mundrabilla and Eucla.  According to the sheriff of Madura, the
-# residents got tired of having to change the time so often, as they are
-# located in a strip overlapping the border of South Australia and Western
-# Australia.  South Australia observes daylight saving time; Western
+# southern coast....  South Australia observes daylight saving time; Western
 # Australia does not.  The two states are one and a half hours apart.  The
 # residents decided to forget about this nonsense of changing the clock so
 # much and set the local time 20 hours and 45 minutes from the
 # international date line, or right in the middle of the time of South
-# Australia and Western Australia.  As it only affects about 10 people and
-# tourists staying at the Madura Motel, it has never really made as big an
-# impact as Broken Hill.  However, as tourist visiting there or anyone
-# calling the local sheriff will attest, they do keep time in this way.
+# Australia and Western Australia....
 #
 # From Paul Eggert (2002-04-09):
 # This is confirmed by the section entitled
 # "What's the deal with time zones???" in
-# ,
-# which says a few other things:
+# .
 #
-# * Border Village, SA also is 45 minutes ahead of Perth.
-# * The locals call this time zone "central W.A. Time" (presumably "CWAT").
-# * The locals also call Western Australia time "Perth time".
+# From Alex Livingston (2006-12-07):
+# ... it was just on four years ago that I drove along the Eyre Highway,
+# which passes through eastern Western Australia close to the southern
+# coast of the continent.
 #
-# It's not clear from context whether everyone in Western Australia
-# knows of this naming convention, or whether it's just the people in
-# this subregion.
+# I paid particular attention to the time kept there. There can be no
+# dispute that UTC+08:45 was considered "the time" from the border
+# village just inside the border with South Australia to as far west
+# as just east of Caiguna. There can also be no dispute that Eucla is
+# the largest population centre in this zone....
+#
+# Now that Western Australia is observing daylight saving, the
+# question arose whether this part of the state would follow suit. I
+# just called the border village and confirmed that indeed they have,
+# meaning that they are now observing UTC+09:45.
+# 
+# (2006-12-09):
+# I personally doubt that either experimentation with daylight saving
+# in WA or its introduction in SA had anything to do with the genesis
+# of this time zone.  My hunch is that it's been around since well
+# before 1975.  I remember seeing it noted on road maps decades ago.
 
+# From Paul Eggert (2006-12-15):
+# For lack of better info, assume the tradition dates back to the
+# introduction of standard time in 1895.
+
+
 # South Australia, Tasmania, Victoria
 
 # From Arthur David Olson (1992-03-08):

Modified: haiku/trunk/src/data/etc/timezones/backward
===================================================================
--- haiku/trunk/src/data/etc/timezones/backward	2007-01-09 21:29:02 UTC (rev 19753)
+++ haiku/trunk/src/data/etc/timezones/backward	2007-01-09 22:35:49 UTC (rev 19754)
@@ -1,13 +1,15 @@
-# @(#)backward	8.1
+# @(#)backward	8.3
 
 # This file provides links between current names for time zones
 # and their old names.  Many names changed in late 1993.
 
+Link	Africa/Asmara		Africa/Asmera
 Link	Africa/Bamako		Africa/Timbuktu
 Link	America/Argentina/Catamarca	America/Argentina/ComodRivadavia
 Link	America/Adak		America/Atka
 Link	America/Argentina/Buenos_Aires	America/Buenos_Aires
 Link	America/Argentina/Catamarca	America/Catamarca
+Link	America/Atikokan	America/Coral_Harbour
 Link	America/Argentina/Cordoba	America/Cordoba
 Link	America/Tijuana		America/Ensenada
 Link	America/Indiana/Indianapolis	America/Fort_Wayne
@@ -27,6 +29,7 @@
 Link	Asia/Thimphu		Asia/Thimbu
 Link	Asia/Makassar		Asia/Ujung_Pandang
 Link	Asia/Ulaanbaatar	Asia/Ulan_Bator
+Link	Atlantic/Faroe		Atlantic/Faeroe
 Link	Australia/Sydney	Australia/ACT
 Link	Australia/Sydney	Australia/Canberra
 Link	Australia/Lord_Howe	Australia/LHI

Modified: haiku/trunk/src/data/etc/timezones/europe
===================================================================
--- haiku/trunk/src/data/etc/timezones/europe	2007-01-09 21:29:02 UTC (rev 19753)
+++ haiku/trunk/src/data/etc/timezones/europe	2007-01-09 22:35:49 UTC (rev 19754)
@@ -1,4 +1,4 @@
-# @(#)europe	8.3
+# @(#)europe	8.7
 # 
 
 # This data is by no means authoritative; if you think you know better,
@@ -425,6 +425,9 @@
 			 1:00	-	BST	1971 Oct 31 2:00u
 			 0:00	GB-Eire	%s	1996
 			 0:00	EU	GMT/BST
+Link	Europe/London	Europe/Jersey
+Link	Europe/London	Europe/Guernsey
+Link	Europe/London	Europe/Isle_of_Man
 Zone	Europe/Dublin	-0:25:00 -	LMT	1880 Aug  2
 			-0:25:21 -	DMT	1916 May 21 2:00
 			-0:25:21 1:00	IST	1916 Oct  1 2:00s
@@ -703,7 +706,7 @@
 			1:00	EU	CE%sT
 
 # Bosnia and Herzegovina
-# see Serbia and Montenegro
+# see Serbia
 
 # Bulgaria
 #
@@ -730,7 +733,7 @@
 			2:00	EU	EE%sT
 
 # Croatia
-# see Serbia and Montenegro
+# see Serbia
 
 # Cyprus
 # Please see the `asia' file for Asia/Nicosia.
@@ -751,7 +754,7 @@
 			1:00	Czech	CE%sT	1979
 			1:00	EU	CE%sT
 
-# Denmark, Faeroe Islands, and Greenland
+# Denmark, Faroe Islands, and Greenland
 
 # From Jesper Norgaard Welen (2005-04-26):
 # http://www.hum.aau.dk/~poe/tid/tine/DanskTid.htm says that the law
@@ -806,7 +809,7 @@
 			 1:00	C-Eur	CE%sT	1945 Apr  2 2:00
 			 1:00	Denmark	CE%sT	1980
 			 1:00	EU	CE%sT
-Zone Atlantic/Faeroe	-0:27:04 -	LMT	1908 Jan 11	# Torshavn
+Zone Atlantic/Faroe	-0:27:04 -	LMT	1908 Jan 11	# Torshavn
 			 0:00	-	WET	1981
 			 0:00	EU	WE%sT
 #
@@ -894,7 +897,7 @@
 			-3:00	-	WGT	1980 Apr  6 2:00
 			-3:00	EU	WG%sT	1996
 			0:00	-	GMT
-Zone America/Scoresbysund -1:29:00 -	LMT	1916 Jul 28 # Ittoqqortoormiit
+Zone America/Scoresbysund -1:27:52 -	LMT	1916 Jul 28 # Ittoqqortoormiit
 			-2:00	-	CGT	1980 Apr  6 2:00
 			-2:00	C-Eur	CG%sT	1981 Mar 29
 			-1:00	EU	EG%sT
@@ -1510,7 +1513,7 @@
 			1:00	EU	CE%sT
 
 # Macedonia
-# see Serbia and Montenegro
+# see Serbia
 
 # Malta
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
@@ -1567,6 +1570,9 @@
 			1:00	France	CE%sT	1977
 			1:00	EU	CE%sT
 
+# Montenegro
+# see Serbia
+
 # Netherlands
 
 # Howse writes that the Netherlands' railways used GMT between 1892 and 1940,
@@ -1937,20 +1943,20 @@
 			 2:00	Russia	EE%sT
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
-# Respublika Adygeya, Arkhangel'skaya oblast', Astrakhanskaya oblast',
+# Respublika Adygeya, Arkhangel'skaya oblast',
 # Belgorodskaya oblast', Bryanskaya oblast', Vladimirskaya oblast',
-# Volgogradskaya oblast', Vologodskaya oblast', Voronezhskaya oblast',
+# Vologodskaya oblast', Voronezhskaya oblast',
 # Respublika Dagestan, Ivanovskaya oblast', Respublika Ingushetiya,
 # Kabarbino-Balkarskaya Respublika, Respublika Kalmykiya,
 # Kalyzhskaya oblast', Respublika Karachaevo-Cherkessiya,
-# Respublika Kareliya, Kirovskaya oblast', Respublika Komi,
+# Respublika Kareliya, Respublika Komi,
 # Kostromskaya oblast', Krasnodarskij kraj, Kurskaya oblast',
 # Leningradskaya oblast', Lipetskaya oblast', Respublika Marij El,
 # Respublika Mordoviya, Moskva, Moskovskaya oblast',
 # Murmanskaya oblast', Nenetskij avtonomnyj okrug,
 # Nizhegorodskaya oblast', Novgorodskaya oblast', Orlovskaya oblast',
 # Penzenskaya oblast', Pskovskaya oblast', Rostovskaya oblast',
-# Ryazanskaya oblast', Sankt-Peterburg, Saratovskaya oblast',
+# Ryazanskaya oblast', Sankt-Peterburg,
 # Respublika Severnaya Osetiya, Smolenskaya oblast',
 # Stavropol'skij kraj, Tambovskaya oblast', Respublika Tatarstan,
 # Tverskaya oblast', Tyl'skaya oblast', Ul'yanovskaya oblast',
@@ -1965,11 +1971,25 @@
 			 2:00	Russia	EE%sT	1992 Jan 19 2:00s
 			 3:00	Russia	MSK/MSD
 #
+# Astrakhanskaya oblast', Kirovskaya oblast', Saratovskaya oblast',
+# Volgogradskaya oblast'.  Shanks & Pottenger say Kirov is still at +0400
+# but Wikipedia (2006-05-09) says +0300.  Perhaps it switched after the
+# others?  But we have no data.
+Zone Europe/Volgograd	 2:57:40 -	LMT	1920 Jan  3
+			 3:00	-	TSAT	1925 Apr  6 # Tsaritsyn Time
+			 3:00	-	STAT	1930 Jun 21 # Stalingrad Time
+			 4:00	-	STAT	1961 Nov 11
+			 4:00	Russia	VOL%sT	1989 Mar 26 2:00s # Volgograd T
+			 3:00	Russia	VOL%sT	1991 Mar 31 2:00s
+			 4:00	-	VOLT	1992 Mar 29 2:00s
+			 3:00	Russia	VOL%sT
+#
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Samarskaya oblast', Udmyrtskaya respublika
 Zone Europe/Samara	 3:20:36 -	LMT	1919 Jul  1 2:00
-			 3:00	-	KUYT	1930 Jun 21 # Kuybyshev
-			 4:00	Russia	KUY%sT	1989 Mar 26 2:00s
+			 3:00	-	SAMT	1930 Jun 21
+			 4:00	-	SAMT	1935 Jan 27
+			 4:00	Russia	KUY%sT	1989 Mar 26 2:00s # Kuybyshev
 			 3:00	Russia	KUY%sT	1991 Mar 31 2:00s
 			 2:00	Russia	KUY%sT	1991 Sep 29 2:00s
 			 3:00	-	KUYT	1991 Oct 20 3:00
@@ -1995,7 +2015,9 @@
 			 5:00	Russia	OMS%sT	1992 Jan 19 2:00s
 			 6:00	Russia	OMS%sT
 #
-# Novosibirskaya oblast'.
+# From Paul Eggert (2006-08-19): I'm guessing about Tomsk here; it's
+# not clear when it switched from +7 to +6.
+# Novosibirskaya oblast', Tomskaya oblast'.
 Zone Asia/Novosibirsk	 5:31:40 -	LMT	1919 Dec 14 6:00
 			 6:00	-	NOVT	1930 Jun 21 # Novosibirsk Time
 			 7:00	Russia	NOV%sT	1991 Mar 31 2:00s
@@ -2005,7 +2027,7 @@
 #
 # From Oscar van Vlijmen (2001-08-25): [This region consists of]
 # Kemerovskaya oblast', Krasnoyarskij kraj,
-# Tajmyrskij (Dolgano-Nenetskij) avtonomnyj okrug, Tomskaya oblast',
+# Tajmyrskij (Dolgano-Nenetskij) avtonomnyj okrug,
 # Respublika Tuva, Respublika Khakasiya, Evenkijskij avtonomnyj okrug.
 Zone Asia/Krasnoyarsk	 6:11:20 -	LMT	1920 Jan  6
 			 6:00	-	KRAT	1930 Jun 21 # Krasnoyarsk Time
@@ -2088,7 +2110,7 @@
 			11:00	Russia	ANA%sT	1992 Jan 19 2:00s
 			12:00	Russia	ANA%sT
 
-# Serbia and Montenegro
+# Serbia
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Europe/Belgrade	1:22:00	-	LMT	1884
 			1:00	-	CET	1941 Apr 18 23:00
@@ -2100,6 +2122,7 @@
 			1:00	-	CET	1982 Nov 27
 			1:00	EU	CE%sT
 Link Europe/Belgrade Europe/Ljubljana	# Slovenia
+Link Europe/Belgrade Europe/Podgorica	# Montenegro
 Link Europe/Belgrade Europe/Sarajevo	# Bosnia and Herzegovina
 Link Europe/Belgrade Europe/Skopje	# Macedonia
 Link Europe/Belgrade Europe/Zagreb	# Croatia
@@ -2108,7 +2131,7 @@
 Link Europe/Prague Europe/Bratislava
 
 # Slovenia
-# see Serbia and Montenegro
+# see Serbia
 
 # Spain
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S

Modified: haiku/trunk/src/data/etc/timezones/iso3166.tab
===================================================================
--- haiku/trunk/src/data/etc/timezones/iso3166.tab	2007-01-09 21:29:02 UTC (rev 19753)
+++ haiku/trunk/src/data/etc/timezones/iso3166.tab	2007-01-09 22:35:49 UTC (rev 19754)
@@ -1,12 +1,12 @@
 # ISO 3166 alpha-2 country codes
 #
-# @(#)iso3166.tab	8.1
+# @(#)iso3166.tab	8.4
 #
-# From Paul Eggert (2004-06-14):
+# From Paul Eggert (2006-09-27):
 #
 # This file contains a table with the following columns:
 # 1.  ISO 3166-1 alpha-2 country code, current as of
-#     ISO 3166-1 Newsletter No. V-10 (2004-04-26).  See:
+#     ISO 3166-1 Newsletter No. V-12 (2006-09-26).  See:
 #     
 #     ISO 3166 Maintenance agency (ISO 3166/MA)
 #     .
@@ -70,7 +70,6 @@
 CN	China
 CO	Colombia
 CR	Costa Rica
-CS	Serbia and Montenegro
 CU	Cuba
 CV	Cape Verde
 CX	Christmas Island
@@ -93,13 +92,14 @@
 FJ	Fiji
 FK	Falkland Islands
 FM	Micronesia
-FO	Faeroe Islands
+FO	Faroe Islands
 FR	France
 GA	Gabon
 GB	Britain (UK)
 GD	Grenada
 GE	Georgia
 GF	French Guiana
+GG	Guernsey
 GH	Ghana
 GI	Gibraltar
 GL	Greenland
@@ -122,12 +122,14 @@
 ID	Indonesia
 IE	Ireland
 IL	Israel
+IM	Isle of Man
 IN	India
 IO	British Indian Ocean Territory
 IQ	Iraq
 IR	Iran
 IS	Iceland
 IT	Italy
+JE	Jersey
 JM	Jamaica
 JO	Jordan
 JP	Japan
@@ -156,6 +158,7 @@
 MA	Morocco
 MC	Monaco
 MD	Moldova
+ME	Montenegro
 MG	Madagascar
 MH	Marshall Islands
 MK	Macedonia
@@ -204,6 +207,7 @@
 QA	Qatar
 RE	Reunion
 RO	Romania
+RS	Serbia
 RU	Russia
 RW	Rwanda
 SA	Saudi Arabia

Modified: haiku/trunk/src/data/etc/timezones/northamerica
===================================================================
--- haiku/trunk/src/data/etc/timezones/northamerica	2007-01-09 21:29:02 UTC (rev 19753)
+++ haiku/trunk/src/data/etc/timezones/northamerica	2007-01-09 22:35:49 UTC (rev 19754)
@@ -1,4 +1,4 @@
-# @(#)northamerica	8.4
+# @(#)northamerica	8.11
 # 
 
 # also includes Central America and the Caribbean
@@ -301,6 +301,13 @@
 # Nebraska, eastern North Dakota, Oklahoma, eastern South Dakota,
 # western Tennessee, most of Texas, Wisconsin
 
+# From Larry M. Smith (2006-04-26) re Wisconsin:
+# http://www.legis.state.wi.us/statutes/Stat0175.pdf ...
+# is currently enforced at the 01:00 time of change.  Because the local
+# "bar time" in the state corresponds to 02:00, a number of citations
+# are issued for the "sale of class 'B' alcohol after prohibited
+# hours" within the deviated hour of this change every year....
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
 Rule	Chicago	1920	only	-	Jun	13	2:00	1:00	D
 Rule	Chicago	1920	1921	-	Oct	lastSun	2:00	0	S
@@ -322,7 +329,7 @@
 			-7:00	US	M%sT	1992 Oct 25 02:00
 			-6:00	US	C%sT
 # Morton County, ND, switched from mountain to central time on
-# 2003-10-26, except for the area around Mandan.
+# 2003-10-26, except for the area around Mandan which was already central time.
 # See .
 # Officially this switch also included part of Sioux County, and
 # Jones, Mellette, and Todd Counties in South Dakota;
@@ -544,17 +551,9 @@
 # - Clark, Floyd, and Harrison counties have been like
 #   America/Kentucky/Louisville.
 #
-# - Daviess, Dubois, Knox, and Perry counties
+# - Daviess, Dubois, Knox, Martin, Perry, and Pulaski counties
 #   have been like America/Indiana/Vincennes.
 #
-# - Officially, Martin and Pulaski counties have also been like
-#   America/Indiana/Vincennes, but an AP article on Pulaski county
-#   
-#   (2006-02-07) and an InsideINdianaBusiness.com report on Martin county
-#    (2006-03-15)
-#   say that the county commissioners have voted to stay on eastern time in
-#   2006, which means they are actually like America/Indiana/Indianopolis.
-#
 # - Crawford, Pike, Starke, and Switzerland counties have their own time zone
 #   histories as noted below.
 #
@@ -619,7 +618,7 @@
 			-5:00	-	EST	2006
 			-5:00	US	E%sT
 #
-# Daviess, Dubois, Knox, and Perry Counties, Indiana,
+# Daviess, Dubois, Knox, Martin, Perry, and Pulaski Counties, Indiana,
 # switched from eastern to central time in April 2006.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER
 Rule Vincennes	1946	only	-	Apr	lastSun	2:00	1:00	D
@@ -901,7 +900,42 @@
 # U.S. and the rest of Canada....
 # http://www2.news.gov.bc.ca/news_releases_2005-2009/2006AG0014-000330.htm
 
-# From Paul Eggert (2006-04-09):
+# From Chris Walton (2006-04-25):
+# Daylight saving time will be extended by four weeks starting in 2007....
+# Here is a news release which was issued today by the Nova Scotia government:
+# http://www.gov.ns.ca/news/details.asp?id=20060425004
+
+# From Chris Walton (2006-06-26):
+# [For New Brunswick] the new legislation dictates that the time change is to
+# be done at 02:00 instead of 00:01.
+# http://www.gnb.ca/0062/acts/BBA-2006/Chap-19.pdf
+# ...
+# Manitoba has traditionally changed the clock every fall at 03:00.
+# As of 2006, the transition is to take place one hour earlier at 02:00.
+# http://web2.gov.mb.ca/laws/statutes/ccsm/o030e.php
+# ...
+# [Alberta, Ontario, Quebec] will follow US rules.
+# http://www.qp.gov.ab.ca/documents/Acts/2006CH03_UNPR.cfm?frm_isbn=0779744934
+# http://www.e-laws.gov.on.ca/DBLaws/Source/Regs/English/2006/R06111_e.htm
+# http://www.assnat.qc.ca/eng/37legislature2/Projets-loi/Publics/06-a002.htm
+# ...
+# P.E.I. will follow US rules.  The new legislation is not law yet.
+# It passed first reading on April 20....
+# http://www.assembly.pe.ca/bills/pdf_first/62/3/bill-101.pdf
+# ...
+# Province of Newfoundland and Labrador.... The change is being considered.
+# http://www.releases.gov.nl.ca/releases/2006/mpa/0331n01.htm
+# ...
+# N.W.T. will follow US rules.  Whoever maintains the government web site
+# does not seem to believe in bookmarks.  To see the news release, click the
+# following link and search for "Daylight Savings Time Change".  Press the
+# "Daylight Savings Time Change" link; it will fire off a popup using
+# JavaScript.
+# http://www.exec.gov.nt.ca/currentnews/currentPR.asp?mode=archive
+
+
+
+# From Paul Eggert (2006-04-25):
 # H. David Matthews and Mary Vincent's map
 # 
 # "It's about TIME", _Canadian Geographic_ (September-October 1998)
@@ -913,17 +947,11 @@
 # information about standard and daylight saving time zones in Canada.
 #  (updated periodically).
 # Its unofficial information is often taken from Matthews and Vincent.
-#
-# CBC News reported that Ontario and Manitoba have announced plans to
-# follow the US change, and that Nova Scotia is considering it; see
-#  (2005-10-21).
-# CBC news also reported that Prince Edward Island is the first
-# province in Atlantic Canada to follow the US change, and that Quebec
-# had agreed; see 
-# (2005-12-07).  It also reported that Alberta will fall into line; see
-#  (2006-02-02).
-# For now, assume all of Canada will fall into line.
 
+# From Paul Eggert (2006-06-27):
+# For now, assume all of DST-observing Canada will fall into line with the
+# new US DST rules,
+
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Canada	1918	only	-	Apr	14	2:00	1:00	D
 Rule	Canada	1918	only	-	Oct	31	2:00	0	S
@@ -937,7 +965,7 @@
 Rule	Canada	2007	max	-	Nov	Sun>=1	2:00	0	S
 
 
-# Newfoundland (and far southeast Labrador)
+# Newfoundland and Labrador
 
 # From Paul Eggert (2000-10-02):
 # Matthews and Vincent (1998) write that Labrador should use NST/NDT,
@@ -975,9 +1003,6 @@
 Rule	StJohns	1987	2006	-	Oct	lastSun	0:01	0	S
 Rule	StJohns	1988	only	-	Apr	Sun>=1	0:01	2:00	DD
 Rule	StJohns	1989	2006	-	Apr	Sun>=1	0:01	1:00	D
-# From Chris Walton (2006-04-05):
-# http://www.releases.gov.nl.ca/releases/2006/mpa/0331n01.htm
-# [This says Newfoundlandland expects to follow step with the US.]
 Rule	StJohns	2007	max	-	Mar	Sun>=8	0:01	1:00	D
 Rule	StJohns	2007	max	-	Nov	Sun>=1	0:01	0	S
 #
@@ -1080,10 +1105,7 @@
 #  says they change at 00:01, and
 #  makes it
 # clear that this has been the case since at least 1993.
-# For now, assume it started in 1993.  The Office of the Premier announced
-#  (2005-12-23)
-# that they will bring forward proposed amendments to harmonize with the US;
-# for now assume that this will happen, but they'll still switch at 00:01.
+# For now, assume it started in 1993.
 
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule	Moncton	1933	1935	-	Jun	Sun>=8	1:00	1:00	D
@@ -1099,8 +1121,6 @@
 Rule	Moncton	1957	1972	-	Oct	lastSun	2:00	0	S
 Rule	Moncton	1993	2006	-	Apr	Sun>=1	0:01	1:00	D
 Rule	Moncton	1993	2006	-	Oct	lastSun	0:01	0	S
-Rule	Moncton	2007	max	-	Mar	Sun>=8	0:01	1:00	D
-Rule	Moncton	2007	max	-	Nov	Sun>=1	0:01	0	S
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone America/Moncton	-4:19:08 -	LMT	1883 Dec  9
 			-5:00	-	EST	1902 Jun 15
@@ -1109,13 +1129,79 @@
 			-4:00	Canada	A%sT	1946
 			-4:00	Moncton	A%sT	1973
 			-4:00	Canada	A%sT	1993
-			-4:00	Moncton	A%sT
+			-4:00	Moncton	A%sT	2007
+			-4:00	Canada	A%sT
 
-# Ontario, Quebec
+# Quebec
 
-# From Paul Eggert (2006-03-22):
-# Shanks & Pottenger writes that since 1970 most of Ontario has been like
-# Toronto, and most of Quebec has been like Montreal.
+# From Paul Eggert (2006-07-09):
+# Shanks & Pottenger write that since 1970 most of Quebec has been
+# like Montreal.
+
+# From Paul Eggert (2006-06-27):
+# Matthews and Vincent (1998) also write that Quebec east of the -63
+# meridian is supposed to observe AST, but residents as far east as
+# Natashquan use EST/EDT, and residents east of Natashquan use AST.
+# In "Official time in Quebec" the Quebec department of justice writes in
+# http://www.justice.gouv.qc.ca/english/publications/generale/temps-regl-1-a.htm
+# that "The residents of the Municipality of the
+# Cote-Nord-du-Golfe-Saint-Laurent and the municipalities of Saint-Augustin,
+# Bonne-Esperance and Blanc-Sablon apply the Official Time Act as it is
+# written and use Atlantic standard time all year round. The same applies to
+# the residents of the Native facilities along the lower North Shore."
+# 
+# says this common practice was codified into law as of 2007.
+# For lack of better info, guess this practice began around 1970, contra to
+# Shanks & Pottenger who have this region observing AST/ADT.
+
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Mont	1917	only	-	Mar	25	2:00	1:00	D
+Rule	Mont	1917	only	-	Apr	24	0:00	0	S
+Rule	Mont	1919	only	-	Mar	31	2:30	1:00	D
+Rule	Mont	1919	only	-	Oct	25	2:30	0	S
+Rule	Mont	1920	only	-	May	 2	2:30	1:00	D
+Rule	Mont	1920	1922	-	Oct	Sun>=1	2:30	0	S
+Rule	Mont	1921	only	-	May	 1	2:00	1:00	D
+Rule	Mont	1922	only	-	Apr	30	2:00	1:00	D
+Rule	Mont	1924	only	-	May	17	2:00	1:00	D
+Rule	Mont	1924	1926	-	Sep	lastSun	2:30	0	S
+Rule	Mont	1925	1926	-	May	Sun>=1	2:00	1:00	D
+# The 1927-to-1937 rules can be expressed more simply as
+# Rule	Mont	1927	1937	-	Apr	lastSat	24:00	1:00	D
+# Rule	Mont	1927	1937	-	Sep	lastSat	24:00	0	S
+# The rules below avoid use of 24:00
+# (which pre-1998 versions of zic cannot handle).
+Rule	Mont	1927	only	-	May	1	0:00	1:00	D
+Rule	Mont	1927	1932	-	Sep	lastSun	0:00	0	S
+Rule	Mont	1928	1931	-	Apr	lastSun	0:00	1:00	D
+Rule	Mont	1932	only	-	May	1	0:00	1:00	D
+Rule	Mont	1933	1940	-	Apr	lastSun	0:00	1:00	D
+Rule	Mont	1933	only	-	Oct	1	0:00	0	S

[... truncated: 789 lines follow ...]


From korli at mail.berlios.de  Wed Jan 10 00:16:27 2007
From: korli at mail.berlios.de (korli at BerliOS)
Date: Wed, 10 Jan 2007 00:16:27 +0100
Subject: [Haiku-commits] r19755 - in haiku/trunk:
	headers/private/libroot/time src/bin/zic
	src/system/libroot/posix/time
Message-ID: <200701092316.l09NGRWp009273@sheep.berlios.de>

Author: korli
Date: 2007-01-10 00:16:26 +0100 (Wed, 10 Jan 2007)
New Revision: 19755
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19755&view=rev

Modified:
   haiku/trunk/headers/private/libroot/time/private.h
   haiku/trunk/headers/private/libroot/time/tzfile.h
   haiku/trunk/src/bin/zic/ialloc.c
   haiku/trunk/src/bin/zic/scheck.c
   haiku/trunk/src/bin/zic/zdump.c
   haiku/trunk/src/bin/zic/zic.c
   haiku/trunk/src/system/libroot/posix/time/localtime.c
   haiku/trunk/src/system/libroot/posix/time/strftime.c
Log:
updated to tzcode2007a


Modified: haiku/trunk/headers/private/libroot/time/private.h
===================================================================
--- haiku/trunk/headers/private/libroot/time/private.h	2007-01-09 22:35:49 UTC (rev 19754)
+++ haiku/trunk/headers/private/libroot/time/private.h	2007-01-09 23:16:26 UTC (rev 19755)
@@ -4,7 +4,7 @@
 
 /*
 ** This file is in the public domain, so clarified as of
-** 1996-06-05 by Arthur David Olson (arthur_david_olson at nih.gov).
+** 1996-06-05 by Arthur David Olson.
 */
 
 /*
@@ -21,7 +21,7 @@
 
 #ifndef lint
 #ifndef NOID
-static char	privatehid[] = "@(#)private.h	7.55";
+static char	privatehid[] = "@(#)private.h	8.2";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -89,7 +89,7 @@
 #include "stdio.h"
 #include "errno.h"
 #include "string.h"
-#include "limits.h"	/* for CHAR_BIT */
+#include "limits.h"	/* for CHAR_BIT et al. */
 #include "time.h"
 #include "stdlib.h"
 
@@ -125,20 +125,51 @@
 #define is_digit(c) ((unsigned)(c) - '0' <= 9)
 
 /*
+** Define HAVE_STDINT_H's default value here, rather than at the
+** start, since __GLIBC__'s value depends on previously-included
+** files.
+** (glibc 2.1 and later have stdint.h, even with pre-C99 compilers.)
+*/
+#ifndef HAVE_STDINT_H
+#define HAVE_STDINT_H \
+	(199901 <= __STDC_VERSION__ || \
+	2 < (__GLIBC__ + (0 < __GLIBC_MINOR__)))
+#endif /* !defined HAVE_STDINT_H */
+
+#if HAVE_STDINT_H
+#include "stdint.h"
+#endif /* !HAVE_STDINT_H */
+
+#ifndef INT_FAST64_MAX
+/* Pre-C99 GCC compilers define __LONG_LONG_MAX__ instead of LLONG_MAX.  */
+#if defined LLONG_MAX || defined __LONG_LONG_MAX__
+typedef long long	int_fast64_t;
+#else /* ! (defined LLONG_MAX || defined __LONG_LONG_MAX__) */
+#if (LONG_MAX >> 31) < 0xffffffff
+Please use a compiler that supports a 64-bit integer type (or wider);
+you may need to compile with "-DHAVE_STDINT_H".
+#endif /* (LONG_MAX >> 31) < 0xffffffff */
+typedef long		int_fast64_t;
+#endif /* ! (defined LLONG_MAX || defined __LONG_LONG_MAX__) */
+#endif /* !defined INT_FAST64_MAX */
+
+#ifndef INT32_MAX
+#define INT32_MAX 0x7fffffff
+#endif /* !defined INT32_MAX */
+#ifndef INT32_MIN
+#define INT32_MIN (-1 - INT32_MAX)
+#endif /* !defined INT32_MIN */
+
+/*
 ** Workarounds for compilers/systems.
 */
 
 /*
-** SunOS 4.1.1 cc lacks prototypes.
+** If your compiler lacks prototypes, "#define P(x) ()".
 */
 
 #ifndef P
-#ifdef __STDC__
 #define P(x)	x
-#endif /* defined __STDC__ */
-#ifndef __STDC__
-#define P(x)	()
-#endif /* !defined __STDC__ */
 #endif /* !defined P */
 
 /*
@@ -211,14 +242,14 @@
 ** Private function declarations.
 */
 
-char *	icalloc P((int nelem, int elsize));
-char *	icatalloc P((char * old, const char * new));
-char *	icpyalloc P((const char * string));
-char *	imalloc P((int n));
-void *	irealloc P((void * pointer, int size));
-void	icfree P((char * pointer));
-void	ifree P((char * pointer));
-char *	scheck P((const char *string, char *format));
+char *		icalloc P((int nelem, int elsize));
+char *		icatalloc P((char * old, const char * new));
+char *		icpyalloc P((const char * string));
+char *		imalloc P((int n));
+void *		irealloc P((void * pointer, int size));
+void		icfree P((char * pointer));
+void		ifree P((char * pointer));
+const char *	scheck P((const char * string, const char * format));
 
 /*
 ** Finally, some convenience items.
@@ -310,7 +341,27 @@
 char *ctime_r P((time_t const *, char *));
 #endif /* HAVE_INCOMPATIBLE_CTIME_R */
 
+#ifndef YEARSPERREPEAT
+#define YEARSPERREPEAT		400	/* years before a Gregorian repeat */
+#endif /* !defined YEARSPERREPEAT */
+
 /*
+** The Gregorian year averages 365.2425 days, which is 31556952 seconds.
+*/
+
+#ifndef AVGSECSPERYEAR
+#define AVGSECSPERYEAR		31556952L
+#endif /* !defined AVGSECSPERYEAR */
+
+#ifndef SECSPERREPEAT
+#define SECSPERREPEAT		((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
+#endif /* !defined SECSPERREPEAT */
+ 
+#ifndef SECSPERREPEAT_BITS
+#define SECSPERREPEAT_BITS	34	/* ceil(log2(SECSPERREPEAT)) */
+#endif /* !defined SECSPERREPEAT_BITS */
+
+/*
 ** UNIX was a registered trademark of The Open Group in 2003.
 */
 

Modified: haiku/trunk/headers/private/libroot/time/tzfile.h
===================================================================
--- haiku/trunk/headers/private/libroot/time/tzfile.h	2007-01-09 22:35:49 UTC (rev 19754)
+++ haiku/trunk/headers/private/libroot/time/tzfile.h	2007-01-09 23:16:26 UTC (rev 19755)
@@ -4,7 +4,7 @@
 
 /*
 ** This file is in the public domain, so clarified as of
-** 1996-06-05 by Arthur David Olson (arthur_david_olson at nih.gov).
+** 1996-06-05 by Arthur David Olson.
 */
 
 /*
@@ -21,7 +21,7 @@
 
 #ifndef lint
 #ifndef NOID
-static char	tzfilehid[] = "@(#)tzfile.h	7.17";
+static char	tzfilehid[] = "@(#)tzfile.h	8.1";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -49,7 +49,8 @@
 
 struct tzhead {
 	char	tzh_magic[4];		/* TZ_MAGIC */
-	char	tzh_reserved[16];	/* reserved for future use */
+	char	tzh_version[1];		/* '\0' or '2' as of 2005 */
+	char	tzh_reserved[15];	/* reserved--must be zero */
 	char	tzh_ttisgmtcnt[4];	/* coded number of trans. time flags */
 	char	tzh_ttisstdcnt[4];	/* coded number of trans. time flags */
 	char	tzh_leapcnt[4];		/* coded number of leap seconds */
@@ -84,18 +85,22 @@
 */
 
 /*
+** If tzh_version is '2' or greater, the above is followed by a second instance
+** of tzhead and a second instance of the data in which each coded transition
+** time uses 8 rather than 4 chars,
+** then a POSIX-TZ-environment-variable-style string for use in handling
+** instants after the last transition time stored in the file
+** (with nothing between the newlines if there is no POSIX representation for
+** such instants).
+*/
+
+/*
 ** In the current implementation, "tzset()" refuses to deal with files that
 ** exceed any of the limits below.
 */
 
 #ifndef TZ_MAX_TIMES
-/*
-** The TZ_MAX_TIMES value below is enough to handle a bit more than a
-** year's worth of solar time (corrected daily to the nearest second) or
-** 138 years of Pacific Presidential Election time
-** (where there are three time zone transitions every fourth year).
-*/
-#define TZ_MAX_TIMES	370
+#define TZ_MAX_TIMES	1200
 #endif /* !defined TZ_MAX_TIMES */
 
 #ifndef TZ_MAX_TYPES
@@ -105,7 +110,7 @@
 #ifdef NOSOLAR
 /*
 ** Must be at least 14 for Europe/Riga as of Jan 12 1995,
-** as noted by Earl Chew .
+** as noted by Earl Chew.
 */
 #define TZ_MAX_TYPES	20	/* Maximum number of local time types */
 #endif /* !defined NOSOLAR */

Modified: haiku/trunk/src/bin/zic/ialloc.c
===================================================================
--- haiku/trunk/src/bin/zic/ialloc.c	2007-01-09 22:35:49 UTC (rev 19754)
+++ haiku/trunk/src/bin/zic/ialloc.c	2007-01-09 23:16:26 UTC (rev 19755)
@@ -1,6 +1,11 @@
+/*
+** This file is in the public domain, so clarified as of
+** 2006-07-17 by Arthur David Olson.
+*/
+
 #ifndef lint
 #ifndef NOID
-static char	elsieid[] = "@(#)ialloc.c	8.29";
+static char	elsieid[] = "@(#)ialloc.c	8.30";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 

Modified: haiku/trunk/src/bin/zic/scheck.c
===================================================================
--- haiku/trunk/src/bin/zic/scheck.c	2007-01-09 22:35:49 UTC (rev 19754)
+++ haiku/trunk/src/bin/zic/scheck.c	2007-01-09 23:16:26 UTC (rev 19755)
@@ -1,6 +1,11 @@
+/*
+** This file is in the public domain, so clarified as of
+** 2006-07-17 by Arthur David Olson.
+*/
+
 #ifndef lint
 #ifndef NOID
-static char	elsieid[] = "@(#)scheck.c	8.16";
+static char	elsieid[] = "@(#)scheck.c	8.19";
 #endif /* !defined lint */
 #endif /* !defined NOID */
 
@@ -8,20 +13,19 @@
 
 #include "private.h"
 
-char *
+const char *
 scheck(string, format)
 const char * const	string;
-char * const		format;
+const char * const	format;
 {
 	register char *		fbuf;
 	register const char *	fp;
 	register char *		tp;
 	register int		c;
-	register char *		result;
+	register const char *	result;
 	char			dummy;
-	static char		nada;
 
-	result = &nada;
+	result = "";
 	if (string == NULL || format == NULL)
 		return result;
 	fbuf = imalloc((int) (2 * strlen(format) + 4));

Modified: haiku/trunk/src/bin/zic/zdump.c
===================================================================
--- haiku/trunk/src/bin/zic/zdump.c	2007-01-09 22:35:49 UTC (rev 19754)
+++ haiku/trunk/src/bin/zic/zdump.c	2007-01-09 23:16:26 UTC (rev 19755)
@@ -1,4 +1,4 @@
-static char	elsieid[] = "@(#)zdump.c	7.65";
+static char	elsieid[] = "@(#)zdump.c	8.3";
 
 /*
 ** This code has been made independent of the rest of the time
@@ -12,6 +12,10 @@
 #include "time.h"	/* for struct tm */
 #include "stdlib.h"	/* for exit, malloc, atoi */
 #include "float.h"	/* for FLT_MAX and DBL_MAX */
+#include "ctype.h"	/* for isalpha et al. */
+#ifndef isascii
+#define isascii(x) 1
+#endif /* !defined isascii */
 
 #ifndef ZDUMP_LO_YEAR
 #define ZDUMP_LO_YEAR	(-500)
@@ -126,11 +130,7 @@
 #endif /* !defined TZ_DOMAIN */
 
 #ifndef P
-#ifdef __STDC__
 #define P(x)	x
-#else /* !defined __STDC__ */
-#define P(x)	()
-#endif /* !defined __STDC__ */
 #endif /* !defined P */
 
 extern char **	environ;
@@ -147,7 +147,7 @@
 static int	warned;
 
 static char *	abbr P((struct tm * tmp));
-static void	abbrok P((const char * abbr, const char * zone));
+static void	abbrok P((const char * abbrp, const char * zone));
 static long	delta P((struct tm * newp, struct tm * oldp));
 static void	dumptime P((const struct tm * tmp));
 static time_t	hunt P((char * name, time_t lot, time_t	hit));
@@ -194,40 +194,40 @@
 #endif /* !defined TYPECHECK */
 
 static void
-abbrok(abbr, zone)
-const char * const	abbr;
+abbrok(abbrp, zone)
+const char * const	abbrp;
 const char * const	zone;
 {
-	register int		i;
 	register const char *	cp;
 	register char *		wp;
 
 	if (warned)
 		return;
-	cp = abbr;
+	cp = abbrp;
 	wp = NULL;
-	while (isascii(*cp) && isalpha(*cp))
+	while (isascii((unsigned char) *cp) && isalpha((unsigned char) *cp))
 		++cp;
-	if (cp - abbr == 0)
+	if (cp - abbrp == 0)
 		wp = _("lacks alphabetic at start");
-	if (cp - abbr < 3)
+	else if (cp - abbrp < 3)
 		wp = _("has fewer than 3 alphabetics");
-	if (cp - abbr > 6)
+	else if (cp - abbrp > 6)
 		wp = _("has more than 6 alphabetics");
 	if (wp == NULL && (*cp == '+' || *cp == '-')) {
 		++cp;
-		if (isascii(*cp) && isdigit(*cp))
-			if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
-				++cp;
+		if (isascii((unsigned char) *cp) &&
+			isdigit((unsigned char) *cp))
+				if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
+					++cp;
+		if (*cp != '\0')
+			wp = _("differs from POSIX standard");
 	}
-	if (*cp != '\0')
-		wp = _("differs from POSIX standard");
 	if (wp == NULL)
 		return;
 	(void) fflush(stdout);
 	(void) fprintf(stderr,
-		"%s: warning: zone \"%s\" abbreviation \"%s\" %s\n",
-		progname, zone, abbr, wp);
+		_("%s: warning: zone \"%s\" abbreviation \"%s\" %s\n"),
+		progname, zone, abbrp, wp);
 	warned = TRUE;
 }
 
@@ -266,7 +266,7 @@
 	for (i = 1; i < argc; ++i)
 		if (strcmp(argv[i], "--version") == 0) {
 			(void) printf("%s\n", elsieid);
-			(void) exit(EXIT_SUCCESS);
+			exit(EXIT_SUCCESS);
 		}
 	vflag = 0;
 	cutarg = NULL;
@@ -279,7 +279,7 @@
 			(void) fprintf(stderr,
 _("%s: usage is %s [ --version ] [ -v ] [ -c [loyear,]hiyear ] zonename ...\n"),
 				progname, progname);
-			(void) exit(EXIT_FAILURE);
+			exit(EXIT_FAILURE);
 	}
 	if (vflag) {
 		if (cutarg != NULL) {
@@ -296,7 +296,7 @@
 			} else {
 (void) fprintf(stderr, _("%s: wild -c argument %s\n"),
 					progname, cutarg);
-				(void) exit(EXIT_FAILURE);
+				exit(EXIT_FAILURE);
 			}
 		}
 		setabsolutes();
@@ -319,7 +319,7 @@
 		if (fakeenv == NULL ||
 			(fakeenv[0] = (char *) malloc(longest + 4)) == NULL) {
 					(void) perror(progname);
-					(void) exit(EXIT_FAILURE);
+					exit(EXIT_FAILURE);
 		}
 		to = 0;
 		(void) strcpy(fakeenv[to++], "TZ=");
@@ -385,8 +385,8 @@
 	}
 	if (fflush(stdout) || ferror(stdout)) {
 		(void) fprintf(stderr, "%s: ", progname);
-		(void) perror(_("Error writing standard output"));
-		(void) exit(EXIT_FAILURE);
+		(void) perror(_("Error writing to standard output"));
+		exit(EXIT_FAILURE);
 	}
 	exit(EXIT_SUCCESS);
 	/* If exit fails to exit... */
@@ -410,18 +410,25 @@
 			(void) fprintf(stderr,
 _("%s: use of -v on system with floating time_t other than float or double\n"),
 				progname);
-			(void) exit(EXIT_FAILURE);
+			exit(EXIT_FAILURE);
 		}
 	} else if (0 > (time_t) -1) {
 		/*
-		** time_t is signed.
+		** time_t is signed.  Assume overflow wraps around.
 		*/
-		register time_t	hibit;
+		time_t t = 0;
+		time_t t1 = 1;
 
-		for (hibit = 1; (hibit * 2) != 0; hibit *= 2)
-			continue;
-		absolute_min_time = hibit;
-		absolute_max_time = -(hibit + 1);
+		while (t < t1) {
+			t = t1;
+			t1 = 2 * t1 + 1;
+		}
+		  
+		absolute_max_time = t;
+		t = -t;
+		absolute_min_time = t - 1;
+		if (t < absolute_min_time)
+			absolute_min_time = t;
 	} else {
 		/*
 		** time_t is unsigned.
@@ -464,10 +471,7 @@
 }
 
 static time_t
-hunt(name, lot, hit)
-char *	name;
-time_t	lot;
-time_t	hit;
+hunt(char *name, time_t lot, time_t hit)
 {
 	time_t			t;
 	long			diff;
@@ -510,7 +514,7 @@
 }
 
 /*
-** Thanks to Paul Eggert (eggert at twinsun.com) for logic used in delta.
+** Thanks to Paul Eggert for logic used in delta.
 */
 
 static long
@@ -537,10 +541,7 @@
 }
 
 static void
-show(zone, t, v)
-char *	zone;
-time_t	t;
-int	v;
+show(char *zone, time_t t, int v)
 {
 	register struct tm *	tmp;
 

Modified: haiku/trunk/src/bin/zic/zic.c
===================================================================
--- haiku/trunk/src/bin/zic/zic.c	2007-01-09 22:35:49 UTC (rev 19754)
+++ haiku/trunk/src/bin/zic/zic.c	2007-01-09 23:16:26 UTC (rev 19755)
@@ -1,15 +1,18 @@
-static char	elsieid[] = "@(#)zic.c	7.124";
-
 /*
-** Regardless of the type of time_t, we do our work using this type.
+** This file is in the public domain, so clarified as of
+** 2006-07-17 by Arthur David Olson.
 */
 
-typedef int	zic_t;
+static char	elsieid[] = "@(#)zic.c	8.8";
 
 #include "private.h"
 #include "locale.h"
 #include "tzfile.h"
 
+#define	ZIC_VERSION	'2'
+
+typedef int_fast64_t	zic_t;
+
 #ifndef ZIC_MAX_ABBR_LEN_WO_WARN
 #define ZIC_MAX_ABBR_LEN_WO_WARN	6
 #endif /* !defined ZIC_MAX_ABBR_LEN_WO_WARN */
@@ -36,6 +39,11 @@
 #define isascii(x) 1
 #endif
 
+#define OFFSET_STRLEN_MAXIMUM	(7 + INT_STRLEN_MAXIMUM(long))
+#define RULE_STRLEN_MAXIMUM	8	/* "Mdd.dd.d" */
+
+#define end(cp)	(strchr((cp), '\0'))
+
 struct rule {
 	const char *	r_filename;
 	int		r_linenum;
@@ -44,6 +52,8 @@
 	int		r_loyear;	/* for example, 1986 */
 	int		r_hiyear;	/* for example, 1986 */
 	const char *	r_yrtype;
+	int		r_lowasnum;
+	int		r_hiwasnum;
 
 	int		r_month;	/* 0..11 */
 
@@ -103,9 +113,10 @@
 static void	associate P((void));
 static int	ciequal P((const char * ap, const char * bp));
 static void	convert P((long val, char * buf));
+static void	convert64 P((zic_t val, char * buf));
 static void	dolink P((const char * fromfile, const char * tofile));
 static void	doabbr P((char * abbr, const char * format,
-			const char * letters, int isdst));
+			const char * letters, int isdst, int doquotes));
 static void	eat P((const char * name, int num));
 static void	eats P((const char * name, int num,
 			const char * rname, int rnum));
@@ -121,6 +132,7 @@
 static int	inzcont P((char ** fields, int nfields));
 static int	inzone P((char ** fields, int nfields));
 static int	inzsub P((char ** fields, int nfields, int iscont));
+static int	is32 P((zic_t x));
 static int	itsabbr P((const char * abbr, const char * word));
 static int	itsdir P((const char * name));
 static int	lowerit P((int c));
@@ -130,16 +142,22 @@
 static long	oadd P((long t1, long t2));
 static void	outzone P((const struct zone * zp, int ntzones));
 static void	puttzcode P((long code, FILE * fp));
+static void	puttzcode64 P((zic_t code, FILE * fp));
 static int	rcomp P((const void * leftp, const void * rightp));
 static zic_t	rpytime P((const struct rule * rp, int wantedy));
 static void	rulesub P((struct rule * rp,
 			const char * loyearp, const char * hiyearp,
 			const char * typep, const char * monthp,
 			const char * dayp, const char * timep));
+static int 	stringoffset P((char * result, long offset));
+static int	stringrule P((char * result, const struct rule * rp,
+			long dstoff, long gmtoff));
+static void 	stringzone P((char * result,
+			const struct zone * zp, int ntzones));
 static void	setboundaries P((void));
 static zic_t	tadd P((zic_t t1, long t2));
 static void	usage P((void));
-static void	writezone P((const char * name));
+static void	writezone P((const char * name, const char * string));
 static int	yearistype P((int year, const char * type));
 
 #if !HAVE_STRERROR
@@ -150,13 +168,16 @@
 static int		errors;
 static const char *	filename;
 static int		leapcnt;
+static int		leapseen;
+static int		leapminyear;
+static int		leapmaxyear;
 static int		linenum;
+static int		max_abbrvar_len;
+static int		max_format_len;
 static zic_t		max_time;
 static int		max_year;
-static int		max_year_representable;
 static zic_t		min_time;
 static int		min_year;
-static int		min_year_representable;
 static int		noise;
 static const char *	rfilename;
 static int		rlinenum;
@@ -370,7 +391,7 @@
 
 		(void) fprintf(stderr, _("%s: Memory exhausted: %s\n"),
 			progname, e);
-		(void) exit(EXIT_FAILURE);
+		exit(EXIT_FAILURE);
 	}
 	return ptr;
 }
@@ -453,10 +474,10 @@
 usage P((void))
 {
 	(void) fprintf(stderr, _("%s: usage is %s \
-[ --version ] [ -s ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
+[ --version ] [ -v ] [ -l localtime ] [ -p posixrules ] \\\n\
 \t[ -d directory ] [ -L leapseconds ] [ -y yearistype ] [ filename ... ]\n"),
 		progname, progname);
-	(void) exit(EXIT_FAILURE);
+	exit(EXIT_FAILURE);
 }
 
 static const char *	psxrules;
@@ -464,7 +485,6 @@
 static const char *	directory;
 static const char *	leapsec;
 static const char *	yitcommand;
-static int		sflag = FALSE;
 
 int
 main(argc, argv)
@@ -486,10 +506,15 @@
 	(void) textdomain(TZ_DOMAIN);
 #endif /* HAVE_GETTEXT */
 	progname = argv[0];
+	if (TYPE_BIT(zic_t) < 64) {
+		(void) fprintf(stderr, "%s: %s\n", progname,
+			_("wild compilation-time specification of zic_t"));
+		exit(EXIT_FAILURE);
+	}
 	for (i = 1; i < argc; ++i)
 		if (strcmp(argv[i], "--version") == 0) {
 			(void) printf("%s\n", elsieid);
-			(void) exit(EXIT_SUCCESS);
+			exit(EXIT_SUCCESS);
 		}
 	while ((c = getopt(argc, argv, "d:l:p:L:vsy:")) != EOF && c != -1)
 		switch (c) {
@@ -502,7 +527,7 @@
 					(void) fprintf(stderr,
 _("%s: More than one -d option specified\n"),
 						progname);
-					(void) exit(EXIT_FAILURE);
+					exit(EXIT_FAILURE);
 				}
 				break;
 			case 'l':
@@ -512,7 +537,7 @@
 					(void) fprintf(stderr,
 _("%s: More than one -l option specified\n"),
 						progname);
-					(void) exit(EXIT_FAILURE);
+					exit(EXIT_FAILURE);
 				}
 				break;
 			case 'p':
@@ -522,7 +547,7 @@
 					(void) fprintf(stderr,
 _("%s: More than one -p option specified\n"),
 						progname);
-					(void) exit(EXIT_FAILURE);
+					exit(EXIT_FAILURE);
 				}
 				break;
 			case 'y':
@@ -532,7 +557,7 @@
 					(void) fprintf(stderr,
 _("%s: More than one -y option specified\n"),
 						progname);
-					(void) exit(EXIT_FAILURE);
+					exit(EXIT_FAILURE);
 				}
 				break;
 			case 'L':
@@ -542,14 +567,14 @@
 					(void) fprintf(stderr,
 _("%s: More than one -L option specified\n"),
 						progname);
-					(void) exit(EXIT_FAILURE);
+					exit(EXIT_FAILURE);
 				}
 				break;
 			case 'v':
 				noise = TRUE;
 				break;
 			case 's':
-				sflag = TRUE;
+				(void) printf("%s: -s ignored\n", progname);
 				break;
 		}
 	if (optind == argc - 1 && strcmp(argv[optind], "=") == 0)
@@ -569,7 +594,7 @@
 	for (i = optind; i < argc; ++i)
 		infile(argv[i]);
 	if (errors)
-		(void) exit(EXIT_FAILURE);
+		exit(EXIT_FAILURE);
 	associate();
 	for (i = 0; i < nzones; i = j) {
 		/*
@@ -634,7 +659,7 @@
 		int	result;
 
 		if (mkdirs(toname) != 0)
-			(void) exit(EXIT_FAILURE);
+			exit(EXIT_FAILURE);
 
 		result = link(fromname, toname);
 #if HAVE_SYMLINK
@@ -648,14 +673,14 @@
 					symlinkcontents =
 						ecatalloc(symlinkcontents,
 						"../");
-					symlinkcontents =
-						ecatalloc(symlinkcontents,
-						fromfile);
-					result = symlink(symlinkcontents,
-						toname);
-//					if (result == 0)
-//warning(_("hard link failed, symbolic link used"));
-					ifree(symlinkcontents);
+				symlinkcontents =
+					ecatalloc(symlinkcontents,
+					fromname);
+				result = symlink(symlinkcontents,
+					toname);
+				if (result == 0)
+warning(_("hard link failed, symbolic link used"));
+				ifree(symlinkcontents);
 		}
 #endif /* HAVE_SYMLINK */
 		if (result != 0) {
@@ -664,61 +689,24 @@
 			(void) fprintf(stderr,
 				_("%s: Can't link from %s to %s: %s\n"),
 				progname, fromname, toname, e);
-			(void) exit(EXIT_FAILURE);
+			exit(EXIT_FAILURE);
 		}
 	}
 	ifree(fromname);
 	ifree(toname);
 }
 
-#ifndef INT_MAX
-#define INT_MAX	((int) (((unsigned)~0)>>1))
-#endif /* !defined INT_MAX */
+#define TIME_T_BITS_IN_FILE	64
 
-#ifndef INT_MIN
-#define INT_MIN	((int) ~(((unsigned)~0)>>1))
-#endif /* !defined INT_MIN */
-
-/*
-** The tz file format currently allows at most 32-bit quantities.
-** This restriction should be removed before signed 32-bit values
-** wrap around in 2038, but unfortunately this will require a
-** change to the tz file format.
-*/
-
-#define MAX_BITS_IN_FILE	32
-#define TIME_T_BITS_IN_FILE	((TYPE_BIT(zic_t) < MAX_BITS_IN_FILE) ? \
-					TYPE_BIT(zic_t) : MAX_BITS_IN_FILE)
-
 static void
 setboundaries P((void))
 {
 	register int	i;
 
-	if (TYPE_SIGNED(zic_t)) {
-		min_time = -1;
-		for (i = 0; i < TIME_T_BITS_IN_FILE - 1; ++i)
-			min_time *= 2;
-		max_time = -(min_time + 1);
-		if (sflag)
-			min_time = 0;
-	} else {
-		min_time = 0;
-		max_time = 2 - sflag;
-		for (i = 0; i < TIME_T_BITS_IN_FILE - 1; ++i)
-			max_time *= 2;
-		--max_time;
-	}
-	{
-		time_t	t;
-
-		t = (time_t) min_time;
-		min_year = TM_YEAR_BASE + gmtime(&t)->tm_year;
-		t = (time_t) max_time;
-		max_year = TM_YEAR_BASE + gmtime(&t)->tm_year;
-	}
-	min_year_representable = min_year;
-	max_year_representable = max_year;
+	min_time = -1;
+	for (i = 0; i < TIME_T_BITS_IN_FILE - 1; ++i)
+		min_time *= 2;
+	max_time = -(min_time + 1);
 }
 
 static int
@@ -825,7 +813,7 @@
 		}
 	}
 	if (errors)
-		(void) exit(EXIT_FAILURE);
+		exit(EXIT_FAILURE);
 }
 
 static void
@@ -849,7 +837,7 @@
 
 		(void) fprintf(stderr, _("%s: Can't open %s: %s\n"),
 			progname, name, e);
-		(void) exit(EXIT_FAILURE);
+		exit(EXIT_FAILURE);
 	}
 	wantcont = FALSE;
 	for (num = 1; ; ++num) {
@@ -859,7 +847,7 @@
 		cp = strchr(buf, '\n');
 		if (cp == NULL) {
 			error(_("line too long"));
-			(void) exit(EXIT_FAILURE);
+			exit(EXIT_FAILURE);
 		}
 		*cp = '\0';
 		fields = getfields(buf);
@@ -903,7 +891,7 @@
 					(void) fprintf(stderr,
 _("%s: panic: Invalid l_value %d\n"),
 						progname, lp->l_value);
-					(void) exit(EXIT_FAILURE);
+					exit(EXIT_FAILURE);
 			}
 		}
 		ifree((char *) fields);
@@ -911,14 +899,14 @@
 	if (ferror(fp)) {
 		(void) fprintf(stderr, _("%s: Error reading %s\n"),
 			progname, filename);
-		(void) exit(EXIT_FAILURE);
+		exit(EXIT_FAILURE);
 	}
 	if (fp != stdin && fclose(fp)) {
 		const char *e = strerror(errno);
 
 		(void) fprintf(stderr, _("%s: Error closing %s: %s\n"),
 			progname, filename, e);
-		(void) exit(EXIT_FAILURE);
+		exit(EXIT_FAILURE);
 	}
 	if (wantcont)
 		error(_("expected continuation line not found"));
@@ -993,6 +981,8 @@
 		fields[RF_MONTH], fields[RF_DAY], fields[RF_TOD]);
 	r.r_name = ecpyalloc(fields[RF_NAME]);
 	r.r_abbrvar = ecpyalloc(fields[RF_ABBRVAR]);
+	if (max_abbrvar_len < strlen(r.r_abbrvar))
+		max_abbrvar_len = strlen(r.r_abbrvar);
 	rules = (struct rule *) (void *) erealloc((char *) rules,
 		(int) ((nrules + 1) * sizeof *rules));
 	rules[nrules++] = r;
@@ -1098,6 +1088,8 @@
 	}
 	z.z_rule = ecpyalloc(fields[i_rule]);
 	z.z_format = ecpyalloc(fields[i_format]);
+	if (max_format_len < strlen(z.z_format))
+		max_format_len = strlen(z.z_format);
 	hasuntil = nfields > i_untilyear;
 	if (hasuntil) {
 		z.z_untilrule.r_filename = filename;
@@ -1159,6 +1151,11 @@
 		error(_("invalid leaping year"));
 		return;
 	}
+	if (!leapseen || leapmaxyear < year)
+		leapmaxyear = year;
+	if (!leapseen || leapminyear > year)
+		leapminyear = year;
+	leapseen = TRUE;
 	j = EPOCH_YEAR;
 	while (j != year) {
 		if (year > j) {
@@ -1313,7 +1310,8 @@
 	*/
 	cp = loyearp;
 	lp = byword(cp, begin_years);
-	if (lp != NULL) switch ((int) lp->l_value) {
+	rp->r_lowasnum = lp == NULL;
+	if (!rp->r_lowasnum) switch ((int) lp->l_value) {
 		case YR_MINIMUM:
 			rp->r_loyear = INT_MIN;
 			break;
@@ -1324,18 +1322,15 @@
 			(void) fprintf(stderr,
 				_("%s: panic: Invalid l_value %d\n"),
 				progname, lp->l_value);
-			(void) exit(EXIT_FAILURE);
+			exit(EXIT_FAILURE);
 	} else if (sscanf(cp, scheck(cp, "%d"), &rp->r_loyear) != 1) {
 		error(_("invalid starting year"));
 		return;
-	} else if (noise) {
-		if (rp->r_loyear < min_year_representable)
-			warning(_("starting year too low to be represented"));
-		else if (rp->r_loyear > max_year_representable)
-			warning(_("starting year too high to be represented"));
 	}
 	cp = hiyearp;
-	if ((lp = byword(cp, end_years)) != NULL) switch ((int) lp->l_value) {
+	lp = byword(cp, end_years);
+	rp->r_hiwasnum = lp == NULL;
+	if (!rp->r_hiwasnum) switch ((int) lp->l_value) {
 		case YR_MINIMUM:
 			rp->r_hiyear = INT_MIN;
 			break;
@@ -1349,15 +1344,10 @@
 			(void) fprintf(stderr,
 				_("%s: panic: Invalid l_value %d\n"),
 				progname, lp->l_value);
-			(void) exit(EXIT_FAILURE);
+			exit(EXIT_FAILURE);
 	} else if (sscanf(cp, scheck(cp, "%d"), &rp->r_hiyear) != 1) {
 		error(_("invalid ending year"));
 		return;
-	} else if (noise) {
-		if (rp->r_loyear < min_year_representable)
-			warning(_("ending year too low to be represented"));
-		else if (rp->r_loyear > max_year_representable)
-			warning(_("ending year too high to be represented"));
 	}
 	if (rp->r_loyear > rp->r_hiyear) {
 		error(_("starting year greater than ending year"));
@@ -1372,8 +1362,6 @@
 		}
 		rp->r_yrtype = ecpyalloc(typep);
 	}
-	if (rp->r_loyear < min_year && rp->r_loyear > 0)
-		min_year = rp->r_loyear;
 	/*
 	** Day work.
 	** Accept things such as:
@@ -1427,13 +1415,25 @@
 char * const	buf;
 {
 	register int	i;
-	register long	shift;
+	register int	shift;
 
 	for (i = 0, shift = 24; i < 4; ++i, shift -= 8)
 		buf[i] = val >> shift;
 }
 
 static void
+convert64(val, buf)
+const zic_t	val;
+char * const	buf;
+{
+	register int	i;
+	register int	shift;
+
+	for (i = 0, shift = 56; i < 8; ++i, shift -= 8)
+		buf[i] = val >> shift;
+}
+
+static void
 puttzcode(val, fp)
 const long	val;
 FILE * const	fp;
@@ -1444,28 +1444,50 @@
 	(void) fwrite((void *) buf, (size_t) sizeof buf, (size_t) 1, fp);
 }
 
+static void
+puttzcode64(val, fp)
+const zic_t	val;
+FILE * const	fp;
+{
+	char	buf[8];
+
+	convert64(val, buf);
+	(void) fwrite((void *) buf, (size_t) sizeof buf, (size_t) 1, fp);
+}
+
 static int
 atcomp(avp, bvp)
-void *	avp;
-void *	bvp;
+const void *	avp;
+const void *	bvp;
 {
-	if (((struct attype *) avp)->at < ((struct attype *) bvp)->at)
-		return -1;
-	else if (((struct attype *) avp)->at > ((struct attype *) bvp)->at)

[... truncated: 1311 lines follow ...]


From axeld at mail.berlios.de  Wed Jan 10 00:33:58 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Wed, 10 Jan 2007 00:33:58 +0100
Subject: [Haiku-commits] r19756 - haiku/trunk/src/servers/app
Message-ID: <200701092333.l09NXwsg020667@sheep.berlios.de>

Author: axeld
Date: 2007-01-10 00:33:57 +0100 (Wed, 10 Jan 2007)
New Revision: 19756
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19756&view=rev

Modified:
   haiku/trunk/src/servers/app/Desktop.cpp
Log:
Fixed minor ugliness (only visible on slow systems, such as Qemu): the mouse cursor
was drawn before the background got cleared.


Modified: haiku/trunk/src/servers/app/Desktop.cpp
===================================================================
--- haiku/trunk/src/servers/app/Desktop.cpp	2007-01-09 23:16:26 UTC (rev 19755)
+++ haiku/trunk/src/servers/app/Desktop.cpp	2007-01-09 23:33:57 UTC (rev 19756)
@@ -362,12 +362,8 @@
 	// TODO: temporary workaround, fActiveScreen will be removed
 	fActiveScreen = fVirtualScreen.ScreenAt(0);
 
-	SetCursor(NULL);
-		// this will set the default cursor
-
 	fVirtualScreen.HWInterface()->MoveCursorTo(fVirtualScreen.Frame().Width() / 2,
 		fVirtualScreen.Frame().Height() / 2);
-	fVirtualScreen.HWInterface()->SetCursorVisible(true);
 
 #if TEST_MODE
 	gInputManager->AddStream(new InputServerStream);
@@ -393,6 +389,11 @@
 
 	gFontManager->AttachUser(fUserID);
 
+	SetCursor(NULL);
+		// this will set the default cursor
+
+	fVirtualScreen.HWInterface()->SetCursorVisible(true);
+
 	return B_OK;
 }
 



From axeld at mail.berlios.de  Wed Jan 10 00:53:41 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Wed, 10 Jan 2007 00:53:41 +0100
Subject: [Haiku-commits] r19757 - haiku/trunk/src/tests/system/kernel
Message-ID: <200701092353.l09NrfcI021535@sheep.berlios.de>

Author: axeld
Date: 2007-01-10 00:53:40 +0100 (Wed, 10 Jan 2007)
New Revision: 19757
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19757&view=rev

Added:
   haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp
Modified:
   haiku/trunk/src/tests/system/kernel/Jamfile
Log:
* Added fibo_load_image test based on Manuel's fibo test from NewOS - doesn't work yet
  due to problems with wait_for_thread().
* Minor cleanup to the Jamfile.


Modified: haiku/trunk/src/tests/system/kernel/Jamfile
===================================================================
--- haiku/trunk/src/tests/system/kernel/Jamfile	2007-01-09 23:33:57 UTC (rev 19756)
+++ haiku/trunk/src/tests/system/kernel/Jamfile	2007-01-09 23:53:40 UTC (rev 19757)
@@ -3,66 +3,31 @@
 UsePrivateHeaders kernel ;
 UseHeaders $(TARGET_PRIVATE_KERNEL_HEADERS) : true ;
 
-SimpleTest port_close_test_1 :
-	port_close_test_1.cpp
-	;
+SimpleTest fibo_load_image : fibo_load_image.cpp ;
+#SimpleTest fibo_fork : fibo_fork.cpp ;
+#SimpleTest fibo_exec : fibo_exec.cpp ;
 
-SimpleTest port_close_test_2 :
-	port_close_test_2.cpp
-	;
+SimpleTest port_close_test_1 : port_close_test_1.cpp ;
+SimpleTest port_close_test_2 : port_close_test_2.cpp ;
 
-SimpleTest port_delete_test :
-	port_delete_test.cpp
-	;
+SimpleTest port_delete_test : port_delete_test.cpp ;
 
-SimpleTest port_wakeup_test_1 :
-	port_wakeup_test_1.cpp
-	;
+SimpleTest port_wakeup_test_1 : port_wakeup_test_1.cpp ;
+SimpleTest port_wakeup_test_2 : port_wakeup_test_2.cpp ;
+SimpleTest port_wakeup_test_3 : port_wakeup_test_3.cpp ;
+SimpleTest port_wakeup_test_4 : port_wakeup_test_4.cpp ;
+SimpleTest port_wakeup_test_5 : port_wakeup_test_5.cpp ;
+SimpleTest port_wakeup_test_6 : port_wakeup_test_6.cpp ;
+SimpleTest port_wakeup_test_7 : port_wakeup_test_7.cpp ;
+SimpleTest port_wakeup_test_8 : port_wakeup_test_8.cpp ;
+SimpleTest port_wakeup_test_9 : port_wakeup_test_9.cpp ;
 
-SimpleTest port_wakeup_test_2 :
-	port_wakeup_test_2.cpp
-	;
+SimpleTest transfer_area_test : transfer_area_test.cpp ;
 
-SimpleTest port_wakeup_test_3 :
-	port_wakeup_test_3.cpp
-	;
+SimpleTest syscall_time : syscall_time.cpp ;
 
-SimpleTest port_wakeup_test_4 :
-	port_wakeup_test_4.cpp
-	;
+SimpleTest yield_test : yield_test.cpp ;
 
-SimpleTest port_wakeup_test_5 :
-	port_wakeup_test_5.cpp
-	;
-
-SimpleTest port_wakeup_test_6 :
-	port_wakeup_test_6.cpp
-	;
-
-SimpleTest port_wakeup_test_7 :
-	port_wakeup_test_7.cpp
-	;
-
-SimpleTest port_wakeup_test_8 :
-	port_wakeup_test_8.cpp
-	;
-
-SimpleTest port_wakeup_test_9 :
-	port_wakeup_test_9.cpp
-	;
-
-SimpleTest transfer_area_test :
-	transfer_area_test.cpp
-	;
-
-SimpleTest syscall_time :
-	syscall_time.cpp
-	;
-
-SimpleTest yield_test :
-	yield_test.cpp
-	;
-
 SimpleTest lock_node_test :
 	lock_node_test.cpp
 	: be

Added: haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp
===================================================================
--- haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp	2007-01-09 23:33:57 UTC (rev 19756)
+++ haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp	2007-01-09 23:53:40 UTC (rev 19757)
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Copyright 2002, Manuel J. Petit. All rights reserved.
+ * Distributed under the terms of the NewOS License.
+ */
+
+
+#include 
+
+#include 
+#include 
+#include 
+
+
+static void
+usage(char const *app)
+{
+	printf("usage: %s [-s] ###\n", app);
+	exit(-1);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+	bool silent = false;
+	int num = 0;
+	int result;
+
+	switch (argc) {
+		case 2:
+			num = atoi(argv[1]);
+			break;
+		case 3:
+			if (!strcmp(argv[1], "-s")) {
+				num = atoi(argv[2]);
+				silent = true;
+				break;
+			}
+			// supposed to fall through
+
+		default:
+			usage(argv[0]);
+			break;
+	}
+
+	if (num < 2) {
+		result = 1;
+	} else {
+		char buffer[64];
+		char* args[]= { argv[0], "-s", buffer, NULL };
+		int argCount = 3;
+		status_t status;
+
+		snprintf(buffer, sizeof(buffer), "%d", num - 1);
+		thread_id threadA = load_image(argCount, (const char**)args, (const char**)environ);
+		snprintf(buffer, sizeof(buffer), "%d", num - 2);
+		thread_id threadB = load_image(argCount, (const char**)args, (const char**)environ);
+
+		resume_thread(threadA);
+		resume_thread(threadB);
+
+		while (wait_for_thread(threadA, &status) == B_INTERRUPTED)
+			;
+		result = status;
+
+		while (wait_for_thread(threadB, &status) == B_INTERRUPTED)
+			;
+		result += status;
+	}
+
+	if (silent) {
+		return result;
+	} else {
+		printf("%d\n", result);
+		return 0;
+	}
+}
+



From axeld at mail.berlios.de  Wed Jan 10 00:59:06 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Wed, 10 Jan 2007 00:59:06 +0100
Subject: [Haiku-commits] r19758 - in haiku/trunk: headers/private/kernel
	src/system/kernel
Message-ID: <200701092359.l09Nx6MW030031@sheep.berlios.de>

Author: axeld
Date: 2007-01-10 00:58:59 +0100 (Wed, 10 Jan 2007)
New Revision: 19758
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19758&view=rev

Modified:
   haiku/trunk/headers/private/kernel/team.h
   haiku/trunk/src/system/kernel/team.c
   haiku/trunk/src/system/kernel/thread.c
Log:
* Renamed get_team_death_entry() to team_get_death_entry() and make it available
  to other kernel components.
* wait_for_thread_etc() will now search the team's death entries in case the
  thread is already gone; also resume_thread() is now done later, and its return
  code will no longer matter (as we already have our death entry, no matter if
  the thread is gone now or not).
* The fibo_load_image test now works as expected (only tested with low numbers
  yet, though - the mean testing comes later (first comes functionality) :-))


Modified: haiku/trunk/headers/private/kernel/team.h
===================================================================
--- haiku/trunk/headers/private/kernel/team.h	2007-01-09 23:53:40 UTC (rev 19757)
+++ haiku/trunk/headers/private/kernel/team.h	2007-01-09 23:58:59 UTC (rev 19758)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2005, Haiku Inc.
+ * Copyright 2004-2007, Haiku Inc. All Rights Reserved.
  * Distributed under the terms of the MIT License.
  */
 #ifndef _TEAM_H
@@ -28,6 +28,8 @@
 status_t team_get_address_space(team_id id, struct vm_address_space **_addressSpace);
 char **user_team_get_arguments(void);
 int user_team_get_arg_count(void);
+status_t team_get_death_entry(struct team *team, thread_id child,
+	struct death_entry *death, struct death_entry **_freeDeath);
 bool team_is_valid(team_id id);
 struct team *team_get_team_struct_locked(team_id id);
 int32 team_max_teams(void);

Modified: haiku/trunk/src/system/kernel/team.c
===================================================================
--- haiku/trunk/src/system/kernel/team.c	2007-01-09 23:53:40 UTC (rev 19757)
+++ haiku/trunk/src/system/kernel/team.c	2007-01-09 23:58:59 UTC (rev 19758)
@@ -1289,37 +1289,6 @@
 }
 
 
-static status_t
-get_team_death_entry(struct team *team, thread_id child, struct death_entry *death,
-	struct death_entry **_freeDeath)
-{
-	struct death_entry *entry = NULL;
-
-	// find matching death entry structure
-
-	while ((entry = list_get_next_item(&team->dead_children.list, entry)) != NULL) {
-		if (child != -1 && entry->thread != child)
-			continue;
-
-		// we found one
-
-		*death = *entry;
-
-		// only remove the death entry if there aren't any other interested parties
-		if ((child == -1 && atomic_add(&team->dead_children.wait_for_any, -1) == 1)
-			|| (child != -1 && team->dead_children.wait_for_any == 0)) {
-			list_remove_link(entry);
-			team->dead_children.count--;
-			*_freeDeath = entry;
-		}
-
-		return B_OK;
-	}
-
-	return child > 0 ? B_BAD_THREAD_ID : B_WOULD_BLOCK;
-}
-
-
 /**	Gets the next pending death entry, if any. Also fills in \a _waitSem
  *	to the semaphore the caller have to wait for for other death entries.
  *	Must be called with the team lock held.
@@ -1336,7 +1305,7 @@
 		// wait for any children or a specific child of this team to die
 		*_waitSem = team->dead_children.sem;
 		*_waitCount = &team->dead_children.waiters;
-		return get_team_death_entry(team, child, death, _freeDeath);
+		return team_get_death_entry(team, child, death, _freeDeath);
 	} else if (child < 0) {
 		// we wait for all children of the specified process group
 		group = team_get_process_group_locked(team->group->session, -child);
@@ -1348,7 +1317,7 @@
 	}
 
 	for (team = group->teams; team; team = team->group_next) {
-		status = get_team_death_entry(team, -1, death, _freeDeath);
+		status = team_get_death_entry(team, -1, death, _freeDeath);
 		if (status == B_OK) {
 			atomic_add(&group->wait_for_any, -1);
 			return B_OK;
@@ -1568,6 +1537,41 @@
 }
 
 
+/** Fills the provided death entry if it's in the team.
+ *	You need to have the team lock held when calling this function.
+ */
+
+status_t
+team_get_death_entry(struct team *team, thread_id child, struct death_entry *death,
+	struct death_entry **_freeDeath)
+{
+	struct death_entry *entry = NULL;
+
+	// find matching death entry structure
+
+	while ((entry = list_get_next_item(&team->dead_children.list, entry)) != NULL) {
+		if (child != -1 && entry->thread != child)
+			continue;
+
+		// we found one
+
+		*death = *entry;
+
+		// only remove the death entry if there aren't any other interested parties
+		if ((child == -1 && atomic_add(&team->dead_children.wait_for_any, -1) == 1)
+			|| (child != -1 && team->dead_children.wait_for_any == 0)) {
+			list_remove_link(entry);
+			team->dead_children.count--;
+			*_freeDeath = entry;
+		}
+
+		return B_OK;
+	}
+
+	return child > 0 ? B_BAD_THREAD_ID : B_WOULD_BLOCK;
+}
+
+
 /** Quick check to see if we have a valid team ID.
  */
 

Modified: haiku/trunk/src/system/kernel/thread.c
===================================================================
--- haiku/trunk/src/system/kernel/thread.c	2007-01-09 23:53:40 UTC (rev 19757)
+++ haiku/trunk/src/system/kernel/thread.c	2007-01-09 23:58:59 UTC (rev 19758)
@@ -1300,15 +1300,15 @@
 wait_for_thread_etc(thread_id id, uint32 flags, bigtime_t timeout, status_t *_returnCode)
 {
 	sem_id sem = B_BAD_THREAD_ID;
-	struct death_entry death;
+	struct death_entry death, *freeDeath = NULL;
 	struct thread *thread;
 	cpu_status state;
-	status_t status;
+	status_t status = B_OK;
 
+	if (id < B_OK)
+		return B_BAD_THREAD_ID;
+
 	// we need to resume the thread we're waiting for first
-	status = resume_thread(id);
-	if (status != B_OK)
-		return status;
 
 	state = disable_interrupts();
 	GRAB_THREAD_LOCK();
@@ -1321,11 +1321,36 @@
 	}
 
 	RELEASE_THREAD_LOCK();
+
+	if (thread == NULL) {
+		// we couldn't find this thread - maybe it's already gone, and we'll
+		// find its death entry
+		GRAB_TEAM_LOCK();
+
+		status = team_get_death_entry(thread_get_current_thread()->team,
+			id, &death, &freeDeath);
+
+		RELEASE_TEAM_LOCK();
+	}
+
 	restore_interrupts(state);
 
+	if (thread == NULL && status == B_OK) {
+		// we found the thread's death entry in our team
+		if (_returnCode)
+			*_returnCode = death.status;
+
+		free(freeDeath);
+		return B_OK;
+	}
+
+	// we need to wait for the death of the thread
+
 	if (sem < B_OK)
 		return B_BAD_THREAD_ID;
 
+	resume_thread(id);
+
 	status = acquire_sem_etc(sem, 1, flags, timeout);
 
 	if (status == B_OK) {



From phoudoin at mail.berlios.de  Wed Jan 10 01:24:57 2007
From: phoudoin at mail.berlios.de (phoudoin at BerliOS)
Date: Wed, 10 Jan 2007 01:24:57 +0100
Subject: [Haiku-commits] r19759 - in haiku/trunk/src/add-ons/kernel/generic:
	. dpc
Message-ID: <200701100024.l0A0OvXG027490@sheep.berlios.de>

Author: phoudoin
Date: 2007-01-10 01:24:56 +0100 (Wed, 10 Jan 2007)
New Revision: 19759
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19759&view=rev

Added:
   haiku/trunk/src/add-ons/kernel/generic/dpc/
   haiku/trunk/src/add-ons/kernel/generic/dpc/Jamfile
   haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
Modified:
   haiku/trunk/src/add-ons/kernel/generic/Jamfile
Log:
Added a 50% work-in-progress (very few free time) generic Defered Procedure Call (DPC) kernel module. 


Modified: haiku/trunk/src/add-ons/kernel/generic/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/generic/Jamfile	2007-01-09 23:58:59 UTC (rev 19758)
+++ haiku/trunk/src/add-ons/kernel/generic/Jamfile	2007-01-10 00:24:56 UTC (rev 19759)
@@ -2,6 +2,7 @@
 
 SubInclude HAIKU_TOP src add-ons kernel generic atomizer ;
 SubInclude HAIKU_TOP src add-ons kernel generic block_io ;
+SubInclude HAIKU_TOP src add-ons kernel generic dpc ;
 SubInclude HAIKU_TOP src add-ons kernel generic fast_log ;
 SubInclude HAIKU_TOP src add-ons kernel generic ide_adapter ;
 SubInclude HAIKU_TOP src add-ons kernel generic locked_pool ;

Added: haiku/trunk/src/add-ons/kernel/generic/dpc/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/generic/dpc/Jamfile	2007-01-09 23:58:59 UTC (rev 19758)
+++ haiku/trunk/src/add-ons/kernel/generic/dpc/Jamfile	2007-01-10 00:24:56 UTC (rev 19759)
@@ -0,0 +1,8 @@
+SubDir HAIKU_TOP src add-ons kernel generic dpc ;
+
+SetSubDirSupportedPlatformsBeOSCompatible ;
+
+KernelAddon dpc :
+	dpc.c
+;
+

Added: haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-09 23:58:59 UTC (rev 19758)
+++ haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-10 00:24:56 UTC (rev 19759)
@@ -0,0 +1,155 @@
+/* Deferred Procedure Call support kernel module
+ *
+ * Copyright 2007, Haiku, Inc. All Rights Reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *		Philippe Houdoin, philippe.houdoin at free.fr
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+// #include 
+
+#define DPC_MODULE_NAME "generic/dpc/v1"
+
+typedef void (*dpc_func) (void *arg);
+
+typedef struct {
+	module_info info;
+	void * 		(*new_dpc_thread)(const char *name, long priority, int max_dpc);
+	status_t	(*delete_dpc_thread)(void *thread);
+	status_t	(*queue_dpc)(void *thread, dpc_func dpc_name, void *arg);
+} dpc_module_info;
+	
+// ----
+
+typedef struct {
+	dpc_func function;
+	void *arg;
+} dpc;
+
+typedef struct {
+	thread_id	thread;
+	sem_id		wakeup_sem;
+	int 		max_dpc;
+	spinlock	lock;
+	dpc 		list[1];
+	// max_dpc - 1 follow
+} dpc_queue;
+
+static int32
+dpc_thread(void *arg)
+{
+	// TODO:
+	// loop on acquire_sem(queue->wakeup_sem), exit on bad sem
+	// inner loop: disable interrupt, find first slot not empty, empty it, restore interrupts
+	// and call the dpc
+	return 0;
+}
+
+// ----
+
+static void *
+new_dpc_thread(const char *name, long priority, int max_dpc)
+{
+	char str[64];
+	dpc_queue *queue;
+	int i;
+	
+	queue = malloc(sizeof(dpc_queue) + (max_dpc - 1) * sizeof(dpc));
+	if (!queue)
+		return NULL;
+	
+	queue->max_dpc = max_dpc;
+	queue->lock = 0;
+	for (i = 0; i < max_dpc; i++) {
+		queue->list[i].function = NULL;
+		queue->list[i].arg = NULL;		
+	}
+
+	sprintf(str, "%.*s_wakeup_sem", (int) sizeof(str) - 11, name);
+	queue->wakeup_sem = create_sem(-1, str);
+	set_sem_owner(queue->wakeup_sem, B_SYSTEM_TEAM);
+	
+	queue->thread = spawn_kernel_thread(dpc_thread, name, priority, queue);
+	if (queue->thread < 0) {
+		delete_sem(queue->wakeup_sem);
+		free(queue);
+		return NULL;
+	}
+	resume_thread(queue->thread);
+
+	return queue;
+}
+
+
+static status_t
+delete_dpc_thread(void *thread)
+{
+	dpc_queue *queue = thread;
+	status_t exit_value;
+	
+	if (!queue)
+		return B_BAD_VALUE;
+
+	delete_sem(queue->wakeup_sem);
+	wait_for_thread(queue->thread, &exit_value);
+	free(queue);
+	
+	return B_OK;
+}
+
+
+static status_t
+queue_dpc(void *thread, dpc_func function, void *arg)
+{
+	dpc_queue *queue = thread;
+	
+	if (!queue)
+		return B_BAD_VALUE;
+
+	// TODO: acquire queue (spin)lock, find an empty slot, release lock and
+	// wakup the thread (but be interrupt handler safe here: B_DO_NOT_RESCHEDULE flag!
+	return B_ERROR;
+}
+
+
+
+static status_t
+std_ops(int32 op, ...)
+{
+	switch (op) {
+		case B_MODULE_INIT:
+			return B_OK;
+		case B_MODULE_UNINIT:
+			return B_OK;
+
+		default:
+			return B_ERROR;
+	}
+}
+
+static dpc_module_info sDPCModule = {
+	{
+		DPC_MODULE_NAME,
+		0,
+		std_ops
+	},
+	
+	new_dpc_thread,
+	delete_dpc_thread,
+	queue_dpc
+};
+
+
+module_info *modules[] = {
+	(module_info *) &sDPCModule,
+	NULL
+};
+



From phoudoin at mail.berlios.de  Wed Jan 10 01:34:05 2007
From: phoudoin at mail.berlios.de (phoudoin at BerliOS)
Date: Wed, 10 Jan 2007 01:34:05 +0100
Subject: [Haiku-commits] r19760 - haiku/trunk/src/add-ons/kernel/generic/dpc
Message-ID: <200701100034.l0A0Y5PD028339@sheep.berlios.de>

Author: phoudoin
Date: 2007-01-10 01:34:04 +0100 (Wed, 10 Jan 2007)
New Revision: 19760
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19760&view=rev

Modified:
   haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
Log:
Replaced overkilling sprintf() usage.


Modified: haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-10 00:24:56 UTC (rev 19759)
+++ haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-10 00:34:04 UTC (rev 19760)
@@ -72,8 +72,9 @@
 		queue->list[i].function = NULL;
 		queue->list[i].arg = NULL;		
 	}
-
-	sprintf(str, "%.*s_wakeup_sem", (int) sizeof(str) - 11, name);
+	
+	strncpy(str, name, sizeof(str));
+	strncat(str, "_wakeup_sem", sizeof(str));
 	queue->wakeup_sem = create_sem(-1, str);
 	set_sem_owner(queue->wakeup_sem, B_SYSTEM_TEAM);
 	



From phoudoin at mail.berlios.de  Wed Jan 10 02:08:45 2007
From: phoudoin at mail.berlios.de (phoudoin at BerliOS)
Date: Wed, 10 Jan 2007 02:08:45 +0100
Subject: [Haiku-commits] r19761 - haiku/trunk/src/add-ons/kernel/generic/dpc
Message-ID: <200701100108.l0A18j8R032075@sheep.berlios.de>

Author: phoudoin
Date: 2007-01-10 02:08:44 +0100 (Wed, 10 Jan 2007)
New Revision: 19761
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19761&view=rev

Modified:
   haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
Log:
Completed an UNTESTED implementation. Did I say it was untested already?!
Until, it's obvioulsy not ready for prime time: using it to queue AcpiOsExecute() event/method callbacks... 


Modified: haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-10 00:34:04 UTC (rev 19760)
+++ haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-10 01:08:44 UTC (rev 19761)
@@ -32,52 +32,79 @@
 typedef struct {
 	dpc_func function;
 	void *arg;
-} dpc;
+} dpc_slot;
 
 typedef struct {
 	thread_id	thread;
 	sem_id		wakeup_sem;
-	int 		max_dpc;
 	spinlock	lock;
-	dpc 		list[1];
-	// max_dpc - 1 follow
+	int 		size;
+	int			head;
+	int 		tail;
+	dpc_slot	slots[0];
+	// size * slots follow
 } dpc_queue;
 
 static int32
 dpc_thread(void *arg)
 {
-	// TODO:
-	// loop on acquire_sem(queue->wakeup_sem), exit on bad sem
-	// inner loop: disable interrupt, find first slot not empty, empty it, restore interrupts
-	// and call the dpc
+	dpc_queue *queue = arg;
+	
+	if (!queue)
+		return -1;
+
+	// Let's wait forever/until sem death for DPC to show up
+	while (acquire_sem(queue->wakeup_sem) == B_OK) {
+		cpu_status former;
+		int i;
+		dpc_slot call;
+	
+		// grab the next dpc slot
+		former = disable_interrupts();
+		acquire_spinlock(&queue->lock);
+		
+		call = queue->slots[queue->head];
+		queue->head = (queue->head++) % queue->size;
+
+		release_spinlock(&queue->lock);
+		restore_interrupts(former);
+		
+		if (call.function)
+			call.function(call.arg);
+	}
+
+	// Let's die quietly, ignored by all...
 	return 0;
 }
 
 // ----
 
 static void *
-new_dpc_thread(const char *name, long priority, int max_dpc)
+new_dpc_thread(const char *name, long priority, int queue_size)
 {
 	char str[64];
 	dpc_queue *queue;
-	int i;
 	
-	queue = malloc(sizeof(dpc_queue) + (max_dpc - 1) * sizeof(dpc));
+	queue = malloc(sizeof(dpc_queue) + queue_size * sizeof(dpc_slot));
 	if (!queue)
 		return NULL;
 	
-	queue->max_dpc = max_dpc;
+	queue->head = queue->tail = 0;
+	queue->size = queue_size;
 	queue->lock = 0;
-	for (i = 0; i < max_dpc; i++) {
-		queue->list[i].function = NULL;
-		queue->list[i].arg = NULL;		
-	}
 	
 	strncpy(str, name, sizeof(str));
 	strncat(str, "_wakeup_sem", sizeof(str));
+
 	queue->wakeup_sem = create_sem(-1, str);
+	if (queue->wakeup_sem < B_OK) {
+		free(queue);
+		return NULL;
+	}
 	set_sem_owner(queue->wakeup_sem, B_SYSTEM_TEAM);
 	
+	// Fire a kernel thread to do actually do
+	// the deferred procedure calls
 	queue->thread = spawn_kernel_thread(dpc_thread, name, priority, queue);
 	if (queue->thread < 0) {
 		delete_sem(queue->wakeup_sem);
@@ -99,6 +126,7 @@
 	if (!queue)
 		return B_BAD_VALUE;
 
+	// Wakeup the thread by murdering its favorite semaphore 
 	delete_sem(queue->wakeup_sem);
 	wait_for_thread(queue->thread, &exit_value);
 	free(queue);
@@ -111,13 +139,26 @@
 queue_dpc(void *thread, dpc_func function, void *arg)
 {
 	dpc_queue *queue = thread;
+	cpu_status former;
 	
 	if (!queue)
 		return B_BAD_VALUE;
 
-	// TODO: acquire queue (spin)lock, find an empty slot, release lock and
-	// wakup the thread (but be interrupt handler safe here: B_DO_NOT_RESCHEDULE flag!
-	return B_ERROR;
+	// Take measure to be safe to be called from interrupt handlers:
+	former = disable_interrupts();
+	acquire_spinlock(&queue->lock);
+	
+	queue->slots[queue->tail].function = function;
+	queue->slots[queue->tail].arg      = arg;
+	queue->tail = (queue->tail++) %  queue->size;
+	
+	release_spinlock(&queue->lock);
+	restore_interrupts(former);
+
+	// wake up the corresponding dpc thead
+	// Notice that the interrupt handler should returns B_INVOKE_SCHEDULER for
+	// shortest DPC latency...
+	return release_sem_etc(queue->wakeup_sem, 1, B_DO_NOT_RESCHEDULE);
 }
 
 



From phoudoin at mail.berlios.de  Wed Jan 10 02:26:51 2007
From: phoudoin at mail.berlios.de (phoudoin at BerliOS)
Date: Wed, 10 Jan 2007 02:26:51 +0100
Subject: [Haiku-commits] r19762 - haiku/trunk/src/add-ons/kernel/generic/dpc
Message-ID: <200701100126.l0A1QpLR003015@sheep.berlios.de>

Author: phoudoin
Date: 2007-01-10 02:26:49 +0100 (Wed, 10 Jan 2007)
New Revision: 19762
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19762&view=rev

Modified:
   haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
Log:
Late cleanup a bit before actually going to bed. Good night world.


Modified: haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-10 01:08:44 UTC (rev 19761)
+++ haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-10 01:26:49 UTC (rev 19762)
@@ -8,32 +8,34 @@
  */
 
 #include 
-#include 
-#include 
 #include 
 
 #include 
 
 // #include 
 
+// ----
+// To be moved into a new headers/os/drivers/dpc.h:
 #define DPC_MODULE_NAME "generic/dpc/v1"
 
 typedef void (*dpc_func) (void *arg);
 
 typedef struct {
 	module_info info;
-	void * 		(*new_dpc_thread)(const char *name, long priority, int max_dpc);
+	void * 		(*new_dpc_thread)(const char *name, long priority, int queue_size);
 	status_t	(*delete_dpc_thread)(void *thread);
 	status_t	(*queue_dpc)(void *thread, dpc_func dpc_name, void *arg);
 } dpc_module_info;
-	
 // ----
 
+// Private DPC queue structures
+
 typedef struct {
-	dpc_func function;
-	void *arg;
+	dpc_func 	function;
+	void 		*arg;
 } dpc_slot;
 
+
 typedef struct {
 	thread_id	thread;
 	sem_id		wakeup_sem;
@@ -45,6 +47,7 @@
 	// size * slots follow
 } dpc_queue;
 
+
 static int32
 dpc_thread(void *arg)
 {
@@ -53,10 +56,9 @@
 	if (!queue)
 		return -1;
 
-	// Let's wait forever/until sem death for DPC to show up
+	// Let's wait forever/until semaphore death for new DPC slot to show up
 	while (acquire_sem(queue->wakeup_sem) == B_OK) {
 		cpu_status former;
-		int i;
 		dpc_slot call;
 	
 		// grab the next dpc slot
@@ -73,11 +75,11 @@
 			call.function(call.arg);
 	}
 
-	// Let's die quietly, ignored by all...
+	// Let's die quietly, ignored by all... sigh.
 	return 0;
 }
 
-// ----
+// ---- Public API
 
 static void *
 new_dpc_thread(const char *name, long priority, int queue_size)
@@ -91,7 +93,7 @@
 	
 	queue->head = queue->tail = 0;
 	queue->size = queue_size;
-	queue->lock = 0;
+	queue->lock = 0;	// Init the spinlock
 	
 	strncpy(str, name, sizeof(str));
 	strncat(str, "_wakeup_sem", sizeof(str));
@@ -103,8 +105,8 @@
 	}
 	set_sem_owner(queue->wakeup_sem, B_SYSTEM_TEAM);
 	
-	// Fire a kernel thread to do actually do
-	// the deferred procedure calls
+	// Fire a kernel thread to actually handle (aka call them!)
+	// the queued/deferred procedure calls
 	queue->thread = spawn_kernel_thread(dpc_thread, name, priority, queue);
 	if (queue->thread < 0) {
 		delete_sem(queue->wakeup_sem);
@@ -129,6 +131,7 @@
 	// Wakeup the thread by murdering its favorite semaphore 
 	delete_sem(queue->wakeup_sem);
 	wait_for_thread(queue->thread, &exit_value);
+
 	free(queue);
 	
 	return B_OK;
@@ -144,20 +147,20 @@
 	if (!queue)
 		return B_BAD_VALUE;
 
-	// Take measure to be safe to be called from interrupt handlers:
+	// Try to be safe being called from interrupt handlers:
 	former = disable_interrupts();
 	acquire_spinlock(&queue->lock);
 	
 	queue->slots[queue->tail].function = function;
 	queue->slots[queue->tail].arg      = arg;
-	queue->tail = (queue->tail++) %  queue->size;
+	queue->tail = (queue->tail++) % queue->size;
 	
 	release_spinlock(&queue->lock);
 	restore_interrupts(former);
 
-	// wake up the corresponding dpc thead
-	// Notice that the interrupt handler should returns B_INVOKE_SCHEDULER for
-	// shortest DPC latency...
+	// Wake up the corresponding dpc thead
+	// Notice that interrupt handlers should returns B_INVOKE_SCHEDULER to
+	// shorten DPC latency as much as possible...
 	return release_sem_etc(queue->wakeup_sem, 1, B_DO_NOT_RESCHEDULE);
 }
 



From korli at users.berlios.de  Wed Jan 10 10:06:19 2007
From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=)
Date: Wed, 10 Jan 2007 10:06:19 +0100
Subject: [Haiku-commits] r19759 - in
	haiku/trunk/src/add-ons/kernel/generic: . dpc
In-Reply-To: <200701100024.l0A0OvXG027490@sheep.berlios.de>
References: <200701100024.l0A0OvXG027490@sheep.berlios.de>
Message-ID: 

Hi Philippe,

2007/1/10, phoudoin at BerliOS :
> Added a 50% work-in-progress (very few free time) generic Defered Procedure Call (DPC) kernel module.
>

This is nice from you :)
Still I'm wondering if it could be slightly modified for the need of
the ACPI module ... In fact, ACPI would need four thread priorities,
which would mean four threads with your implementation.
Would it be possible to one thread which uses set_thread_priority()
before launching the task ? (would mean including the thread priority
in each dpc item)

Another weird thing is the list maximum. I would find better to use
the single-linked list without such a limitation. But maybe you did
this because it's needed for the queue_dpc to be called in interrupt
context ?

Bye,
J?r?me


From axeld at pinc-software.de  Wed Jan 10 10:51:19 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Wed, 10 Jan 2007 10:51:19 +0100 (MET)
Subject: [Haiku-commits] r19760 -
 haiku/trunk/src/add-ons/kernel/generic/dpc
In-Reply-To: <200701100034.l0A0Y5PD028339@sheep.berlios.de>
Message-ID: <1189984979-BeMail@zon>

phoudoin at BerliOS  wrote:
> -	sprintf(str, "%.*s_wakeup_sem", (int) sizeof(str) - 11, name);
> +	
> +	strncpy(str, name, sizeof(str));
> +	strncat(str, "_wakeup_sem", sizeof(str));

We do have snprintf() in the kernel, and please make use of it instead 
of this unsafe version.
Just remove strncpy()/strncat() from your brain, they shouldn't be used 
this way, ever.

Bye,
   Axel.



From philippe.houdoin at free.fr  Wed Jan 10 10:59:20 2007
From: philippe.houdoin at free.fr (Philippe Houdoin)
Date: Wed, 10 Jan 2007 10:59:20 +0100
Subject: [Haiku-commits] r19760 - haiku/trunk/src/add-ons/kernel/generic/dpc
Message-ID: <1168423160.45a4b8f819d90@imp4-g19.free.fr>

Axel remarked:
>> -	sprintf(str, "%.*s_wakeup_sem", (int) sizeof(str) - 11, name);
>> +
>> +	strncpy(str, name, sizeof(str));
>> +	strncat(str, "_wakeup_sem", sizeof(str));
>
> We do have snprintf() in the kernel, and please make use of it instead
> of this unsafe version.

For debugging purpose, I was building against R5 (well, BONE) kernel, where
snprintf() don't exists. Hence the initial sprintf(), which I found a bit
overkill and unsafe.

> Just remove strncpy()/strncat() from your brain, they shouldn't be used
> this way, ever.

How nice, a neuro-strnxtomy!

Joke apart, I'll change to use snprintf() for haiku target, indeed.
But, for my own enlightment, what *so* wrong about using those this way, beside
the unsafety (no warranted trailing zero, right?) ?

Bye,
   Axel.


From axeld at pinc-software.de  Wed Jan 10 10:59:49 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Wed, 10 Jan 2007 10:59:49 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?r19759_-_in_haiku/trunk/src/add-o?=
	=?iso-8859-15?q?ns/kernel/generic=3A_=2E_dpc?=
In-Reply-To: 
Message-ID: <1701317306-BeMail@zon>

"J?r?me Duval"  wrote:
> Still I'm wondering if it could be slightly modified for the need of
> the ACPI module ... In fact, ACPI would need four thread priorities,
> which would mean four threads with your implementation.
> Would it be possible to one thread which uses set_thread_priority()
> before launching the task ? (would mean including the thread priority
> in each dpc item)

If really needed the function you call could do this, but why should it 
be important to have that many different priorities?

> Another weird thing is the list maximum. I would find better to use
> the single-linked list without such a limitation. But maybe you did
> this because it's needed for the queue_dpc to be called in interrupt
> context ?

Doubly-linked list functions can be used with interrupts turned off as 
well, though :-)
And indeed, I would go that route here, too.

Bye,
   Axel.



From axeld at mail.berlios.de  Wed Jan 10 11:02:46 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Wed, 10 Jan 2007 11:02:46 +0100
Subject: [Haiku-commits] r19763 - haiku/trunk/src/tests/system/kernel
Message-ID: <200701101002.l0AA2kRm030785@sheep.berlios.de>

Author: axeld
Date: 2007-01-10 11:02:46 +0100 (Wed, 10 Jan 2007)
New Revision: 19763
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19763&view=rev

Modified:
   haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp
Log:
fibo_load_image now notices if spawn_thread() fails, and puts a warning to stderr.


Modified: haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp
===================================================================
--- haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp	2007-01-10 01:26:49 UTC (rev 19762)
+++ haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp	2007-01-10 10:02:46 UTC (rev 19763)
@@ -56,8 +56,17 @@
 
 		snprintf(buffer, sizeof(buffer), "%d", num - 1);
 		thread_id threadA = load_image(argCount, (const char**)args, (const char**)environ);
+		if (threadA < B_OK) {
+			fprintf(stderr, "Could not create thread A: %s\n", strerror(threadA));
+			return -1;
+		}
+
 		snprintf(buffer, sizeof(buffer), "%d", num - 2);
 		thread_id threadB = load_image(argCount, (const char**)args, (const char**)environ);
+		if (threadB < B_OK) {
+			fprintf(stderr, "Could not create thread B: %s\n", strerror(threadB));
+			return -1;
+		}
 
 		resume_thread(threadA);
 		resume_thread(threadB);



From axeld at pinc-software.de  Wed Jan 10 11:09:19 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Wed, 10 Jan 2007 11:09:19 +0100 (MET)
Subject: [Haiku-commits] r19760 -
 haiku/trunk/src/add-ons/kernel/generic/dpc
In-Reply-To: <1168423160.45a4b8f819d90@imp4-g19.free.fr>
Message-ID: <2270745125-BeMail@zon>

Philippe Houdoin  wrote:
> Axel remarked:
> >> -	sprintf(str, "%.*s_wakeup_sem", (int) sizeof(str) - 11, name);
> >> +
> >> +	strncpy(str, name, sizeof(str));
> >> +	strncat(str, "_wakeup_sem", sizeof(str));
> > We do have snprintf() in the kernel, and please make use of it 
> > instead
> > of this unsafe version.
> For debugging purpose, I was building against R5 (well, BONE) kernel, 
> where
> snprintf() don't exists. Hence the initial sprintf(), which I found a 
> bit
> overkill and unsafe.

Indeed. Even though I thought only PPC didn't have snprintf() (as 
opposed to strlcat()/strlcpy() which were only added to Dano and up).

> > Just remove strncpy()/strncat() from your brain, they shouldn't be 
> > used
> > this way, ever.
> How nice, a neuro-strnxtomy!
> 
> Joke apart, I'll change to use snprintf() for haiku target, indeed.
> But, for my own enlightment, what *so* wrong about using those this 
> way, beside
> the unsafety (no warranted trailing zero, right?) ?

Yes, in this case it isn't as bad, as str[] is larger than 
B_OS_NAME_LENGTH, but if it were the other way around you would at 
least have some garbage at the end.
Since you're passing it to create_sem() you can *assume* it will handle 
this gracefully, but you can't always just do this; at least that 
wouldn't qualify as defensive programming :-)

Bye,
   Axel.



From philippe.houdoin at free.fr  Wed Jan 10 10:47:16 2007
From: philippe.houdoin at free.fr (Philippe Houdoin)
Date: Wed, 10 Jan 2007 10:47:16 +0100
Subject: [Haiku-commits] r19759 - in
	haiku/trunk/src/add-ons/kernel/generic: . dpc
Message-ID: <1168422436.45a4b6241f934@imp4-g19.free.fr>

>> Added a 50% work-in-progress (very few free time) generic Defered
>> Procedure Call (DPC) kernel module.
>
> This is nice from you :)
> Still I'm wondering if it could be slightly modified for the need of
> the ACPI module ... In fact, ACPI would need four thread priorities,
> which would mean four threads with your implementation.
> Would it be possible to one thread which uses set_thread_priority()
> before launching the task ? (would mean including the thread priority
> in each dpc item)

While it's perfectly possible, does it worth both the effort and the bit of
bloat it will add. After all, what's wrong with four "ACPI_dpc" kernel threads?
Otherwise, can't we use a single urgent priority DPC thread for all ACPI dpcs?

Anyway, sure calling set_thread_priority() before each task is easy. I just
follow the BeOS R5 dpc design, where each dpc thread run at his own priority
(ps | grep dpc).

> Another weird thing is the list maximum. I would find better to use
> the single-linked list without such a limitation. But maybe you did
> this because it's needed for the queue_dpc to be called in interrupt
> context ?

Exactly. No malloc from queue_dpc() allowed. I try to keep it stupid simple. In
the process, I lost all dynamics, indeed. Maybe it could be enhanced later.

I plan to test the current implementation tonight, please tell me *before* if I
should not bother that much ;-)

- Philippe


From korli at users.berlios.de  Wed Jan 10 11:15:05 2007
From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=)
Date: Wed, 10 Jan 2007 11:15:05 +0100
Subject: [Haiku-commits] r19759 - in
	haiku/trunk/src/add-ons/kernel/generic: . dpc
In-Reply-To: <1701317306-BeMail@zon>
References: 
	<1701317306-BeMail@zon>
Message-ID: 

2007/1/10, Axel D?rfler :
> "J?r?me Duval"  wrote:
> > Still I'm wondering if it could be slightly modified for the need of
> > the ACPI module ... In fact, ACPI would need four thread priorities,
> > which would mean four threads with your implementation.
> > Would it be possible to one thread which uses set_thread_priority()
> > before launching the task ? (would mean including the thread priority
> > in each dpc item)
>
> If really needed the function you call could do this, but why should it
> be important to have that many different priorities?

The thread priority isn't that important. The ordering of the task
list is important : adding a top priority task to the end of the list
isn't right.

>
> > Another weird thing is the list maximum. I would find better to use
> > the single-linked list without such a limitation. But maybe you did
> > this because it's needed for the queue_dpc to be called in interrupt
> > context ?
>
> Doubly-linked list functions can be used with interrupts turned off as
> well, though :-)
> And indeed, I would go that route here, too.

I had a look at FreeBSD ACPICA OsExecute and it calls malloc() in
interrupt context. It seems we don't have the same malloc
implementation. In Haiku, this would enforce the need for already
allocated task items (ie in an unused slots list).

Bye,
J?r?me


From axeld at mail.berlios.de  Wed Jan 10 11:33:02 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Wed, 10 Jan 2007 11:33:02 +0100
Subject: [Haiku-commits] r19764 - haiku/trunk/src/tests/system/kernel
Message-ID: <200701101033.l0AAX2OT001492@sheep.berlios.de>

Author: axeld
Date: 2007-01-10 11:33:01 +0100 (Wed, 10 Jan 2007)
New Revision: 19764
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19764&view=rev

Added:
   haiku/trunk/src/tests/system/kernel/fibo_fork.cpp
Modified:
   haiku/trunk/src/tests/system/kernel/Jamfile
   haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp
Log:
* Fixed fibo_load_image: it actually did not produce the fibonacci numbers.
* Implemented a fibo_fork which uses fork() instead.
* Both tests can pretty easily let the kernel crash!


Modified: haiku/trunk/src/tests/system/kernel/Jamfile
===================================================================
--- haiku/trunk/src/tests/system/kernel/Jamfile	2007-01-10 10:02:46 UTC (rev 19763)
+++ haiku/trunk/src/tests/system/kernel/Jamfile	2007-01-10 10:33:01 UTC (rev 19764)
@@ -4,7 +4,7 @@
 UseHeaders $(TARGET_PRIVATE_KERNEL_HEADERS) : true ;
 
 SimpleTest fibo_load_image : fibo_load_image.cpp ;
-#SimpleTest fibo_fork : fibo_fork.cpp ;
+SimpleTest fibo_fork : fibo_fork.cpp ;
 #SimpleTest fibo_exec : fibo_exec.cpp ;
 
 SimpleTest port_close_test_1 : port_close_test_1.cpp ;

Added: haiku/trunk/src/tests/system/kernel/fibo_fork.cpp
===================================================================
--- haiku/trunk/src/tests/system/kernel/fibo_fork.cpp	2007-01-10 10:02:46 UTC (rev 19763)
+++ haiku/trunk/src/tests/system/kernel/fibo_fork.cpp	2007-01-10 10:33:01 UTC (rev 19764)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Copyright 2002, Manuel J. Petit. All rights reserved.
+ * Distributed under the terms of the NewOS License.
+ */
+
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+int gForked = 0;
+
+
+static void
+usage(char const *app)
+{
+	printf("usage: %s ###\n", app);
+	exit(-1);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+	int result = 0;
+
+	if (argc != 2)
+		usage(argv[0]);
+
+	int num = atoi(argv[1]);
+
+	if (num < 2) {
+		result = num;
+	} else {
+		pid_t childA = fork();
+		if (childA == 0) {
+			// we're the child
+			char buffer[64];
+			char* args[]= { argv[0], buffer, NULL };
+			int argCount = 2;
+			gForked++;
+
+			snprintf(buffer, sizeof(buffer), "%d", num - 1);
+			return main(argCount, args);
+		} else if (childA < 0) {
+			fprintf(stderr, "fork() failed for child A: %s\n", strerror(errno));
+			return -1;
+		}
+
+		pid_t childB = fork();
+		if (childB == 0) {
+			// we're the child
+			char buffer[64];
+			char* args[]= { argv[0], buffer, NULL };
+			int argCount = 2;
+			gForked++;
+
+			snprintf(buffer, sizeof(buffer), "%d", num - 2);
+			return main(argCount, args);
+		} else if (childB < 0) {
+			fprintf(stderr, "fork() failed for child B: %s\n", strerror(errno));
+			return -1;
+		}
+
+		status_t status;
+		while (wait_for_thread(childA, &status) == B_INTERRUPTED)
+			;
+		result = status;
+
+		while (wait_for_thread(childB, &status) == B_INTERRUPTED)
+			;
+		result += status;
+	}
+
+	if (gForked) {
+		return result;
+	} else {
+		printf("%d\n", result);
+		return 0;
+	}
+}
+

Modified: haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp
===================================================================
--- haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp	2007-01-10 10:02:46 UTC (rev 19763)
+++ haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp	2007-01-10 10:33:01 UTC (rev 19764)
@@ -47,7 +47,7 @@
 	}
 
 	if (num < 2) {
-		result = 1;
+		result = num;
 	} else {
 		char buffer[64];
 		char* args[]= { argv[0], "-s", buffer, NULL };



From axeld at pinc-software.de  Wed Jan 10 11:37:55 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Wed, 10 Jan 2007 11:37:55 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?r19759_-_in_haiku/trunk/src/add-o?=
	=?iso-8859-15?q?ns/kernel/generic=3A_=2E_dpc?=
In-Reply-To: 
Message-ID: <223210204-BeMail@zon>

"J?r?me Duval"  wrote:
> > If really needed the function you call could do this, but why 
> > should it
> > be important to have that many different priorities?
> The thread priority isn't that important. The ordering of the task
> list is important : adding a top priority task to the end of the list
> isn't right.

Ah, so queue_dpc() should get a priority member?

> > Doubly-linked list functions can be used with interrupts turned off 
> > as
> > well, though :-)
> > And indeed, I would go that route here, too.
> I had a look at FreeBSD ACPICA OsExecute and it calls malloc() in
> interrupt context. It seems we don't have the same malloc
> implementation. In Haiku, this would enforce the need for already
> allocated task items (ie in an unused slots list).

While this would be at least possible, are you sure it's even called in 
interrupt context?

Bye,
   Axel.



From axeld at pinc-software.de  Wed Jan 10 11:40:37 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Wed, 10 Jan 2007 11:40:37 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?r19759_-_in_haiku/trunk/src/add-o?=
	=?iso-8859-15?q?ns/kernel/generic=3A_=2E_dpc?=
In-Reply-To: <1168422436.45a4b6241f934@imp4-g19.free.fr>
Message-ID: <384693969-BeMail@zon>

Philippe Houdoin  wrote:
> While it's perfectly possible, does it worth both the effort and the 
> bit of
> bloat it will add. After all, what's wrong with four "ACPI_dpc" 
> kernel threads?

It wastes kernel resources for no reason: 8K per thread stack that 
cannot be paged out plus the thread structures.

Bye,
   Axel.



From axeld at pinc-software.de  Wed Jan 10 11:43:13 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Wed, 10 Jan 2007 11:43:13 +0100 (MET)
Subject: [Haiku-commits] r19764 - haiku/trunk/src/tests/system/kernel
In-Reply-To: <200701101033.l0AAX2OT001492@sheep.berlios.de>
Message-ID: <540207930-BeMail@zon>

axeld at BerliOS  wrote:
> Log:
> * Fixed fibo_load_image: it actually did not produce the fibonacci 
> numbers.
> * Implemented a fibo_fork which uses fork() instead.
> * Both tests can pretty easily let the kernel crash!

Beware, while fibo_load_image doesn't even work on BeOS (for whatever 
reason, load_image() is always aborted with B_INTERRUPTED), fibo_fork 
does, and you can easily crash BeOS with it, too... (at least the Dano 
flavour, didn't test R5 yet)

Bye,
   Axel.



From marcusoverhagen at arcor.de  Wed Jan 10 11:52:14 2007
From: marcusoverhagen at arcor.de (Marcus Overhagen)
Date: Wed, 10 Jan 2007 11:52:14 +0100 (CET)
Subject: [Haiku-commits] r19759 -
	in	haiku/trunk/src/add-ons/kernel/generic: . dpc
Message-ID: <3402216.1168426334830.JavaMail.ngmail@webmail17>

Philippe Houdoin wrote:

> I plan to test the current implementation tonight, please tell me *before*
> if I should not bother that much ;-)

I think the current implementation has the following issues:

>    if (!queue)
>        return -1;
This check isn't very useful. Personally I would prefer a crash in acquire_sem(queue->wakeup_sem)
if queue is really 0 at this place, instead of not knowing why it doesn't work at all.

>    if (call.function)
>        call.function(call.arg);
Checking if function is 0 could be moved into queue_dpc, this would save much overhead
in case function is 0.

> while (acquire_sem(queue->wakeup_sem) == B_OK) {
This prevents suspending / resuming the thread, which is sometimes
usefull for debugging. I would suggest using 
for (;;)
    ret = acquire_sem(
    if (ret == B_INTERRUPTED)
      continue;
    if (ret != B_OK)
      break;


> queue->wakeup_sem = create_sem(-1, str);
This must initialize with 0, not with -1


> queue->slots[queue->tail].function = function;
> queue->slots[queue->tail].arg      = arg;
> queue->tail = (queue->tail++) % queue->size;
This will overwrite entries once the queue is full, they will never be executed.

hth
Marcus


Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: g?nstig
und schnell mit DSL - das All-Inclusive-Paket f?r clevere Doppel-Sparer,
nur  44,85 ?  inkl. DSL- und ISDN-Grundgeb?hr!
http://www.arcor.de/rd/emf-dsl-2


From philippe.houdoin at free.fr  Wed Jan 10 12:03:56 2007
From: philippe.houdoin at free.fr (Philippe Houdoin)
Date: Wed, 10 Jan 2007 12:03:56 +0100
Subject: [Haiku-commits] Haiku-commits] r19759 - in
	haiku/trunk/src/add-ons/kernel/generic: . dpc
Message-ID: <1168427036.45a4c81c41bfc@imp4-g19.free.fr>

Axel asked:
> Jerome added:
>> The thread priority isn't that important. The ordering of the task
>> list is important : adding a top priority task to the end of the list
>> isn't right.
>
> Ah, so queue_dpc() should get a priority member?

Or choose the corresponding priority dpc thread.

> > Doubly-linked list functions can be used with interrupts turned off
> > as
> > well, though :-)
> > And indeed, I would go that route here, too.

Okay, I didn't see that. But in such case doesn't the caller should manage
allocating each new element to add the list instead?
I don't see how queue_dpc() could allocate a new dpc entry from interrupt
context. Except if it's from a pre-allocated dpc entries pool. Does kernel
double/linked_list provide this feature? util/queue don't either AFAIK, right?

>> I had a look at FreeBSD ACPICA OsExecute and it calls malloc() in
>> interrupt context. It seems we don't have the same malloc
>> implementation. In Haiku, this would enforce the need for already
>> allocated task items (ie in an unused slots list).
>
> While this would be at least possible, are you sure it's even called in
> interrupt context?

Oh yes.
It's called from the Acpi Event interrupt handler (AcpiEvSciXruptHandler) and is
why ACPI was crashing the kernel recently, until we disable it. The last ACPI-CA
code imported by Jerome introduced calling automatically methods on fixed ACPI
events, which crash due to our current AcpiOsExecute(): spawn_kernel_thread()
requires allocation.

Under Linux, it used kernel DPC queue to push the task. IIRC, only one queue is
used, and they don't care that much about priority (aka FIFO). I'll check
again.

- philippe


From korli at users.berlios.de  Wed Jan 10 12:06:32 2007
From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=)
Date: Wed, 10 Jan 2007 12:06:32 +0100
Subject: [Haiku-commits] r19759 - in
	haiku/trunk/src/add-ons/kernel/generic: . dpc
In-Reply-To: <223210204-BeMail@zon>
References: 
	<223210204-BeMail@zon>
Message-ID: 

2007/1/10, Axel D?rfler :
> "J?r?me Duval"  wrote:
> > > If really needed the function you call could do this, but why
> > > should it
> > > be important to have that many different priorities?
> > The thread priority isn't that important. The ordering of the task
> > list is important : adding a top priority task to the end of the list
> > isn't right.
>
> Ah, so queue_dpc() should get a priority member?

Seems the way to go indeed. It would just help to place to task in the list.

>
> > > Doubly-linked list functions can be used with interrupts turned off
> > > as
> > > well, though :-)
> > > And indeed, I would go that route here, too.
> > I had a look at FreeBSD ACPICA OsExecute and it calls malloc() in
> > interrupt context. It seems we don't have the same malloc
> > implementation. In Haiku, this would enforce the need for already
> > allocated task items (ie in an unused slots list).
>
> While this would be at least possible, are you sure it's even called in
> interrupt context?
>

I'm pretty sure : the comment says it does. And you might remember the
very same function was called in interrupt context for two people on
the main list !

If you want to have a look :
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/acpica/Osd/OsdSchedule.c?rev=1.37&content-type=text/x-cvsweb-markup

Bye,
J?r?me


From axeld at pinc-software.de  Wed Jan 10 12:22:33 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Wed, 10 Jan 2007 12:22:33 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?r19759_-_in_haiku/trunk/src/add-o?=
	=?iso-8859-15?q?ns/kernel/generic=3A_=2E_dpc?=
In-Reply-To: <3402216.1168426334830.JavaMail.ngmail@webmail17>
Message-ID: <2901756352-BeMail@zon>

Marcus Overhagen  wrote:
> > while (acquire_sem(queue->wakeup_sem) == B_OK) {
> This prevents suspending / resuming the thread, which is sometimes
> usefull for debugging. I would suggest using 
> for (;;)
>     ret = acquire_sem(
>     if (ret == B_INTERRUPTED)
>       continue;
>     if (ret != B_OK)
>       break;

You cannot suspend/resume kernel threads. This only works with userland 
threads (and only if you're using B_CAN_INTERRUPT with 
acquire_sem_etc()).

Bye,
   Axel.



From axeld at pinc-software.de  Wed Jan 10 12:58:57 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Wed, 10 Jan 2007 12:58:57 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?Haiku-commits=5D_r19759_-_in_haik?=
	=?iso-8859-15?q?u/trunk/src/add-ons/kernel/generic=3A_=2E_dpc?=
In-Reply-To: <1168427036.45a4c81c41bfc@imp4-g19.free.fr>
Message-ID: <5087127678-BeMail@zon>

Philippe Houdoin  wrote:
> > > Doubly-linked list functions can be used with interrupts turned 
> > > off
> > > as well, though :-)
> > > And indeed, I would go that route here, too.
> Okay, I didn't see that. But in such case doesn't the caller should 
> manage
> allocating each new element to add the list instead?
> I don't see how queue_dpc() could allocate a new dpc entry from 
> interrupt
> context. Except if it's from a pre-allocated dpc entries pool. Does 
> kernel
> double/linked_list provide this feature? util/queue don't either 
> AFAIK, right?

Yes, you'd need to allocate space in advance, so maybe the fixed queue 
will do the job equally well :-)

Bye,
   Axel.



From marcusoverhagen at arcor.de  Wed Jan 10 14:04:27 2007
From: marcusoverhagen at arcor.de (Marcus Overhagen)
Date: Wed, 10 Jan 2007 14:04:27 +0100 (CET)
Subject: [Haiku-commits] r19759 - in
 haiku/trunk/src/add-ons/kernel/generic: . dpc
Message-ID: <9117107.1168434267967.JavaMail.ngmail@webmail18>

Axel D?rfler wrote:

> You cannot suspend/resume kernel threads. This only works with userland 
> threads (and only if you're using B_CAN_INTERRUPT with 
> acquire_sem_etc()).

Well, I didn't know that. I also don't know if haiku is different here from BeOs,
but the BeBook only says "You can suspend any thread, regardless of its current state."

Why are kernel threads handled differently? Isn't it just a matter of setting
next_state to B_THREAD_READY or B_THREAD_SUSPENDED, and interrupting
semaphore acquire when B_CAN_INTERRUPT is specified?

(I don't know what happens with waiting threads that get set to B_THREAD_READY,
just curious, I don't really need that feature)

Marcus

Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren
ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: g?nstig
und schnell mit DSL - das All-Inclusive-Paket f?r clevere Doppel-Sparer,
nur  44,85 ?  inkl. DSL- und ISDN-Grundgeb?hr!
http://www.arcor.de/rd/emf-dsl-2


From philippe.houdoin at free.fr  Wed Jan 10 14:06:15 2007
From: philippe.houdoin at free.fr (Philippe Houdoin)
Date: Wed, 10 Jan 2007 14:06:15 +0100
Subject: [Haiku-commits] r19759 - in haiku/trunk/src/add-ons/kernel/generic:
	. dpc
Message-ID: <1168434375.45a4e4c7a3d28@imp4-g19.free.fr>

Marcus wrote:
> I think the current implementation has the following issues:
>
>>    if (!queue)
>>        return -1;
> This check isn't very useful. Personally I would prefer a crash in
> acquire_sem(queue->wakeup_sem) if queue is really 0 at this place,
> instead of not knowing why it doesn't work at all.
>>    if (call.function)
>>        call.function(call.arg);
> Checking if function is 0 could be moved into queue_dpc, this
> would save much overhead in case function is 0.

Agreed, good points.
Thanks.

>> while (acquire_sem(queue->wakeup_sem) == B_OK) {
> This prevents suspending / resuming the thread, which is sometimes
> usefull for debugging.

As Axel said, it's a kernel thread, we can't suspend it. At first I wrote
exactly the code you suggested ;-)

>> queue->wakeup_sem = create_sem(-1, str);
> This must initialize with 0, not with -1

Thanks you very much, that's one KDL round trip less!

>> queue->slots[queue->tail].function = function;
>> queue->slots[queue->tail].arg      = arg;
>> queue->tail = (queue->tail++) % queue->size;
>
> This will overwrite entries once the queue is full,
> they will never be executed.

Yeap. I'll add a count field to forbid such event.

Thanks for your comments, guys.

- Philippe


From axeld at pinc-software.de  Wed Jan 10 14:22:23 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Wed, 10 Jan 2007 14:22:23 +0100 (MET)
Subject: [Haiku-commits] r19759 - in
 haiku/trunk/src/add-ons/kernel/generic: . dpc
In-Reply-To: <9117107.1168434267967.JavaMail.ngmail@webmail18>
Message-ID: <10089347272-BeMail@zon>

Marcus Overhagen  wrote:
> Axel D?rfler wrote:
> > You cannot suspend/resume kernel threads. This only works with 
> > userland 
> > threads (and only if you're using B_CAN_INTERRUPT with 
> > acquire_sem_etc()).
> Well, I didn't know that. I also don't know if haiku is different 
> here from BeOs,
> but the BeBook only says "You can suspend any thread, regardless of 
> its current state."

I'm pretty sure it also doesn't work in BeOS.

> Why are kernel threads handled differently? Isn't it just a matter of 
> setting
> next_state to B_THREAD_READY or B_THREAD_SUSPENDED, and interrupting
> semaphore acquire when B_CAN_INTERRUPT is specified?

Kernel threads cannot have signal handlers, and signals are handled 
when exiting the kernel space only. Of course, you could manually 
suspend a thread the way you mention.

> (I don't know what happens with waiting threads that get set to 
> B_THREAD_READY,
> just curious, I don't really need that feature)

For waiting threads, you'd have to call sem_interrupt_thread() to put 
them into the ready queue. If you put a waiting thread into the ready 
queue manually, you will probably mess up the semaphores waiting queue 
(if you don't remove it from there, before); ie. you're risking a KDL 
here.

Bye,
   Axel.



From stefano.ceccherini at gmail.com  Wed Jan 10 17:52:09 2007
From: stefano.ceccherini at gmail.com (Stefano Ceccherini)
Date: Wed, 10 Jan 2007 17:52:09 +0100
Subject: [Haiku-commits] Rev 19731
Message-ID: <894b9700701100852gedfd4a0t5542cb59b2ca01c5@mail.gmail.com>

I can't reply to the original message since I dont' have it anymore, so...
Axel, if you haven't noticed, rev 19731 breaks source compatibility,
since _privateData is a protected member of BString. I know there is
at least one thing on bebits which subclass BString and uses
_privateData.

On an unrelated subject... Just a note if someone wanted to work on
that: I'm working on the popup menu nonsticky issue, I've already
fixed it locally some days ago, but I haven't committed because
enabling sticky mode for popupmenus made an old bug show up, which I
want to fix first.
Since I just returned from a short vacation with my family, but I'm
still on holiday, it will take some time (next week probably).


From geist at foobox.com  Wed Jan 10 20:43:21 2007
From: geist at foobox.com (Travis Geiselbrecht)
Date: Wed, 10 Jan 2007 11:43:21 -0800
Subject: [Haiku-commits] r19764 - haiku/trunk/src/tests/system/kernel
In-Reply-To: <540207930-BeMail@zon>
References: <540207930-BeMail@zon>
Message-ID: <89FC967D-F449-4B95-979F-7BAF13CD579F@foobox.com>

Ah the old fibonacci sequence tester. newos used to survive this for  
a few hours, but iirc, it would eventually triple fault, which caused  
me to add the double fault handler. Then it wouldn't reproduce.

This should be good.

Travis

On Jan 10, 2007, at 2:43 AM, Axel D?rfler wrote:

> axeld at BerliOS  wrote:
>> Log:
>> * Fixed fibo_load_image: it actually did not produce the fibonacci
>> numbers.
>> * Implemented a fibo_fork which uses fork() instead.
>> * Both tests can pretty easily let the kernel crash!
>
> Beware, while fibo_load_image doesn't even work on BeOS (for whatever
> reason, load_image() is always aborted with B_INTERRUPTED), fibo_fork
> does, and you can easily crash BeOS with it, too... (at least the Dano
> flavour, didn't test R5 yet)
>
> Bye,
>    Axel.
>
> _______________________________________________
> Haiku-commits mailing list
> Haiku-commits at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/haiku-commits



From phoudoin at mail.berlios.de  Wed Jan 10 21:28:45 2007
From: phoudoin at mail.berlios.de (phoudoin at BerliOS)
Date: Wed, 10 Jan 2007 21:28:45 +0100
Subject: [Haiku-commits] r19765 - in haiku/trunk: headers/os/drivers
	src/add-ons/kernel/generic/dpc
Message-ID: <200701102028.l0AKSjCf013818@sheep.berlios.de>

Author: phoudoin
Date: 2007-01-10 21:28:45 +0100 (Wed, 10 Jan 2007)
New Revision: 19765
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19765&view=rev

Added:
   haiku/trunk/headers/os/drivers/dpc.h
Modified:
   haiku/trunk/src/add-ons/kernel/generic/dpc/Jamfile
   haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
Log:
Moved public interface into its own header file.
Fixed most obvious issues, as reported by Marcus and Axel.


Added: haiku/trunk/headers/os/drivers/dpc.h
===================================================================
--- haiku/trunk/headers/os/drivers/dpc.h	2007-01-10 10:33:01 UTC (rev 19764)
+++ haiku/trunk/headers/os/drivers/dpc.h	2007-01-10 20:28:45 UTC (rev 19765)
@@ -0,0 +1,31 @@
+/* 	DPC module API
+ *  Copyright 2007, Haiku Inc. All Rights Reserved.
+ *  Distributed under the terms of the MIT License
+ */
+ 
+#ifndef _DPC_MODULE_H_
+#define _DPC_MODULE_H_
+
+#include 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define B_DPC_MODULE_NAME "generic/dpc/v1"
+
+typedef void (*dpc_func) (void *arg);
+
+typedef struct {
+	module_info info;
+	void * 		(*new_dpc_thread)(const char *name, long priority, int queue_size);
+	status_t	(*delete_dpc_thread)(void *thread);
+	status_t	(*queue_dpc)(void *thread, dpc_func dpc_name, void *arg);
+} dpc_module_info;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

Modified: haiku/trunk/src/add-ons/kernel/generic/dpc/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/generic/dpc/Jamfile	2007-01-10 10:33:01 UTC (rev 19764)
+++ haiku/trunk/src/add-ons/kernel/generic/dpc/Jamfile	2007-01-10 20:28:45 UTC (rev 19765)
@@ -2,6 +2,10 @@
 
 SetSubDirSupportedPlatformsBeOSCompatible ;
 
+if $(TARGET_PLATFORM) != haiku {
+	UsePublicHeaders [ FDirName drivers ] ;
+}
+
 KernelAddon dpc :
 	dpc.c
 ;

Modified: haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-10 10:33:01 UTC (rev 19764)
+++ haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c	2007-01-10 20:28:45 UTC (rev 19765)
@@ -10,26 +10,13 @@
 #include 
 #include 
 
-#include 
+#ifndef COMPILE_FOR_R5
+	#include 	// For snprintf()
+#endif
 
-// #include 
+#include 
 
-// ----
-// To be moved into a new headers/os/drivers/dpc.h:
-#define DPC_MODULE_NAME "generic/dpc/v1"
-
-typedef void (*dpc_func) (void *arg);
-
-typedef struct {
-	module_info info;
-	void * 		(*new_dpc_thread)(const char *name, long priority, int queue_size);
-	status_t	(*delete_dpc_thread)(void *thread);
-	status_t	(*queue_dpc)(void *thread, dpc_func dpc_name, void *arg);
-} dpc_module_info;
-// ----
-
 // Private DPC queue structures
-
 typedef struct {
 	dpc_func 	function;
 	void 		*arg;
@@ -41,6 +28,7 @@
 	sem_id		wakeup_sem;
 	spinlock	lock;
 	int 		size;
+	int			count;
 	int			head;
 	int 		tail;
 	dpc_slot	slots[0];
@@ -53,9 +41,6 @@
 {
 	dpc_queue *queue = arg;
 	
-	if (!queue)
-		return -1;
-
 	// Let's wait forever/until semaphore death for new DPC slot to show up
 	while (acquire_sem(queue->wakeup_sem) == B_OK) {
 		cpu_status former;
@@ -67,12 +52,12 @@
 		
 		call = queue->slots[queue->head];
 		queue->head = (queue->head++) % queue->size;
+		queue->count--;
 
 		release_spinlock(&queue->lock);
 		restore_interrupts(former);
 		
-		if (call.function)
-			call.function(call.arg);
+		call.function(call.arg);
 	}
 
 	// Let's die quietly, ignored by all... sigh.
@@ -93,12 +78,18 @@
 	
 	queue->head = queue->tail = 0;
 	queue->size = queue_size;
+	queue->count = 0;
 	queue->lock = 0;	// Init the spinlock
-	
-	strncpy(str, name, sizeof(str));
-	strncat(str, "_wakeup_sem", sizeof(str));
 
-	queue->wakeup_sem = create_sem(-1, str);
+#ifdef COMPILE_FOR_R5
+	strncpy(str, name, sizeof(str) - 1);
+	strncat(str, "_wakeup_sem", sizeof(str) - 1);
+	str[sizeof(str) - 1] = '\0';
+#else
+	snprintf(str, sizeof(str), "%.*s_wakeup_sem", (int) sizeof(str) - 11, name);
+#endif
+
+	queue->wakeup_sem = create_sem(0, str);
 	if (queue->wakeup_sem < B_OK) {
 		free(queue);
 		return NULL;
@@ -143,25 +134,35 @@
 {
 	dpc_queue *queue = thread;
 	cpu_status former;
+	status_t status = B_OK;
 	
-	if (!queue)
+	if (!queue || !function)
 		return B_BAD_VALUE;
 
 	// Try to be safe being called from interrupt handlers:
 	former = disable_interrupts();
 	acquire_spinlock(&queue->lock);
 	
-	queue->slots[queue->tail].function = function;
-	queue->slots[queue->tail].arg      = arg;
-	queue->tail = (queue->tail++) % queue->size;
-	
+	if (queue->count == queue->size)
+		// This DPC queue is full, sorry
+		status = B_NO_MEMORY;
+	else {
+		queue->slots[queue->tail].function = function;
+		queue->slots[queue->tail].arg      = arg;
+		queue->tail = (queue->tail++) % queue->size;
+		queue->count++;	
+	}
+
 	release_spinlock(&queue->lock);
 	restore_interrupts(former);
 
-	// Wake up the corresponding dpc thead
-	// Notice that interrupt handlers should returns B_INVOKE_SCHEDULER to
-	// shorten DPC latency as much as possible...
-	return release_sem_etc(queue->wakeup_sem, 1, B_DO_NOT_RESCHEDULE);
+	if (status == B_OK)
+		// Wake up the corresponding dpc thead
+		// Notice that interrupt handlers should returns B_INVOKE_SCHEDULER to
+		// shorten DPC latency as much as possible...
+		status = release_sem_etc(queue->wakeup_sem, 1, B_DO_NOT_RESCHEDULE);
+	
+	return status;
 }
 
 
@@ -182,7 +183,7 @@
 
 static dpc_module_info sDPCModule = {
 	{
-		DPC_MODULE_NAME,
+		B_DPC_MODULE_NAME,
 		0,
 		std_ops
 	},



From korli at mail.berlios.de  Wed Jan 10 23:54:16 2007
From: korli at mail.berlios.de (korli at BerliOS)
Date: Wed, 10 Jan 2007 23:54:16 +0100
Subject: [Haiku-commits] r19766 - haiku/trunk/build/jam
Message-ID: <200701102254.l0AMsGMA025447@sheep.berlios.de>

Author: korli
Date: 2007-01-10 23:54:16 +0100 (Wed, 10 Jan 2007)
New Revision: 19766
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19766&view=rev

Modified:
   haiku/trunk/build/jam/HaikuImage
Log:
added expr and test as suggested by Kaoutsis, thanks!


Modified: haiku/trunk/build/jam/HaikuImage
===================================================================
--- haiku/trunk/build/jam/HaikuImage	2007-01-10 20:28:45 UTC (rev 19765)
+++ haiku/trunk/build/jam/HaikuImage	2007-01-10 22:54:16 UTC (rev 19766)
@@ -22,7 +22,7 @@
 
 BEOS_BIN = addattr alert arp basename beep cat catattr chgrp chmod chop chown clear
 	clockconfig cmp comm cp copyattr csplit cut date dd desklink df diff dirname driveinfo
-	dstcheck du echo eject env error factor false fdinfo ffm find finddir fortune ftp funzip gawk
+	dstcheck du echo eject env error expr factor false fdinfo ffm find finddir fortune ftp funzip gawk
 	$(X86_ONLY)gdb grep groups gzip head hey id ideinfo idestatus ifconfig iroster isvolume
 	join keymap kill less lessecho lesskey link listarea listattr listdev listimage
 	listport listres listsem ln locate logger logname ls lsindex makebootable md5sum mimeset
@@ -30,7 +30,7 @@
 	playsound playwav ps pwd
 	query quit renice rm rmattr rmindex rmdir roster route safemode screen_blanker sed settype
 	setversion setvolume sh shutdown sleep sort split strace su sum sync sysinfo
-	tail tar tcpdump tee telnet top touch tput traceroute translate true tty uname unmount unrar unzip
+	tail tar tcpdump tee telnet test top touch tput traceroute translate true tty uname unmount unrar unzip
 	unzipsfx uptime version waitfor wc wget whoami xargs xres yes zdiff zforce zgrep zip
 	zipcloak zipnote zipsplit zmore znew
 ;



From axeld at pinc-software.de  Thu Jan 11 16:10:58 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Thu, 11 Jan 2007 16:10:58 +0100 (MET)
Subject: [Haiku-commits] Rev 19731
In-Reply-To: <894b9700701100852gedfd4a0t5542cb59b2ca01c5@mail.gmail.com>
Message-ID: <3256572571-BeMail@zon>

"Stefano Ceccherini"  wrote:
> I can't reply to the original message since I dont' have it anymore, 
> so...
> Axel, if you haven't noticed, rev 19731 breaks source compatibility,
> since _privateData is a protected member of BString. I know there is
> at least one thing on bebits which subclass BString and uses
> _privateData.

Ah, I didn't even notice it was not a private member of this class, 
though I see why a protected member indeed makes a bit of sense (for a 
class that "open").
However, I don't really mind breaking source compatibility this way; 
it's all for the best, and a #define _privateData fPrivateData 
shouldn't be too hard to add for a quick fix. What do others think 
about it?

> On an unrelated subject... Just a note if someone wanted to work on
> that: I'm working on the popup menu nonsticky issue, I've already
> fixed it locally some days ago, but I haven't committed because
> enabling sticky mode for popupmenus made an old bug show up, which I
> want to fix first.
> Since I just returned from a short vacation with my family, but I'm
> still on holiday, it will take some time (next week probably).

Have a good time!

Bye,
   Axel.



From axeld at mail.berlios.de  Thu Jan 11 18:00:31 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Thu, 11 Jan 2007 18:00:31 +0100
Subject: [Haiku-commits] r19767 - haiku/trunk/src/tests/system/kernel
Message-ID: <200701111700.l0BH0VLA030404@sheep.berlios.de>

Author: axeld
Date: 2007-01-11 18:00:30 +0100 (Thu, 11 Jan 2007)
New Revision: 19767
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19767&view=rev

Added:
   haiku/trunk/src/tests/system/kernel/fibo_exec.cpp
Modified:
   haiku/trunk/src/tests/system/kernel/Jamfile
Log:
Added the last of the companion fibo test apps (based on fork/exec - this is just
another test that doesn't work on BeOS, dunno why, but who cares...).


Modified: haiku/trunk/src/tests/system/kernel/Jamfile
===================================================================
--- haiku/trunk/src/tests/system/kernel/Jamfile	2007-01-10 22:54:16 UTC (rev 19766)
+++ haiku/trunk/src/tests/system/kernel/Jamfile	2007-01-11 17:00:30 UTC (rev 19767)
@@ -5,7 +5,7 @@
 
 SimpleTest fibo_load_image : fibo_load_image.cpp ;
 SimpleTest fibo_fork : fibo_fork.cpp ;
-#SimpleTest fibo_exec : fibo_exec.cpp ;
+SimpleTest fibo_exec : fibo_exec.cpp ;
 
 SimpleTest port_close_test_1 : port_close_test_1.cpp ;
 SimpleTest port_close_test_2 : port_close_test_2.cpp ;

Added: haiku/trunk/src/tests/system/kernel/fibo_exec.cpp
===================================================================
--- haiku/trunk/src/tests/system/kernel/fibo_exec.cpp	2007-01-10 22:54:16 UTC (rev 19766)
+++ haiku/trunk/src/tests/system/kernel/fibo_exec.cpp	2007-01-11 17:00:30 UTC (rev 19767)
@@ -0,0 +1,103 @@
+/*
+ * Copyright 2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Copyright 2002, Manuel J. Petit. All rights reserved.
+ * Distributed under the terms of the NewOS License.
+ */
+
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+static void
+usage(char const *app)
+{
+	printf("usage: %s [-s] ###\n", app);
+	exit(-1);
+}
+
+
+int
+main(int argc, char *argv[])
+{
+	bool silent = false;
+	int num = 0;
+	int result;
+
+	switch (argc) {
+		case 2:
+			num = atoi(argv[1]);
+			break;
+		case 3:
+			if (!strcmp(argv[1], "-s")) {
+				num = atoi(argv[2]);
+				silent = true;
+				break;
+			}
+			// supposed to fall through
+
+		default:
+			usage(argv[0]);
+			break;
+	}
+
+	if (num < 2) {
+		result = num;
+	} else {
+		pid_t childA = fork();
+		if (childA == 0) {
+			// we're the child
+			char buffer[64];
+			char* args[]= { argv[0], "-s", buffer, NULL };
+
+			snprintf(buffer, sizeof(buffer), "%d", num - 1);
+			if (execv(args[0], args) < 0) {
+				fprintf(stderr, "Could not create exec A: %s\n", strerror(errno));
+				return -1;
+			}
+		} else if (childA < 0) {
+			fprintf(stderr, "fork() failed for child A: %s\n", strerror(errno));
+			return -1;
+		}
+
+		pid_t childB = fork();
+		if (childB == 0) {
+			// we're the child
+			char buffer[64];
+			char* args[]= { argv[0], "-s", buffer, NULL };
+
+			snprintf(buffer, sizeof(buffer), "%d", num - 2);
+			if (execv(args[0], args) < 0) {
+				fprintf(stderr, "Could not create exec B: %s\n", strerror(errno));
+				return -1;
+			}
+		} else if (childB < 0) {
+			fprintf(stderr, "fork() failed for child B: %s\n", strerror(errno));
+			return -1;
+		}
+
+		status_t status;
+		while (wait_for_thread(childA, &status) == B_INTERRUPTED)
+			;
+		result = status;
+
+		while (wait_for_thread(childB, &status) == B_INTERRUPTED)
+			;
+		result += status;
+	}
+
+	if (silent) {
+		return result;
+	} else {
+		printf("%d\n", result);
+		return 0;
+	}
+}
+



From bonefish at cs.tu-berlin.de  Thu Jan 11 18:02:15 2007
From: bonefish at cs.tu-berlin.de (Ingo Weinhold)
Date: Thu, 11 Jan 2007 18:02:15 +0100
Subject: [Haiku-commits] Rev 19731
In-Reply-To: <3256572571-BeMail@zon>
References: <3256572571-BeMail@zon>
Message-ID: <20070111180215.1092.1@cs.tu-berlin.de>

On 2007-01-11 at 16:10:58 [+0100], Axel D?rfler  
wrote:
> "Stefano Ceccherini"  wrote:
> > I can't reply to the original message since I dont' have it anymore,
> > so...
> > Axel, if you haven't noticed, rev 19731 breaks source compatibility,
> > since _privateData is a protected member of BString. I know there is
> > at least one thing on bebits which subclass BString and uses
> > _privateData.
> 
> Ah, I didn't even notice it was not a private member of this class,
> though I see why a protected member indeed makes a bit of sense (for a
> class that "open").
> However, I don't really mind breaking source compatibility this way;
> it's all for the best, and a #define _privateData fPrivateData
> shouldn't be too hard to add for a quick fix. What do others think
> about it?

Er, this breaks not only source but binary compatibility, since 
_privateData is accessed by inline methods. Please undo the change.

CU, Ingo


From axeld at pinc-software.de  Thu Jan 11 18:11:38 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Thu, 11 Jan 2007 18:11:38 +0100 (MET)
Subject: [Haiku-commits] Rev 19731
In-Reply-To: <20070111180215.1092.1@cs.tu-berlin.de>
Message-ID: <10499491498-BeMail@zon>

Ingo Weinhold  wrote:
> On 2007-01-11 at 16:10:58 [+0100], Axel D?rfler  
> > wrote:
> > "Stefano Ceccherini"  wrote:
> > > I can't reply to the original message since I dont' have it 
> > > anymore,
> > > so...
> > > Axel, if you haven't noticed, rev 19731 breaks source 
> > > compatibility,
> > > since _privateData is a protected member of BString. I know there 
> > > is
> > > at least one thing on bebits which subclass BString and uses
> > > _privateData.
> > Ah, I didn't even notice it was not a private member of this class,
> > though I see why a protected member indeed makes a bit of sense 
> > (for a
> > class that "open").
> > However, I don't really mind breaking source compatibility this 
> > way;
> > it's all for the best, and a #define _privateData fPrivateData
> > shouldn't be too hard to add for a quick fix. What do others think
> > about it?
> Er, this breaks not only source but binary compatibility, since 
> _privateData is accessed by inline methods. Please undo the change.

Since when does the name matter for inline methods? The position in the 
vtable hasn't changed.

Bye,
   Axel.



From bonefish at cs.tu-berlin.de  Thu Jan 11 18:30:09 2007
From: bonefish at cs.tu-berlin.de (Ingo Weinhold)
Date: Thu, 11 Jan 2007 18:30:09 +0100
Subject: [Haiku-commits] Rev 19731
In-Reply-To: <10499491498-BeMail@zon>
References: <10499491498-BeMail@zon>
Message-ID: <20070111183009.1497.3@cs.tu-berlin.de>


On 2007-01-11 at 18:11:38 [+0100], Axel D?rfler  
wrote:
> Ingo Weinhold  wrote:
> > On 2007-01-11 at 16:10:58 [+0100], Axel D?rfler 
> > > wrote:
> > > "Stefano Ceccherini"  wrote:
> > > > I can't reply to the original message since I dont' have it
> > > > anymore,
> > > > so...
> > > > Axel, if you haven't noticed, rev 19731 breaks source
> > > > compatibility,
> > > > since _privateData is a protected member of BString. I know there
> > > > is
> > > > at least one thing on bebits which subclass BString and uses
> > > > _privateData.
> > > Ah, I didn't even notice it was not a private member of this class,
> > > though I see why a protected member indeed makes a bit of sense
> > > (for a
> > > class that "open").
> > > However, I don't really mind breaking source compatibility this
> > > way;
> > > it's all for the best, and a #define _privateData fPrivateData
> > > shouldn't be too hard to add for a quick fix. What do others think
> > > about it?
> > Er, this breaks not only source but binary compatibility, since
> > _privateData is accessed by inline methods. Please undo the change.
> 
> Since when does the name matter for inline methods? The position in the
> vtable hasn't changed.

Oh sorry, you're right of course (although it's the position in the object 
data, not the vtable :-). And yep, just breaking source compatibility is 
fine in this case.

CU, Ingo


From stefano.ceccherini at gmail.com  Thu Jan 11 18:36:37 2007
From: stefano.ceccherini at gmail.com (Stefano Ceccherini)
Date: Thu, 11 Jan 2007 18:36:37 +0100
Subject: [Haiku-commits] Rev 19731
In-Reply-To: <3256572571-BeMail@zon>
References: <894b9700701100852gedfd4a0t5542cb59b2ca01c5@mail.gmail.com>
	<3256572571-BeMail@zon>
Message-ID: <894b9700701110936t7a0f1644hf2e586c4754f681d@mail.gmail.com>

2007/1/11, Axel D?rfler :

> However, I don't really mind breaking source compatibility this way;
> it's all for the best, and a #define _privateData fPrivateData
> shouldn't be too hard to add for a quick fix. What do others think
> about it?

Yeah I think it's okay. Just making sure you actually KNEW what you
were doing :=)


> Have a good time!

Thank you very much !


From axeld at pinc-software.de  Thu Jan 11 18:49:15 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Thu, 11 Jan 2007 18:49:15 +0100 (MET)
Subject: [Haiku-commits] Rev 19731
In-Reply-To: <20070111183009.1497.3@cs.tu-berlin.de>
Message-ID: <12755565798-BeMail@zon>

Ingo Weinhold  wrote:
> > > Er, this breaks not only source but binary compatibility, since
> > > _privateData is accessed by inline methods. Please undo the 
> > > change.
> > Since when does the name matter for inline methods? The position in 
> > the
> > vtable hasn't changed.
> Oh sorry, you're right of course (although it's the position in the 
> object 
> data, not the vtable :-). And yep, just breaking source compatibility 
> is 
> fine in this case.

Damn, I was almost right ;-)

Bye,
   Axel.



From axeld at mail.berlios.de  Thu Jan 11 19:21:35 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Thu, 11 Jan 2007 19:21:35 +0100
Subject: [Haiku-commits] r19768 - in haiku/trunk:
	headers/private/kernel/arch src/system/kernel/arch/ppc
	src/system/kernel/arch/x86
Message-ID: <200701111821.l0BILZoN016251@sheep.berlios.de>

Author: axeld
Date: 2007-01-11 19:21:35 +0100 (Thu, 11 Jan 2007)
New Revision: 19768
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19768&view=rev

Modified:
   haiku/trunk/headers/private/kernel/arch/thread.h
   haiku/trunk/src/system/kernel/arch/ppc/arch_thread.c
   haiku/trunk/src/system/kernel/arch/x86/arch_thread.c
Log:
arch_thread_init_tls() now accesses user memory safely, and therefore could now
fail.


Modified: haiku/trunk/headers/private/kernel/arch/thread.h
===================================================================
--- haiku/trunk/headers/private/kernel/arch/thread.h	2007-01-11 17:00:30 UTC (rev 19767)
+++ haiku/trunk/headers/private/kernel/arch/thread.h	2007-01-11 18:21:35 UTC (rev 19768)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2004, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -19,7 +19,7 @@
 status_t arch_thread_init(struct kernel_args *args);
 status_t arch_team_init_team_struct(struct team *t, bool kernel);
 status_t arch_thread_init_thread_struct(struct thread *t);
-void arch_thread_init_tls(struct thread *thread);
+status_t arch_thread_init_tls(struct thread *thread);
 void arch_thread_context_switch(struct thread *t_from, struct thread *t_to);
 status_t arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void), void (*entry_func)(void), void (*exit_func)(void));
 void arch_thread_dump_info(void *info);

Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_thread.c
===================================================================
--- haiku/trunk/src/system/kernel/arch/ppc/arch_thread.c	2007-01-11 17:00:30 UTC (rev 19767)
+++ haiku/trunk/src/system/kernel/arch/ppc/arch_thread.c	2007-01-11 18:21:35 UTC (rev 19768)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2006, Haiku Inc. All rights reserved.
+ * Copyright 2003-2007, Haiku Inc. All rights reserved.
  * Distributed under the terms of the MIT License.
  *
  * Authors:
@@ -160,10 +160,11 @@
 }
 
 
-void
+status_t
 arch_thread_init_tls(struct thread *thread)
 {
-// TODO: Implement!
+	// TODO: Implement!
+	return B_OK;
 }
 
 

Modified: haiku/trunk/src/system/kernel/arch/x86/arch_thread.c
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_thread.c	2007-01-11 17:00:30 UTC (rev 19767)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_thread.c	2007-01-11 18:21:35 UTC (rev 19768)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001, Travis Geiselbrecht. All rights reserved.
@@ -229,17 +229,19 @@
  *	Is called from _create_user_thread_kentry().
  */
 
-void
+status_t
 arch_thread_init_tls(struct thread *thread)
 {
-	uint32 *tls;
+	uint32 tls[TLS_THREAD_ID_SLOT + 1];
+	int32 i;
 
 	thread->user_local_storage = thread->user_stack_base + thread->user_stack_size;
-	tls = (uint32 *)thread->user_local_storage;
 
+	// initialize default TLS fields
 	tls[TLS_BASE_ADDRESS_SLOT] = thread->user_local_storage;
 	tls[TLS_THREAD_ID_SLOT] = thread->id;
-	tls[TLS_ERRNO_SLOT] = 0;
+
+	return user_memcpy((void *)thread->user_local_storage, tls, sizeof(tls));
 }
 
 



From korli at mail.berlios.de  Thu Jan 11 21:13:49 2007
From: korli at mail.berlios.de (korli at BerliOS)
Date: Thu, 11 Jan 2007 21:13:49 +0100
Subject: [Haiku-commits] r19769 - haiku/trunk/src/bin/zic
Message-ID: <200701112013.l0BKDnos000284@sheep.berlios.de>

Author: korli
Date: 2007-01-11 21:13:49 +0100 (Thu, 11 Jan 2007)
New Revision: 19769
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19769&view=rev

Modified:
   haiku/trunk/src/bin/zic/Jamfile
   haiku/trunk/src/bin/zic/zic.c
Log:
fixed build on dano, commented again a warning


Modified: haiku/trunk/src/bin/zic/Jamfile
===================================================================
--- haiku/trunk/src/bin/zic/Jamfile	2007-01-11 18:21:35 UTC (rev 19768)
+++ haiku/trunk/src/bin/zic/Jamfile	2007-01-11 20:13:49 UTC (rev 19769)
@@ -1,6 +1,6 @@
 SubDir HAIKU_TOP src bin zic ;
 
-SubDirCcFlags -DNOID ;
+SubDirCcFlags -DNOID -DHAVE_STDINT_H=0 ;
 
 UsePrivateHeaders [ FDirName libroot time ] ;
 

Modified: haiku/trunk/src/bin/zic/zic.c
===================================================================
--- haiku/trunk/src/bin/zic/zic.c	2007-01-11 18:21:35 UTC (rev 19768)
+++ haiku/trunk/src/bin/zic/zic.c	2007-01-11 20:13:49 UTC (rev 19769)
@@ -678,8 +678,8 @@
 					fromname);
 				result = symlink(symlinkcontents,
 					toname);
-				if (result == 0)
-warning(_("hard link failed, symbolic link used"));
+//				if (result == 0)
+//warning(_("hard link failed, symbolic link used"));
 				ifree(symlinkcontents);
 		}
 #endif /* HAVE_SYMLINK */



From korli at mail.berlios.de  Thu Jan 11 21:27:23 2007
From: korli at mail.berlios.de (korli at BerliOS)
Date: Thu, 11 Jan 2007 21:27:23 +0100
Subject: [Haiku-commits] r19770 - in haiku/trunk: build/jam
	src/bin/coreutils/src
Message-ID: <200701112027.l0BKRNLe001889@sheep.berlios.de>

Author: korli
Date: 2007-01-11 21:27:22 +0100 (Thu, 11 Jan 2007)
New Revision: 19770
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19770&view=rev

Modified:
   haiku/trunk/build/jam/HaikuImage
   haiku/trunk/src/bin/coreutils/src/Jamfile
Log:
added lbracket to the build


Modified: haiku/trunk/build/jam/HaikuImage
===================================================================
--- haiku/trunk/build/jam/HaikuImage	2007-01-11 20:13:49 UTC (rev 19769)
+++ haiku/trunk/build/jam/HaikuImage	2007-01-11 20:27:22 UTC (rev 19770)
@@ -20,7 +20,7 @@
 	GPL_ONLY = ;
 }
 
-BEOS_BIN = addattr alert arp basename beep cat catattr chgrp chmod chop chown clear
+BEOS_BIN = "[" addattr alert arp basename beep cat catattr chgrp chmod chop chown clear
 	clockconfig cmp comm cp copyattr csplit cut date dd desklink df diff dirname driveinfo
 	dstcheck du echo eject env error expr factor false fdinfo ffm find finddir fortune ftp funzip gawk
 	$(X86_ONLY)gdb grep groups gzip head hey id ideinfo idestatus ifconfig iroster isvolume

Modified: haiku/trunk/src/bin/coreutils/src/Jamfile
===================================================================
--- haiku/trunk/src/bin/coreutils/src/Jamfile	2007-01-11 20:13:49 UTC (rev 19769)
+++ haiku/trunk/src/bin/coreutils/src/Jamfile	2007-01-11 20:27:22 UTC (rev 19770)
@@ -103,6 +103,7 @@
 # users.c
 # who.c
 
+BinCommand "[" : lbracket.c : libfetish.a : $(coreutils_rsrc) ;
 
 BinCommand ls : 
 	ls.c ls-dir.c : libfetish.a : $(coreutils_rsrc) ;



From axeld at pinc-software.de  Thu Jan 11 21:56:28 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Thu, 11 Jan 2007 21:56:28 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?r19770_-_in_haiku/trunk=3A_build/?=
	=?iso-8859-15?q?jam_src/bin/coreutils/src?=
In-Reply-To: <200701112027.l0BKRNLe001889@sheep.berlios.de>
Message-ID: <23989588382-BeMail@zon>

korli at BerliOS  wrote:
> Log:
> added lbracket to the build

What is it, and why do we need it? :-)

Bye,
   Axel.



From axeld at pinc-software.de  Thu Jan 11 21:57:34 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Thu, 11 Jan 2007 21:57:34 +0100 (MET)
Subject: [Haiku-commits] r19769 - haiku/trunk/src/bin/zic
In-Reply-To: <200701112013.l0BKDnos000284@sheep.berlios.de>
Message-ID: <24055918565-BeMail@zon>

korli at BerliOS  wrote:
> Log:
> fixed build on dano, commented again a warning
> 
> 
> Modified: haiku/trunk/src/bin/zic/Jamfile
> ===================================================================
> --- haiku/trunk/src/bin/zic/Jamfile	2007-01-11 18:21:35 UTC (rev 
> 19768)
> +++ haiku/trunk/src/bin/zic/Jamfile	2007-01-11 20:13:49 UTC (rev 
> 19769)
> @@ -1,6 +1,6 @@
>  SubDir HAIKU_TOP src bin zic ;
>  
> -SubDirCcFlags -DNOID ;
> +SubDirCcFlags -DNOID -DHAVE_STDINT_H=0 ;

Is building it for Dano important? At least, Haiku has stdint.h - maybe 
it should be added only in case of building it for BeOS?

Bye,
   Axel.



From korli at users.berlios.de  Thu Jan 11 22:07:02 2007
From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=)
Date: Thu, 11 Jan 2007 22:07:02 +0100
Subject: [Haiku-commits] r19770 - in haiku/trunk: build/jam
	src/bin/coreutils/src
In-Reply-To: <23989588382-BeMail@zon>
References: <200701112027.l0BKRNLe001889@sheep.berlios.de>
	<23989588382-BeMail@zon>
Message-ID: 

2007/1/11, Axel D?rfler :
> korli at BerliOS  wrote:
> > Log:
> > added lbracket to the build
>
> What is it, and why do we need it? :-)
>

It's part of coreutils and used to make tests like [ 1 = 0 ]
It's used in configure scripts.

http://unixhelp.ed.ac.uk/CGI/man-cgi?test

Bye
J?r?me


From korli at users.berlios.de  Thu Jan 11 22:10:48 2007
From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=)
Date: Thu, 11 Jan 2007 22:10:48 +0100
Subject: [Haiku-commits] r19769 - haiku/trunk/src/bin/zic
In-Reply-To: <24055918565-BeMail@zon>
References: <200701112013.l0BKDnos000284@sheep.berlios.de>
	<24055918565-BeMail@zon>
Message-ID: 

2007/1/11, Axel D?rfler :

> Is building it for Dano important? At least, Haiku has stdint.h - maybe
> it should be added only in case of building it for BeOS?
>

Except it's a build platform tool :) I should have added that the
build was broken on Dano before this fix.

Bye,
J?r?me


From axeld at pinc-software.de  Fri Jan 12 01:07:53 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Fri, 12 Jan 2007 01:07:53 +0100 (MET)
Subject: [Haiku-commits] r19769 - haiku/trunk/src/bin/zic
In-Reply-To: 
Message-ID: <35478246951-BeMail@zon>

"J?r?me Duval"  wrote:
> 2007/1/11, Axel D?rfler :
> > Is building it for Dano important? At least, Haiku has stdint.h - 
> > maybe
> > it should be added only in case of building it for BeOS?
> Except it's a build platform tool :) I should have added that the
> build was broken on Dano before this fix.

Ah, and I didn't notice as I added stdint.h to my installation a long 
time ago :-)

Bye,
   Axel.



From axeld at pinc-software.de  Fri Jan 12 14:10:52 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Fri, 12 Jan 2007 14:10:52 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?r19770_-_in_haiku/trunk=3A_build/?=
	=?iso-8859-15?q?jam_src/bin/coreutils/src?=
In-Reply-To: 
Message-ID: <2989374974-BeMail@zon>

"J?r?me Duval"  wrote:
> 2007/1/11, Axel D?rfler :
> > korli at BerliOS  wrote:
> > > Log:
> > > added lbracket to the build
> > What is it, and why do we need it? :-)
> It's part of coreutils and used to make tests like [ 1 = 0 ]
> It's used in configure scripts.
> 
> http://unixhelp.ed.ac.uk/CGI/man-cgi?test

Err, I know "test" - I was asking about "lbracket", wasn't I??

Bye,
   Axel.



From korli at users.berlios.de  Fri Jan 12 14:26:35 2007
From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=)
Date: Fri, 12 Jan 2007 14:26:35 +0100
Subject: [Haiku-commits] r19770 - in haiku/trunk: build/jam
	src/bin/coreutils/src
In-Reply-To: <2989374974-BeMail@zon>
References: 
	<2989374974-BeMail@zon>
Message-ID: 

2007/1/12, Axel D?rfler :
> "J?r?me Duval"  wrote:
> > 2007/1/11, Axel D?rfler :
> > > korli at BerliOS  wrote:
> > > > Log:
> > > > added lbracket to the build
> > > What is it, and why do we need it? :-)
> > It's part of coreutils and used to make tests like [ 1 = 0 ]
> > It's used in configure scripts.
> >
> > http://unixhelp.ed.ac.uk/CGI/man-cgi?test
>
> Err, I know "test" - I was asking about "lbracket", wasn't I??

The POSIX spec requires external versions of the shell built-in
commands. The test command, for which [ is a synonym, is both
built into the shell and available as an external command.

http://www.opengroup.org/onlinepubs/000095399/utilities/test.html

Bye,
J?r?me


From axeld at pinc-software.de  Fri Jan 12 15:16:49 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Fri, 12 Jan 2007 15:16:49 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?r19770_-_in_haiku/trunk=3A_build/?=
	=?iso-8859-15?q?jam_src/bin/coreutils/src?=
In-Reply-To: 
Message-ID: <6937869299-BeMail@zon>

"J?r?me Duval"  wrote:
> 2007/1/12, Axel D?rfler :
> > "J?r?me Duval"  wrote:
> > > 2007/1/11, Axel D?rfler :
> > > > korli at BerliOS  wrote:
> > > > > Log:
> > > > > added lbracket to the build
> > > > What is it, and why do we need it? :-)
> > > It's part of coreutils and used to make tests like [ 1 = 0 ]
> > > It's used in configure scripts.
> > >
> > > http://unixhelp.ed.ac.uk/CGI/man-cgi?test
> > Err, I know "test" - I was asking about "lbracket", wasn't I??
> The POSIX spec requires external versions of the shell built-in
> commands. The test command, for which [ is a synonym, is both
> built into the shell and available as an external command.
> 
> http://www.opengroup.org/onlinepubs/000095399/utilities/test.html

Okay, you really managed to confuse me ;-)
'[' is pretty ugly, but that's obviously the world of Unix...

Bye,
   Axel.



From axeld at mail.berlios.de  Fri Jan 12 16:07:19 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Fri, 12 Jan 2007 16:07:19 +0100
Subject: [Haiku-commits] r19771 - in haiku/trunk: headers/private/kernel
	src/system/kernel/vm
Message-ID: <200701121507.l0CF7JV5005873@sheep.berlios.de>

Author: axeld
Date: 2007-01-12 16:07:18 +0100 (Fri, 12 Jan 2007)
New Revision: 19771
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19771&view=rev

Modified:
   haiku/trunk/headers/private/kernel/vm_types.h
   haiku/trunk/src/system/kernel/vm/vm.cpp
   haiku/trunk/src/system/kernel/vm/vm_cache.c
   haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.c
Log:
* Private and temporary vm_caches now maintain their new virtual_base field, which allows
  them to commit substantially less memory (we we're committing about 40 MB (!) too much
  after a complete system boot). This means you'll run out of memory less likely now.
* fill_area_info() no longer filters out kernel protection flags - we may want to keep
  filtering them when called from userland, though, dunno.
* Added new debugger command "avail" which shows how much memory has been committed, and
  how much is regarded as free space.


Modified: haiku/trunk/headers/private/kernel/vm_types.h
===================================================================
--- haiku/trunk/headers/private/kernel/vm_types.h	2007-01-11 20:27:22 UTC (rev 19770)
+++ haiku/trunk/headers/private/kernel/vm_types.h	2007-01-12 15:07:18 UTC (rev 19771)
@@ -1,5 +1,5 @@
 /* 
- * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -75,7 +75,9 @@
 	vm_cache_ref		*ref;
 	struct vm_cache		*source;
 	struct vm_store		*store;
+	off_t				virtual_base;
 	off_t				virtual_size;
+		// the size is absolute, and independent from virtual_base
 	uint32				page_count;
 	uint32				temporary : 1;
 	uint32				scan_skip : 1;

Modified: haiku/trunk/src/system/kernel/vm/vm.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm.cpp	2007-01-11 20:27:22 UTC (rev 19770)
+++ haiku/trunk/src/system/kernel/vm/vm.cpp	2007-01-12 15:07:18 UTC (rev 19771)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -506,9 +506,8 @@
 	off_t offset, addr_t size, uint32 addressSpec, int wiring, int protection,
 	int mapping, vm_area **_area, const char *areaName)
 {
+	vm_cache_ref *cacheRef;
 	vm_cache *cache;
-	vm_cache_ref *cacheRef;
-
 	status_t status;
 
 	TRACE(("map_backing_store: aspace %p, store %p, *vaddr %p, offset 0x%Lx, size %lu, addressSpec %ld, wiring %d, protection %d, _area %p, area_name '%s'\n",
@@ -528,7 +527,6 @@
 		vm_cache *newCache;
 		vm_store *newStore;
 
-		// ToDo: panic???
 		// create an anonymous store object
 		newStore = vm_store_create_anonymous_noswap((protection & B_STACK_AREA) != 0,
 			USER_STACK_GUARD_PAGES);
@@ -557,6 +555,7 @@
 		cache = newCache;
 		cacheRef = newCache->ref;
 		store = newStore;
+		cache->virtual_base = offset;
 		cache->virtual_size = offset + size;
 	}
 
@@ -1658,7 +1657,8 @@
 					count++;
 				}
 
-				status = cache->store->ops->commit(cache->store, count * B_PAGE_SIZE);
+				status = cache->store->ops->commit(cache->store,
+					cache->virtual_base + count * B_PAGE_SIZE);
 
 				// ToDo: we may be able to join with our source cache, if count == 0
 			}
@@ -1905,6 +1905,7 @@
 		kprintf("  %p\n", consumer);
 	}
 	kprintf("store: %p\n", cache->store);
+	kprintf("virtual_base: 0x%Lx\n", cache->virtual_base);
 	kprintf("virtual_size: 0x%Lx\n", cache->virtual_size);
 	kprintf("temporary: %ld\n", cache->temporary);
 	kprintf("scan_skip: %ld\n", cache->scan_skip);
@@ -2008,6 +2009,15 @@
 }
 
 
+static int
+dump_available_memory(int argc, char **argv)
+{
+	kprintf("Available memory: %Ld/%lu bytes\n",
+		sAvailableMemory, vm_page_num_pages() * B_PAGE_SIZE);
+	return 0;
+}
+
+
 status_t
 vm_delete_areas(struct vm_address_space *addressSpace)
 {
@@ -2356,6 +2366,7 @@
 	add_debugger_command("area", &dump_area, "Dump info about a particular area");
 	add_debugger_command("cache_ref", &dump_cache_ref, "Dump cache_ref data structure");
 	add_debugger_command("cache", &dump_cache, "Dump cache_ref data structure");
+	add_debugger_command("avail", &dump_available_memory, "Dump available memory");
 //	add_debugger_command("dl", &display_mem, "dump memory long words (64-bit)");
 	add_debugger_command("dw", &display_mem, "dump memory words (32-bit)");
 	add_debugger_command("ds", &display_mem, "dump memory shorts (16-bit)");
@@ -2971,6 +2982,30 @@
 }
 
 
+static void
+fill_area_info(struct vm_area *area, area_info *info, size_t size)
+{
+	strlcpy(info->name, area->name, B_OS_NAME_LENGTH);
+	info->area = area->id;
+	info->address = (void *)area->base;
+	info->size = area->size;
+	info->protection = area->protection;
+	info->lock = B_FULL_LOCK;
+	info->team = area->address_space->id;
+	info->copy_count = 0;
+	info->in_count = 0;
+	info->out_count = 0;
+		// ToDo: retrieve real values here!
+
+	mutex_lock(&area->cache_ref->lock);
+
+	// Note, this is a simplification; the cache could be larger than this area
+	info->ram_size = area->cache_ref->cache->page_count * B_PAGE_SIZE;
+
+	mutex_unlock(&area->cache_ref->lock);
+}
+
+
 //	#pragma mark -
 
 
@@ -3005,7 +3040,7 @@
 }
 
 
-//	#pragma mark -
+//	#pragma mark - kernel public API
 
 
 long
@@ -3205,30 +3240,6 @@
 }
 
 
-static void
-fill_area_info(struct vm_area *area, area_info *info, size_t size)
-{
-	strlcpy(info->name, area->name, B_OS_NAME_LENGTH);
-	info->area = area->id;
-	info->address = (void *)area->base;
-	info->size = area->size;
-	info->protection = area->protection & B_USER_PROTECTION;
-	info->lock = B_FULL_LOCK;
-	info->team = area->address_space->id;
-	info->copy_count = 0;
-	info->in_count = 0;
-	info->out_count = 0;
-		// ToDo: retrieve real values here!
-
-	mutex_lock(&area->cache_ref->lock);
-
-	// Note, this is a simplification; the cache could be larger than this area
-	info->ram_size = area->cache_ref->cache->page_count * B_PAGE_SIZE;
-
-	mutex_unlock(&area->cache_ref->lock);
-}
-
-
 status_t
 _get_area_info(area_id id, area_info *info, size_t size)
 {
@@ -3580,7 +3591,7 @@
 }
 
 
-//	#pragma mark -
+//	#pragma mark - Userland syscalls
 
 
 status_t
@@ -3647,6 +3658,9 @@
 	if (status < B_OK)
 		return status;
 
+	// TODO: do we want to prevent userland from seeing kernel protections?
+	//info.protection &= B_USER_PROTECTION;
+
 	if (user_memcpy(userInfo, &info, sizeof(area_info)) < B_OK)
 		return B_BAD_ADDRESS;
 
@@ -3670,6 +3684,8 @@
 	if (status != B_OK)
 		return status;
 
+	//info.protection &= B_USER_PROTECTION;
+
 	if (user_memcpy(userCookie, &cookie, sizeof(int32)) < B_OK
 		|| user_memcpy(userInfo, &info, sizeof(area_info)) < B_OK)
 		return B_BAD_ADDRESS;

Modified: haiku/trunk/src/system/kernel/vm/vm_cache.c
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm_cache.c	2007-01-11 20:27:22 UTC (rev 19770)
+++ haiku/trunk/src/system/kernel/vm/vm_cache.c	2007-01-12 15:07:18 UTC (rev 19771)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -103,6 +103,7 @@
 	cache->page_list = NULL;
 	cache->ref = NULL;
 	cache->source = NULL;
+	cache->virtual_base = 0;
 	cache->virtual_size = 0;
 	cache->temporary = 0;
 	cache->scan_skip = 0;

Modified: haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.c
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.c	2007-01-11 20:27:22 UTC (rev 19770)
+++ haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.c	2007-01-12 15:07:18 UTC (rev 19771)
@@ -1,5 +1,5 @@
 /* 
- * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -52,6 +52,9 @@
 	if (store->can_overcommit)
 		return B_OK;
 
+	size -= store->vm.cache->virtual_base;
+		// anonymous stores don't need to span over their whole source
+
 	// Check to see how much we could commit - we need real memory
 
 	if (size > store->vm.committed_size) {



From marcusoverhagen at mail.berlios.de  Fri Jan 12 17:05:44 2007
From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS)
Date: Fri, 12 Jan 2007 17:05:44 +0100
Subject: [Haiku-commits] r19772 - haiku/trunk/src/add-ons/translators/sgi
Message-ID: <200701121605.l0CG5iTp012379@sheep.berlios.de>

Author: marcusoverhagen
Date: 2007-01-12 17:05:43 +0100 (Fri, 12 Jan 2007)
New Revision: 19772
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19772&view=rev

Modified:
   haiku/trunk/src/add-ons/translators/sgi/SGIImage.cpp
Log:
removed strange "warning: converting negative value 'B_ERROR' to 'long unsigned int'" that seemed to be generated by the ? operator converting B_ERROR's type.


Modified: haiku/trunk/src/add-ons/translators/sgi/SGIImage.cpp
===================================================================
--- haiku/trunk/src/add-ons/translators/sgi/SGIImage.cpp	2007-01-12 15:07:18 UTC (rev 19771)
+++ haiku/trunk/src/add-ons/translators/sgi/SGIImage.cpp	2007-01-12 16:05:43 UTC (rev 19772)
@@ -684,6 +684,9 @@
 	uint32 count;		// RLE count
 	uint32 length = 0;	// number of bytes read
 
+	if (numPixels <= 0)
+		return B_ERROR;
+
 	while (numPixels > 0) {
 
 		ch = *rleBuffer ++;
@@ -713,7 +716,7 @@
 		}
 	}
 
-	return (numPixels > 0 ? B_ERROR : length);
+	return length;
 }
 /*ssize_t
 SGIImage::_ReadRLE8(uint8* row, int32 numPixels) const
@@ -851,6 +854,9 @@
 	uint32 count;		// RLE count
 	uint32 length = 0;	// number of bytes read...
 
+	if (numPixels <= 0)
+		return B_ERROR;
+
 	while (numPixels > 0) {
 
 		ch = *rleBuffer ++;
@@ -879,7 +885,7 @@
 			}
 		}
 	}
-	return (numPixels > 0 ? B_ERROR : length * 2);
+	return length * 2;
 }
 
 // _WriteRLE8



From axeld at mail.berlios.de  Fri Jan 12 19:03:22 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Fri, 12 Jan 2007 19:03:22 +0100
Subject: [Haiku-commits] r19773 -
	haiku/trunk/src/system/kernel/device_manager
Message-ID: <200701121803.l0CI3MCA015137@sheep.berlios.de>

Author: axeld
Date: 2007-01-12 19:03:21 +0100 (Fri, 12 Jan 2007)
New Revision: 19773
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19773&view=rev

Modified:
   haiku/trunk/src/system/kernel/device_manager/device_manager.c
Log:
Fixed warning.


Modified: haiku/trunk/src/system/kernel/device_manager/device_manager.c
===================================================================
--- haiku/trunk/src/system/kernel/device_manager/device_manager.c	2007-01-12 16:05:43 UTC (rev 19772)
+++ haiku/trunk/src/system/kernel/device_manager/device_manager.c	2007-01-12 18:03:21 UTC (rev 19773)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved.
+ * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved.
  * Copyright 2002-2004, Thomas Kurschel. All rights reserved.
  *
  * Distributed under the terms of the MIT License.
@@ -16,6 +16,8 @@
 
 #include 
 #include 
+
+#include 
 #include 
 
 



From marcusoverhagen at mail.berlios.de  Fri Jan 12 19:09:16 2007
From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS)
Date: Fri, 12 Jan 2007 19:09:16 +0100
Subject: [Haiku-commits] r19774 - in haiku/trunk: headers/private/kernel
	src/system/kernel/fs
Message-ID: <200701121809.l0CI9Gis018612@sheep.berlios.de>

Author: marcusoverhagen
Date: 2007-01-12 19:09:15 +0100 (Fri, 12 Jan 2007)
New Revision: 19774
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19774&view=rev

Modified:
   haiku/trunk/headers/private/kernel/vfs.h
   haiku/trunk/src/system/kernel/fs/vfs_boot.cpp
Log:
Improved error reporting when a failure to find/mount the root device occurs.


Modified: haiku/trunk/headers/private/kernel/vfs.h
===================================================================
--- haiku/trunk/headers/private/kernel/vfs.h	2007-01-12 18:03:21 UTC (rev 19773)
+++ haiku/trunk/headers/private/kernel/vfs.h	2007-01-12 18:09:15 UTC (rev 19774)
@@ -64,7 +64,7 @@
 
 status_t vfs_init(struct kernel_args *args);
 status_t vfs_bootstrap_file_systems(void);
-status_t vfs_mount_boot_file_system(struct kernel_args *args);
+void vfs_mount_boot_file_system(struct kernel_args *args);
 void vfs_exec_io_context(void *context);
 void *vfs_new_io_context(void *parentContext);
 status_t vfs_free_io_context(void *context);

Modified: haiku/trunk/src/system/kernel/fs/vfs_boot.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/vfs_boot.cpp	2007-01-12 18:03:21 UTC (rev 19773)
+++ haiku/trunk/src/system/kernel/fs/vfs_boot.cpp	2007-01-12 18:09:15 UTC (rev 19774)
@@ -316,15 +316,17 @@
 }
 
 
-status_t
+void
 vfs_mount_boot_file_system(kernel_args *args)
 {
 	PartitionStack partitions;
 	status_t status = get_boot_partitions(args, partitions);
 	if (status < B_OK) {
-		panic("Did not get any boot partitions!");
-		return status;
+		panic("get_boot_partitions failed!");
 	}
+	if (partitions.IsEmpty()) {
+		panic("did not find any boot partitions!");
+	}
 
 	KPartition *bootPartition;
 	while (partitions.Pop(&bootPartition)) {
@@ -332,6 +334,7 @@
 		if (bootPartition->GetPath(&path) != B_OK)
 			panic("could not get boot device!\n");
 
+		TRACE(("trying to mount boot partition: %s\n", path.Path()));
 		gBootDevice = _kern_mount("/boot", path.Path(), NULL, 0, NULL, 0);
 		if (gBootDevice >= B_OK)
 			break;
@@ -355,7 +358,5 @@
 	// search for other disk systems
 	KDiskDeviceManager *manager = KDiskDeviceManager::Default();
 	manager->RescanDiskSystems();
-
-	return B_OK;
 }
 



From axeld at mail.berlios.de  Fri Jan 12 19:26:34 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Fri, 12 Jan 2007 19:26:34 +0100
Subject: [Haiku-commits] r19775 - in haiku/trunk:
	headers/private/kernel/arch headers/private/kernel/arch/x86
	src/system/kernel src/system/kernel/arch/ppc
	src/system/kernel/arch/x86
Message-ID: <200701121826.l0CIQYEN007441@sheep.berlios.de>

Author: axeld
Date: 2007-01-12 19:26:32 +0100 (Fri, 12 Jan 2007)
New Revision: 19775
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19775&view=rev

Modified:
   haiku/trunk/headers/private/kernel/arch/thread.h
   haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h
   haiku/trunk/src/system/kernel/arch/ppc/arch_thread.c
   haiku/trunk/src/system/kernel/arch/x86/arch_thread.c
   haiku/trunk/src/system/kernel/arch/x86/arch_x86.S
   haiku/trunk/src/system/kernel/team.c
   haiku/trunk/src/system/kernel/thread.c
Log:
* There was no reason to copy the "userland calls exit_thread()" stub with interrupts
  turned off - accessing userland memory. Now, arch_thread_enter_userspace() does that
  job, and as a result, may also fail.
* dump_thread() now directly prints the info of the current thread when used without
  argument (rather than iterating the thread list to look for the current thread).
* If arch_thread_init_tls() fails upon thread creation, the function will now return
  an error.


Modified: haiku/trunk/headers/private/kernel/arch/thread.h
===================================================================
--- haiku/trunk/headers/private/kernel/arch/thread.h	2007-01-12 18:09:15 UTC (rev 19774)
+++ haiku/trunk/headers/private/kernel/arch/thread.h	2007-01-12 18:26:32 UTC (rev 19775)
@@ -23,7 +23,7 @@
 void arch_thread_context_switch(struct thread *t_from, struct thread *t_to);
 status_t arch_thread_init_kthread_stack(struct thread *t, int (*start_func)(void), void (*entry_func)(void), void (*exit_func)(void));
 void arch_thread_dump_info(void *info);
-void arch_thread_enter_uspace(struct thread *t, addr_t entry, void *args1, void *args2);
+status_t arch_thread_enter_userspace(struct thread *t, addr_t entry, void *args1, void *args2);
 void arch_thread_switch_kstack_and_call(struct thread *t, addr_t new_kstack, void (*func)(void *), void *arg);
 
 // ToDo: doing this this way is an ugly hack - please fix me!

Modified: haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h
===================================================================
--- haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h	2007-01-12 18:09:15 UTC (rev 19774)
+++ haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h	2007-01-12 18:26:32 UTC (rev 19775)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -100,7 +100,9 @@
 
 void __x86_setup_system_time(uint32 cv_factor);
 void i386_context_switch(struct arch_thread *old_state, struct arch_thread *new_state, addr_t new_pgdir);
-void i386_enter_uspace(addr_t entry, void *args1, void *args2, addr_t ustack_top);
+void x86_userspace_thread_exit(void);
+void x86_end_userspace_thread_exit(void);
+void x86_enter_userspace(addr_t entry, void *args1, void *args2, addr_t ustack_top);
 void i386_set_tss_and_kstack(addr_t kstack);
 void i386_switch_stack_and_call(addr_t stack, void (*func)(void *), void *arg);
 void i386_swap_pgdir(addr_t new_pgdir);

Modified: haiku/trunk/src/system/kernel/arch/ppc/arch_thread.c
===================================================================
--- haiku/trunk/src/system/kernel/arch/ppc/arch_thread.c	2007-01-12 18:09:15 UTC (rev 19774)
+++ haiku/trunk/src/system/kernel/arch/ppc/arch_thread.c	2007-01-12 18:26:32 UTC (rev 19775)
@@ -206,10 +206,11 @@
 }
 
 
-void
-arch_thread_enter_uspace(struct thread *thread, addr_t entry, void *arg1, void *arg2)
+status_t
+arch_thread_enter_userspace(struct thread *thread, addr_t entry, void *arg1, void *arg2)
 {
 	panic("arch_thread_enter_uspace(): not yet implemented\n");
+	return B_ERROR;
 }
 
 

Modified: haiku/trunk/src/system/kernel/arch/x86/arch_thread.c
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_thread.c	2007-01-12 18:09:15 UTC (rev 19774)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_thread.c	2007-01-12 18:26:32 UTC (rev 19775)
@@ -306,19 +306,23 @@
 /** Sets up initial thread context and enters user space
  */
 
-void
-arch_thread_enter_uspace(struct thread *t, addr_t entry, void *args1, void *args2)
+status_t
+arch_thread_enter_userspace(struct thread *t, addr_t entry, void *args1, void *args2)
 {
-	addr_t ustack_top = t->user_stack_base + t->user_stack_size;
+	addr_t stackTop = t->user_stack_base + t->user_stack_size;
+	uint32 codeSize = (addr_t)x86_end_userspace_thread_exit
+		- (addr_t)x86_userspace_thread_exit;
 
 	TRACE(("arch_thread_enter_uspace: entry 0x%lx, args %p %p, ustack_top 0x%lx\n",
-		entry, args1, args2, ustack_top));
+		entry, args1, args2, stackTop));
 
-	// access the new stack to make sure the memory page is present
-	// while interrupts are disabled.
-	// XXX does this belong there, should caller take care of it?
-	*(uint32 *)(ustack_top - 8) = 0;
+	// copy the little stub that calls exit_thread() when the thread entry
+	// function returns
+	stackTop -= codeSize;
 
+	if (user_memcpy((void *)stackTop, x86_userspace_thread_exit, codeSize) < B_OK)
+		return B_BAD_ADDRESS;
+
 	disable_interrupts();
 
 	i386_set_tss_and_kstack(t->kernel_stack_base + KERNEL_STACK_SIZE);
@@ -326,7 +330,10 @@
 	// set the CPU dependent GDT entry for TLS
 	set_tls_context(t);
 
-	i386_enter_uspace(entry, args1, args2, ustack_top - 4);
+	x86_enter_userspace(entry, args1, args2, stackTop);
+
+	return B_OK;
+		// never gets here
 }
 
 

Modified: haiku/trunk/src/system/kernel/arch/x86/arch_x86.S
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_x86.S	2007-01-12 18:09:15 UTC (rev 19774)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_x86.S	2007-01-12 18:26:32 UTC (rev 19775)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2003-2005, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2003-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001, Travis Geiselbrecht. All rights reserved.
@@ -126,20 +126,20 @@
 	movl	%eax,%cr3
 	ret
 
-/* thread exit stub */
+/* thread exit stub - is copied to the userspace stack in arch_thread_enter_uspace() */
 	.align 4
-i386_uspace_exit_stub:
+FUNCTION(x86_userspace_thread_exit):
 	pushl	%eax
 	movl	$1, %ecx
-	lea	(%esp), %edx
+	lea		(%esp), %edx
 	movl	$SYSCALL_EXIT_THREAD, %eax;
-	int	$99
+	int		$99
 	.align 4
-i386_uspace_exit_stub_end:
+FUNCTION(x86_end_userspace_thread_exit):
 
 
-/* void i386_enter_uspace(addr entry, void *args1, void *args2, addr ustack_top); */
-FUNCTION(i386_enter_uspace):
+/* void x86_enter_userspace(addr entry, void *args1, void *args2, addr stackTop); */
+FUNCTION(x86_enter_userspace):
 	movl	4(%esp),%eax	// get entry point
 	movl	8(%esp),%edx	// get arguments
 	movl	12(%esp),%edi
@@ -150,16 +150,6 @@
 	//movw	$0x33 + cpu_num,%fs	-> fs points to the TLS storage (CPU dependent segment)
 	movw	%cx,%gs
 
-	// copy exit stub to stack
-	movl	$i386_uspace_exit_stub_end, %esi
-_copy_more:
-	lea	-4(%esi), %esi
-	lea	-4(%ebx), %ebx
-	mov	(%esi), %ecx
-	mov	%ecx, (%ebx)
-	cmp	$i386_uspace_exit_stub, %esi
-	jg	_copy_more
-
 	// push the args onto the user stack
 	movl	%edi,-4(%ebx)	// args1
 	movl	%edx,-8(%ebx)	// args2

Modified: haiku/trunk/src/system/kernel/team.c
===================================================================
--- haiku/trunk/src/system/kernel/team.c	2007-01-12 18:09:15 UTC (rev 19774)
+++ haiku/trunk/src/system/kernel/team.c	2007-01-12 18:26:32 UTC (rev 19775)
@@ -819,10 +819,8 @@
 	team->state = TEAM_STATE_NORMAL;
 
 	// jump to the entry point in user space
-	arch_thread_enter_uspace(t, entry, uspa, NULL);
-
-	// never gets here
-	return B_OK;
+	return arch_thread_enter_userspace(t, entry, uspa, NULL);
+		// only returns in case of error
 }
 
 

Modified: haiku/trunk/src/system/kernel/thread.c
===================================================================
--- haiku/trunk/src/system/kernel/thread.c	2007-01-12 18:09:15 UTC (rev 19774)
+++ haiku/trunk/src/system/kernel/thread.c	2007-01-12 18:26:32 UTC (rev 19775)
@@ -309,9 +309,10 @@
 	thread_at_kernel_exit();
 
 	// jump to the entry point in user space
-	arch_thread_enter_uspace(thread, (addr_t)thread->entry, thread->args1, thread->args2);
+	arch_thread_enter_userspace(thread, (addr_t)thread->entry,
+		thread->args1, thread->args2);
 
-	// never get here
+	// only get here if the above call fails
 	return 0;
 }
 
@@ -462,14 +463,12 @@
 				(void **)&thread->user_stack_base, B_BASE_ADDRESS,
 				thread->user_stack_size + TLS_SIZE, B_NO_LOCK,
 				B_READ_AREA | B_WRITE_AREA | B_STACK_AREA);
-		if (thread->user_stack_area < 0) {
-			// great, we have a fully running thread without a stack
-			dprintf("create_thread: unable to create user stack!\n");
+		if (thread->user_stack_area < B_OK
+			|| arch_thread_init_tls(thread) < B_OK) {
+			// great, we have a fully running thread without a (usable) stack
+			dprintf("create_thread: unable to create proper user stack!\n");
 			status = thread->user_stack_area;
 			kill_thread(thread->id);
-		} else {
-			// now that the TLS area is allocated, initialize TLS
-			arch_thread_init_tls(thread);
 		}
 
 		// copy the user entry over to the args field in the thread struct
@@ -603,8 +602,8 @@
 	}
 
 	if (argc == 1) {
-		name = NULL;
-		id = thread_get_current_thread()->id;
+		_dump_thread_info(thread_get_current_thread());
+		return 0;
 	} else {
 		name = argv[1];
 		id = strtoul(argv[1], NULL, 0);



From axeld at mail.berlios.de  Fri Jan 12 19:51:02 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Fri, 12 Jan 2007 19:51:02 +0100
Subject: [Haiku-commits] r19776 - haiku/trunk/src/system/kernel/vm
Message-ID: <200701121851.l0CIp2Lg010805@sheep.berlios.de>

Author: axeld
Date: 2007-01-12 19:51:01 +0100 (Fri, 12 Jan 2007)
New Revision: 19776
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19776&view=rev

Modified:
   haiku/trunk/src/system/kernel/vm/vm.cpp
   haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.c
   haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.h
Log:
* Added the possibility to pre-commit pages for areas that can overcommit.
* This is now used for userland stack - they now always pre-commit two pages, enough
  to initialize TLS and copy the user-thread-exit stub to that area.
* Minor cleanup.


Modified: haiku/trunk/src/system/kernel/vm/vm.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm.cpp	2007-01-12 18:26:32 UTC (rev 19775)
+++ haiku/trunk/src/system/kernel/vm/vm.cpp	2007-01-12 18:51:01 UTC (rev 19776)
@@ -529,7 +529,7 @@
 
 		// create an anonymous store object
 		newStore = vm_store_create_anonymous_noswap((protection & B_STACK_AREA) != 0,
-			USER_STACK_GUARD_PAGES);
+			0, USER_STACK_GUARD_PAGES);
 		if (newStore == NULL) {
 			status = B_NO_MEMORY;
 			goto err1;
@@ -784,8 +784,9 @@
 	}
 
 	// create an anonymous store object
-	store = vm_store_create_anonymous_noswap(canOvercommit, isStack ?
-		((protection & B_USER_PROTECTION) != 0 ? 
+	// if it's a stack, make sure that two pages are available at least
+	store = vm_store_create_anonymous_noswap(canOvercommit, isStack ? 2 : 0,
+		isStack ? ((protection & B_USER_PROTECTION) != 0 ? 
 			USER_STACK_GUARD_PAGES : KERNEL_STACK_GUARD_PAGES) : 0);
 	if (store == NULL) {
 		status = B_NO_MEMORY;
@@ -1461,7 +1462,7 @@
 	lowerCache = upperCacheRef->cache;
 
 	// create an anonymous store object
-	store = vm_store_create_anonymous_noswap(false, 0);
+	store = vm_store_create_anonymous_noswap(false, 0, 0);
 	if (store == NULL)
 		return B_NO_MEMORY;
 
@@ -2456,8 +2457,8 @@
 
 	err = vm_soft_fault(address, is_write, is_user);
 	if (err < 0) {
-		dprintf("vm_page_fault: vm_soft_fault returned error %d on fault at 0x%lx, ip 0x%lx, write %d, user %d, thread 0x%lx\n",
-			err, address, fault_address, is_write, is_user, thread_get_current_thread_id());
+		dprintf("vm_page_fault: vm_soft_fault returned error '%s' on fault at 0x%lx, ip 0x%lx, write %d, user %d, thread 0x%lx\n",
+			strerror(err), address, fault_address, is_write, is_user, thread_get_current_thread_id());
 		if (!is_user) {
 			struct thread *t = thread_get_current_thread();
 			if (t && t->fault_handler != 0) {
@@ -2542,8 +2543,8 @@
 	vm_page dummyPage;
 	vm_page *page = NULL;
 	addr_t address;
-	int change_count;
-	int err;
+	int32 changeCount;
+	status_t status;
 
 	FTRACE(("vm_soft_fault: thid 0x%lx address 0x%lx, isWrite %d, isUser %d\n",
 		thread_get_current_thread_id(), originalAddress, isWrite, isUser));
@@ -2604,7 +2605,7 @@
 	topCacheRef = area->cache_ref;
 	cacheOffset = address - area->base + area->cache_offset;
 	vm_cache_acquire_ref(topCacheRef);
-	change_count = addressSpace->change_count;
+	changeCount = addressSpace->change_count;
 	release_sem_etc(addressSpace->sem, READ_COUNT, 0);
 
 	// See if this cache has a fault handler - this will do all the work for us
@@ -2687,8 +2688,10 @@
 
 			addressSpace->translation_map.ops->get_physical_page(page->physical_page_number * B_PAGE_SIZE, (addr_t *)&vec.iov_base, PHYSICAL_PAGE_CAN_WAIT);
 			// ToDo: handle errors here
-			err = cacheRef->cache->store->ops->read(cacheRef->cache->store,
+			status = cacheRef->cache->store->ops->read(cacheRef->cache->store,
 				cacheOffset, &vec, 1, &bytesRead, false);
+			if (status < B_OK)
+				panic("hello, dudes!");
 			addressSpace->translation_map.ops->put_physical_page((addr_t)vec.iov_base);
 
 			mutex_lock(&cacheRef->lock);
@@ -2783,8 +2786,8 @@
 		// try to get a mapping for the src and dest page so we can copy it
 		for (;;) {
 			(*addressSpace->translation_map.ops->get_physical_page)(src_page->physical_page_number * B_PAGE_SIZE, (addr_t *)&src, PHYSICAL_PAGE_CAN_WAIT);
-			err = (*addressSpace->translation_map.ops->get_physical_page)(page->physical_page_number * B_PAGE_SIZE, (addr_t *)&dest, PHYSICAL_PAGE_NO_WAIT);
-			if (err == B_NO_ERROR)
+			status = (*addressSpace->translation_map.ops->get_physical_page)(page->physical_page_number * B_PAGE_SIZE, (addr_t *)&dest, PHYSICAL_PAGE_NO_WAIT);
+			if (status == B_NO_ERROR)
 				break;
 
 			// it couldn't map the second one, so sleep and retry
@@ -2822,20 +2825,20 @@
 		}
 	}
 
-	err = B_OK;
+	status = B_OK;
 	acquire_sem_etc(addressSpace->sem, READ_COUNT, 0, 0);
-	if (change_count != addressSpace->change_count) {
+	if (changeCount != addressSpace->change_count) {
 		// something may have changed, see if the address is still valid
 		area = vm_area_lookup(addressSpace, address);
 		if (area == NULL
 			|| area->cache_ref != topCacheRef
 			|| (address - area->base + area->cache_offset) != cacheOffset) {
 			dprintf("vm_soft_fault: address space layout changed effecting ongoing soft fault\n");
-			err = B_BAD_ADDRESS;
+			status = B_BAD_ADDRESS;
 		}
 	}
 
-	if (err == B_OK) {
+	if (status == B_OK) {
 		// All went fine, all there is left to do is to map the page into the address space
 
 		// If the page doesn't reside in the area's cache, we need to make sure it's
@@ -2868,7 +2871,7 @@
 	vm_cache_release_ref(topCacheRef);
 	vm_put_address_space(addressSpace);
 
-	return err;
+	return status;
 }
 
 

Modified: haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.c
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.c	2007-01-12 18:26:32 UTC (rev 19775)
+++ haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.c	2007-01-12 18:51:01 UTC (rev 19776)
@@ -31,6 +31,8 @@
 typedef struct anonymous_store {
 	vm_store	vm;
 	bool		can_overcommit;
+	bool		has_precommitted;
+	uint8		precommitted_pages;
 	int32		guarded_size;
 } anonymous_store;
 
@@ -49,9 +51,16 @@
 	anonymous_store *store = (anonymous_store *)_store;
 
 	// if we can overcommit, we don't commit here, but in anonymous_fault()
-	if (store->can_overcommit)
-		return B_OK;
+	if (store->can_overcommit) {
+		if (store->has_precommitted)
+			return B_OK;
 
+		// pre-commit some pages to make a later failure less probable
+		store->has_precommitted = true;
+		if (size > store->vm.cache->virtual_base + store->precommitted_pages)
+			size = store->vm.cache->virtual_base + store->precommitted_pages;
+	}
+
 	size -= store->vm.cache->virtual_base;
 		// anonymous stores don't need to span over their whole source
 
@@ -61,7 +70,7 @@
 		// try to commit
 		if (vm_try_reserve_memory(size - store->vm.committed_size) != B_OK)
 			return B_NO_MEMORY;
-		
+
 		store->vm.committed_size = size;
 	} else {
 		// we can release some
@@ -121,9 +130,12 @@
 			}
 		}
 
-		// try to commit additional memory
-		if (vm_try_reserve_memory(B_PAGE_SIZE) != B_OK)
-			return B_NO_MEMORY;
+		if (store->precommitted_pages == 0) {
+			// try to commit additional memory
+			if (vm_try_reserve_memory(B_PAGE_SIZE) != B_OK)
+				return B_NO_MEMORY;
+		} else
+			store->precommitted_pages--;
 
 		store->vm.committed_size += B_PAGE_SIZE;
 	}
@@ -150,7 +162,7 @@
  */
 
 vm_store *
-vm_store_create_anonymous_noswap(bool canOvercommit, int32 numGuardPages)
+vm_store_create_anonymous_noswap(bool canOvercommit, int32 numPrecommittedPages, int32 numGuardPages)
 {
 	anonymous_store *store = malloc(sizeof(anonymous_store));
 	if (store == NULL)
@@ -163,6 +175,8 @@
 	store->vm.cache = NULL;
 	store->vm.committed_size = 0;
 	store->can_overcommit = canOvercommit;
+	store->has_precommitted = numPrecommittedPages != 0;
+	store->precommitted_pages = min(numPrecommittedPages, 255);
 	store->guarded_size = numGuardPages * B_PAGE_SIZE;
 
 	return &store->vm;

Modified: haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.h
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.h	2007-01-12 18:26:32 UTC (rev 19775)
+++ haiku/trunk/src/system/kernel/vm/vm_store_anonymous_noswap.h	2007-01-12 18:51:01 UTC (rev 19776)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2004-2005, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -13,8 +13,14 @@
 
 
 #ifdef __cplusplus
-extern "C"
+extern "C" {
 #endif
-vm_store *vm_store_create_anonymous_noswap(bool canOvercommit, int32 numGuardPages);
 
+vm_store *vm_store_create_anonymous_noswap(bool canOvercommit,
+	int32 numPrecommittedPages, int32 numGuardPages);
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif	/* _KERNEL_VM_STORE_ANONYMOUS_H */



From korli at mail.berlios.de  Fri Jan 12 21:01:09 2007
From: korli at mail.berlios.de (korli at BerliOS)
Date: Fri, 12 Jan 2007 21:01:09 +0100
Subject: [Haiku-commits] r19777 - in haiku/trunk: headers/private/kernel
	src/add-ons/kernel/bus_managers/acpi src/system/boot/loader
Message-ID: <200701122001.l0CK191K018720@sheep.berlios.de>

Author: korli
Date: 2007-01-12 21:01:08 +0100 (Fri, 12 Jan 2007)
New Revision: 19777
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19777&view=rev

Modified:
   haiku/trunk/headers/private/kernel/safemode.h
   haiku/trunk/src/add-ons/kernel/bus_managers/acpi/Jamfile
   haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c
   haiku/trunk/src/system/boot/loader/menu.cpp
Log:
added a boot menu option "Disable ACPI" and code to avoid loading the ACPI module when it's active. untested (because of sudden reboots when boot menu is used).


Modified: haiku/trunk/headers/private/kernel/safemode.h
===================================================================
--- haiku/trunk/headers/private/kernel/safemode.h	2007-01-12 18:51:01 UTC (rev 19776)
+++ haiku/trunk/headers/private/kernel/safemode.h	2007-01-12 20:01:08 UTC (rev 19777)
@@ -14,6 +14,7 @@
 
 #define B_SAFEMODE_DISABLE_USER_ADD_ONS		"disableuseraddons"
 #define B_SAFEMODE_DISABLE_IDE_DMA			"disableidedma"
+#define B_SAFEMODE_DISABLE_ACPI				"disableacpi"
 #define B_SAFEMODE_DISABLE_SMP				"disable_smp"
 #define B_SAFEMODE_DISABLE_HYPER_THREADING	"disable_hyperthreading"
 

Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/Jamfile	2007-01-12 18:51:01 UTC (rev 19776)
+++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/Jamfile	2007-01-12 20:01:08 UTC (rev 19777)
@@ -2,6 +2,7 @@
 
 SetSubDirSupportedPlatformsBeOSCompatible ;
 
+UsePrivateHeaders kernel ;
 SubDirHdrs [ FDirName $(SUBDIR) include ] ;
 SubDirHdrs [ FDirName $(SUBDIR) include platform ] ;
 SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) pci ] ;

Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c	2007-01-12 18:51:01 UTC (rev 19776)
+++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c	2007-01-12 20:01:08 UTC (rev 19777)
@@ -8,8 +8,9 @@
 #include 
 #include 
 
+#include 
+#include 
 #include 
-#include 
 #include 
 
 #include "acpi.h"
@@ -57,6 +58,8 @@
 acpi_std_ops(int32 op,...) 
 {
 	ACPI_STATUS Status;
+	bool acpiDisabled = false;
+	void *settings;
 	
 	switch(op) {
 		case B_MODULE_INIT:
@@ -65,6 +68,19 @@
 				AcpiDbgLevel = ACPI_DEBUG_ALL | ACPI_LV_VERBOSE;
 				AcpiDbgLayer = ACPI_ALL_COMPONENTS;
 			#endif
+			
+			// check if safemode settings disable ACPI
+			settings = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS);
+			if (settings != NULL) {
+				acpiDisabled = get_driver_boolean_parameter(settings, B_SAFEMODE_DISABLE_ACPI,
+					false, false);
+				unload_driver_settings(settings);
+			}
+			
+			if (acpiDisabled) {
+				ERROR("ACPI disabled");
+				return ENOSYS;
+			}
 
 			Status = AcpiInitializeSubsystem();
 			if (Status != AE_OK) {

Modified: haiku/trunk/src/system/boot/loader/menu.cpp
===================================================================
--- haiku/trunk/src/system/boot/loader/menu.cpp	2007-01-12 18:51:01 UTC (rev 19776)
+++ haiku/trunk/src/system/boot/loader/menu.cpp	2007-01-12 20:01:08 UTC (rev 19777)
@@ -443,7 +443,11 @@
 	safeMenu->AddItem(item = new(nothrow) MenuItem("Disable IDE DMA"));
 	item->SetData(B_SAFEMODE_DISABLE_IDE_DMA);
 	item->SetType(MENU_ITEM_MARKABLE);
-
+	
+	safeMenu->AddItem(item = new(nothrow) MenuItem("Disable ACPI"));
+	item->SetData(B_SAFEMODE_DISABLE_ACPI);
+	item->SetType(MENU_ITEM_MARKABLE);
+	
 	platform_add_menus(safeMenu);
 
 	safeMenu->AddItem(item = new(nothrow) MenuItem("Enable on screen debug output"));



From axeld at mail.berlios.de  Fri Jan 12 21:40:40 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Fri, 12 Jan 2007 21:40:40 +0100
Subject: [Haiku-commits] r19778 - in haiku/trunk:
	headers/private/kernel/arch/x86 src/system/kernel/arch/x86
Message-ID: <200701122040.l0CKeeMk023782@sheep.berlios.de>

Author: axeld
Date: 2007-01-12 21:40:39 +0100 (Fri, 12 Jan 2007)
New Revision: 19778
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19778&view=rev

Modified:
   haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h
   haiku/trunk/src/system/kernel/arch/x86/arch_thread.c
   haiku/trunk/src/system/kernel/arch/x86/arch_x86.S
Log:
Didn't notice that x86_enter_userspace() also copied the thread entry's arguments to
the userland stack in an unsafe way - moved that stuff to arch_thread_enter_userspace(), too.


Modified: haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h
===================================================================
--- haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h	2007-01-12 20:01:08 UTC (rev 19777)
+++ haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h	2007-01-12 20:40:39 UTC (rev 19778)
@@ -102,7 +102,7 @@
 void i386_context_switch(struct arch_thread *old_state, struct arch_thread *new_state, addr_t new_pgdir);
 void x86_userspace_thread_exit(void);
 void x86_end_userspace_thread_exit(void);
-void x86_enter_userspace(addr_t entry, void *args1, void *args2, addr_t ustack_top);
+void x86_enter_userspace(addr_t entry, addr_t stackTop);
 void i386_set_tss_and_kstack(addr_t kstack);
 void i386_switch_stack_and_call(addr_t stack, void (*func)(void *), void *arg);
 void i386_swap_pgdir(addr_t new_pgdir);

Modified: haiku/trunk/src/system/kernel/arch/x86/arch_thread.c
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_thread.c	2007-01-12 20:01:08 UTC (rev 19777)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_thread.c	2007-01-12 20:40:39 UTC (rev 19778)
@@ -312,17 +312,26 @@
 	addr_t stackTop = t->user_stack_base + t->user_stack_size;
 	uint32 codeSize = (addr_t)x86_end_userspace_thread_exit
 		- (addr_t)x86_userspace_thread_exit;
+	uint32 args[3];
 
 	TRACE(("arch_thread_enter_uspace: entry 0x%lx, args %p %p, ustack_top 0x%lx\n",
 		entry, args1, args2, stackTop));
 
 	// copy the little stub that calls exit_thread() when the thread entry
-	// function returns
+	// function returns, as well as the arguments of the entry function
 	stackTop -= codeSize;
 
 	if (user_memcpy((void *)stackTop, x86_userspace_thread_exit, codeSize) < B_OK)
 		return B_BAD_ADDRESS;
 
+	args[0] = stackTop;
+	args[1] = (uint32)args1;
+	args[2] = (uint32)args2;
+	stackTop -= sizeof(args);
+
+	if (user_memcpy((void *)stackTop, args, sizeof(args)) < B_OK)
+		return B_BAD_ADDRESS;
+
 	disable_interrupts();
 
 	i386_set_tss_and_kstack(t->kernel_stack_base + KERNEL_STACK_SIZE);
@@ -330,7 +339,7 @@
 	// set the CPU dependent GDT entry for TLS
 	set_tls_context(t);
 
-	x86_enter_userspace(entry, args1, args2, stackTop);
+	x86_enter_userspace(entry, stackTop);
 
 	return B_OK;
 		// never gets here

Modified: haiku/trunk/src/system/kernel/arch/x86/arch_x86.S
===================================================================
--- haiku/trunk/src/system/kernel/arch/x86/arch_x86.S	2007-01-12 20:01:08 UTC (rev 19777)
+++ haiku/trunk/src/system/kernel/arch/x86/arch_x86.S	2007-01-12 20:40:39 UTC (rev 19778)
@@ -138,23 +138,16 @@
 FUNCTION(x86_end_userspace_thread_exit):
 
 
-/* void x86_enter_userspace(addr entry, void *args1, void *args2, addr stackTop); */
+/* void x86_enter_userspace(addr_t entry, addr_t stackTop); */
 FUNCTION(x86_enter_userspace):
-	movl	4(%esp),%eax	// get entry point
-	movl	8(%esp),%edx	// get arguments
-	movl	12(%esp),%edi
-	movl	16(%esp),%ebx	// get user stack
-	movw	$USER_DATA_SEG,%cx
-	movw	%cx,%ds
-	movw	%cx,%es
-	//movw	$0x33 + cpu_num,%fs	-> fs points to the TLS storage (CPU dependent segment)
-	movw	%cx,%gs
+	movl	4(%esp), %eax	// get entry point
+	movl	8(%esp), %ebx	// get user stack
+	movw	$USER_DATA_SEG, %cx
+	movw	%cx, %ds
+	movw	%cx, %es
+	//movw	$0x33 + cpu_num, %fs	-> fs points to the TLS storage (CPU dependent segment)
+	movw	%cx, %gs
 
-	// push the args onto the user stack
-	movl	%edi,-4(%ebx)	// args1
-	movl	%edx,-8(%ebx)	// args2
-	movl	%ebx,-12(%ebx)	// fake return address to copied exit stub
-	sub		$12,%ebx
 	xorl	%ebp, %ebp		// this is the last stack frame - we don't need one on return
 							// (%ebp marks the beginning of this stack frame)
 	pushl	$USER_DATA_SEG	// user data segment



From axeld at pinc-software.de  Fri Jan 12 21:44:11 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Fri, 12 Jan 2007 21:44:11 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?r19777_-_in_haiku/trunk=3A_header?=
	=?iso-8859-15?q?s/private/kernel_src/add-ons/kernel/bus=5Fmanagers?=
	=?iso-8859-15?q?/acpi__src/system/boot/loader?=
In-Reply-To: <200701122001.l0CK191K018720@sheep.berlios.de>
Message-ID: <30191745817-BeMail@zon>

korli at BerliOS  wrote:
> Log:
> added a boot menu option "Disable ACPI" and code to avoid loading the 
> ACPI module when > it's active. untested (because of sudden reboots 
when boot menu is used).

There is an open bug report for this - I could never reproduce it, 
though. Maybe you want to look into that? :-)

> Modified: haiku/trunk/headers/private/kernel/safemode.h
>  #define B_SAFEMODE_DISABLE_USER_ADD_ONS		"disableuseraddons"
>  #define B_SAFEMODE_DISABLE_IDE_DMA			"disableidedma"
> +#define B_SAFEMODE_DISABLE_ACPI				"disableacpi"
>  #define B_SAFEMODE_DISABLE_SMP				"disable_smp"

Preferred would be "disable_acpi" - the other two are called this way 
for BeOS compatibility, only.
Also, we should add the same mechanism as done for APM to disable ACPI 
in the kernel settings file.

Bye,
   Axel.



From marcusoverhagen at mail.berlios.de  Fri Jan 12 22:05:47 2007
From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS)
Date: Fri, 12 Jan 2007 22:05:47 +0100
Subject: [Haiku-commits] r19779 -
	haiku/trunk/src/system/boot/platform/pxe_ia32
Message-ID: <200701122105.l0CL5lES025698@sheep.berlios.de>

Author: marcusoverhagen
Date: 2007-01-12 22:05:47 +0100 (Fri, 12 Jan 2007)
New Revision: 19779
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19779&view=rev

Added:
   haiku/trunk/src/system/boot/platform/pxe_ia32/network.h
Log:
made a copy


Copied: haiku/trunk/src/system/boot/platform/pxe_ia32/network.h (from rev 19771, haiku/trunk/src/system/boot/platform/pxe_ia32/network.cpp)



From marcusoverhagen at mail.berlios.de  Fri Jan 12 23:27:49 2007
From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS)
Date: Fri, 12 Jan 2007 23:27:49 +0100
Subject: [Haiku-commits] r19780 - in haiku/trunk:
	headers/private/kernel/boot headers/private/kernel/boot/net
	src/system/boot/loader/net src/system/boot/platform/bios_ia32
	src/system/boot/platform/pxe_ia32 src/system/kernel/fs
Message-ID: <200701122227.l0CMRn8n001035@sheep.berlios.de>

Author: marcusoverhagen
Date: 2007-01-12 23:27:48 +0100 (Fri, 12 Jan 2007)
New Revision: 19780
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19780&view=rev

Modified:
   haiku/trunk/headers/private/kernel/boot/disk_identifier.h
   haiku/trunk/headers/private/kernel/boot/kernel_args.h
   haiku/trunk/headers/private/kernel/boot/net/RemoteDisk.h
   haiku/trunk/src/system/boot/loader/net/RemoteDisk.cpp
   haiku/trunk/src/system/boot/platform/bios_ia32/devices.cpp
   haiku/trunk/src/system/boot/platform/pxe_ia32/devices.cpp
   haiku/trunk/src/system/boot/platform/pxe_ia32/network.cpp
   haiku/trunk/src/system/boot/platform/pxe_ia32/network.h
   haiku/trunk/src/system/kernel/fs/vfs_boot.cpp
Log:
propagate required settings for the remote disk from boot loader to kernel (client-ip, server-ip, server-port)


Modified: haiku/trunk/headers/private/kernel/boot/disk_identifier.h
===================================================================
--- haiku/trunk/headers/private/kernel/boot/disk_identifier.h	2007-01-12 21:05:47 UTC (rev 19779)
+++ haiku/trunk/headers/private/kernel/boot/disk_identifier.h	2007-01-12 22:27:48 UTC (rev 19780)
@@ -23,6 +23,7 @@
 	USB_DEVICE,
 	FIREWIRE_DEVICE,
 	FIBRE_DEVICE,
+	NETWORK_DEVICE,
 };
 
 #define NUM_DISK_CHECK_SUMS 5
@@ -62,6 +63,11 @@
 			uint64		wwd;
 		} fibre;
 		struct {
+			uint32		client_ip;
+			uint32		server_ip;
+			uint16		server_port;
+		} network;
+		struct {
 			off_t		size;
 			struct {
 				off_t	offset;

Modified: haiku/trunk/headers/private/kernel/boot/kernel_args.h
===================================================================
--- haiku/trunk/headers/private/kernel/boot/kernel_args.h	2007-01-12 21:05:47 UTC (rev 19779)
+++ haiku/trunk/headers/private/kernel/boot/kernel_args.h	2007-01-12 22:27:48 UTC (rev 19780)
@@ -46,6 +46,7 @@
 		off_t	partition_offset;
 		bool	user_selected;
 		bool	booted_from_image;
+		bool	booted_from_network;
 		bool	cd;
 	} boot_disk;
 

Modified: haiku/trunk/headers/private/kernel/boot/net/RemoteDisk.h
===================================================================
--- haiku/trunk/headers/private/kernel/boot/net/RemoteDisk.h	2007-01-12 21:05:47 UTC (rev 19779)
+++ haiku/trunk/headers/private/kernel/boot/net/RemoteDisk.h	2007-01-12 22:27:48 UTC (rev 19780)
@@ -28,6 +28,9 @@
 	virtual status_t GetName(char *nameBuffer, size_t bufferSize) const;
 	virtual off_t Size() const;
 
+	ip_addr_t ServerIPAddress() const;
+	uint16 ServerPort() const;
+
 	static RemoteDisk *FindAnyRemoteDisk();
 
 private:

Modified: haiku/trunk/src/system/boot/loader/net/RemoteDisk.cpp
===================================================================
--- haiku/trunk/src/system/boot/loader/net/RemoteDisk.cpp	2007-01-12 21:05:47 UTC (rev 19779)
+++ haiku/trunk/src/system/boot/loader/net/RemoteDisk.cpp	2007-01-12 22:27:48 UTC (rev 19780)
@@ -179,6 +179,18 @@
 	return fImageSize;
 }
 
+ip_addr_t
+RemoteDisk::ServerIPAddress() const
+{
+	return fServerAddress;
+}
+
+uint16
+RemoteDisk::ServerPort() const
+{
+	return fServerPort;
+}
+
 // FindAnyRemoteDisk
 RemoteDisk *
 RemoteDisk::FindAnyRemoteDisk()

Modified: haiku/trunk/src/system/boot/platform/bios_ia32/devices.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/bios_ia32/devices.cpp	2007-01-12 21:05:47 UTC (rev 19779)
+++ haiku/trunk/src/system/boot/platform/bios_ia32/devices.cpp	2007-01-12 22:27:48 UTC (rev 19780)
@@ -757,6 +757,7 @@
 
 	TRACE(("boot drive size: %Ld bytes\n", drive->Size()));
 	gKernelArgs.boot_disk.booted_from_image = gBootedFromImage;
+	gKernelArgs.boot_disk.booted_from_network = false;
 
 	return B_OK;
 }

Modified: haiku/trunk/src/system/boot/platform/pxe_ia32/devices.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/pxe_ia32/devices.cpp	2007-01-12 21:05:47 UTC (rev 19779)
+++ haiku/trunk/src/system/boot/platform/pxe_ia32/devices.cpp	2007-01-12 22:27:48 UTC (rev 19780)
@@ -6,6 +6,7 @@
 
 #include "bios.h"
 #include "pxe_undi.h"
+#include "network.h"
 
 #include 
 #include 
@@ -37,8 +38,12 @@
 
 	// init a remote disk, if possible
 	RemoteDisk *remoteDisk = RemoteDisk::FindAnyRemoteDisk();
-	if (!remoteDisk)
+	if (!remoteDisk) {
+		unsigned ip = NetStack::Default()->GetEthernetInterface()->IPAddress();
+		panic("PXE boot: can't find remote disk on server %u.%u.%u.%u\n",
+			(ip >> 24) & 0xff, (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff);
 		return B_ENTRY_NOT_FOUND;
+	}
 
 	devicesList->Add(remoteDisk);
 	return B_OK;
@@ -74,11 +79,23 @@
 platform_register_boot_device(Node *device)
 {
 	TRACE("platform_register_boot_device\n");
-	disk_identifier &disk = gKernelArgs.boot_disk.identifier;
 
-	disk.bus_type = UNKNOWN_BUS;
-	disk.device_type = UNKNOWN_DEVICE;
-	disk.device.unknown.size = device->Size();
+	gKernelArgs.platform_args.boot_drive_number = 0xffff;
+	gKernelArgs.platform_args.drives = NULL;
 
+	RemoteDisk *rd = static_cast(device);
+	UNDI *undi = static_cast(NetStack::Default()->GetEthernetInterface());
+
+	gKernelArgs.boot_disk.identifier.bus_type = UNKNOWN_BUS;
+	gKernelArgs.boot_disk.identifier.device_type = NETWORK_DEVICE;
+	gKernelArgs.boot_disk.identifier.device.network.client_ip = undi->IPAddress();
+	gKernelArgs.boot_disk.identifier.device.network.server_ip = rd->ServerIPAddress();
+	gKernelArgs.boot_disk.identifier.device.network.server_port = rd->ServerPort();
+	gKernelArgs.boot_disk.partition_offset = 0;
+	gKernelArgs.boot_disk.user_selected = false;
+	gKernelArgs.boot_disk.booted_from_image = false;
+	gKernelArgs.boot_disk.booted_from_network = true;
+	gKernelArgs.boot_disk.cd = false;
+
 	return B_OK;
 }		

Modified: haiku/trunk/src/system/boot/platform/pxe_ia32/network.cpp
===================================================================
--- haiku/trunk/src/system/boot/platform/pxe_ia32/network.cpp	2007-01-12 21:05:47 UTC (rev 19779)
+++ haiku/trunk/src/system/boot/platform/pxe_ia32/network.cpp	2007-01-12 22:27:48 UTC (rev 19780)
@@ -9,12 +9,9 @@
 #include 
 #include 
 
-#include 
 #include 
 
-#include 
-#include 
-
+#include "network.h"
 #include "pxe_undi.h"
 
 //#define TRACE_NETWORK
@@ -52,29 +49,6 @@
 #endif	// !TRACE_NETWORK
 
 
-class UNDI : public EthernetInterface
-{
-public:
-						UNDI();
-	virtual 			~UNDI();
-
-	status_t 			Init();
-
-	virtual mac_addr_t	MACAddress() const;
-
-	virtual	void *		AllocateSendReceiveBuffer(size_t size);
-	virtual	void 		FreeSendReceiveBuffer(void *buffer);
-
-	virtual ssize_t		Send(const void *buffer, size_t size);
-	virtual ssize_t		Receive(void *buffer, size_t size);
-
-private:
-	mac_addr_t			fMACAddress;
-	bool				fRxFinished;
-	PXE_STRUCT *		fPxeData;
-};
-
-
 UNDI::UNDI()
  :	fMACAddress()
  ,	fRxFinished(true)
@@ -123,7 +97,9 @@
 	ip_addr_t ipClient = ntohl(*(ip_addr_t *)(buf + 16));
 	ip_addr_t ipServer = ntohl(*(ip_addr_t *)(buf + 20));
 
-	dprintf("client-ip: %08x, server-ip: %08x\n", (int)ipClient, (int)ipServer);
+	dprintf("client-ip: %lu.%lu.%lu.%lu, server-ip: %lu.%lu.%lu.%lu\n", 
+		(ipClient >> 24) & 0xff, (ipClient >> 16) & 0xff, (ipClient >> 8) & 0xff, ipClient & 0xff,
+		(ipServer >> 24) & 0xff, (ipServer >> 16) & 0xff, (ipServer >> 8) & 0xff, ipServer & 0xff);
 
 	SetIPAddress(ipClient);
 

Modified: haiku/trunk/src/system/boot/platform/pxe_ia32/network.h
===================================================================
--- haiku/trunk/src/system/boot/platform/pxe_ia32/network.h	2007-01-12 21:05:47 UTC (rev 19779)
+++ haiku/trunk/src/system/boot/platform/pxe_ia32/network.h	2007-01-12 22:27:48 UTC (rev 19780)
@@ -1,3 +1,5 @@
+#ifndef _PXE_NETWORK_H
+#define _PXE_NETWORK_H
 /*
  * Copyright 2006, Marcus Overhagen .
@@ -4,54 +6,12 @@
  * Distributed under the terms of the MIT License.
  */
 
-#include 
-#include 
-#include 
-#include 
-
 #include 
-#include 
-
 #include 
 #include 
 
-#include "pxe_undi.h"
+struct PXE_STRUCT;
 
-//#define TRACE_NETWORK
-#ifdef TRACE_NETWORK
-#	define TRACE(x...) dprintf(x)
-#else
-#	define TRACE(x...)
-#endif
-
-#ifdef TRACE_NETWORK
-
-static void
-hex_dump(const void *_data, int length)
-{
-	uint8 *data = (uint8*)_data;
-	for (int i = 0; i < length; i++) {
-		if (i % 4 == 0) {
-			if (i % 32 == 0) {
-				if (i != 0)
-					TRACE("\n");
-				TRACE("%03x: ", i);
-			} else
-				TRACE(" ");
-		}
-
-		TRACE("%02x", data[i]);
-	}
-	TRACE("\n");
-}
-
-#else	// !TRACE_NETWORK
-
-#define hex_dump(data, length)
-
-#endif	// !TRACE_NETWORK
-
-
 class UNDI : public EthernetInterface
 {
 public:
@@ -60,6 +20,7 @@
 
 	status_t 			Init();
 
+	ip_addr_t			ServerIPAddress() const;
 	virtual mac_addr_t	MACAddress() const;
 
 	virtual	void *		AllocateSendReceiveBuffer(size_t size);
@@ -74,274 +35,4 @@
 	PXE_STRUCT *		fPxeData;
 };
 
-
-UNDI::UNDI()
- :	fMACAddress()
- ,	fRxFinished(true)
- ,	fPxeData(NULL)
-{
-	TRACE("UNDI::UNDI\n");
-
-	fPxeData = pxe_undi_find_data();
-	if (!fPxeData)
-		panic("can't find !PXE structure");
-
-	dprintf("PXE API entrypoint at %04x:%04x\n", fPxeData->EntryPointSP.seg, fPxeData->EntryPointSP.ofs);
-}
-
-
-UNDI::~UNDI()
-{
-	TRACE("UNDI::~UNDI\n");
-}
-
-
-status_t
-UNDI::Init()
-{
-	TRACE("UNDI::Init\n");
-	
-	PXENV_GET_CACHED_INFO cached_info;
-	PXENV_UNDI_GET_INFORMATION get_info;
-	PXENV_UNDI_GET_STATE get_state;
-	PXENV_UNDI_OPEN undi_open;
-	uint16 res;
-
-	cached_info.PacketType = PXENV_PACKET_TYPE_CACHED_REPLY;
-	cached_info.BufferSize = 0;
-	cached_info.BufferLimit = 0;
-	cached_info.Buffer.seg = 0;
-	cached_info.Buffer.ofs = 0;
-	res = call_pxe_bios(fPxeData, GET_CACHED_INFO, &cached_info);
-	if (res != 0 || cached_info.Status != 0) {
-		char s[100];
-		snprintf(s, sizeof(s), "Can't determine IP address! PXENV_GET_CACHED_INFO res %x, status %x\n", res, cached_info.Status);
-		panic(s);
-	}
-	
-	char *buf = (char *)(cached_info.Buffer.seg * 16 + cached_info.Buffer.ofs);
-	ip_addr_t ipClient = ntohl(*(ip_addr_t *)(buf + 16));
-	ip_addr_t ipServer = ntohl(*(ip_addr_t *)(buf + 20));
-
-	dprintf("client-ip: %08x, server-ip: %08x\n", (int)ipClient, (int)ipServer);
-
-	SetIPAddress(ipClient);
-
-	undi_open.OpenFlag = 0;
-	undi_open.PktFilter = FLTR_DIRECTED | FLTR_BRDCST | FLTR_PRMSCS;
-	undi_open.R_Mcast_Buf.MCastAddrCount = 0;
-
-	res = call_pxe_bios(fPxeData, UNDI_OPEN, &undi_open);
-	if (res != 0 || undi_open.Status != 0) {
-		dprintf("PXENV_UNDI_OPEN failed, res %x, status %x, ignoring\n", res, undi_open.Status);
-	}
-
-	res = call_pxe_bios(fPxeData, UNDI_GET_STATE, &get_state);
-	if (res != 0 || get_state.Status != 0) {
-		dprintf("PXENV_UNDI_GET_STATE failed, res %x, status %x, ignoring\n", res, get_state.Status);
-	} else {
-		switch (get_state.UNDIstate) {
-			case PXE_UNDI_GET_STATE_STARTED: 
-				TRACE("PXE_UNDI_GET_STATE_STARTED\n");
-				break;
-			case PXE_UNDI_GET_STATE_INITIALIZED: 
-				TRACE("PXE_UNDI_GET_STATE_INITIALIZED\n");
-				break;
-			case PXE_UNDI_GET_STATE_OPENED: 
-				TRACE("PXE_UNDI_GET_STATE_OPENED\n");
-				break;
-			default: 
-				TRACE("unknown undi state 0x%02x\n", get_state.UNDIstate);
-				break;
-		}
-	}
-
-	res = call_pxe_bios(fPxeData, UNDI_GET_INFORMATION, &get_info);
-	if (res != 0 || get_info.Status != 0) {
-		dprintf("PXENV_UNDI_GET_INFORMATION failed, res %x, status %x\n", res, get_info.Status);
-		return B_ERROR;
-	}
-
-	TRACE("Status = %x\n", get_info.Status);
-	TRACE("BaseIo = %x\n", get_info.BaseIo);
-	TRACE("IntNumber = %x\n", get_info.IntNumber);
-	TRACE("MaxTranUnit = %x\n", get_info.MaxTranUnit);
-	TRACE("HwType = %x\n", get_info.HwType);
-	TRACE("HwAddrLen = %x\n", get_info.HwAddrLen);
-	TRACE("RxBufCt = %x\n", get_info.RxBufCt);
-	TRACE("TxBufCt = %x\n", get_info.TxBufCt);
-
-	fMACAddress = get_info.CurrentNodeAddress;
-	
-	TRACE("MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", fMACAddress[0], fMACAddress[1], fMACAddress[2], fMACAddress[3], fMACAddress[4], fMACAddress[5]);
-
-	return B_OK;
-}
-
-
-mac_addr_t
-UNDI::MACAddress() const
-{
-	return fMACAddress;
-}
-
-
-void *
-UNDI::AllocateSendReceiveBuffer(size_t size)
-{
-	TRACE("UNDI::AllocateSendReceiveBuffer, size %ld\n", size);
-	if (size > 0x3000)
-		return NULL;
-
-	return (void *)0x500;
-}
-
-
-void
-UNDI::FreeSendReceiveBuffer(void *buffer)
-{
-	TRACE("UNDI::FreeSendReceiveBuffer\n");
-}
-
-
-ssize_t
-UNDI::Send(const void *buffer, size_t size)
-{
-	TRACE("UNDI::Send, buffer %p, size %ld\n", buffer, size);
-
-//	hex_dump(buffer, size);
-
-	PXENV_UNDI_TRANSMIT undi_tx;
-	PXENV_UNDI_TBD undi_tbd;
-
-	undi_tx.Protocol = P_UNKNOWN;
-	undi_tx.XmitFlag = XMT_DESTADDR;
-	undi_tx.DestAddr.seg = SEG((char *)buffer + 16);
-	undi_tx.DestAddr.ofs = OFS((char *)buffer + 16);
-	undi_tx.TBD.seg = SEG(&undi_tbd);
-	undi_tx.TBD.ofs = OFS(&undi_tbd);
-
-	undi_tbd.ImmedLength = size;
-	undi_tbd.Xmit.seg = SEG(buffer);
-	undi_tbd.Xmit.ofs = OFS(buffer);
-	undi_tbd.DataBlkCount = 0;
-
-	uint16 res = call_pxe_bios(fPxeData, UNDI_TRANSMIT, &undi_tx);
-	if (res != 0 || undi_tx.Status != 0) {
-		dprintf("UNDI_TRANSMIT failed, res %x, status %x\n", res, undi_tx.Status);
-		return 0;
-	}
-
-	TRACE("UNDI_TRANSMIT success\n");
-
-	return size;
-}
-
-
-ssize_t
-UNDI::Receive(void *buffer, size_t size)
-{
-	//TRACE("UNDI::Receive, buffer %p, size %ld\n", buffer, size);
-
-	PXENV_UNDI_ISR undi_isr;
-	uint16 res;
-
-	if (!fRxFinished) {
-		TRACE("continue receive...\n");
-
-		undi_isr.FuncFlag = PXENV_UNDI_ISR_IN_GET_NEXT;
-		res = call_pxe_bios(fPxeData, UNDI_ISR, &undi_isr);
-		if (res != 0 || undi_isr.Status != 0) {
-			dprintf("PXENV_UNDI_ISR_IN_GET_NEXT failed, res %x, status %x\n", res, undi_isr.Status);
-			fRxFinished = true;
-			return 0;
-		}
-	
-	} else {
-
-		undi_isr.FuncFlag = PXENV_UNDI_ISR_IN_START;
-
-		res = call_pxe_bios(fPxeData, UNDI_ISR, &undi_isr);
-		if (res != 0 || undi_isr.Status != 0) {
-			dprintf("PXENV_UNDI_ISR_IN_START failed, res %x, status %x\n", res, undi_isr.Status);
-			return -1;
-		}
-
-		if (undi_isr.FuncFlag != PXENV_UNDI_ISR_OUT_OURS) {
-//			TRACE("not ours\n");
-			return -1;
-		}
-
-		// send EOI to pic ?
-
-//		TRACE("PXENV_UNDI_ISR_OUT_OURS\n");
-	
-		undi_isr.FuncFlag = PXENV_UNDI_ISR_IN_PROCESS;
-		res = call_pxe_bios(fPxeData, UNDI_ISR, &undi_isr);
-		if (res != 0 || undi_isr.Status != 0) {
-			dprintf("PXENV_UNDI_ISR_IN_PROCESS failed, res %x, status %x\n", res, undi_isr.Status);
-			return -1;
-		}
-	}
-
-	switch (undi_isr.FuncFlag) {
-		case PXENV_UNDI_ISR_OUT_TRANSMIT:
-			TRACE("PXENV_UNDI_ISR_OUT_TRANSMIT\n");
-			fRxFinished = false;
-			return 0;
-
-		case PXENV_UNDI_ISR_OUT_RECEIVE:
-			TRACE("PXENV_UNDI_ISR_OUT_RECEIVE\n");
-//			TRACE("BufferLength %d\n", undi_isr.BufferLength);
-//			TRACE("FrameLength %d\n", undi_isr.FrameLength);
-//			TRACE("FrameHeaderLength %d\n", undi_isr.FrameHeaderLength);
-			if (undi_isr.FrameLength > undi_isr.BufferLength)
-				panic("UNDI::Receive: multi buffer frames not supported");
-			if (size > undi_isr.BufferLength)
-				size = undi_isr.BufferLength;
-			memcpy(buffer, (const void *)(undi_isr.Frame.seg * 16 + undi_isr.Frame.ofs), size);
-//			hex_dump(buffer, size);
-			fRxFinished = false;
-			return size;
-
-		case PXENV_UNDI_ISR_OUT_BUSY:
-			TRACE("PXENV_UNDI_ISR_OUT_BUSY\n");
-			fRxFinished = true;
-			return -1;
-
-		case PXENV_UNDI_ISR_OUT_DONE:
-			TRACE("PXENV_UNDI_ISR_OUT_DONE\n");
-			fRxFinished = true;
-			return -1;
-
-		default:
-			TRACE("default!!!\n");
-			return -1;
-	}
-}
-
-
-status_t
-platform_net_stack_init()
-{
-	TRACE("platform_net_stack_init\n");
-
-	UNDI *interface = new(nothrow) UNDI;
-	if (!interface)
-		return B_NO_MEMORY;
-
-	status_t error = interface->Init();
-	if (error != B_OK) {
-		TRACE("platform_net_stack_init: interface init failed\n");
-		delete interface;
-		return error;
-	}
-
-	error = NetStack::Default()->AddEthernetInterface(interface);
-	if (error != B_OK) {
-		delete interface;
-		return error;
-	}
-
-	return B_OK;
-}
+#endif

Modified: haiku/trunk/src/system/kernel/fs/vfs_boot.cpp
===================================================================
--- haiku/trunk/src/system/kernel/fs/vfs_boot.cpp	2007-01-12 21:05:47 UTC (rev 19779)
+++ haiku/trunk/src/system/kernel/fs/vfs_boot.cpp	2007-01-12 22:27:48 UTC (rev 19780)
@@ -184,6 +184,7 @@
 		case USB_DEVICE:
 		case FIREWIRE_DEVICE:
 		case FIBRE_DEVICE:
+		case NETWORK_DEVICE:
 			// TODO: implement me!
 			break;
 	}
@@ -211,6 +212,12 @@
 		return status;
 	}
 
+	if (args->boot_disk.booted_from_network) {
+		panic("get_boot_partitions: boot from network, server %08lx, client %08lx\n",
+			args->boot_disk.identifier.device.network.server_ip,
+			args->boot_disk.identifier.device.network.client_ip);
+	}
+
 	struct BootPartitionVisitor : KPartitionVisitor {
 		BootPartitionVisitor(kernel_args &args, PartitionStack &stack)
 			: fArgs(args), fPartitions(stack) {}



From axeld at mail.berlios.de  Fri Jan 12 23:54:23 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Fri, 12 Jan 2007 23:54:23 +0100
Subject: [Haiku-commits] r19781 - haiku/trunk/src/system/kernel
Message-ID: <200701122254.l0CMsNN8004118@sheep.berlios.de>

Author: axeld
Date: 2007-01-12 23:54:21 +0100 (Fri, 12 Jan 2007)
New Revision: 19781
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19781&view=rev

Modified:
   haiku/trunk/src/system/kernel/signal.c
   haiku/trunk/src/system/kernel/team.c
   haiku/trunk/src/system/kernel/thread.c
Log:
Another kernel bug less:
* send_signal_etc() (among others) used team::main_thread in an unsafe way; it is
  possible for a team to be part of the team list and a group without having
  a main thread very early in its creation process.
* Replaced most occurences of team->main_thread->id with team->id since the team
  always inherits the ID of its main thread in Haiku for quite some time now.
* Minor cleanup.


Modified: haiku/trunk/src/system/kernel/signal.c
===================================================================
--- haiku/trunk/src/system/kernel/signal.c	2007-01-12 22:27:48 UTC (rev 19780)
+++ haiku/trunk/src/system/kernel/signal.c	2007-01-12 22:54:21 UTC (rev 19781)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de.
  * Copyright 2002, Angelo Mottola, a.mottola at libero.it.
  *
  * Distributed under the terms of the MIT License.
@@ -316,7 +316,7 @@
 		// TODO: handle -1 correctly
 		if (id == 0 || id == -1) {
 			// send a signal to the current team
-			id = thread_get_current_thread()->team->main_thread->id;
+			id = thread_get_current_thread()->team->id;
 		} else
 			id = -id;
 
@@ -330,7 +330,7 @@
 
 			for (team = group->teams; team != NULL; team = next) {
 				next = team->group_next;
-				id = team->main_thread->id;
+				id = team->id;
 
 				GRAB_THREAD_LOCK();
 

Modified: haiku/trunk/src/system/kernel/team.c
===================================================================
--- haiku/trunk/src/system/kernel/team.c	2007-01-12 22:27:48 UTC (rev 19780)
+++ haiku/trunk/src/system/kernel/team.c	2007-01-12 22:54:21 UTC (rev 19781)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -404,7 +404,7 @@
 static bool
 is_process_group_leader(struct team *team)
 {
-	return team->group_id == team->main_thread->id;
+	return team->group_id == team->id;
 }
 
 
@@ -1961,7 +1961,7 @@
 	GRAB_TEAM_LOCK();
 
 	team = team_get_team_struct_locked(id);
-	if (team && team->main_thread)
+	if (team != NULL && team->main_thread != NULL)
 		thread = team->main_thread->id;
 	else
 		thread = B_BAD_THREAD_ID;
@@ -1979,33 +1979,33 @@
 status_t
 kill_team(team_id id)
 {
+	status_t status = B_OK;
+	thread_id threadID = -1;
+	struct team *team;
 	cpu_status state;
-	struct team *team;
-//	struct thread *t;
-	thread_id tid = -1;
-	int retval = 0;
 
 	state = disable_interrupts();
 	GRAB_TEAM_LOCK();
 
 	team = team_get_team_struct_locked(id);
 	if (team != NULL) {
-		if (team == sKernelTeam)
-			retval = B_NOT_ALLOWED;
-		else
-			tid = team->main_thread->id;
+		if (team != sKernelTeam) {
+			threadID = team->id;
+				// the team ID is the same as the ID of its main thread
+		} else
+			status = B_NOT_ALLOWED;
 	} else
-		retval = B_BAD_THREAD_ID;
+		status = B_BAD_THREAD_ID;
 
 	RELEASE_TEAM_LOCK();
 	restore_interrupts(state);
 
-	if (retval < 0)
-		return retval;
+	if (status < B_OK)
+		return status;
 
 	// just kill the main thread in the team. The cleanup code there will
 	// take care of the team
-	return kill_thread(tid);
+	return kill_thread(threadID);
 }
 
 
@@ -2013,7 +2013,7 @@
 _get_team_info(team_id id, team_info *info, size_t size)
 {
 	cpu_status state;
-	status_t rc = B_OK;
+	status_t status = B_OK;
 	struct team *team;
 
 	state = disable_interrupts();
@@ -2025,17 +2025,17 @@
 		team = team_get_team_struct_locked(id);
 
 	if (team == NULL) {
-		rc = B_BAD_TEAM_ID;
+		status = B_BAD_TEAM_ID;
 		goto err;
 	}
 
-	rc = fill_team_info(team, info, size);
+	status = fill_team_info(team, info, size);
 
 err:
 	RELEASE_TEAM_LOCK();
 	restore_interrupts(state);
-	
-	return rc;
+
+	return status;
 }
 
 
@@ -2152,7 +2152,7 @@
 pid_t
 getpid(void)
 {
-	return thread_get_current_thread()->team->main_thread->id;
+	return thread_get_current_thread()->team->id;
 }
 
 
@@ -2166,7 +2166,7 @@
 	state = disable_interrupts();
 	GRAB_TEAM_LOCK();
 
-	parent = team->parent->main_thread->id;
+	parent = team->parent->id;
 
 	RELEASE_TEAM_LOCK();
 	restore_interrupts(state);
@@ -2183,7 +2183,7 @@
 	cpu_status state;
 
 	if (process == 0)
-		process = thread_get_current_thread()->team->main_thread->id;
+		process = thread_get_current_thread()->team->id;
 
 	state = disable_interrupts();
 	GRAB_THREAD_LOCK();
@@ -2207,7 +2207,7 @@
 	cpu_status state;
 
 	if (process == 0)
-		process = thread_get_current_thread()->team->main_thread->id;
+		process = thread_get_current_thread()->team->id;
 
 	state = disable_interrupts();
 	GRAB_THREAD_LOCK();
@@ -2281,7 +2281,7 @@
 {
 	// we only allow to return the parent of the current process
 	if (which == PARENT_ID
-		&& process != 0 && process != thread_get_current_thread()->team->main_thread->id)
+		&& process != 0 && process != thread_get_current_thread()->team->id)
 		return B_BAD_VALUE;
 
 	switch (which) {
@@ -2312,9 +2312,9 @@
 		return B_BAD_VALUE;
 
 	if (processID == 0)
-		processID = currentTeam->main_thread->id;
+		processID = currentTeam->id;
 
-	if (processID == currentTeam->main_thread->id) {
+	if (processID == currentTeam->id) {
 		// we set our own group
 		teamID = currentTeam->id;
 
@@ -2420,7 +2420,7 @@
 	if (is_process_group_leader(team))
 		return B_NOT_ALLOWED;
 
-	group = create_process_group(team->main_thread->id);
+	group = create_process_group(team->id);
 	if (group == NULL)
 		return B_NO_MEMORY;
 

Modified: haiku/trunk/src/system/kernel/thread.c
===================================================================
--- haiku/trunk/src/system/kernel/thread.c	2007-01-12 22:27:48 UTC (rev 19780)
+++ haiku/trunk/src/system/kernel/thread.c	2007-01-12 22:54:21 UTC (rev 19781)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de.
+ * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de.
  * Distributed under the terms of the MIT License.
  *
  * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -898,7 +898,7 @@
 	struct process_group *freeGroup = NULL;
 	struct team *team = thread->team;
 	struct death_entry *death = NULL;
-	thread_id mainParentThread = -1;
+	thread_id parentID = -1;
 	bool deleteTeam = false;
 	sem_id cachedDeathSem = -1;
 	status_t status;
@@ -991,7 +991,7 @@
 			struct team *parent = team->parent;
 
 			// remember who our parent was so we can send a signal
-			mainParentThread = parent->main_thread->id;
+			parentID = parent->id;
 
 			if (death != NULL) {
 				// insert death entry into the parent's list
@@ -1033,7 +1033,7 @@
 		if (death != NULL)
 			free(death);
 
-		send_signal_etc(mainParentThread, SIGCHLD, B_DO_NOT_RESCHEDULE);
+		send_signal_etc(parentID, SIGCHLD, B_DO_NOT_RESCHEDULE);
 		cachedDeathSem = -1;
 	}
 



From axeld at pinc-software.de  Fri Jan 12 23:57:21 2007
From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=)
Date: Fri, 12 Jan 2007 23:57:21 +0100 (MET)
Subject: [Haiku-commits]
	=?iso-8859-15?q?r19780_-_in_haiku/trunk=3A_header?=
	=?iso-8859-15?q?s/private/kernel/boot_headers/private/kernel/boot/?=
	=?iso-8859-15?q?net_src/system/boot/loader/net__src/system/boot/pl?=
	=?iso-8859-15?q?atform/bios=5Fia32_src/system/boot/platform/pxe=5F?=
	=?iso-8859-15?q?ia32_src/system/kernel/fs?=
In-Reply-To: <200701122227.l0CMRn8n001035@sheep.berlios.de>
Message-ID: <38183915538-BeMail@zon>

marcusoverhagen at BerliOS  wrote:
> Log:
> propagate required settings for the remote disk from boot loader to 
> kernel (client-ip,
> server-ip, server-port)

Nice one! :-)

Bye,
   Axel.



From korli at mail.berlios.de  Sat Jan 13 13:49:12 2007
From: korli at mail.berlios.de (korli at BerliOS)
Date: Sat, 13 Jan 2007 13:49:12 +0100
Subject: [Haiku-commits] r19782 -
	haiku/trunk/src/system/boot/loader/file_systems/hfs_plus
Message-ID: <200701131249.l0DCnCrZ005416@sheep.berlios.de>

Author: korli
Date: 2007-01-13 13:49:12 +0100 (Sat, 13 Jan 2007)
New Revision: 19782
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19782&view=rev

Modified:
   haiku/trunk/src/system/boot/loader/file_systems/hfs_plus/Jamfile
Log:
fix build


Modified: haiku/trunk/src/system/boot/loader/file_systems/hfs_plus/Jamfile
===================================================================
--- haiku/trunk/src/system/boot/loader/file_systems/hfs_plus/Jamfile	2007-01-12 22:54:21 UTC (rev 19781)
+++ haiku/trunk/src/system/boot/loader/file_systems/hfs_plus/Jamfile	2007-01-13 12:49:12 UTC (rev 19782)
@@ -2,7 +2,7 @@
 
 UsePrivateHeaders [ FDirName kernel boot platform $(TARGET_BOOT_PLATFORM) ] ;
 UsePrivateHeaders [ FDirName kernel disk_device_manager ] ;
-UsePrivateHeaders [ FDirName storage ] ;
+UsePrivateHeaders kernel storage ;
 
 SubDirC++Flags -fno-rtti ;
 



From axeld at mail.berlios.de  Sat Jan 13 14:18:55 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Sat, 13 Jan 2007 14:18:55 +0100
Subject: [Haiku-commits] r19783 - in haiku/trunk: headers/os/drivers
	src/add-ons/kernel/network src/add-ons/kernel/network/socket
Message-ID: <200701131318.l0DDItBW007904@sheep.berlios.de>

Author: axeld
Date: 2007-01-13 14:18:54 +0100 (Sat, 13 Jan 2007)
New Revision: 19783
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19783&view=rev

Added:
   haiku/trunk/headers/os/drivers/socket_interface.h
   haiku/trunk/src/add-ons/kernel/network/socket/
   haiku/trunk/src/add-ons/kernel/network/socket/Jamfile
   haiku/trunk/src/add-ons/kernel/network/socket/socket.cpp
Modified:
   haiku/trunk/src/add-ons/kernel/network/Jamfile
Log:
Added a kernel socket API module which exports the usual BSD socket API to kernel modules.


Added: haiku/trunk/headers/os/drivers/socket_interface.h
===================================================================
--- haiku/trunk/headers/os/drivers/socket_interface.h	2007-01-13 12:49:12 UTC (rev 19782)
+++ haiku/trunk/headers/os/drivers/socket_interface.h	2007-01-13 13:18:54 UTC (rev 19783)
@@ -0,0 +1,43 @@
+/* Copyright 2007, Haiku Inc. All Rights Reserved.
+ * Distributed under the terms of the MIT License.
+ */
+#ifndef _SOCKET_INTERFACE_H
+#define _SOCKET_INTERFACE_H
+
+//! Kernel interface to the socket API
+
+
+#include 
+
+#include 
+
+
+#define B_SOCKET_MODULE_NAME "network/socket/v1"
+
+typedef struct socket_module_info {
+	struct module_info	info;
+
+	int 	(*accept)(int socket, struct sockaddr *address, socklen_t *_addressLength);
+	int		(*bind)(int socket, const struct sockaddr *address, socklen_t addressLength);
+	int		(*connect)(int socket, const struct sockaddr *address, socklen_t addressLength);
+	int     (*getpeername)(int socket, struct sockaddr *address, socklen_t *_addressLength);
+	int     (*getsockname)(int socket, struct sockaddr *address, socklen_t *_addressLength);
+	int     (*getsockopt)(int socket, int level, int option, void *value, socklen_t *_length);
+	int		(*listen)(int socket, int backlog);
+	ssize_t (*recv)(int socket, void *buffer, size_t length, int flags);
+	ssize_t (*recvfrom)(int socket, void *buffer, size_t bufferLength, int flags,
+				struct sockaddr *address, socklen_t *_addressLength);
+	ssize_t (*recvmsg)(int socket, struct msghdr *message, int flags);
+	ssize_t (*send)(int socket, const void *buffer, size_t length, int flags);
+	ssize_t	(*sendmsg)(int socket, const struct msghdr *message, int flags);
+	ssize_t (*sendto)(int socket, const void *message, size_t length, int flags,
+				const struct sockaddr *address, socklen_t addressLength);
+	int     (*setsockopt)(int socket, int level, int option, const void *value,
+				socklen_t length);
+	int		(*shutdown)(int socket, int how);
+	int		(*socket)(int domain, int type, int protocol);
+	int		(*sockatmark)(int socket);
+	int		(*socketpair)(int domain, int type, int protocol, int socketVector[2]);
+};
+
+#endif	// _SOCKET_INTERFACE_H

Modified: haiku/trunk/src/add-ons/kernel/network/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/network/Jamfile	2007-01-13 12:49:12 UTC (rev 19782)
+++ haiku/trunk/src/add-ons/kernel/network/Jamfile	2007-01-13 13:18:54 UTC (rev 19783)
@@ -3,4 +3,5 @@
 SubInclude HAIKU_TOP src add-ons kernel network datalink_protocols ;
 SubInclude HAIKU_TOP src add-ons kernel network devices ;
 SubInclude HAIKU_TOP src add-ons kernel network protocols ;
+SubInclude HAIKU_TOP src add-ons kernel network socket ;
 SubInclude HAIKU_TOP src add-ons kernel network stack ;

Added: haiku/trunk/src/add-ons/kernel/network/socket/Jamfile
===================================================================
--- haiku/trunk/src/add-ons/kernel/network/socket/Jamfile	2007-01-13 12:49:12 UTC (rev 19782)
+++ haiku/trunk/src/add-ons/kernel/network/socket/Jamfile	2007-01-13 13:18:54 UTC (rev 19783)
@@ -0,0 +1,8 @@
+SubDir HAIKU_TOP src add-ons kernel network socket ;
+
+UseHeaders $(TARGET_PRIVATE_KERNEL_HEADERS) : true ;
+UsePrivateHeaders net ;
+
+KernelAddon socket :
+	socket.cpp
+;

Added: haiku/trunk/src/add-ons/kernel/network/socket/socket.cpp
===================================================================
--- haiku/trunk/src/add-ons/kernel/network/socket/socket.cpp	2007-01-13 12:49:12 UTC (rev 19782)
+++ haiku/trunk/src/add-ons/kernel/network/socket/socket.cpp	2007-01-13 13:18:54 UTC (rev 19783)
@@ -0,0 +1,348 @@
+/*
+ * Copyright 2007, Haiku, Inc. All Rights Reserved.
+ * Distributed under the terms of the MIT License.
+ *
+ * Authors:
+ *		Axel D?rfler, axeld at pinc-software.de
+ */
+
+/*!
+	The kernel socket API directly forwards all requests into the stack
+	via the networking stack driver.
+*/
+
+#include 
+
+#include 
+
+#include 
+#include 
+
+
+static int
+socket(int family, int type, int protocol)
+{
+	int socket = open(NET_STACK_DRIVER_PATH, O_RDWR);
+	if (socket < 0)
+		return -1;
+
+	socket_args args;
+	args.family = family;
+	args.type = type;
+	args.protocol = protocol;
+
+	if (ioctl(socket, NET_STACK_SOCKET, &args, sizeof(args)) < 0) {
+		close(socket);
+		return -1;
+	}
+
+	return socket;
+}
+
+
+static int
+bind(int socket, const struct sockaddr *address, socklen_t addressLength)
+{
+	sockaddr_args args;
+	args.address = const_cast(address);
+	args.address_length = addressLength;
+
+	return ioctl(socket, NET_STACK_BIND, &args, sizeof(args));
+}
+
+
+static int
+shutdown(int socket, int how)
+{
+	return ioctl(socket, NET_STACK_SHUTDOWN, (void *)how, 0);
+}
+
+
+static int
+connect(int socket, const struct sockaddr *address, socklen_t addressLength)
+{
+	sockaddr_args args;
+	args.address = const_cast(address);
+	args.address_length = addressLength;
+
+	return ioctl(socket, NET_STACK_CONNECT, &args, sizeof(args));
+}
+
+
+static int
+listen(int socket, int backlog)
+{
+	return ioctl(socket, NET_STACK_LISTEN, (void *)backlog, 0);
+}
+
+
+static int
+accept(int socket, struct sockaddr *address, socklen_t *_addressLength)
+{
+	int acceptSocket = open(NET_STACK_DRIVER_PATH, O_RDWR);
+	if (acceptSocket < 0)
+		return -1;
+
+	// The network stack driver will need to know to which net_stack_cookie to 
+	// *bind* with the new accepted socket. It can't itself find out, so we need
+	// to pass it the cookie used internally.
+	// TODO: change this to a safer approach using IDs!
+	void *cookie;
+	if (ioctl(acceptSocket, NET_STACK_GET_COOKIE, &cookie) < 0) {
+		close(acceptSocket);
+		return -1;
+	}
+
+	accept_args args;
+	args.cookie = cookie;
+	args.address = address;
+	args.address_length = _addressLength ? *_addressLength : 0;
+
+	if (ioctl(socket, NET_STACK_ACCEPT, &args, sizeof(args)) < 0) {
+		close(acceptSocket);
+		return -1;
+	}
+
+	if (_addressLength != NULL)
+		*_addressLength = args.address_length;
+
+	return acceptSocket;
+}
+
+
+static ssize_t
+recv(int socket, void *data, size_t length, int flags)
+{
+	transfer_args args;
+	args.data = data;
+	args.data_length = length;
+	args.flags = flags;
+	args.address = NULL;
+	args.address_length = 0;
+
+	return ioctl(socket, NET_STACK_RECV, &args, sizeof(args));
+}
+
+
+static ssize_t
+recvfrom(int socket, void *data, size_t length, int flags,
+	struct sockaddr *address, socklen_t *_addressLength)
+{
+	transfer_args args;
+	args.data = data;
+	args.data_length = length;
+	args.flags = flags;
+	args.address = address;
+	args.address_length = _addressLength ? *_addressLength : 0;
+
+	ssize_t bytesReceived = ioctl(socket, NET_STACK_RECVFROM, &args, sizeof(args));
+	if (bytesReceived < 0)
+		return -1;
+
+	if (_addressLength != NULL)
+		*_addressLength = args.address_length;
+
+	return bytesReceived;
+}
+
+
+static ssize_t
+recvmsg(int socket, struct msghdr *message, int flags)
+{
+	// TODO: implement me!
+	return -1;
+}
+
+
+static ssize_t
+send(int socket, const void *data, size_t length, int flags)
+{
+	transfer_args args;
+	args.data = const_cast(data);
+	args.data_length = length;
+	args.flags = flags;
+	args.address = NULL;
+	args.address_length = 0;
+
+	return ioctl(socket, NET_STACK_SEND, &args, sizeof(args));
+}
+
+
+static ssize_t
+sendto(int socket, const void *data, size_t length, int flags,
+	const struct sockaddr *address, socklen_t addressLength)
+{
+	transfer_args args;
+	args.data = const_cast(data);
+	args.data_length = length;
+	args.flags = flags;
+	args.address = const_cast(address);
+	args.address_length = addressLength;
+
+	return ioctl(socket, NET_STACK_SENDTO, &args, sizeof(args));
+}
+
+
+static ssize_t
+sendmsg(int socket, const struct msghdr *message, int flags)
+{
+	// TODO: implement me!
+	return -1;
+}
+
+
+static int
+getsockopt(int socket, int level, int option, void *value, size_t *_length)
+{
+	sockopt_args args;
+	args.level = level;
+	args.option = option;
+	args.value = value;
+	args.length = _length ? *_length : 0;
+
+	if (ioctl(socket, NET_STACK_GETSOCKOPT, &args, sizeof(args)) < 0)
+		return -1;
+
+	if (_length)
+		*_length = args.length;
+
+	return 0;
+}
+
+
+static int
+setsockopt(int socket, int level, int option, const void *value, size_t length)
+{
+	sockopt_args args;
+	args.level = level;
+	args.option = option;
+	args.value = const_cast(value);
+	args.length = length;
+
+	return ioctl(socket, NET_STACK_SETSOCKOPT, &args, sizeof(args));
+}
+
+
+static int
+getpeername(int socket, struct sockaddr *address, socklen_t *_addressLength)
+{
+	sockaddr_args args;
+	args.address = address;
+	args.address_length = _addressLength ? *_addressLength : 0;
+
+	if (ioctl(socket, NET_STACK_GETPEERNAME, &args, sizeof(args)) < 0)
+		return -1;
+
+	if (_addressLength != NULL)
+		*_addressLength = args.address_length;
+
+	return 0;
+}
+
+
+static int
+getsockname(int socket, struct sockaddr *address, socklen_t *_addressLength)
+{
+	sockaddr_args args;
+	args.address = address;
+	args.address_length = _addressLength ? *_addressLength : 0;
+
+	if (ioctl(socket, NET_STACK_GETSOCKNAME, &args, sizeof(args)) < 0)
+		return -1;
+
+	if (_addressLength != NULL)
+		*_addressLength = args.address_length;
+
+	return 0;
+}
+
+
+static int
+sockatmark(int socket)
+{
+	// TODO: implement me!
+	return -1;
+}
+
+
+static int
+socketpair(int family, int type, int protocol, int socketVector[2])
+{
+	socketVector[0] = socket(family, type, protocol);
+	if (socketVector[0] < 0)
+		return -1;
+
+	socketVector[1] = socket(family, type, protocol);
+	if (socketVector[1] < 0)
+		goto err1;
+
+	// TODO: find a better way to do this!
+	void *cookie;
+	if (ioctl(socketVector[1], NET_STACK_GET_COOKIE, &cookie) < 0)
+		goto err2;
+
+	socketpair_args args;
+	args.cookie = cookie;
+		// this way driver can use the right fd/cookie! 	
+
+	if (ioctl(socketVector[0], NET_STACK_SOCKETPAIR, &args, sizeof(args)) < 0)
+		goto err2;
+
+	return 0;
+
+err2:
+	close(socketVector[1]); 
+err1:
+	close(socketVector[0]);
+	return -1;
+}
+
+
+//	#pragma mark -
+
+
+static status_t
+std_ops(int32 op, ...)
+{
+	switch (op) {
+		case B_MODULE_INIT:
+		case B_MODULE_UNINIT:
+			return B_OK;
+
+		default:
+			return B_ERROR;
+	}
+}
+
+
+static socket_module_info sSocketModule = {
+	{
+		B_SOCKET_MODULE_NAME,
+		0,
+		std_ops
+	},
+
+	accept,
+	bind,
+	connect,
+	getpeername,
+	getsockname,
+	getsockopt,
+	listen,
+	recv,
+	recvfrom,
+	recvmsg,
+	send,
+	sendmsg,
+	sendto,
+	setsockopt,
+	shutdown,
+	socket,
+	sockatmark,
+	socketpair,
+};
+
+module_info *modules[] = {
+	(module_info *)&sSocketModule,
+	NULL
+};



From laplace at mail.berlios.de  Sat Jan 13 16:38:55 2007
From: laplace at mail.berlios.de (laplace at BerliOS)
Date: Sat, 13 Jan 2007 16:38:55 +0100
Subject: [Haiku-commits] r19784 - haiku/trunk/src/add-ons/accelerants/radeon
Message-ID: <200701131538.l0DFct6Z020486@sheep.berlios.de>

Author: laplace
Date: 2007-01-13 16:38:55 +0100 (Sat, 13 Jan 2007)
New Revision: 19784
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19784&view=rev

Modified:
   haiku/trunk/src/add-ons/accelerants/radeon/ProposeDisplayMode.c
Log:
Updated display mode line for resolution 1920x1200. See revision 19753.


Modified: haiku/trunk/src/add-ons/accelerants/radeon/ProposeDisplayMode.c
===================================================================
--- haiku/trunk/src/add-ons/accelerants/radeon/ProposeDisplayMode.c	2007-01-13 13:18:54 UTC (rev 19783)
+++ haiku/trunk/src/add-ons/accelerants/radeon/ProposeDisplayMode.c	2007-01-13 15:38:55 UTC (rev 19784)
@@ -79,7 +79,8 @@
 { { 83500, 1280, 1344, 1480, 1680, 800, 801, 804, 828, T_POSITIVE_SYNC}, B_CMAP8, 1280, 800, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X800) */
 { { 106500, 1440, 1520, 1672, 1904, 900, 901, 904, 932, T_POSITIVE_SYNC}, B_CMAP8, 1440, 900, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1440X900) */
 { { 147100, 1680, 1784, 1968, 2256, 1050, 1051, 1054, 1087, T_POSITIVE_SYNC}, B_CMAP8, 1680, 1050, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1680X1050) */
-{ { 193200, 1920, 2048, 2256, 2592, 1200, 1201, 1204, 1242, T_POSITIVE_SYNC}, B_CMAP8, 1920, 1200, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1920X1200) */
+/* 16:10 panel mode; 2.304M pixels */
+{ { 154000, 1920, 1968, 2000, 2080, 1200, 1203, 1209, 1235, T_POSITIVE_SYNC}, B_CMAP8, 1920, 1200, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1920X1200) */
 // widescreen resolutions, 16:9
 { { 74520, 1280, 1368, 1424, 1656, 720, 724, 730, 750, T_POSITIVE_SYNC}, B_CMAP8, 1280, 720, 0, 0, MODE_FLAGS}, /* Vesa_Monitor_ at 60Hz_(1280X720) */
 };



From axeld at mail.berlios.de  Sat Jan 13 18:13:51 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Sat, 13 Jan 2007 18:13:51 +0100
Subject: [Haiku-commits] r19785 - haiku/trunk/src/system/kernel
Message-ID: <200701131713.l0DHDpdr031301@sheep.berlios.de>

Author: axeld
Date: 2007-01-13 18:13:50 +0100 (Sat, 13 Jan 2007)
New Revision: 19785
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19785&view=rev

Modified:
   haiku/trunk/src/system/kernel/thread.c
Log:
The "thread" debugger command now also prints out the thread exit waiters.


Modified: haiku/trunk/src/system/kernel/thread.c
===================================================================
--- haiku/trunk/src/system/kernel/thread.c	2007-01-13 15:38:55 UTC (rev 19784)
+++ haiku/trunk/src/system/kernel/thread.c	2007-01-13 17:13:50 UTC (rev 19785)
@@ -548,6 +548,8 @@
 static void
 _dump_thread_info(struct thread *thread)
 {
+	struct death_entry *death = NULL;
+
 	kprintf("THREAD: %p\n", thread);
 	kprintf("id:                 0x%lx\n", thread->id);
 	kprintf("name:               \"%s\"\n", thread->name);
@@ -571,7 +573,15 @@
 	kprintf("args:               %p %p\n", thread->args1, thread->args2);
 	kprintf("entry:              %p\n", (void *)thread->entry);
 	kprintf("team:               %p, \"%s\"\n", thread->team, thread->team->name);
-	kprintf("exit.sem:           0x%lx\n", thread->exit.sem);
+	kprintf("  exit.sem:         0x%lx\n", thread->exit.sem);
+	kprintf("  exit.status:      0x%lx (%s)\n", thread->exit.status, strerror(thread->exit.status));
+	kprintf("  exit.reason:      0x%x\n", thread->exit.reason);
+	kprintf("  exit.signal:      0x%x\n", thread->exit.signal);
+	kprintf("  exit.waiters:\n");
+	while ((death = list_get_next_item(&thread->exit.waiters, death)) != NULL) {
+		kprintf("\t%p (team 0x%lx, thread 0x%lx)\n", death, death->team, death->thread);
+	}
+
 	kprintf("kernel_stack_area:  0x%lx\n", thread->kernel_stack_area);
 	kprintf("kernel_stack_base:  %p\n", (void *)thread->kernel_stack_base);
 	kprintf("user_stack_area:    0x%lx\n", thread->user_stack_area);



From axeld at mail.berlios.de  Sat Jan 13 18:21:47 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Sat, 13 Jan 2007 18:21:47 +0100
Subject: [Haiku-commits] r19786 - haiku/trunk/headers/private/kernel
Message-ID: <200701131721.l0DHLlhS031888@sheep.berlios.de>

Author: axeld
Date: 2007-01-13 18:21:47 +0100 (Sat, 13 Jan 2007)
New Revision: 19786
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19786&view=rev

Modified:
   haiku/trunk/headers/private/kernel/vm_types.h
Log:
ref_count should be vint32, as we're accessing it at least once directly.


Modified: haiku/trunk/headers/private/kernel/vm_types.h
===================================================================
--- haiku/trunk/headers/private/kernel/vm_types.h	2007-01-13 17:13:50 UTC (rev 19785)
+++ haiku/trunk/headers/private/kernel/vm_types.h	2007-01-13 17:21:47 UTC (rev 19786)
@@ -63,7 +63,7 @@
 
 	struct vm_area		*areas;
 
-	int32				ref_count;
+	vint32				ref_count;
 } vm_cache_ref;
 
 // vm_cache



From axeld at mail.berlios.de  Sat Jan 13 18:24:40 2007
From: axeld at mail.berlios.de (axeld at BerliOS)
Date: Sat, 13 Jan 2007 18:24:40 +0100
Subject: [Haiku-commits] r19787 - haiku/trunk/src/system/kernel/vm
Message-ID: <200701131724.l0DHOei5032181@sheep.berlios.de>

Author: axeld
Date: 2007-01-13 18:24:40 +0100 (Sat, 13 Jan 2007)
New Revision: 19787
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19787&view=rev

Modified:
   haiku/trunk/src/system/kernel/vm/vm.cpp
Log:
* Merged "cache"/"cache_ref" commands, as you usually want to have all the info, anyway
  (you can still use both commands, but you'll see always the same output).
* The cache_ref's area list now also prints the owner of the area.
* Added "-p" option to "cache"/"cache_ref" that will show the pages of the cache; if you
  omit it, it will now only present you a page counter.
* Nicer output for the commands above.
* Added "dl" to display memory in 64 bit values.


Modified: haiku/trunk/src/system/kernel/vm/vm.cpp
===================================================================
--- haiku/trunk/src/system/kernel/vm/vm.cpp	2007-01-13 17:21:47 UTC (rev 19786)
+++ haiku/trunk/src/system/kernel/vm/vm.cpp	2007-01-13 17:24:40 UTC (rev 19787)
@@ -1736,7 +1736,8 @@
 	int i, j;
 
 	if (argc < 2) {
-		kprintf("usage: dw/ds/db 
[num]\n" + kprintf("usage: dl/dw/ds/db
[num]\n" + "\tdl - 8 bytes\n" "\tdw - 4 bytes\n" "\tds - 2 bytes\n" "\tdb - 1 byte\n"); @@ -1760,6 +1761,9 @@ } else if (strcmp(argv[0], "dw") == 0) { itemSize = 4; displayWidth = 4; + } else if (strcmp(argv[0], "dl") == 0) { + itemSize = 8; + displayWidth = 2; } else { kprintf("display_mem called in an invalid way!\n"); return 0; @@ -1809,6 +1813,9 @@ case 4: kprintf(" 0x%08lx", *(uint32 *)&value); break; + case 8: + kprintf(" 0x%016Lx", *(uint64 *)&value); + break; } } @@ -1817,42 +1824,6 @@ } -static int -dump_cache_ref(int argc, char **argv) -{ - addr_t address; - vm_area *area; - vm_cache_ref *cache_ref; - - if (argc < 2) { - kprintf("cache_ref: not enough arguments\n"); - return 0; - } - if (strlen(argv[1]) < 2 || argv[1][0] != '0' || argv[1][1] != 'x') { - kprintf("cache_ref: invalid argument, pass address\n"); - return 0; - } - - address = strtoul(argv[1], NULL, 0); - cache_ref = (vm_cache_ref *)address; - - kprintf("cache_ref at %p:\n", cache_ref); - kprintf("cache: %p\n", cache_ref->cache); - kprintf("lock.holder: %ld\n", cache_ref->lock.holder); - kprintf("lock.sem: 0x%lx\n", cache_ref->lock.sem); - kprintf("areas:\n"); - for (area = cache_ref->areas; area != NULL; area = area->cache_next) { - kprintf(" area 0x%lx: ", area->id); - kprintf("base_addr = 0x%lx ", area->base); - kprintf("size = 0x%lx ", area->size); - kprintf("name = '%s' ", area->name); - kprintf("protection = 0x%lx\n", area->protection); - } - kprintf("ref_count: %ld\n", cache_ref->ref_count); - return 0; -} - - static const char * page_state_to_text(int state) { @@ -1882,46 +1853,87 @@ static int dump_cache(int argc, char **argv) { - vm_cache *cache, *consumer = NULL; - addr_t address; - vm_page *page; + vm_cache *cache; + vm_cache_ref *cacheRef; + bool showPages = false; + int addressIndex = 1; if (argc < 2) { - kprintf("cache: not enough arguments\n"); + kprintf("usage: %s [-p]
\n" + " if -p is specified, all pages are shown.", argv[0]); return 0; } - if (strlen(argv[1]) < 2 || argv[1][0] != '0' || argv[1][1] != 'x') { - kprintf("cache: invalid argument, pass address\n"); + if (!strcmp(argv[1], "-p")) { + showPages = true; + addressIndex++; + } + if (strlen(argv[addressIndex]) < 2 + || argv[addressIndex][0] != '0' + || argv[addressIndex][1] != 'x') { + kprintf("%s: invalid argument, pass address\n", argv[0]); return 0; } - address = strtoul(argv[1], NULL, 0); - cache = (vm_cache *)address; + addr_t address = strtoul(argv[addressIndex], NULL, 0); + if (address == NULL) + return 0; + if (!strcmp(argv[0], "cache")) { + cache = (vm_cache *)address; + cacheRef = cache->ref; + } else { + cacheRef = (vm_cache_ref *)address; + cache = cacheRef->cache; + } + + kprintf("cache_ref at %p:\n", cacheRef); + kprintf(" ref_count: %ld\n", cacheRef->ref_count); + kprintf(" lock.holder: %ld\n", cacheRef->lock.holder); + kprintf(" lock.sem: 0x%lx\n", cacheRef->lock.sem); + kprintf(" areas:\n"); + + for (vm_area *area = cacheRef->areas; area != NULL; area = area->cache_next) { + kprintf(" area 0x%lx, %s: ", area->id, area->name); + kprintf("\tbase_addr: 0x%lx, size: 0x%lx", area->base, area->size); + kprintf("\tprotection: 0x%lx\n", area->protection); + kprintf("\towner: 0x%lx ", area->address_space->id); + } + kprintf("cache at %p:\n", cache); - kprintf("cache_ref: %p\n", cache->ref); - kprintf("source: %p\n", cache->source); - kprintf("consumers:\n"); + kprintf(" source: %p\n", cache->source); + kprintf(" store: %p\n", cache->store); + kprintf(" virtual_base: 0x%Lx\n", cache->virtual_base); + kprintf(" virtual_size: 0x%Lx\n", cache->virtual_size); + kprintf(" temporary: %ld\n", cache->temporary); + kprintf(" scan_skip: %ld\n", cache->scan_skip); + + kprintf(" consumers:\n"); + vm_cache *consumer = NULL; while ((consumer = (vm_cache *)list_get_next_item(&cache->consumers, consumer)) != NULL) { - kprintf(" %p\n", consumer); + kprintf("\t%p\n", consumer); } - kprintf("store: %p\n", cache->store); - kprintf("virtual_base: 0x%Lx\n", cache->virtual_base); - kprintf("virtual_size: 0x%Lx\n", cache->virtual_size); - kprintf("temporary: %ld\n", cache->temporary); - kprintf("scan_skip: %ld\n", cache->scan_skip); - kprintf("page_list:\n"); - for (page = cache->page_list; page != NULL; page = page->cache_next) { + + kprintf(" pages:\n"); + int32 count = 0; + for (vm_page *page = cache->page_list; page != NULL; page = page->cache_next) { + count++; + if (!showPages) + continue; + if (page->type == PAGE_TYPE_PHYSICAL) { - kprintf(" %p ppn 0x%lx offset 0x%lx type %ld state %ld (%s) ref_count %ld\n", + kprintf("\t%p ppn 0x%lx offset 0x%lx type %ld state %ld (%s) ref_count %ld\n", page, page->physical_page_number, page->cache_offset, page->type, page->state, page_state_to_text(page->state), page->ref_count); } else if(page->type == PAGE_TYPE_DUMMY) { - kprintf(" %p DUMMY PAGE state %ld (%s)\n", + kprintf("\t%p DUMMY PAGE state %ld (%s)\n", page, page->state, page_state_to_text(page->state)); } else - kprintf(" %p UNKNOWN PAGE type %ld\n", page, page->type); + kprintf("\t%p UNKNOWN PAGE type %ld\n", page, page->type); } + + if (!showPages) + kprintf("\t%ld in cache\n", count); + return 0; } @@ -2365,10 +2377,10 @@ // add some debugger commands add_debugger_command("areas", &dump_area_list, "Dump a list of all areas"); add_debugger_command("area", &dump_area, "Dump info about a particular area"); - add_debugger_command("cache_ref", &dump_cache_ref, "Dump cache_ref data structure"); - add_debugger_command("cache", &dump_cache, "Dump cache_ref data structure"); + add_debugger_command("cache_ref", &dump_cache, "Dump vm_cache"); + add_debugger_command("cache", &dump_cache, "Dump vm_cache"); add_debugger_command("avail", &dump_available_memory, "Dump available memory"); -// add_debugger_command("dl", &display_mem, "dump memory long words (64-bit)"); + add_debugger_command("dl", &display_mem, "dump memory long words (64-bit)"); add_debugger_command("dw", &display_mem, "dump memory words (32-bit)"); add_debugger_command("ds", &display_mem, "dump memory shorts (16-bit)"); add_debugger_command("db", &display_mem, "dump memory bytes (8-bit)"); From darkwyrm at mail.berlios.de Sat Jan 13 18:25:42 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Sat, 13 Jan 2007 18:25:42 +0100 Subject: [Haiku-commits] r19788 - haiku/trunk/src/apps/soundrecorder Message-ID: <200701131725.l0DHPgZb032241@sheep.berlios.de> Author: darkwyrm Date: 2007-01-13 18:25:42 +0100 (Sat, 13 Jan 2007) New Revision: 19788 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19788&view=rev Modified: haiku/trunk/src/apps/soundrecorder/TrackSlider.cpp Log: Initialized a couple of wild pointers -- fixes a startup crash Modified: haiku/trunk/src/apps/soundrecorder/TrackSlider.cpp =================================================================== --- haiku/trunk/src/apps/soundrecorder/TrackSlider.cpp 2007-01-13 17:24:40 UTC (rev 19787) +++ haiku/trunk/src/apps/soundrecorder/TrackSlider.cpp 2007-01-13 17:25:42 UTC (rev 19788) @@ -15,7 +15,8 @@ TrackSlider::TrackSlider(BRect rect, const char *title, BMessage *msg, uint32 resizeFlags) : BControl(rect, "slider", NULL, msg, resizeFlags, B_WILL_DRAW | B_FRAME_EVENTS), fLeftTime(0), fRightTime(1000000), fMainTime(0), fTotalTime(1000000), - fLeftTracking(false), fRightTracking(false), fMainTracking(false) + fLeftTracking(false), fRightTracking(false), fMainTracking(false), + fBitmap(NULL), fBitmapView(NULL) { fFont.SetSize(8.0); fFont.SetFlags(B_DISABLE_ANTIALIASING); From axeld at mail.berlios.de Sat Jan 13 19:33:13 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 13 Jan 2007 19:33:13 +0100 Subject: [Haiku-commits] r19789 - haiku/trunk/src/system/kernel/vm Message-ID: <200701131833.l0DIXDaf013580@sheep.berlios.de> Author: axeld Date: 2007-01-13 19:33:13 +0100 (Sat, 13 Jan 2007) New Revision: 19789 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19789&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: * Maintain the vm_cache::virtual_size field in all cases. * Fixed dumping the area list of a cache I broke with the previous commit. * Minor cleanup. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-13 17:25:42 UTC (rev 19788) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-13 18:33:13 UTC (rev 19789) @@ -802,6 +802,7 @@ goto err3; cache->temporary = 1; + cache->virtual_size = size; switch (wiring) { case B_LAZY_LOCK: // for now @@ -1003,6 +1004,7 @@ // tell the page scanner to skip over this area, it's pages are special cache->scan_skip = 1; + cache->virtual_size = size; status = map_backing_store(addressSpace, store, _address, 0, size, addressSpec & ~B_MTR_MASK, 0, protection, REGION_NO_PRIVATE_MAP, &area, name); @@ -1046,7 +1048,8 @@ area_id -vm_create_null_area(team_id aid, const char *name, void **address, uint32 addressSpec, addr_t size) +vm_create_null_area(team_id aid, const char *name, void **address, + uint32 addressSpec, addr_t size) { vm_area *area; vm_cache *cache; @@ -1078,6 +1081,7 @@ // tell the page scanner to skip over this area, no pages will be mapped here cache->scan_skip = 1; + cache->virtual_size = size; status = map_backing_store(addressSpace, store, address, 0, size, addressSpec, 0, B_KERNEL_READ_AREA, REGION_NO_PRIVATE_MAP, &area, name); @@ -1487,10 +1491,10 @@ mutex_lock(&upperCacheRef->lock); mutex_lock(&lowerCacheRef->lock); - // ToDo: add a child counter to vm_cache - so that we can collapse a - // cache layer when possible (ie. "the other" area was deleted) upperCache->temporary = 1; upperCache->scan_skip = lowerCache->scan_skip; + upperCache->virtual_base = lowerCache->virtual_base; + upperCache->virtual_size = lowerCache->virtual_size; upperCache->source = lowerCache; list_add_item(&lowerCache->consumers, upperCache); upperCache->ref = upperCacheRef; @@ -1893,8 +1897,8 @@ kprintf(" areas:\n"); for (vm_area *area = cacheRef->areas; area != NULL; area = area->cache_next) { - kprintf(" area 0x%lx, %s: ", area->id, area->name); - kprintf("\tbase_addr: 0x%lx, size: 0x%lx", area->base, area->size); + kprintf(" area 0x%lx, %s\n", area->id, area->name); + kprintf("\tbase_addr: 0x%lx, size: 0x%lx\n", area->base, area->size); kprintf("\tprotection: 0x%lx\n", area->protection); kprintf("\towner: 0x%lx ", area->address_space->id); } From axeld at mail.berlios.de Sat Jan 13 19:37:50 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 13 Jan 2007 19:37:50 +0100 Subject: [Haiku-commits] r19790 - haiku/trunk/src/system/kernel Message-ID: <200701131837.l0DIbo8V013903@sheep.berlios.de> Author: axeld Date: 2007-01-13 19:37:50 +0100 (Sat, 13 Jan 2007) New Revision: 19790 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19790&view=rev Modified: haiku/trunk/src/system/kernel/thread.c Log: wait_for_thread_etc() didn't care when it could no longer find the thread it was waiting for in case it was interrupted; but that could easily lead the thread_exit() function to access invalid memory (and thus, crash the kernel): since we could not remove our death entry from the thread, we have to make sure the thread (which might still run even if not in the thread hash anymore) will access our death entry as long as it is valid. IOW we must wait for the thread to delete its exit semaphore, even if we were interrupted before. Modified: haiku/trunk/src/system/kernel/thread.c =================================================================== --- haiku/trunk/src/system/kernel/thread.c 2007-01-13 18:33:13 UTC (rev 19789) +++ haiku/trunk/src/system/kernel/thread.c 2007-01-13 18:37:50 UTC (rev 19790) @@ -1308,7 +1308,7 @@ status_t wait_for_thread_etc(thread_id id, uint32 flags, bigtime_t timeout, status_t *_returnCode) { - sem_id sem = B_BAD_THREAD_ID; + sem_id exitSem = B_BAD_THREAD_ID; struct death_entry death, *freeDeath = NULL; struct thread *thread; cpu_status state; @@ -1325,7 +1325,7 @@ thread = thread_get_thread_struct_locked(id); if (thread != NULL) { // remember the semaphore we have to wait on and place our death entry - sem = thread->exit.sem; + exitSem = thread->exit.sem; list_add_link_to_head(&thread->exit.waiters, &death); } @@ -1355,12 +1355,13 @@ // we need to wait for the death of the thread - if (sem < B_OK) + if (exitSem < B_OK) return B_BAD_THREAD_ID; resume_thread(id); + // make sure we don't wait forever on a suspended thread - status = acquire_sem_etc(sem, 1, flags, timeout); + status = acquire_sem_etc(exitSem, 1, flags, timeout); if (status == B_OK) { // this should never happen as the thread deletes the semaphore on exit @@ -1373,8 +1374,6 @@ *_returnCode = death.status; } else { // We were probably interrupted; we need to remove our death entry now. - // When the thread is already gone, we don't have to care - state = disable_interrupts(); GRAB_THREAD_LOCK(); @@ -1384,6 +1383,11 @@ RELEASE_THREAD_LOCK(); restore_interrupts(state); + + // If the thread is already gone, we need to wait for its exit semaphore + // to make sure our death entry stays valid - it won't take long + if (thread == NULL) + acquire_sem(exitSem); } return status; From korli at mail.berlios.de Sat Jan 13 20:55:15 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Sat, 13 Jan 2007 20:55:15 +0100 Subject: [Haiku-commits] r19791 - in haiku/trunk: data/settings/kernel/drivers headers/private/kernel src/add-ons/kernel/bus_managers/acpi src/system/boot/loader src/system/boot/platform/bios_ia32 Message-ID: <200701131955.l0DJtFMV019307@sheep.berlios.de> Author: korli Date: 2007-01-13 20:55:14 +0100 (Sat, 13 Jan 2007) New Revision: 19791 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19791&view=rev Modified: haiku/trunk/data/settings/kernel/drivers/kernel haiku/trunk/headers/private/kernel/safemode.h haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c haiku/trunk/src/system/boot/loader/menu.cpp haiku/trunk/src/system/boot/platform/bios_ia32/menu.cpp Log: ACPI boot menu item is for bios_ia32 added a kernel settings option to disable ACPI Modified: haiku/trunk/data/settings/kernel/drivers/kernel =================================================================== --- haiku/trunk/data/settings/kernel/drivers/kernel 2007-01-13 18:37:50 UTC (rev 19790) +++ haiku/trunk/data/settings/kernel/drivers/kernel 2007-01-13 19:55:14 UTC (rev 19791) @@ -32,3 +32,5 @@ # APM (advanced power management) support # (system shutdown, battery info, ...) +#acpi true + # ACPI support Modified: haiku/trunk/headers/private/kernel/safemode.h =================================================================== --- haiku/trunk/headers/private/kernel/safemode.h 2007-01-13 18:37:50 UTC (rev 19790) +++ haiku/trunk/headers/private/kernel/safemode.h 2007-01-13 19:55:14 UTC (rev 19791) @@ -14,7 +14,7 @@ #define B_SAFEMODE_DISABLE_USER_ADD_ONS "disableuseraddons" #define B_SAFEMODE_DISABLE_IDE_DMA "disableidedma" -#define B_SAFEMODE_DISABLE_ACPI "disableacpi" +#define B_SAFEMODE_DISABLE_ACPI "disable_acpi" #define B_SAFEMODE_DISABLE_SMP "disable_smp" #define B_SAFEMODE_DISABLE_HYPER_THREADING "disable_hyperthreading" Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c 2007-01-13 18:37:50 UTC (rev 19790) +++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c 2007-01-13 19:55:14 UTC (rev 19791) @@ -63,7 +63,26 @@ switch(op) { case B_MODULE_INIT: + // check if safemode settings disable DMA + settings = load_driver_settings("kernel"); + if (settings != NULL) { + acpiDisabled = !get_driver_boolean_parameter(settings, "acpi", true, true); + unload_driver_settings(settings); + } + + settings = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS); + if (settings != NULL) { + acpiDisabled = get_driver_boolean_parameter(settings, B_SAFEMODE_DISABLE_ACPI, + acpiDisabled, acpiDisabled); + unload_driver_settings(settings); + } + + if (acpiDisabled) { + ERROR("ACPI disabled"); + return ENOSYS; + } + #ifdef ACPI_DEBUG_OUTPUT AcpiDbgLevel = ACPI_DEBUG_ALL | ACPI_LV_VERBOSE; AcpiDbgLayer = ACPI_ALL_COMPONENTS; Modified: haiku/trunk/src/system/boot/loader/menu.cpp =================================================================== --- haiku/trunk/src/system/boot/loader/menu.cpp 2007-01-13 18:37:50 UTC (rev 19790) +++ haiku/trunk/src/system/boot/loader/menu.cpp 2007-01-13 19:55:14 UTC (rev 19791) @@ -444,10 +444,6 @@ item->SetData(B_SAFEMODE_DISABLE_IDE_DMA); item->SetType(MENU_ITEM_MARKABLE); - safeMenu->AddItem(item = new(nothrow) MenuItem("Disable ACPI")); - item->SetData(B_SAFEMODE_DISABLE_ACPI); - item->SetType(MENU_ITEM_MARKABLE); - platform_add_menus(safeMenu); safeMenu->AddItem(item = new(nothrow) MenuItem("Enable on screen debug output")); Modified: haiku/trunk/src/system/boot/platform/bios_ia32/menu.cpp =================================================================== --- haiku/trunk/src/system/boot/platform/bios_ia32/menu.cpp 2007-01-13 18:37:50 UTC (rev 19790) +++ haiku/trunk/src/system/boot/platform/bios_ia32/menu.cpp 2007-01-13 19:55:14 UTC (rev 19791) @@ -32,6 +32,11 @@ item->SetType(MENU_ITEM_MARKABLE); item->SetData("disable_apm"); item->SetHelpText("This overrides the APM setting in the kernel settings file"); + + menu->AddItem(item = new(nothrow) MenuItem("Disable ACPI")); + item->SetType(MENU_ITEM_MARKABLE); + item->SetData(B_SAFEMODE_DISABLE_ACPI); + item->SetHelpText("This overrides the ACPI setting in the kernel settings file"); break; default: break; From axeld at mail.berlios.de Sun Jan 14 14:01:22 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 14 Jan 2007 14:01:22 +0100 Subject: [Haiku-commits] r19792 - in haiku/trunk/src/bin: . coreutils/src Message-ID: <200701141301.l0ED1MJc020653@sheep.berlios.de> Author: axeld Date: 2007-01-14 14:01:21 +0100 (Sun, 14 Jan 2007) New Revision: 19792 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19792&view=rev Added: haiku/trunk/src/bin/haiku-utils.rdef Modified: haiku/trunk/src/bin/Jamfile haiku/trunk/src/bin/coreutils/src/coreutils.rdef Log: * Applied patch by Vasilis Kaoutsis: added rdef file for all Haiku utilities. * Updated coreutils.rdef to follow the same style as all other rdef files (or at least most of them). Modified: haiku/trunk/src/bin/Jamfile =================================================================== --- haiku/trunk/src/bin/Jamfile 2007-01-13 19:55:14 UTC (rev 19791) +++ haiku/trunk/src/bin/Jamfile 2007-01-14 13:01:21 UTC (rev 19792) @@ -8,6 +8,10 @@ UseHeaders $(TARGET_PRIVATE_KERNEL_HEADERS) : true ; SubDirHdrs $(HAIKU_TOP) src add-ons kernel file_cache ; +local haiku-utils_rsrc = [ FGristFiles haiku-utils.rsrc ] ; + +ResComp $(haiku-utils_rsrc) : [ FGristFiles haiku-utils.rdef ] ; + AddResources hey : hey.rdef ; # standard commands that don't need any additional library @@ -42,7 +46,7 @@ uptime.cpp waitfor.c # whoami.c - ; + : : $(haiku-utils_rsrc) ; # Commands which don't need another library that depend on # Haiku-specific code @@ -55,15 +59,14 @@ rmindex.cpp safemode.c unmount.c - ; + : : $(haiku-utils_rsrc) ; } # standard commands that need libtermcap.a StdBinCommands top.c tput.c - : libtermcap.a - ; + : libtermcap.a : $(haiku-utils_rsrc) ; AddResources mimeset : mimeset.rdef ; @@ -93,48 +96,43 @@ setversion.cpp version.cpp # yes.cpp - : be ; + : be : $(haiku-utils_rsrc) ; # Haiku-specific apps which need libbe.so if $(TARGET_PLATFORM) = haiku { StdBinCommands shutdown.cpp - : be ; + : be : $(haiku-utils_rsrc) ; } # standard commands that need libbe.so, libstdc++.so StdBinCommands copyattr.cpp xres.cpp - : be $(TARGET_LIBSTDC++) - ; + : be $(TARGET_LIBSTDC++) : $(haiku-utils_rsrc) ; # Haiku-specific apps which need libbe., libstdc++.so if $(TARGET_PLATFORM) = haiku { StdBinCommands mountvolume.cpp - : be $(TARGET_LIBSTDC++) - ; + : be $(TARGET_LIBSTDC++) : $(haiku-utils_rsrc) ; } # standard commands that need libbe.so, libtranslation.so StdBinCommands translate.cpp - : be translation - ; + : be translation : $(haiku-utils_rsrc) ; # standard commands that need libbe.so, libmedia.so StdBinCommands installsound.cpp setvolume.cpp - : be libmedia.so - ; + : be libmedia.so : $(haiku-utils_rsrc) ; # standard commands that need libbe.so, libmail.so StdBinCommands mail.cpp - : be libmail.so - ; + : be libmail.so : $(haiku-utils_rsrc) ; SubInclude HAIKU_TOP src bin addattr ; SubInclude HAIKU_TOP src bin bash ; Modified: haiku/trunk/src/bin/coreutils/src/coreutils.rdef =================================================================== --- haiku/trunk/src/bin/coreutils/src/coreutils.rdef 2007-01-13 19:55:14 UTC (rev 19791) +++ haiku/trunk/src/bin/coreutils/src/coreutils.rdef 2007-01-14 13:01:21 UTC (rev 19792) @@ -1,11 +1,10 @@ -resource app_version -{ +resource app_version { major = 6, middle = 7, minor = 0, - variety = 5, + variety = B_FINAL_VERSION, internal = 0, - short_info = "6.7", - long_info = "6.7 ?2006 The Free Software Foundation" + short_info = "coreutils", + long_info = "coreutils ?2006 The Free Software Foundation" }; Added: haiku/trunk/src/bin/haiku-utils.rdef =================================================================== --- haiku/trunk/src/bin/haiku-utils.rdef 2007-01-13 19:55:14 UTC (rev 19791) +++ haiku/trunk/src/bin/haiku-utils.rdef 2007-01-14 13:01:21 UTC (rev 19792) @@ -0,0 +1,9 @@ +resource app_version { + major = 1, + middle = 0, + minor = 0, + variety = B_APPV_ALPHA, + internal = 0, + short_info = "Haiku Utilities", + long_info = "Haiku Utilities ?2007 Haiku, Inc." +}; From axeld at mail.berlios.de Sun Jan 14 15:16:08 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 14 Jan 2007 15:16:08 +0100 Subject: [Haiku-commits] r19793 - in haiku/trunk: headers/private/graphics headers/private/graphics/vmware src/add-ons/accelerants src/add-ons/accelerants/vmware src/add-ons/kernel/drivers/graphics src/add-ons/kernel/drivers/graphics/vmware Message-ID: <200701141416.l0EEG83P029995@sheep.berlios.de> Author: axeld Date: 2007-01-14 15:16:06 +0100 (Sun, 14 Jan 2007) New Revision: 19793 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19793&view=rev Added: haiku/trunk/headers/private/graphics/vmware/ haiku/trunk/headers/private/graphics/vmware/DriverInterface.h haiku/trunk/headers/private/graphics/vmware/svga_reg.h haiku/trunk/headers/private/graphics/vmware/vm_device_version.h haiku/trunk/src/add-ons/accelerants/vmware/ haiku/trunk/src/add-ons/accelerants/vmware/Acceleration.c haiku/trunk/src/add-ons/accelerants/vmware/Cursor.c haiku/trunk/src/add-ons/accelerants/vmware/EngineManagment.c haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c haiku/trunk/src/add-ons/accelerants/vmware/GetAccelerantHook.c haiku/trunk/src/add-ons/accelerants/vmware/GetModeInfo.c haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.c haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h haiku/trunk/src/add-ons/accelerants/vmware/InitAccelerant.c haiku/trunk/src/add-ons/accelerants/vmware/Jamfile haiku/trunk/src/add-ons/accelerants/vmware/ProposeDisplayMode.c haiku/trunk/src/add-ons/accelerants/vmware/README haiku/trunk/src/add-ons/accelerants/vmware/SetDisplayMode.c haiku/trunk/src/add-ons/accelerants/vmware/generic.h haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/ haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/Jamfile haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/device.c haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/driver.c haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/driver.h Modified: haiku/trunk/src/add-ons/accelerants/Jamfile haiku/trunk/src/add-ons/kernel/drivers/graphics/Jamfile Log: Added Eric Petit's VMware graphics driver - thanks! Made the following changes from the version I got from Eric: * made BppForSpace() in DriverInterface.h inline to remove some warnings * renamed driver source files to lower case. * removed Be Inc. copyright from kernel driver as I couldn't see anything coming from Be Inc. there - correct me if I was wrong, Eric. * Minor other changes like added missing header guards. * The README provided in the main directory is only included in the accelerant directory. Added: haiku/trunk/headers/private/graphics/vmware/DriverInterface.h =================================================================== --- haiku/trunk/headers/private/graphics/vmware/DriverInterface.h 2007-01-14 13:01:21 UTC (rev 19792) +++ haiku/trunk/headers/private/graphics/vmware/DriverInterface.h 2007-01-14 14:16:06 UTC (rev 19793) @@ -0,0 +1,119 @@ +/* + * Copyright 1999, Be Incorporated. + * Copyright 2007, Haiku. + * Distributed under the terms of the MIT License. + * + * Authors: + * Be Incorporated + * Eric Petit + */ + +#ifndef DRIVERINTERFACE_H +#define DRIVERINTERFACE_H + +#include +#include +#include +#include +#include + +#include "vm_device_version.h" +#include "svga_reg.h" + +#define MAX_SAMPLE_DEVICE_NAME_LENGTH 32 +#define CURSOR_ID 1 + + +/*--------------------------------------------------------------------*/ +/* Benaphores */ + +typedef struct { + sem_id sem; + int32 ben; +} Benaphore; +#define INIT_BEN(x) x.sem = create_sem(0, "VMware "#x); x.ben = 0; +#define ACQUIRE_BEN(x) if((atomic_add(&(x.ben), 1)) >= 1) acquire_sem(x.sem); +#define RELEASE_BEN(x) if((atomic_add(&(x.ben), -1)) > 1) release_sem(x.sem); +#define DELETE_BEN(x) delete_sem(x.sem); + + +/*--------------------------------------------------------------------*/ +/* Utils */ + +#define ROUND_TO_PAGE_SIZE(x) (((x)+(B_PAGE_SIZE)-1)&~((B_PAGE_SIZE)-1)) + +static inline int +BppForSpace(int space) +{ + switch (space) { + case B_RGB32: + return 32; + case B_RGB24: + return 24; + case B_RGB16: + return 16; + case B_RGB15: + return 15; + case B_CMAP8: + return 8; + } + return 0; +} + + +/*--------------------------------------------------------------------*/ +/* Request codes for ioctl() */ + +enum { + VMWARE_GET_PRIVATE_DATA = B_DEVICE_OP_CODES_END + 1, + VMWARE_FIFO_START, + VMWARE_FIFO_STOP, + VMWARE_FIFO_SYNC, + VMWARE_SET_MODE, + VMWARE_SHOW_CURSOR, + VMWARE_MOVE_CURSOR, +}; + + +/*--------------------------------------------------------------------*/ +/* Structure shared between the kernel driver and the accelerant */ + +typedef struct { + /* Device info and capabilities */ + uint16 vendorId; + uint16 deviceId; + uint8 revision; + uint32 maxWidth; + uint32 maxHeight; + void *fbDma; + uint32 fbSize; + void *fifoDma; + uint32 fifoSize; + uint32 fifoMin; + uint32 capabilities; + uint32 fifoCapabilities; + uint32 fifoFlags; + + /* For registers access */ + uint16 indexPort; + uint16 valuePort; + + /* Mapped areas */ + area_id fbArea; + void *fb; + area_id fifoArea; + void *fifo; + + /* This changes when we switch to another mode */ + uint32 fbOffset; + uint32 bytesPerRow; + + /* Current display mode */ + display_mode dm; + + Benaphore engineLock; + Benaphore fifoLock; + uint32 fifoNext; +} SharedInfo; + +#endif Added: haiku/trunk/headers/private/graphics/vmware/svga_reg.h =================================================================== --- haiku/trunk/headers/private/graphics/vmware/svga_reg.h 2007-01-14 13:01:21 UTC (rev 19792) +++ haiku/trunk/headers/private/graphics/vmware/svga_reg.h 2007-01-14 14:16:06 UTC (rev 19793) @@ -0,0 +1,518 @@ +/* + * Copyright 1998-2001, VMware, Inc. + * Distributed under the terms of the MIT License. + * + */ + +/* + * svga_reg.h -- + * + * SVGA hardware definitions + */ + +#ifndef _SVGA_REG_H_ +#define _SVGA_REG_H_ + +/* + * Memory and port addresses and fundamental constants + */ + +/* + * Note-- MAX_WIDTH and MAX_HEIGHT are largely ignored by the code. This + * isn't such a bad thing for forward compatibility. --Jeremy. + */ +#define SVGA_MAX_WIDTH 2360 +#define SVGA_MAX_HEIGHT 1770 +#define SVGA_MAX_BITS_PER_PIXEL 32 +#define SVGA_MAX_DEPTH 24 + +#define SVGA_FB_MAX_SIZE \ + ((((SVGA_MAX_WIDTH * SVGA_MAX_HEIGHT * \ + SVGA_MAX_BITS_PER_PIXEL / 8) >> PAGE_SHIFT) + 1) << PAGE_SHIFT) + +#define SVGA_MAX_PSEUDOCOLOR_DEPTH 8 +#define SVGA_MAX_PSEUDOCOLORS (1 << SVGA_MAX_PSEUDOCOLOR_DEPTH) +#define SVGA_NUM_PALETTE_REGS (3 * SVGA_MAX_PSEUDOCOLORS) + +#define SVGA_MAGIC 0x900000UL +#define SVGA_MAKE_ID(ver) (SVGA_MAGIC << 8 | (ver)) + +/* Version 2 let the address of the frame buffer be unsigned on Win32 */ +#define SVGA_VERSION_2 2 +#define SVGA_ID_2 SVGA_MAKE_ID(SVGA_VERSION_2) + +/* Version 1 has new registers starting with SVGA_REG_CAPABILITIES so + PALETTE_BASE has moved */ +#define SVGA_VERSION_1 1 +#define SVGA_ID_1 SVGA_MAKE_ID(SVGA_VERSION_1) + +/* Version 0 is the initial version */ +#define SVGA_VERSION_0 0 +#define SVGA_ID_0 SVGA_MAKE_ID(SVGA_VERSION_0) + +/* Invalid SVGA_ID_ */ +#define SVGA_ID_INVALID 0xFFFFFFFF + +/* More backwards compatibility, old location of color map: */ +#define SVGA_OLD_PALETTE_BASE 17 + +/* Base and Offset gets us headed the right way for PCI Base Addr Registers */ +#define SVGA_LEGACY_BASE_PORT 0x4560 +#define SVGA_INDEX_PORT 0x0 +#define SVGA_VALUE_PORT 0x1 +#define SVGA_BIOS_PORT 0x2 +#define SVGA_NUM_PORTS 0x3 + +/* This port is deprecated, but retained because of old drivers. */ +#define SVGA_LEGACY_ACCEL_PORT 0x3 + +/* Legal values for the SVGA_REG_CURSOR_ON register in cursor bypass mode */ +#define SVGA_CURSOR_ON_HIDE 0x0 /* Must be 0 to maintain backward compatibility */ +#define SVGA_CURSOR_ON_SHOW 0x1 /* Must be 1 to maintain backward compatibility */ +#define SVGA_CURSOR_ON_REMOVE_FROM_FB 0x2 /* Remove the cursor from the framebuffer because we need to see what's under it */ +#define SVGA_CURSOR_ON_RESTORE_TO_FB 0x3 /* Put the cursor back in the framebuffer so the user can see it */ + +/* + * Registers + */ + +enum { + SVGA_REG_ID = 0, + SVGA_REG_ENABLE = 1, + SVGA_REG_WIDTH = 2, + SVGA_REG_HEIGHT = 3, + SVGA_REG_MAX_WIDTH = 4, + SVGA_REG_MAX_HEIGHT = 5, + SVGA_REG_DEPTH = 6, + SVGA_REG_BITS_PER_PIXEL = 7, /* Current bpp in the guest */ + SVGA_REG_PSEUDOCOLOR = 8, + SVGA_REG_RED_MASK = 9, + SVGA_REG_GREEN_MASK = 10, + SVGA_REG_BLUE_MASK = 11, + SVGA_REG_BYTES_PER_LINE = 12, + SVGA_REG_FB_START = 13, + SVGA_REG_FB_OFFSET = 14, + SVGA_REG_VRAM_SIZE = 15, + SVGA_REG_FB_SIZE = 16, + + /* ID 0 implementation only had the above registers, then the palette */ + + SVGA_REG_CAPABILITIES = 17, + SVGA_REG_MEM_START = 18, /* Memory for command FIFO and bitmaps */ + SVGA_REG_MEM_SIZE = 19, + SVGA_REG_CONFIG_DONE = 20, /* Set when memory area configured */ + SVGA_REG_SYNC = 21, /* Write to force synchronization */ + SVGA_REG_BUSY = 22, /* Read to check if sync is done */ + SVGA_REG_GUEST_ID = 23, /* Set guest OS identifier */ + SVGA_REG_CURSOR_ID = 24, /* ID of cursor */ + SVGA_REG_CURSOR_X = 25, /* Set cursor X position */ + SVGA_REG_CURSOR_Y = 26, /* Set cursor Y position */ + SVGA_REG_CURSOR_ON = 27, /* Turn cursor on/off */ + SVGA_REG_HOST_BITS_PER_PIXEL = 28, /* Current bpp in the host */ + SVGA_REG_SCRATCH_SIZE = 29, /* Number of scratch registers */ + SVGA_REG_MEM_REGS = 30, /* Number of FIFO registers */ + SVGA_REG_NUM_DISPLAYS = 31, /* Number of guest displays */ + SVGA_REG_PITCHLOCK = 32, /* Fixed pitch for all modes */ + SVGA_REG_TOP = 33, /* Must be 1 more than the last register */ + + SVGA_PALETTE_BASE = 1024, /* Base of SVGA color map */ + /* Next 768 (== 256*3) registers exist for colormap */ + SVGA_SCRATCH_BASE = SVGA_PALETTE_BASE + SVGA_NUM_PALETTE_REGS + /* Base of scratch registers */ + /* Next reg[SVGA_REG_SCRATCH_SIZE] registers exist for scratch usage: + First 4 are reserved for VESA BIOS Extension; any remaining are for + the use of the current SVGA driver. */ +}; + + +/* + * Capabilities + */ + +#define SVGA_CAP_NONE 0x00000 +#define SVGA_CAP_RECT_FILL 0x00001 +#define SVGA_CAP_RECT_COPY 0x00002 +#define SVGA_CAP_RECT_PAT_FILL 0x00004 +#define SVGA_CAP_LEGACY_OFFSCREEN 0x00008 +#define SVGA_CAP_RASTER_OP 0x00010 +#define SVGA_CAP_CURSOR 0x00020 +#define SVGA_CAP_CURSOR_BYPASS 0x00040 +#define SVGA_CAP_CURSOR_BYPASS_2 0x00080 +#define SVGA_CAP_8BIT_EMULATION 0x00100 +#define SVGA_CAP_ALPHA_CURSOR 0x00200 +#define SVGA_CAP_GLYPH 0x00400 +#define SVGA_CAP_GLYPH_CLIPPING 0x00800 +#define SVGA_CAP_OFFSCREEN_1 0x01000 +#define SVGA_CAP_ALPHA_BLEND 0x02000 +#define SVGA_CAP_3D 0x04000 +#define SVGA_CAP_EXTENDED_FIFO 0x08000 +#define SVGA_CAP_MULTIMON 0x10000 +#define SVGA_CAP_PITCHLOCK 0x20000 + +/* + * Raster op codes (same encoding as X) used by FIFO drivers. + */ + +#define SVGA_ROP_CLEAR 0x00 /* 0 */ +#define SVGA_ROP_AND 0x01 /* src AND dst */ +#define SVGA_ROP_AND_REVERSE 0x02 /* src AND NOT dst */ +#define SVGA_ROP_COPY 0x03 /* src */ +#define SVGA_ROP_AND_INVERTED 0x04 /* NOT src AND dst */ +#define SVGA_ROP_NOOP 0x05 /* dst */ +#define SVGA_ROP_XOR 0x06 /* src XOR dst */ +#define SVGA_ROP_OR 0x07 /* src OR dst */ +#define SVGA_ROP_NOR 0x08 /* NOT src AND NOT dst */ +#define SVGA_ROP_EQUIV 0x09 /* NOT src XOR dst */ +#define SVGA_ROP_INVERT 0x0a /* NOT dst */ +#define SVGA_ROP_OR_REVERSE 0x0b /* src OR NOT dst */ +#define SVGA_ROP_COPY_INVERTED 0x0c /* NOT src */ +#define SVGA_ROP_OR_INVERTED 0x0d /* NOT src OR dst */ +#define SVGA_ROP_NAND 0x0e /* NOT src OR NOT dst */ +#define SVGA_ROP_SET 0x0f /* 1 */ +#define SVGA_ROP_UNSUPPORTED 0x10 + +#define SVGA_NUM_SUPPORTED_ROPS 16 +#define SVGA_ROP_ALL (MASK(SVGA_NUM_SUPPORTED_ROPS)) +#define SVGA_IS_VALID_ROP(rop) (rop < SVGA_NUM_SUPPORTED_ROPS) + +/* + * Ops + * For each pixel, the four channels of the image are computed with: + * + * C = Ca * Fa + Cb * Fb + * + * where C, Ca, Cb are the values of the respective channels and Fa + * and Fb come from the following table: + * + * BlendOp Fa Fb + * ------------------------------------------ + * Clear 0 0 + * Src 1 0 + * Dst 0 1 + * Over 1 1-Aa + * OverReverse 1-Ab 1 + * In Ab 0 + * InReverse 0 Aa + * Out 1-Ab 0 + * OutReverse 0 1-Aa + * Atop Ab 1-Aa + * AtopReverse 1-Ab Aa + * Xor 1-Ab 1-Aa + * Add 1 1 + * Saturate min(1,(1-Ab)/Aa) 1 + * + * Flags + * You can use the following flags to achieve additional affects: + * + * Flag Effect + * ------------------------------------------ + * ConstantSourceAlpha Ca = Ca * Param0 + * ConstantDestAlpha Cb = Cb * Param1 + * + * Flag effects resolve before the op. For example + * BlendOp == Add && Flags == ConstantSourceAlpha | + * ConstantDestAlpha results in: + * + * C = (Ca * Param0) + (Cb * Param1) + */ + +#define SVGA_BLENDOP_CLEAR 0 +#define SVGA_BLENDOP_SRC 1 +#define SVGA_BLENDOP_DST 2 +#define SVGA_BLENDOP_OVER 3 +#define SVGA_BLENDOP_OVER_REVERSE 4 +#define SVGA_BLENDOP_IN 5 +#define SVGA_BLENDOP_IN_REVERSE 6 +#define SVGA_BLENDOP_OUT 7 +#define SVGA_BLENDOP_OUT_REVERSE 8 +#define SVGA_BLENDOP_ATOP 9 +#define SVGA_BLENDOP_ATOP_REVERSE 10 +#define SVGA_BLENDOP_XOR 11 +#define SVGA_BLENDOP_ADD 12 +#define SVGA_BLENDOP_SATURATE 13 + +#define SVGA_NUM_BLENDOPS 14 +#define SVGA_IS_VALID_BLENDOP(op) (op >= 0 && op < SVGA_NUM_BLENDOPS) + +#define SVGA_BLENDFLAG_CONSTANT_SOURCE_ALPHA 0x01 +#define SVGA_BLENDFLAG_CONSTANT_DEST_ALPHA 0x02 +#define SVGA_NUM_BLENDFLAGS 2 +#define SVGA_BLENDFLAG_ALL (MASK(SVGA_NUM_BLENDFLAGS)) +#define SVGA_IS_VALID_BLENDFLAG(flag) ((flag & ~SVGA_BLENDFLAG_ALL) == 0) + + +/* + * FIFO offsets (viewed as an array of 32-bit words) + */ + +enum { + /* + * The original defined FIFO offsets + */ + + SVGA_FIFO_MIN = 0, + SVGA_FIFO_MAX, /* The distance from MIN to MAX must be at least 10K */ + SVGA_FIFO_NEXT_CMD, + SVGA_FIFO_STOP, + + /* + * Additional offsets added as of SVGA_CAP_EXTENDED_FIFO + */ + + SVGA_FIFO_CAPABILITIES = 4, + SVGA_FIFO_FLAGS, + SVGA_FIFO_FENCE, + SVGA_FIFO_3D_HWVERSION, /* Check SVGA3dHardwareVersion in svga3d_reg.h */ + SVGA_FIFO_PITCHLOCK, + + /* + * Always keep this last. It's not an offset with semantic value, but + * rather a convenient way to produce the value of fifo[SVGA_FIFO_NUM_REGS] + */ + + SVGA_FIFO_NUM_REGS +}; + +/* + * FIFO Capabilities + * + * Fence -- Fence register and command are supported + * Accel Front -- Front buffer only commands are supported + * Pitch Lock -- Pitch lock register is supported + */ + +#define SVGA_FIFO_CAP_NONE 0 +#define SVGA_FIFO_CAP_FENCE (1<<0) +#define SVGA_FIFO_CAP_ACCELFRONT (1<<1) +#define SVGA_FIFO_CAP_PITCHLOCK (1<<2) + + +/* + * FIFO Flags + * + * Accel Front -- Driver should use front buffer only commands + */ + +#define SVGA_FIFO_FLAG_NONE 0 +#define SVGA_FIFO_FLAG_ACCELFRONT (1<<0) + + +/* + * Drawing object ID's, in the range 0 to SVGA_MAX_ID + */ + +#define SVGA_MAX_ID 499 + +/* + * Macros to compute variable length items (sizes in 32-bit words, except + * for SVGA_GLYPH_SCANLINE_SIZE, which is in bytes). + */ + +#define SVGA_BITMAP_SIZE(w,h) ((((w)+31) >> 5) * (h)) +#define SVGA_BITMAP_SCANLINE_SIZE(w) (( (w)+31 ) >> 5) +#define SVGA_PIXMAP_SIZE(w,h,bpp) ((( ((w)*(bpp))+31 ) >> 5) * (h)) +#define SVGA_PIXMAP_SCANLINE_SIZE(w,bpp) (( ((w)*(bpp))+31 ) >> 5) +#define SVGA_GLYPH_SIZE(w,h) ((((((w) + 7) >> 3) * (h)) + 3) >> 2) +#define SVGA_GLYPH_SCANLINE_SIZE(w) (((w) + 7) >> 3) + +/* + * Increment from one scanline to the next of a bitmap or pixmap + */ +#define SVGA_BITMAP_INCREMENT(w) ((( (w)+31 ) >> 5) * sizeof (uint32)) +#define SVGA_PIXMAP_INCREMENT(w,bpp) ((( ((w)*(bpp))+31 ) >> 5) * sizeof (uint32)) + +/* + * Transparent color for DRAW_GLYPH_CLIPPED + */ +#define SVGA_COLOR_TRANSPARENT (~0) + +/* + * Commands in the command FIFO + */ + +#define SVGA_CMD_INVALID_CMD 0 + /* FIFO layout: + (well, undefined) */ + +#define SVGA_CMD_UPDATE 1 + /* FIFO layout: + X, Y, Width, Height */ + +#define SVGA_CMD_RECT_FILL 2 + /* FIFO layout: + Color, X, Y, Width, Height */ + +#define SVGA_CMD_RECT_COPY 3 + /* FIFO layout: + Source X, Source Y, Dest X, Dest Y, Width, Height */ + +#define SVGA_CMD_DEFINE_BITMAP 4 + /* FIFO layout: + Pixmap ID, Width, Height, */ + +#define SVGA_CMD_DEFINE_BITMAP_SCANLINE 5 + /* FIFO layout: + Pixmap ID, Width, Height, Line #, scanline */ + +#define SVGA_CMD_DEFINE_PIXMAP 6 + /* FIFO layout: + Pixmap ID, Width, Height, Depth, */ + +#define SVGA_CMD_DEFINE_PIXMAP_SCANLINE 7 + /* FIFO layout: + Pixmap ID, Width, Height, Depth, Line #, scanline */ + +#define SVGA_CMD_RECT_BITMAP_FILL 8 + /* FIFO layout: + Bitmap ID, X, Y, Width, Height, Foreground, Background */ + +#define SVGA_CMD_RECT_PIXMAP_FILL 9 + /* FIFO layout: + Pixmap ID, X, Y, Width, Height */ + +#define SVGA_CMD_RECT_BITMAP_COPY 10 + /* FIFO layout: + Bitmap ID, Source X, Source Y, Dest X, Dest Y, + Width, Height, Foreground, Background */ + +#define SVGA_CMD_RECT_PIXMAP_COPY 11 + /* FIFO layout: + Pixmap ID, Source X, Source Y, Dest X, Dest Y, Width, Height */ + +#define SVGA_CMD_FREE_OBJECT 12 + /* FIFO layout: + Object (pixmap, bitmap, ...) ID */ + +#define SVGA_CMD_RECT_ROP_FILL 13 + /* FIFO layout: + Color, X, Y, Width, Height, ROP */ + +#define SVGA_CMD_RECT_ROP_COPY 14 + /* FIFO layout: + Source X, Source Y, Dest X, Dest Y, Width, Height, ROP */ + +#define SVGA_CMD_RECT_ROP_BITMAP_FILL 15 + /* FIFO layout: + ID, X, Y, Width, Height, Foreground, Background, ROP */ + +#define SVGA_CMD_RECT_ROP_PIXMAP_FILL 16 + /* FIFO layout: + ID, X, Y, Width, Height, ROP */ + +#define SVGA_CMD_RECT_ROP_BITMAP_COPY 17 + /* FIFO layout: + ID, Source X, Source Y, + Dest X, Dest Y, Width, Height, Foreground, Background, ROP */ + +#define SVGA_CMD_RECT_ROP_PIXMAP_COPY 18 + /* FIFO layout: + ID, Source X, Source Y, Dest X, Dest Y, Width, Height, ROP */ + +#define SVGA_CMD_DEFINE_CURSOR 19 + /* FIFO layout: + ID, Hotspot X, Hotspot Y, Width, Height, + Depth for AND mask, Depth for XOR mask, + , */ + +#define SVGA_CMD_DISPLAY_CURSOR 20 + /* FIFO layout: + ID, On/Off (1 or 0) */ + +#define SVGA_CMD_MOVE_CURSOR 21 + /* FIFO layout: + X, Y */ + +#define SVGA_CMD_DEFINE_ALPHA_CURSOR 22 + /* FIFO layout: + ID, Hotspot X, Hotspot Y, Width, Height, + */ + +#define SVGA_CMD_DRAW_GLYPH 23 + /* FIFO layout: + X, Y, W, H, FGCOLOR, */ + +#define SVGA_CMD_DRAW_GLYPH_CLIPPED 24 + /* FIFO layout: + X, Y, W, H, FGCOLOR, BGCOLOR, , + Transparent color expands are done by setting BGCOLOR to ~0 */ + +#define SVGA_CMD_UPDATE_VERBOSE 25 + /* FIFO layout: + X, Y, Width, Height, Reason */ + +#define SVGA_CMD_SURFACE_FILL 26 + /* FIFO layout: + color, dstSurfaceOffset, x, y, w, h, rop */ + +#define SVGA_CMD_SURFACE_COPY 27 + /* FIFO layout: + srcSurfaceOffset, dstSurfaceOffset, srcX, srcY, + destX, destY, w, h, rop */ + +#define SVGA_CMD_SURFACE_ALPHA_BLEND 28 + /* FIFO layout: + srcSurfaceOffset, dstSurfaceOffset, srcX, srcY, + destX, destY, w, h, op (SVGA_BLENDOP*), flags (SVGA_BLENDFLAGS*), + param1, param2 */ + +#define SVGA_CMD_FRONT_ROP_FILL 29 + /* FIFO layout: + Color, X, Y, Width, Height, ROP */ + +#define SVGA_CMD_FENCE 30 + /* FIFO layout: + Fence value */ + +#define SVGA_CMD_MAX 31 + +#define SVGA_CMD_MAX_ARGS 64 + +/* + * Location and size of SVGA frame buffer and the FIFO. + */ +#define SVGA_VRAM_MAX_SIZE (16 * 1024 * 1024) + +#define SVGA_VRAM_SIZE_WS (16 * 1024 * 1024) // 16 MB +#define SVGA_MEM_SIZE_WS (2 * 1024 * 1024) // 2 MB +#define SVGA_VRAM_SIZE_SERVER (4 * 1024 * 1024) // 4 MB +#define SVGA_MEM_SIZE_SERVER (256 * 1024) // 256 KB + +#if /* defined(VMX86_WGS) || */ defined(VMX86_SERVER) +#define SVGA_VRAM_SIZE SVGA_VRAM_SIZE_SERVER +#define SVGA_MEM_SIZE SVGA_MEM_SIZE_SERVER +#else +#define SVGA_VRAM_SIZE SVGA_VRAM_SIZE_WS +#define SVGA_MEM_SIZE SVGA_MEM_SIZE_WS +#endif + +/* + * SVGA_FB_START is the default starting address of the SVGA frame + * buffer in the guest's physical address space. + * SVGA_FB_START_BIGMEM is the starting address of the SVGA frame + * buffer for VMs that have a large amount of physical memory. + * + * The address of SVGA_FB_START is set to 2GB - (SVGA_FB_MAX_SIZE + SVGA_MEM_SIZE), + * thus the SVGA frame buffer sits at [SVGA_FB_START .. 2GB-1] in the + * physical address space. Our older SVGA drivers for NT treat the + * address of the frame buffer as a signed integer. For backwards + * compatibility, we keep the default location of the frame buffer + * at under 2GB in the address space. This restricts VMs to have "only" + * up to ~2031MB (i.e., up to SVGA_FB_START) of physical memory. + * + * For VMs that want more memory than the ~2031MB, we place the SVGA + * frame buffer at SVGA_FB_START_BIGMEM. This allows VMs to have up + * to 3584MB, at least as far as the SVGA frame buffer is concerned + * (note that there may be other issues that limit the VM memory + * size). PCI devices use high memory addresses, so we have to put + * SVGA_FB_START_BIGMEM low enough so that it doesn't overlap with any + * of these devices. Placing SVGA_FB_START_BIGMEM at 0xE0000000 + * should leave plenty of room for the PCI devices. + * + * NOTE: All of that is only true for the 0710 chipset. As of the 0405 + * chipset, the framebuffer start is determined solely based on the value + * the guest BIOS or OS programs into the PCI base address registers. + */ +#define SVGA_FB_LEGACY_START 0x7EFC0000 +#define SVGA_FB_LEGACY_START_BIGMEM 0xE0000000 + +#endif Added: haiku/trunk/headers/private/graphics/vmware/vm_device_version.h =================================================================== --- haiku/trunk/headers/private/graphics/vmware/vm_device_version.h 2007-01-14 13:01:21 UTC (rev 19792) +++ haiku/trunk/headers/private/graphics/vmware/vm_device_version.h 2007-01-14 14:16:06 UTC (rev 19793) @@ -0,0 +1,14 @@ +/* + * Copyright 1998-2001, VMware, Inc. + * Distributed under the terms of the MIT License. + * + */ + +#ifndef VM_DEVICE_VERSION_H +#define VM_DEVICE_VERSION_H + +#define PCI_VENDOR_ID_VMWARE 0x15AD +#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 +#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 + +#endif /* VM_DEVICE_VERSION_H */ Modified: haiku/trunk/src/add-ons/accelerants/Jamfile =================================================================== --- haiku/trunk/src/add-ons/accelerants/Jamfile 2007-01-14 13:01:21 UTC (rev 19792) +++ haiku/trunk/src/add-ons/accelerants/Jamfile 2007-01-14 14:16:06 UTC (rev 19793) @@ -12,5 +12,6 @@ SubInclude HAIKU_TOP src add-ons accelerants skeleton ; SubInclude HAIKU_TOP src add-ons accelerants vesa ; SubInclude HAIKU_TOP src add-ons accelerants via ; +SubInclude HAIKU_TOP src add-ons accelerants vmware ; SubIncludeGPL HAIKU_TOP src add-ons accelerants atimach64 ; Added: haiku/trunk/src/add-ons/accelerants/vmware/Acceleration.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/Acceleration.c 2007-01-14 13:01:21 UTC (rev 19792) +++ haiku/trunk/src/add-ons/accelerants/vmware/Acceleration.c 2007-01-14 14:16:06 UTC (rev 19793) @@ -0,0 +1,69 @@ +/* + * Copyright 1999, Be Incorporated. + * Copyright 2007, Haiku. + * Distributed under the terms of the MIT License. + * + * Authors: + * Be Incorporated + * Eric Petit + */ + +#include "GlobalData.h" + + +void +SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count) +{ + int i; + blit_params * b; + + for (i = 0; i < count; i++) { + b = &list[i]; +#if 0 + TRACE("BLIT %dx%d, %dx%d->%dx%d\n", b->width + 1, b->height + 1, + b->src_left, b->src_top, b->dest_left, b->dest_top); +#endif + FifoBeginWrite(); + FifoWrite(SVGA_CMD_RECT_COPY); + FifoWrite(b->src_left); + FifoWrite(b->src_top); + FifoWrite(b->dest_left); + FifoWrite(b->dest_top); + FifoWrite(b->width + 1); + FifoWrite(b->height + 1); + FifoEndWrite(); + } +} + + +void +FILL_RECTANGLE(engine_token *et, uint32 colorIndex, + fill_rect_params *list, uint32 count) +{ + int i; + fill_rect_params * f; + + for (i = 0; i < count; i++) { + f = &list[i]; +#if 0 + TRACE("FILL %lX, %dx%d->%dx%d\n", colorIndex, + f->left, f->top, f->right, f->bottom); +#endif + /* TODO */ + } +} + + +void +INVERT_RECTANGLE(engine_token *et, fill_rect_params *list, uint32 count) +{ + /* TODO */ +} + + +void +FILL_SPAN(engine_token * et, uint32 colorIndex, uint16 * list, uint32 count) +{ + /* TODO */ +} + Added: haiku/trunk/src/add-ons/accelerants/vmware/Cursor.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/Cursor.c 2007-01-14 13:01:21 UTC (rev 19792) +++ haiku/trunk/src/add-ons/accelerants/vmware/Cursor.c 2007-01-14 14:16:06 UTC (rev 19793) @@ -0,0 +1,82 @@ +/* + * Copyright 1999, Be Incorporated. + * Copyright 2007, Haiku. + * Distributed under the terms of the MIT License. + * + * Authors: + * Be Incorporated + * Eric Petit + */ + +#include "GlobalData.h" + +status_t +SET_CURSOR_SHAPE(uint16 width, uint16 height, uint16 hot_x, + uint16 hot_y, uint8 * andMask, uint8 * xorMask) +{ + int i, shift; + uint32 * alphaCursor; + + TRACE("SET_CURSOR_SHAPE (%d, %d, %d, %d)\n", width, height, hot_x, hot_y); + + /* Sanity check */ + if (hot_x >= width || hot_y >= height) + return B_ERROR; + + /* Build ARGB image */ + alphaCursor = calloc(1, height * width * sizeof(uint32)); + shift = 7; + for (i = 0; i < height * width; i++) { + if (!((*andMask >> shift) & 1)) { + /* Opaque */ + alphaCursor[i] |= 0xFF000000; + if (!((*xorMask >> shift) & 1)) + /* White */ + alphaCursor[i] |= 0x00FFFFFF; + } + if (--shift < 0) { + shift = 7; + andMask++; + xorMask++; + } + } + + /* Give it to VMware */ + FifoBeginWrite(); + FifoWrite(SVGA_CMD_DEFINE_ALPHA_CURSOR); + FifoWrite(CURSOR_ID); + FifoWrite(hot_x); + FifoWrite(hot_y); + FifoWrite(width); + FifoWrite(height); + for (i = 0; i < height * width; i++) + FifoWrite(alphaCursor[i]); + FifoEndWrite(); + + free(alphaCursor); + + return B_OK; +} + + +void +MOVE_CURSOR(uint16 x, uint16 y) +{ + uint16 pos[2]; + + //TRACE("MOVE_CURSOR (%d, %d)\n", x, y); + + pos[0] = x; + pos[1] = y; + ioctl(gFd, VMWARE_MOVE_CURSOR, pos, sizeof(pos)); +} + + +void +SHOW_CURSOR(bool isVisible) +{ + TRACE("SHOW_CURSOR (%d)\n", isVisible); + + ioctl(gFd, VMWARE_SHOW_CURSOR, &isVisible, sizeof(bool)); +} + Added: haiku/trunk/src/add-ons/accelerants/vmware/EngineManagment.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/EngineManagment.c 2007-01-14 13:01:21 UTC (rev 19792) +++ haiku/trunk/src/add-ons/accelerants/vmware/EngineManagment.c 2007-01-14 14:16:06 UTC (rev 19793) @@ -0,0 +1,66 @@ +/* + * Copyright 1999, Be Incorporated. + * Copyright 2007, Haiku. + * Distributed under the terms of the MIT License. + * + * Authors: + * Be Incorporated + * Eric Petit + */ + +#include "GlobalData.h" + +static engine_token vmwareEngineToken = {1, B_2D_ACCELERATION, NULL}; + +uint32 +ACCELERANT_ENGINE_COUNT() +{ + return 1; +} + + +status_t +ACQUIRE_ENGINE(uint32 capabilities, uint32 max_wait, sync_token * st, + engine_token ** et) +{ + ACQUIRE_BEN(gSi->engineLock); + if (st) + SYNC_TO_TOKEN(st); + *et = &vmwareEngineToken; + return B_OK; +} + + +status_t +RELEASE_ENGINE(engine_token * et, sync_token * st) +{ + if (st) + GET_SYNC_TOKEN(et, st); + RELEASE_BEN(gSi->engineLock); + return B_OK; +} + + +void +WAIT_ENGINE_IDLE() +{ + FifoSync(); +} + + +status_t +GET_SYNC_TOKEN(engine_token * et, sync_token * st) +{ + st->engine_id = et->engine_id; + st->counter = 0; + return B_OK; +} + + +status_t +SYNC_TO_TOKEN(sync_token * st) +{ + WAIT_ENGINE_IDLE(); + return B_OK; +} + Added: haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c 2007-01-14 13:01:21 UTC (rev 19792) +++ haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c 2007-01-14 14:16:06 UTC (rev 19793) @@ -0,0 +1,140 @@ +/* + * Copyright 1999, Be Incorporated. + * Copyright 2007, Haiku. + * Distributed under the terms of the MIT License. + * + * Authors: + * Be Incorporated + * Eric Petit + */ + + +#include "GlobalData.h" + + +/*--------------------------------------------------------------------*/ +/* UpdateThread: we explicitely need to tell VMware what and when + * something should be refreshed from the frame buffer. Since the + * app_server doesn't tell us what it's doing, we simply force a full + * screen update every 1/50 second */ + +static int32 +UpdateThread(void *data) +{ + bigtime_t begin, end, wait; + + while (!gUpdateThreadDie) { + begin = system_time(); + FifoUpdateFullscreen(); + end = system_time(); + + /* 50 Hz refresh */ + wait = 20000 - (end - begin); + if (wait > 0) + snooze(wait); + } + + return B_OK; +} + + +static void +FifoPrintCapabilities(int c) +{ + TRACE("fifo capabilities:\n"); + if (c & SVGA_FIFO_CAP_FENCE) TRACE("FENCE\n"); + if (c & SVGA_FIFO_CAP_ACCELFRONT) TRACE("ACCELFRONT\n"); + if (c & SVGA_FIFO_CAP_PITCHLOCK) TRACE("PITCHLOCK\n"); +} + + +void +FifoInit() +{ + uint32 *fifo = gSi->fifo; + + /* Stop update thread, if any */ + if (gUpdateThread > B_OK) { + status_t exitValue; + gUpdateThreadDie = 1; + wait_for_thread(gUpdateThread, &exitValue); + } + + gSi->fifoCapabilities = 0; + gSi->fifoFlags = 0; + if (gSi->capabilities & SVGA_CAP_EXTENDED_FIFO) { + gSi->fifoCapabilities = fifo[SVGA_FIFO_CAPABILITIES]; + gSi->fifoFlags = fifo[SVGA_FIFO_FLAGS]; + FifoPrintCapabilities(gSi->fifoCapabilities); + } + + fifo[SVGA_FIFO_MIN] = gSi->fifoMin * 4; + fifo[SVGA_FIFO_MAX] = gSi->fifoSize; + fifo[SVGA_FIFO_NEXT_CMD] = fifo[SVGA_FIFO_MIN]; + fifo[SVGA_FIFO_STOP] = fifo[SVGA_FIFO_MIN]; + + gSi->fifoNext = fifo[SVGA_FIFO_NEXT_CMD]; + + /* Launch a new update thread */ + gUpdateThreadDie = 0; [... truncated: 1789 lines follow ...] From axeld at mail.berlios.de Sun Jan 14 15:24:45 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 14 Jan 2007 15:24:45 +0100 Subject: [Haiku-commits] r19794 - haiku/trunk/src/bin/coreutils/src Message-ID: <200701141424.l0EEOjLG030705@sheep.berlios.de> Author: axeld Date: 2007-01-14 15:24:45 +0100 (Sun, 14 Jan 2007) New Revision: 19794 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19794&view=rev Modified: haiku/trunk/src/bin/coreutils/src/coreutils.rdef Log: Fixed wrong app version constant I introduced earlier. Modified: haiku/trunk/src/bin/coreutils/src/coreutils.rdef =================================================================== --- haiku/trunk/src/bin/coreutils/src/coreutils.rdef 2007-01-14 14:16:06 UTC (rev 19793) +++ haiku/trunk/src/bin/coreutils/src/coreutils.rdef 2007-01-14 14:24:45 UTC (rev 19794) @@ -2,7 +2,7 @@ major = 6, middle = 7, minor = 0, - variety = B_FINAL_VERSION, + variety = B_APPV_FINAL, internal = 0, short_info = "coreutils", long_info = "coreutils ?2006 The Free Software Foundation" From axeld at mail.berlios.de Sun Jan 14 15:26:29 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 14 Jan 2007 15:26:29 +0100 Subject: [Haiku-commits] r19795 - in haiku/trunk: build/jam src/add-ons/accelerants/vmware Message-ID: <200701141426.l0EEQTDm031024@sheep.berlios.de> Author: axeld Date: 2007-01-14 15:26:29 +0100 (Sun, 14 Jan 2007) New Revision: 19795 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19795&view=rev Modified: haiku/trunk/build/jam/HaikuImage haiku/trunk/src/add-ons/accelerants/vmware/Acceleration.c haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c haiku/trunk/src/add-ons/accelerants/vmware/GetModeInfo.c haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h Log: * Fixed warnings in the VMware accelerant - GCC 2.95.3 cannot compare function signatures without any argument specifier, and a(void); != a(); in C. * Added the VMware graphics driver to the image. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-14 14:24:45 UTC (rev 19794) +++ haiku/trunk/build/jam/HaikuImage 2007-01-14 14:26:29 UTC (rev 19795) @@ -62,7 +62,7 @@ BEOS_ADD_ONS_ACCELERANTS = $(X86_ONLY)radeon.accelerant $(X86_ONLY)nv.accelerant $(X86_ONLY)mga.accelerant $(X86_ONLY)nm.accelerant $(X86_ONLY)intel_extreme.accelerant - vesa.accelerant + vesa.accelerant $(X86_ONLY)vmware.accelerant ; BEOS_ADD_ONS_TRANSLATORS = BMPTranslator GIFTranslator JPEGTranslator JPEG2000Translator TIFFTranslator PNGTranslator PPMTranslator @@ -92,6 +92,7 @@ BEOS_ADD_ONS_DRIVERS_AUDIO = auich auvia emuxki ; BEOS_ADD_ONS_DRIVERS_GRAPHICS = $(X86_ONLY)radeon.driver $(X86_ONLY)nv.driver $(X86_ONLY)nm.driver $(X86_ONLY)mga.driver $(X86_ONLY)intel_extreme vesa + $(X86_ONLY)vmware ; BEOS_ADD_ONS_DRIVERS_MIDI = emuxki ; BEOS_ADD_ONS_DRIVERS_NET = etherpci ipro1000 rtl8139 rtl8169 sis900 Modified: haiku/trunk/src/add-ons/accelerants/vmware/Acceleration.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/Acceleration.c 2007-01-14 14:24:45 UTC (rev 19794) +++ haiku/trunk/src/add-ons/accelerants/vmware/Acceleration.c 2007-01-14 14:26:29 UTC (rev 19795) @@ -8,14 +8,15 @@ * Eric Petit */ + #include "GlobalData.h" void SCREEN_TO_SCREEN_BLIT(engine_token *et, blit_params *list, uint32 count) { - int i; - blit_params * b; + uint32 i; + blit_params *b; for (i = 0; i < count; i++) { b = &list[i]; @@ -40,8 +41,8 @@ FILL_RECTANGLE(engine_token *et, uint32 colorIndex, fill_rect_params *list, uint32 count) { - int i; - fill_rect_params * f; + uint32 i; + fill_rect_params *f; for (i = 0; i < count; i++) { f = &list[i]; Modified: haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c 2007-01-14 14:24:45 UTC (rev 19794) +++ haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c 2007-01-14 14:26:29 UTC (rev 19795) @@ -49,7 +49,7 @@ void -FifoInit() +FifoInit(void) { uint32 *fifo = gSi->fifo; @@ -87,14 +87,14 @@ void -FifoSync() +FifoSync(void) { ioctl(gFd, VMWARE_FIFO_SYNC, NULL, 0); } void -FifoBeginWrite() +FifoBeginWrite(void) { ACQUIRE_BEN(gSi->fifoLock); } @@ -117,7 +117,7 @@ void -FifoEndWrite() +FifoEndWrite(void) { uint32 *fifo = gSi->fifo; @@ -127,7 +127,7 @@ void -FifoUpdateFullscreen() +FifoUpdateFullscreen(void) { FifoBeginWrite(); FifoWrite(SVGA_CMD_UPDATE); Modified: haiku/trunk/src/add-ons/accelerants/vmware/GetModeInfo.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/GetModeInfo.c 2007-01-14 14:24:45 UTC (rev 19794) +++ haiku/trunk/src/add-ons/accelerants/vmware/GetModeInfo.c 2007-01-14 14:26:29 UTC (rev 19795) @@ -26,8 +26,8 @@ { TRACE("GET_FRAME_BUFFER_CONFIG\n"); - afb->frame_buffer = gSi->fb + gSi->fbOffset; - afb->frame_buffer_dma = gSi->fbDma + gSi->fbOffset; + afb->frame_buffer = (uint8 *)gSi->fb + gSi->fbOffset; + afb->frame_buffer_dma = (uint8 *)gSi->fbDma + gSi->fbOffset; afb->bytes_per_row = gSi->bytesPerRow; TRACE("fb: %p, fb_dma: %p, row: %d bytes\n", afb->frame_buffer, Modified: haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h 2007-01-14 14:24:45 UTC (rev 19794) +++ haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h 2007-01-14 14:26:29 UTC (rev 19795) @@ -27,11 +27,11 @@ extern volatile int gUpdateThreadDie; /* Fifo.c */ -void FifoInit(); -void FifoSync(); -void FifoBeginWrite(); +void FifoInit(void); +void FifoSync(void); +void FifoBeginWrite(void); void FifoWrite(uint32 value); -void FifoEndWrite(); -void FifoUpdateFullscreen(); +void FifoEndWrite(void); +void FifoUpdateFullscreen(void); #endif // GLOBAL_DATA_H From axeld at mail.berlios.de Sun Jan 14 19:41:58 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 14 Jan 2007 19:41:58 +0100 Subject: [Haiku-commits] r19796 - in haiku/trunk: headers/private/kernel src/system/kernel/vm Message-ID: <200701141841.l0EIfwOt027030@sheep.berlios.de> Author: axeld Date: 2007-01-14 19:41:57 +0100 (Sun, 14 Jan 2007) New Revision: 19796 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19796&view=rev Modified: haiku/trunk/headers/private/kernel/vm_cache.h haiku/trunk/src/system/kernel/vm/vm.cpp haiku/trunk/src/system/kernel/vm/vm_cache.c Log: * vm_copy_on_write_area() did not always correctly divide the ref_count of the two cache_refs - it needs to count the consumers of the lower cache to find its actual number of references; the upper cache could still be in use by someone else. * There were several locking bugs in the VM code; since cache_ref::cache can change, we must not access it without having the cache_ref locked. * As a result, map_backing_store() now requires you to have the lock of the store's cache_ref held. * And therefore, some functions in vm_cache.c must no longer lock the cache_ref on their own, but require the caller to have it locked already. * Added the -s option to the cache/cache_ref KDL commands: it will only print the requested structure, and not its counterpart (useful if accessing one structure results in a page fault, as was possible previously). Modified: haiku/trunk/headers/private/kernel/vm_cache.h =================================================================== --- haiku/trunk/headers/private/kernel/vm_cache.h 2007-01-14 14:26:29 UTC (rev 19795) +++ haiku/trunk/headers/private/kernel/vm_cache.h 2007-01-14 18:41:57 UTC (rev 19796) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2003-2007, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -28,11 +28,11 @@ void vm_cache_insert_page(vm_cache_ref *cacheRef, vm_page *page, off_t offset); void vm_cache_remove_page(vm_cache_ref *cacheRef, vm_page *page); void vm_cache_remove_consumer(vm_cache_ref *cacheRef, vm_cache *consumer); -void vm_cache_add_consumer(vm_cache_ref *cacheRef, vm_cache *consumer); +void vm_cache_add_consumer_locked(vm_cache_ref *cacheRef, vm_cache *consumer); status_t vm_cache_write_modified(vm_cache_ref *ref, bool fsReenter); -status_t vm_cache_set_minimal_commitment(vm_cache_ref *ref, off_t commitment); +status_t vm_cache_set_minimal_commitment_locked(vm_cache_ref *ref, off_t commitment); status_t vm_cache_resize(vm_cache_ref *cacheRef, off_t newSize); -status_t vm_cache_insert_area(vm_cache_ref *cacheRef, vm_area *area); +status_t vm_cache_insert_area_locked(vm_cache_ref *cacheRef, vm_area *area); status_t vm_cache_remove_area(vm_cache_ref *cacheRef, vm_area *area); #ifdef __cplusplus Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-14 14:26:29 UTC (rev 19795) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-14 18:41:57 UTC (rev 19796) @@ -501,6 +501,9 @@ } +/*! + The \a store's owner must be locked when calling this function. +*/ static status_t map_backing_store(vm_address_space *addressSpace, vm_store *store, void **_virtualAddress, off_t offset, addr_t size, uint32 addressSpec, int wiring, int protection, @@ -550,7 +553,7 @@ newCache->temporary = 1; newCache->scan_skip = cache->scan_skip; - vm_cache_add_consumer(cacheRef, newCache); + vm_cache_add_consumer_locked(cacheRef, newCache); cache = newCache; cacheRef = newCache->ref; @@ -559,7 +562,7 @@ cache->virtual_size = offset + size; } - status = vm_cache_set_minimal_commitment(cacheRef, offset + size); + status = vm_cache_set_minimal_commitment_locked(cacheRef, offset + size); if (status != B_OK) goto err2; @@ -581,7 +584,7 @@ area->cache_ref = cacheRef; area->cache_offset = offset; // point the cache back to the area - vm_cache_insert_area(cacheRef, area); + vm_cache_insert_area_locked(cacheRef, area); // insert the area in the global area hash table acquire_sem_etc(sAreaHashLock, WRITE_COUNT, 0 ,0); @@ -817,8 +820,13 @@ break; } + mutex_lock(&cache->ref->lock); + status = map_backing_store(addressSpace, store, address, 0, size, addressSpec, wiring, protection, REGION_NO_PRIVATE_MAP, &area, name); + + mutex_unlock(&cache->ref->lock); + if (status < B_OK) { vm_cache_release_ref(cache->ref); goto err1; @@ -1006,8 +1014,13 @@ cache->scan_skip = 1; cache->virtual_size = size; + mutex_lock(&cache->ref->lock); + status = map_backing_store(addressSpace, store, _address, 0, size, addressSpec & ~B_MTR_MASK, 0, protection, REGION_NO_PRIVATE_MAP, &area, name); + + mutex_unlock(&cache->ref->lock); + if (status < B_OK) vm_cache_release_ref(cache->ref); @@ -1083,8 +1096,12 @@ cache->scan_skip = 1; cache->virtual_size = size; + mutex_lock(&cache->ref->lock); + status = map_backing_store(addressSpace, store, address, 0, size, addressSpec, 0, B_KERNEL_READ_AREA, REGION_NO_PRIVATE_MAP, &area, name); + + mutex_unlock(&cache->ref->lock); vm_put_address_space(addressSpace); if (status < B_OK) { @@ -1188,9 +1205,13 @@ if (status < B_OK) goto err1; + mutex_lock(&cacheRef->lock); + status = map_backing_store(addressSpace, cacheRef->cache->store, _address, offset, size, addressSpec, 0, protection, mapping, &area, name); + mutex_unlock(&cacheRef->lock); + if (status < B_OK || mapping == REGION_PRIVATE_MAP) { // map_backing_store() cannot know we no longer need the ref vm_cache_release_ref(cacheRef); @@ -1282,9 +1303,13 @@ } else #endif { + mutex_lock(&sourceArea->cache_ref->lock); + status = map_backing_store(addressSpace, sourceArea->cache_ref->cache->store, address, sourceArea->cache_offset, sourceArea->size, addressSpec, sourceArea->wiring, protection, mapping, &newArea, name); + + mutex_unlock(&sourceArea->cache_ref->lock); } if (status == B_OK && mapping != REGION_PRIVATE_MAP) { // If the mapping is REGION_PRIVATE_MAP, map_backing_store() needed @@ -1463,22 +1488,28 @@ // So the old cache gets a new cache_ref and the area a new cache. upperCacheRef = area->cache_ref; + + // we will exchange the cache_ref's cache, so we better hold its lock + mutex_lock(&upperCacheRef->lock); + lowerCache = upperCacheRef->cache; // create an anonymous store object store = vm_store_create_anonymous_noswap(false, 0, 0); - if (store == NULL) - return B_NO_MEMORY; + if (store == NULL) { + status = B_NO_MEMORY; + goto err1; + } upperCache = vm_cache_create(store); if (upperCache == NULL) { status = B_NO_MEMORY; - goto err1; + goto err2; } status = vm_cache_ref_create(lowerCache); if (status < B_OK) - goto err2; + goto err3; lowerCacheRef = lowerCache->ref; @@ -1488,24 +1519,30 @@ protection |= B_READ_AREA; // we need to hold the cache_ref lock when we want to switch its cache - mutex_lock(&upperCacheRef->lock); mutex_lock(&lowerCacheRef->lock); upperCache->temporary = 1; upperCache->scan_skip = lowerCache->scan_skip; upperCache->virtual_base = lowerCache->virtual_base; upperCache->virtual_size = lowerCache->virtual_size; - upperCache->source = lowerCache; - list_add_item(&lowerCache->consumers, upperCache); + upperCache->ref = upperCacheRef; upperCacheRef->cache = upperCache; // we need to manually alter the ref_count (divide it between the two) - lowerCacheRef->ref_count = upperCacheRef->ref_count - 1; - upperCacheRef->ref_count = 1; + // the lower cache_ref has only known refs, so compute them + { + int32 count = 0; + vm_cache *consumer = NULL; + while ((consumer = (vm_cache *)list_get_next_item( + &lowerCache->consumers, consumer)) != NULL) { + count++; + } + lowerCacheRef->ref_count = count; + atomic_add(&upperCacheRef->ref_count, -count); + } - // grab a ref to the cache object we're now linked to as a source - vm_cache_acquire_ref(lowerCacheRef); + vm_cache_add_consumer_locked(lowerCacheRef, upperCache); // We now need to remap all pages from the area read-only, so that // a copy will be created on next write access @@ -1527,10 +1564,12 @@ return B_OK; +err3: + free(upperCache); err2: - free(upperCache); + store->ops->destroy(store); err1: - store->ops->destroy(store); + mutex_unlock(&upperCacheRef->lock); return status; } @@ -1565,11 +1604,15 @@ // First, create a cache on top of the source area + mutex_lock(&cacheRef->lock); + status = map_backing_store(addressSpace, cacheRef->cache->store, _address, source->cache_offset, source->size, addressSpec, source->wiring, protection, writableCopy ? REGION_PRIVATE_MAP : REGION_NO_PRIVATE_MAP, &target, name); + mutex_unlock(&cacheRef->lock); + if (status < B_OK) goto err; @@ -1640,10 +1683,10 @@ } cacheRef = area->cache_ref; + mutex_lock(&cacheRef->lock); + cache = cacheRef->cache; - mutex_lock(&cacheRef->lock); - if ((area->protection & (B_WRITE_AREA | B_KERNEL_WRITE_AREA)) != 0 && (newProtection & (B_WRITE_AREA | B_KERNEL_WRITE_AREA)) == 0) { // change from read/write to read-only @@ -1860,25 +1903,39 @@ vm_cache *cache; vm_cache_ref *cacheRef; bool showPages = false; - int addressIndex = 1; + bool showCache = true; + bool showCacheRef = true; + int i = 1; if (argc < 2) { - kprintf("usage: %s [-p]
\n" - " if -p is specified, all pages are shown.", argv[0]); + kprintf("usage: %s [-ps]
\n" + " if -p is specified, all pages are shown, if -s is used\n" + " only the cache/cache_ref info is shown respectively.\n", argv[0]); return 0; } - if (!strcmp(argv[1], "-p")) { - showPages = true; - addressIndex++; + while (argv[i][0] == '-') { + char *arg = argv[i] + 1; + while (arg[0]) { + if (arg[0] == 'p') + showPages = true; + else if (arg[0] == 's') { + if (!strcmp(argv[0], "cache")) + showCacheRef = false; + else + showCache = false; + } + arg++; + } + i++; } - if (strlen(argv[addressIndex]) < 2 - || argv[addressIndex][0] != '0' - || argv[addressIndex][1] != 'x') { + if (argv[i] == NULL || strlen(argv[i]) < 2 + || argv[i][0] != '0' + || argv[i][1] != 'x') { kprintf("%s: invalid argument, pass address\n", argv[0]); return 0; } - addr_t address = strtoul(argv[addressIndex], NULL, 0); + addr_t address = strtoul(argv[i], NULL, 0); if (address == NULL) return 0; @@ -1890,54 +1947,62 @@ cache = cacheRef->cache; } - kprintf("cache_ref at %p:\n", cacheRef); - kprintf(" ref_count: %ld\n", cacheRef->ref_count); - kprintf(" lock.holder: %ld\n", cacheRef->lock.holder); - kprintf(" lock.sem: 0x%lx\n", cacheRef->lock.sem); - kprintf(" areas:\n"); + if (showCacheRef) { + kprintf("cache_ref at %p:\n", cacheRef); + if (!showCache) + kprintf(" cache: %p\n", cacheRef->cache); + kprintf(" ref_count: %ld\n", cacheRef->ref_count); + kprintf(" lock.holder: %ld\n", cacheRef->lock.holder); + kprintf(" lock.sem: 0x%lx\n", cacheRef->lock.sem); + kprintf(" areas:\n"); - for (vm_area *area = cacheRef->areas; area != NULL; area = area->cache_next) { - kprintf(" area 0x%lx, %s\n", area->id, area->name); - kprintf("\tbase_addr: 0x%lx, size: 0x%lx\n", area->base, area->size); - kprintf("\tprotection: 0x%lx\n", area->protection); - kprintf("\towner: 0x%lx ", area->address_space->id); + for (vm_area *area = cacheRef->areas; area != NULL; area = area->cache_next) { + kprintf(" area 0x%lx, %s\n", area->id, area->name); + kprintf("\tbase_addr: 0x%lx, size: 0x%lx\n", area->base, area->size); + kprintf("\tprotection: 0x%lx\n", area->protection); + kprintf("\towner: 0x%lx\n", area->address_space->id); + } } - kprintf("cache at %p:\n", cache); - kprintf(" source: %p\n", cache->source); - kprintf(" store: %p\n", cache->store); - kprintf(" virtual_base: 0x%Lx\n", cache->virtual_base); - kprintf(" virtual_size: 0x%Lx\n", cache->virtual_size); - kprintf(" temporary: %ld\n", cache->temporary); - kprintf(" scan_skip: %ld\n", cache->scan_skip); + if (showCache) { + kprintf("cache at %p:\n", cache); + if (!showCacheRef) + kprintf(" cache_ref: %p\n", cache->ref); + kprintf(" source: %p\n", cache->source); + kprintf(" store: %p\n", cache->store); + kprintf(" virtual_base: 0x%Lx\n", cache->virtual_base); + kprintf(" virtual_size: 0x%Lx\n", cache->virtual_size); + kprintf(" temporary: %ld\n", cache->temporary); + kprintf(" scan_skip: %ld\n", cache->scan_skip); - kprintf(" consumers:\n"); - vm_cache *consumer = NULL; - while ((consumer = (vm_cache *)list_get_next_item(&cache->consumers, consumer)) != NULL) { - kprintf("\t%p\n", consumer); - } + kprintf(" consumers:\n"); + vm_cache *consumer = NULL; + while ((consumer = (vm_cache *)list_get_next_item(&cache->consumers, consumer)) != NULL) { + kprintf("\t%p\n", consumer); + } - kprintf(" pages:\n"); - int32 count = 0; - for (vm_page *page = cache->page_list; page != NULL; page = page->cache_next) { - count++; + kprintf(" pages:\n"); + int32 count = 0; + for (vm_page *page = cache->page_list; page != NULL; page = page->cache_next) { + count++; + if (!showPages) + continue; + + if (page->type == PAGE_TYPE_PHYSICAL) { + kprintf("\t%p ppn 0x%lx offset 0x%lx type %ld state %ld (%s) ref_count %ld\n", + page, page->physical_page_number, page->cache_offset, page->type, page->state, + page_state_to_text(page->state), page->ref_count); + } else if(page->type == PAGE_TYPE_DUMMY) { + kprintf("\t%p DUMMY PAGE state %ld (%s)\n", + page, page->state, page_state_to_text(page->state)); + } else + kprintf("\t%p UNKNOWN PAGE type %ld\n", page, page->type); + } + if (!showPages) - continue; - - if (page->type == PAGE_TYPE_PHYSICAL) { - kprintf("\t%p ppn 0x%lx offset 0x%lx type %ld state %ld (%s) ref_count %ld\n", - page, page->physical_page_number, page->cache_offset, page->type, page->state, - page_state_to_text(page->state), page->ref_count); - } else if(page->type == PAGE_TYPE_DUMMY) { - kprintf("\t%p DUMMY PAGE state %ld (%s)\n", - page, page->state, page_state_to_text(page->state)); - } else - kprintf("\t%p UNKNOWN PAGE type %ld\n", page, page->type); + kprintf("\t%ld in cache\n", count); } - if (!showPages) - kprintf("\t%ld in cache\n", count); - return 0; } @@ -2624,6 +2689,8 @@ changeCount = addressSpace->change_count; release_sem_etc(addressSpace->sem, READ_COUNT, 0); + mutex_lock(&topCacheRef->lock); + // See if this cache has a fault handler - this will do all the work for us if (topCacheRef->cache->store->ops->fault != NULL) { // Note, since the page fault is resolved with interrupts enabled, the @@ -2631,12 +2698,15 @@ // the store must take this into account status_t status = (*topCacheRef->cache->store->ops->fault)(topCacheRef->cache->store, addressSpace, cacheOffset); if (status != B_BAD_HANDLER) { + mutex_unlock(&topCacheRef->lock); vm_cache_release_ref(topCacheRef); vm_put_address_space(addressSpace); return status; } } + mutex_unlock(&topCacheRef->lock); + // The top most cache has no fault handler, so let's see if the cache or its sources // already have the page we're searching for (we're going from top to bottom) @@ -2833,10 +2903,10 @@ if (dummyPage.state == PAGE_STATE_BUSY) { // we had inserted the dummy cache in another cache, so let's remove it from there - vm_cache_ref *temp_cache = dummyPage.cache->ref; - mutex_lock(&temp_cache->lock); - vm_cache_remove_page(temp_cache, &dummyPage); - mutex_unlock(&temp_cache->lock); + vm_cache_ref *tempRef = dummyPage.cache->ref; + mutex_lock(&tempRef->lock); + vm_cache_remove_page(tempRef, &dummyPage); + mutex_unlock(&tempRef->lock); dummyPage.state = PAGE_STATE_INACTIVE; } } @@ -2875,10 +2945,10 @@ if (dummyPage.state == PAGE_STATE_BUSY) { // We still have the dummy page in the cache - that happens if we didn't need // to allocate a new page before, but could use one in another cache - vm_cache_ref *temp_cache = dummyPage.cache->ref; - mutex_lock(&temp_cache->lock); - vm_cache_remove_page(temp_cache, &dummyPage); - mutex_unlock(&temp_cache->lock); + vm_cache_ref *tempRef = dummyPage.cache->ref; + mutex_lock(&tempRef->lock); + vm_cache_remove_page(tempRef, &dummyPage); + mutex_unlock(&tempRef->lock); dummyPage.state = PAGE_STATE_INACTIVE; } @@ -3339,7 +3409,7 @@ status_t resize_area(area_id areaID, size_t newSize) { - vm_cache_ref *cache; + vm_cache_ref *cacheRef; vm_area *area, *current; status_t status = B_OK; size_t oldSize; @@ -3352,25 +3422,25 @@ if (area == NULL) return B_BAD_VALUE; + cacheRef = area->cache_ref; + mutex_lock(&cacheRef->lock); + // Resize all areas of this area's cache - cache = area->cache_ref; oldSize = area->size; // ToDo: we should only allow to resize anonymous memory areas! - if (!cache->cache->temporary) { + if (!cacheRef->cache->temporary) { status = B_NOT_ALLOWED; - goto err1; + goto out; } // ToDo: we must lock all address spaces here! - mutex_lock(&cache->lock); - if (oldSize < newSize) { // We need to check if all areas of this cache can be resized - for (current = cache->areas; current; current = current->cache_next) { + for (current = cacheRef->areas; current; current = current->cache_next) { if (current->address_space_next && current->address_space_next->base <= (current->base + newSize)) { // if the area was created inside a reserved area, it can also be // resized in that area @@ -3381,14 +3451,14 @@ continue; status = B_ERROR; - goto err2; + goto out; } } } // Okay, looks good so far, so let's do it - for (current = cache->areas; current; current = current->cache_next) { + for (current = cacheRef->areas; current; current = current->cache_next) { if (current->address_space_next && current->address_space_next->base <= (current->base + newSize)) { vm_area *next = current->address_space_next; if (next->id == RESERVED_AREA_ID && next->cache_offset <= current->base @@ -3421,17 +3491,16 @@ } if (status == B_OK) - status = vm_cache_resize(cache, newSize); + status = vm_cache_resize(cacheRef, newSize); if (status < B_OK) { // This shouldn't really be possible, but hey, who knows - for (current = cache->areas; current; current = current->cache_next) + for (current = cacheRef->areas; current; current = current->cache_next) current->size = oldSize; } -err2: - mutex_unlock(&cache->lock); -err1: +out: + mutex_unlock(&cacheRef->lock); vm_put_area(area); // ToDo: we must honour the lock restrictions of this area Modified: haiku/trunk/src/system/kernel/vm/vm_cache.c =================================================================== --- haiku/trunk/src/system/kernel/vm/vm_cache.c 2007-01-14 14:26:29 UTC (rev 19795) +++ haiku/trunk/src/system/kernel/vm/vm_cache.c 2007-01-14 18:41:57 UTC (rev 19796) @@ -185,7 +185,7 @@ // delete this cache if (cacheRef->areas != NULL) - panic("cache to be deleted still has areas"); + panic("cache_ref %p to be deleted still has areas", cacheRef); if (!list_is_empty(&cacheRef->cache->consumers)) panic("cache %p to be deleted still has consumers", cacheRef->cache); @@ -330,14 +330,18 @@ } +/*! + Commits the memory to the store if the \a commitment is larger than + what's committed already. + Assumes you have the \a ref's lock held. +*/ status_t -vm_cache_set_minimal_commitment(vm_cache_ref *ref, off_t commitment) +vm_cache_set_minimal_commitment_locked(vm_cache_ref *ref, off_t commitment) { status_t status = B_OK; - vm_store *store; + vm_store *store = ref->cache->store; - mutex_lock(&ref->lock); - store = ref->cache->store; + ASSERT_LOCKED_MUTEX(&ref->lock); // If we don't have enough committed space to cover through to the new end of region... if (store->committed_size < commitment) { @@ -348,7 +352,6 @@ status = store->ops->commit(store, commitment); } - mutex_unlock(&ref->lock); return status; } @@ -399,6 +402,7 @@ /*! Removes the \a consumer from the \a cacheRef's cache. It will also release the reference to the cacheRef owned by the consumer. + Assumes you have the consumer's cache_ref lock held. */ void vm_cache_remove_consumer(vm_cache_ref *cacheRef, vm_cache *consumer) @@ -407,9 +411,9 @@ vm_cache *newSource = NULL; TRACE(("remove consumer vm cache %p from cache %p\n", consumer, cache)); + ASSERT_LOCKED_MUTEX(&consumer->ref->lock); mutex_lock(&cacheRef->lock); - list_remove_item(&cache->consumers, consumer); consumer->source = NULL; @@ -453,19 +457,21 @@ if (newSource != NULL) { // The remaining consumer has gotten a new source + mutex_lock(&newSource->ref->lock); + list_remove_item(&newSource->consumers, cache); list_add_item(&newSource->consumers, consumer); consumer->source = newSource; cache->source = NULL; - mutex_unlock(&cacheRef->lock); + mutex_unlock(&newSource->ref->lock); // Release the other reference to the cache - we take over // its reference of its source cache vm_cache_release_ref(cacheRef); - } else - mutex_unlock(&cacheRef->lock); + } + mutex_unlock(&cacheRef->lock); vm_cache_release_ref(cacheRef); } @@ -474,26 +480,30 @@ Marks the \a cacheRef's cache as source of the \a consumer cache, and adds the \a consumer to its list. This also grabs a reference to the source cache. + Assumes you have the cache_ref and the consumer's lock held. */ void -vm_cache_add_consumer(vm_cache_ref *cacheRef, vm_cache *consumer) +vm_cache_add_consumer_locked(vm_cache_ref *cacheRef, vm_cache *consumer) { TRACE(("add consumer vm cache %p to cache %p\n", consumer, cacheRef->cache)); - mutex_lock(&cacheRef->lock); + ASSERT_LOCKED_MUTEX(&cacheRef->lock); + ASSERT_LOCKED_MUTEX(&consumer->ref->lock); consumer->source = cacheRef->cache; list_add_item(&cacheRef->cache->consumers, consumer); vm_cache_acquire_ref(cacheRef); - - mutex_unlock(&cacheRef->lock); } +/*! + Adds the \a area to the \a cacheRef. + Assumes you have the locked the cache_ref. +*/ status_t -vm_cache_insert_area(vm_cache_ref *cacheRef, vm_area *area) +vm_cache_insert_area_locked(vm_cache_ref *cacheRef, vm_area *area) { - mutex_lock(&cacheRef->lock); + ASSERT_LOCKED_MUTEX(&cacheRef->lock); area->cache_next = cacheRef->areas; if (area->cache_next) @@ -501,7 +511,6 @@ area->cache_prev = NULL; cacheRef->areas = area; - mutex_unlock(&cacheRef->lock); return B_OK; } From korli at mail.berlios.de Sun Jan 14 22:27:29 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Sun, 14 Jan 2007 22:27:29 +0100 Subject: [Haiku-commits] r19797 - in haiku/trunk/src/add-ons: accelerants/vmware kernel/drivers/graphics/vmware Message-ID: <200701142127.l0ELRTgM008653@sheep.berlios.de> Author: korli Date: 2007-01-14 22:27:28 +0100 (Sun, 14 Jan 2007) New Revision: 19797 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19797&view=rev Modified: haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/driver.h Log: fixed build on gcc4 Modified: haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h 2007-01-14 18:41:57 UTC (rev 19796) +++ haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h 2007-01-14 21:27:28 UTC (rev 19797) @@ -13,7 +13,7 @@ #include #undef TRACE -#define TRACE(a...) _sPrintf("VMware: " ##a) +#define TRACE(a...) _sPrintf("VMware: " a) #include "DriverInterface.h" #include "generic.h" Modified: haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/driver.h =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/driver.h 2007-01-14 18:41:57 UTC (rev 19796) +++ haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/driver.h 2007-01-14 21:27:28 UTC (rev 19797) @@ -9,7 +9,7 @@ #define DRIVER_H -#define TRACE(a...) dprintf("VMware: " ##a) +#define TRACE(a...) dprintf("VMware: " a) #include "DriverInterface.h" From fekdahl at gmail.com Sun Jan 14 22:25:15 2007 From: fekdahl at gmail.com (Fredrik Ekdahl) Date: Sun, 14 Jan 2007 22:25:15 +0100 Subject: [Haiku-commits] r19793 - in haiku/trunk: headers/private/graphics headers/private/graphics/vmware src/add-ons/accelerants src/add-ons/accelerants/vmware src/add-ons/kernel/drivers/graphics src/add-ons/kernel/drivers/graphics/vmware In-Reply-To: <200701141416.l0EEG83P029995@sheep.berlios.de> References: <200701141416.l0EEG83P029995@sheep.berlios.de> Message-ID: <45AA9FBB.1070203@gmail.com> axeld at BerliOS skrev: > Author: axeld > Date: 2007-01-14 15:16:06 +0100 (Sun, 14 Jan 2007) > New Revision: 19793 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19793&view=rev > > Added: > haiku/trunk/headers/private/graphics/vmware/ > haiku/trunk/headers/private/graphics/vmware/DriverInterface.h > haiku/trunk/headers/private/graphics/vmware/svga_reg.h > haiku/trunk/headers/private/graphics/vmware/vm_device_version.h > haiku/trunk/src/add-ons/accelerants/vmware/ > haiku/trunk/src/add-ons/accelerants/vmware/Acceleration.c > haiku/trunk/src/add-ons/accelerants/vmware/Cursor.c > haiku/trunk/src/add-ons/accelerants/vmware/EngineManagment.c > haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c > haiku/trunk/src/add-ons/accelerants/vmware/GetAccelerantHook.c > haiku/trunk/src/add-ons/accelerants/vmware/GetModeInfo.c > haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.c > haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h > haiku/trunk/src/add-ons/accelerants/vmware/InitAccelerant.c > haiku/trunk/src/add-ons/accelerants/vmware/Jamfile > haiku/trunk/src/add-ons/accelerants/vmware/ProposeDisplayMode.c > haiku/trunk/src/add-ons/accelerants/vmware/README > haiku/trunk/src/add-ons/accelerants/vmware/SetDisplayMode.c > haiku/trunk/src/add-ons/accelerants/vmware/generic.h > haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/ > haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/Jamfile > haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/device.c > haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/driver.c > haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/driver.h > Modified: > haiku/trunk/src/add-ons/accelerants/Jamfile > haiku/trunk/src/add-ons/kernel/drivers/graphics/Jamfile > Log: > Added Eric Petit's VMware graphics driver - thanks! > Made the following changes from the version I got from Eric: > * made BppForSpace() in DriverInterface.h inline to remove some warnings > * renamed driver source files to lower case. > * removed Be Inc. copyright from kernel driver as I couldn't see anything coming > from Be Inc. there - correct me if I was wrong, Eric. > * Minor other changes like added missing header guards. > * The README provided in the main directory is only included in the accelerant > directory. > Hi. Build is broken on gcc4. It's the trace macros in haiku/trunk/src/add-ons/accelerants/vmware/GlobalData.h and haiku/trunk/src/add-ons/kernel/drivers/graphics/vmware/driver.h Changing "##a" to "a" fixes it. Hope it works on the old gcc too. /Fredrik Ekdahl From phoudoin at mail.berlios.de Sun Jan 14 22:58:19 2007 From: phoudoin at mail.berlios.de (phoudoin at BerliOS) Date: Sun, 14 Jan 2007 22:58:19 +0100 Subject: [Haiku-commits] r19798 - in haiku/trunk: headers/os/drivers src/add-ons/kernel/generic/dpc Message-ID: <200701142158.l0ELwJVD011922@sheep.berlios.de> Author: phoudoin Date: 2007-01-14 22:58:19 +0100 (Sun, 14 Jan 2007) New Revision: 19798 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19798&view=rev Modified: haiku/trunk/headers/os/drivers/dpc.h haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c Log: Renamed the public api to underline the DPC *queue* mechanism handled. Pending DPCs at queue death time are now called too, to avoid possible leaks. Meanwhile, queue_dpc() will refuse to add another DPC and returns B_CANCELLED. Modified: haiku/trunk/headers/os/drivers/dpc.h =================================================================== --- haiku/trunk/headers/os/drivers/dpc.h 2007-01-14 21:27:28 UTC (rev 19797) +++ haiku/trunk/headers/os/drivers/dpc.h 2007-01-14 21:58:19 UTC (rev 19798) @@ -18,9 +18,9 @@ typedef struct { module_info info; - void * (*new_dpc_thread)(const char *name, long priority, int queue_size); - status_t (*delete_dpc_thread)(void *thread); - status_t (*queue_dpc)(void *thread, dpc_func dpc_name, void *arg); + void * (*new_dpc_queue)(const char *name, long priority, int queue_size); + status_t (*delete_dpc_queue)(void *queue); + status_t (*queue_dpc)(void *queue, dpc_func dpc_name, void *arg); } dpc_module_info; Modified: haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c =================================================================== --- haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c 2007-01-14 21:27:28 UTC (rev 19797) +++ haiku/trunk/src/add-ons/kernel/generic/dpc/dpc.c 2007-01-14 21:58:19 UTC (rev 19798) @@ -40,34 +40,42 @@ dpc_thread(void *arg) { dpc_queue *queue = arg; + dpc_slot dpc; // Let's wait forever/until semaphore death for new DPC slot to show up while (acquire_sem(queue->wakeup_sem) == B_OK) { cpu_status former; - dpc_slot call; // grab the next dpc slot former = disable_interrupts(); acquire_spinlock(&queue->lock); - call = queue->slots[queue->head]; + dpc = queue->slots[queue->head]; queue->head = (queue->head++) % queue->size; queue->count--; release_spinlock(&queue->lock); restore_interrupts(former); - call.function(call.arg); + dpc.function(dpc.arg); } - // Let's die quietly, ignored by all... sigh. + // Let's finish the pending DPCs, if any. + // Otherwise, resource could leaks... + while (queue->count--) { + dpc = queue->slots[queue->head]; + queue->head = (queue->head++) % queue->size; + dpc.function(dpc.arg); + } + + // Now, let's die quietly, ignored by all... sigh. return 0; } // ---- Public API static void * -new_dpc_thread(const char *name, long priority, int queue_size) +new_dpc_queue(const char *name, long priority, int queue_size) { char str[64]; dpc_queue *queue; @@ -111,17 +119,29 @@ static status_t -delete_dpc_thread(void *thread) +delete_dpc_queue(void *handle) { - dpc_queue *queue = thread; + dpc_queue *queue = handle; + thread_id thread; status_t exit_value; - + cpu_status former; + if (!queue) return B_BAD_VALUE; - // Wakeup the thread by murdering its favorite semaphore + // Close the queue: queue_dpc() should knows we're closing: + former = disable_interrupts(); + acquire_spinlock(&queue->lock); + + thread = queue->thread; + queue->thread = -1; + + release_spinlock(&queue->lock); + restore_interrupts(former); + + // Wakeup the thread by murdering its favorite semaphore delete_sem(queue->wakeup_sem); - wait_for_thread(queue->thread, &exit_value); + wait_for_thread(thread, &exit_value); free(queue); @@ -130,20 +150,23 @@ static status_t -queue_dpc(void *thread, dpc_func function, void *arg) +queue_dpc(void *handle, dpc_func function, void *arg) { - dpc_queue *queue = thread; + dpc_queue *queue = handle; cpu_status former; status_t status = B_OK; if (!queue || !function) return B_BAD_VALUE; - + // Try to be safe being called from interrupt handlers: former = disable_interrupts(); acquire_spinlock(&queue->lock); - if (queue->count == queue->size) + if (queue->thread < 0) { + // Queue thread is dying... + status = B_CANCELED; + } else if (queue->count == queue->size) // This DPC queue is full, sorry status = B_NO_MEMORY; else { @@ -166,7 +189,6 @@ } - static status_t std_ops(int32 op, ...) { @@ -188,8 +210,8 @@ std_ops }, - new_dpc_thread, - delete_dpc_thread, + new_dpc_queue, + delete_dpc_queue, queue_dpc }; From axeld at mail.berlios.de Mon Jan 15 00:22:50 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 00:22:50 +0100 Subject: [Haiku-commits] r19799 - haiku/trunk/src/system/kernel Message-ID: <200701142322.l0ENMoOu016871@sheep.berlios.de> Author: axeld Date: 2007-01-15 00:22:49 +0100 (Mon, 15 Jan 2007) New Revision: 19799 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19799&view=rev Modified: haiku/trunk/src/system/kernel/team.c Log: * team::args was not correctly initialized in create_team_struct() * even worse, in case of fork(), it was never initialized. Modified: haiku/trunk/src/system/kernel/team.c =================================================================== --- haiku/trunk/src/system/kernel/team.c 2007-01-14 21:58:19 UTC (rev 19798) +++ haiku/trunk/src/system/kernel/team.c 2007-01-14 23:22:49 UTC (rev 19799) @@ -560,6 +560,7 @@ team->next = team->siblings_next = team->children = team->parent = NULL; team->id = allocate_thread_id(); strlcpy(team->name, name, B_OS_NAME_LENGTH); + team->args[0] = '\0'; team->num_threads = 0; team->io_context = NULL; team->address_space = NULL; @@ -1133,6 +1134,8 @@ if (team == NULL) return B_NO_MEMORY; + strlcpy(team->args, parentTeam->args, sizeof(team->args)); + state = disable_interrupts(); GRAB_TEAM_LOCK(); From axeld at mail.berlios.de Mon Jan 15 00:26:20 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 00:26:20 +0100 Subject: [Haiku-commits] r19800 - in haiku/trunk: headers/private/kernel src/system/kernel/arch/x86 src/system/kernel/vm Message-ID: <200701142326.l0ENQKwc017090@sheep.berlios.de> Author: axeld Date: 2007-01-15 00:26:20 +0100 (Mon, 15 Jan 2007) New Revision: 19800 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19800&view=rev Modified: haiku/trunk/headers/private/kernel/vm.h haiku/trunk/src/system/kernel/arch/x86/arch_debug.c haiku/trunk/src/system/kernel/vm/vm.cpp Log: * Made vm_area_lookup() part of the kernel private API. * "sc"/"where"/"bt" now prints the area where the function of the stack frame is located in case there is no other information (using the above function). Modified: haiku/trunk/headers/private/kernel/vm.h =================================================================== --- haiku/trunk/headers/private/kernel/vm.h 2007-01-14 23:22:49 UTC (rev 19799) +++ haiku/trunk/headers/private/kernel/vm.h 2007-01-14 23:26:20 UTC (rev 19800) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -9,7 +9,6 @@ #define _KERNEL_VM_H -//#include #include #include #include @@ -58,6 +57,7 @@ area_id sourceArea); status_t vm_delete_area(team_id aid, area_id id); status_t vm_create_vnode_cache(void *vnode, vm_cache_ref **_cacheRef); +vm_area *vm_area_lookup(vm_address_space *addressSpace, addr_t address); status_t vm_set_area_memory_type(area_id id, addr_t physicalBase, uint32 type); Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug.c =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_debug.c 2007-01-14 23:22:49 UTC (rev 19799) +++ haiku/trunk/src/system/kernel/arch/x86/arch_debug.c 2007-01-14 23:26:20 UTC (rev 19800) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2001, Travis Geiselbrecht. All rights reserved. @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -91,16 +92,25 @@ status = image_debug_lookup_user_symbol_address(thread->team, eip, &baseAddress, &symbol, &image, &exactMatch); } + + kprintf("%08lx (+%4ld) %08lx", ebp, diff, eip); + if (status == B_OK) { if (symbol != NULL) { - kprintf("%08lx (+%4ld) %08lx <%s>:%s + 0x%04lx%s\n", ebp, diff, eip, - image, symbol, eip - baseAddress, exactMatch ? "" : " (nearest)"); + kprintf(" <%s>:%s + 0x%04lx%s\n", image, symbol, + eip - baseAddress, exactMatch ? "" : " (nearest)"); } else { - kprintf("%08lx (+%4ld) %08lx <%s@%p>:unknown + 0x%04lx\n", ebp, diff, - eip, image, (void *)baseAddress, eip - baseAddress); + kprintf(" <%s@%p>:unknown + 0x%04lx\n", image, + (void *)baseAddress, eip - baseAddress); } - } else - kprintf("%08lx (+%4ld) %08lx\n", ebp, diff, eip); + } else { + vm_area *area = vm_area_lookup(thread->team->address_space, eip); + if (area != NULL) { + kprintf(" %ld:%s@%p + %#lx\n", area->id, area->name, (void *)area->base, + eip - area->base); + } else + kprintf("\n"); + } } Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-14 23:22:49 UTC (rev 19799) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-14 23:26:20 UTC (rev 19800) @@ -2961,8 +2961,8 @@ } -/* NOTE: must have the address space's sem held */ -static vm_area * +/*! You must have the address space's sem held */ +vm_area * vm_area_lookup(vm_address_space *addressSpace, addr_t address) { vm_area *area; From axeld at mail.berlios.de Mon Jan 15 00:29:24 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 00:29:24 +0100 Subject: [Haiku-commits] r19801 - haiku/trunk/src/system/kernel/vm Message-ID: <200701142329.l0ENTOkk017398@sheep.berlios.de> Author: axeld Date: 2007-01-15 00:29:23 +0100 (Mon, 15 Jan 2007) New Revision: 19801 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19801&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm_cache.c Log: vm_cache_remove_consumer() did not only access vm_cache_ref::cache without having had the cache_ref locked, it also locked two refs in the wrong order (bottom-up); there was even a TODO item for this... Modified: haiku/trunk/src/system/kernel/vm/vm_cache.c =================================================================== --- haiku/trunk/src/system/kernel/vm/vm_cache.c 2007-01-14 23:26:20 UTC (rev 19800) +++ haiku/trunk/src/system/kernel/vm/vm_cache.c 2007-01-14 23:29:23 UTC (rev 19801) @@ -407,13 +407,14 @@ void vm_cache_remove_consumer(vm_cache_ref *cacheRef, vm_cache *consumer) { - vm_cache *cache = cacheRef->cache; vm_cache *newSource = NULL; + vm_cache *cache; - TRACE(("remove consumer vm cache %p from cache %p\n", consumer, cache)); + TRACE(("remove consumer vm cache %p from cache %p\n", consumer, cacheRef->cache)); ASSERT_LOCKED_MUTEX(&consumer->ref->lock); mutex_lock(&cacheRef->lock); + cache = cacheRef->cache; list_remove_item(&cache->consumers, consumer); consumer->source = NULL; @@ -423,36 +424,73 @@ // The cache is not really needed anymore - it can be merged with its only // consumer left. vm_cache_ref *consumerRef; - vm_page *page, *nextPage; + bool merge = false; - consumer = list_remove_head_item(&cache->consumers); + consumer = list_get_first_item(&cache->consumers); consumerRef = consumer->ref; - mutex_lock(&consumerRef->lock); - // TODO: is it okay to lock them in this direction? + // Our cache doesn't have a ref to its consumer (only the other way around), + // so we cannot just acquire it here; it might be deleted right now + while (true) { + int32 count = consumerRef->ref_count; + if (count == 0) + break; - TRACE(("merge vm cache %p (ref == %ld) with vm cache %p\n", - cache, cacheRef->ref_count, consumer)); + if (atomic_test_and_set(&consumerRef->ref_count, count + 1, count) == count) { + // we managed to grab a reference to the consumer + merge = true; + break; + } + } - for (page = cache->page_list; page != NULL; page = nextPage) { - nextPage = page->cache_next; - vm_cache_remove_page(cacheRef, page); + if (merge) { + // But since we need to keep the locking order upper->lower cache, we + // need to unlock our cache now + mutex_unlock(&cacheRef->lock); - if (vm_cache_lookup_page(consumerRef, - (off_t)page->cache_offset << PAGE_SHIFT) != NULL) { - // the page already is in the consumer cache - this copy is no - // longer needed, and can be freed - vm_page_set_state(page, PAGE_STATE_FREE); - continue; + mutex_lock(&consumerRef->lock); + mutex_lock(&cacheRef->lock); + + // the cache and the situation might have changed + cache = cacheRef->cache; + if (cacheRef->areas != NULL || cache->source == NULL + || list_is_empty(&cache->consumers) + || cache->consumers.link.next != cache->consumers.link.prev + || consumerRef != list_get_first_item(&cache->consumers)) { + merge = false; + mutex_unlock(&consumerRef->lock); } + } - // move the page into the consumer cache - vm_cache_insert_page(consumerRef, page, - (off_t)page->cache_offset << PAGE_SHIFT); + if (merge) { + vm_page *page, *nextPage; + + consumer = list_remove_head_item(&cache->consumers); + + TRACE(("merge vm cache %p (ref == %ld) with vm cache %p\n", + cache, cacheRef->ref_count, consumer)); + + for (page = cache->page_list; page != NULL; page = nextPage) { + nextPage = page->cache_next; + vm_cache_remove_page(cacheRef, page); + + if (vm_cache_lookup_page(consumerRef, + (off_t)page->cache_offset << PAGE_SHIFT) != NULL) { + // the page already is in the consumer cache - this copy is no + // longer needed, and can be freed + vm_page_set_state(page, PAGE_STATE_FREE); + continue; + } + + // move the page into the consumer cache + vm_cache_insert_page(consumerRef, page, + (off_t)page->cache_offset << PAGE_SHIFT); + } + + newSource = cache->source; + mutex_unlock(&consumerRef->lock); } - - newSource = cache->source; - mutex_unlock(&consumerRef->lock); + vm_cache_release_ref(consumerRef); } if (newSource != NULL) { From korli at mail.berlios.de Mon Jan 15 00:33:53 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 15 Jan 2007 00:33:53 +0100 Subject: [Haiku-commits] r19802 - haiku/trunk/src/system/kernel/vm Message-ID: <200701142333.l0ENXr9f026060@sheep.berlios.de> Author: korli Date: 2007-01-15 00:33:52 +0100 (Mon, 15 Jan 2007) New Revision: 19802 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19802&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: fix gcc4 build Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-14 23:29:23 UTC (rev 19801) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-14 23:33:52 UTC (rev 19802) @@ -73,7 +73,6 @@ static status_t map_backing_store(vm_address_space *addressSpace, vm_store *store, void **vaddr, off_t offset, addr_t size, uint32 addressSpec, int wiring, int lock, int mapping, vm_area **_area, const char *area_name); static status_t vm_soft_fault(addr_t address, bool is_write, bool is_user); -static vm_area *vm_area_lookup(vm_address_space *addressSpace, addr_t address); static bool vm_put_area(vm_area *area); From axeld at pinc-software.de Mon Jan 15 00:49:47 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Mon, 15 Jan 2007 00:49:47 +0100 (MET) Subject: [Haiku-commits] r19802 - haiku/trunk/src/system/kernel/vm In-Reply-To: <200701142333.l0ENXr9f026060@sheep.berlios.de> Message-ID: <45976825575-BeMail@zon> korli at BerliOS wrote: > Log: > fix gcc4 build Thanks, I missed that one. Bye, Axel. From axeld at mail.berlios.de Mon Jan 15 10:42:08 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 10:42:08 +0100 Subject: [Haiku-commits] r19803 - haiku/trunk/src/add-ons/accelerants/vmware Message-ID: <200701150942.l0F9g8Od012257@sheep.berlios.de> Author: axeld Date: 2007-01-15 10:42:08 +0100 (Mon, 15 Jan 2007) New Revision: 19803 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19803&view=rev Modified: haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c Log: Applied patch by Eric: this fixes a crash after some time (when the FIFO queue was full for the first time). Modified: haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c =================================================================== --- haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c 2007-01-14 23:33:52 UTC (rev 19802) +++ haiku/trunk/src/add-ons/accelerants/vmware/Fifo.c 2007-01-15 09:42:08 UTC (rev 19803) @@ -112,7 +112,8 @@ FifoSync(); fifo[gSi->fifoNext / 4] = value; - gSi->fifoNext = (gSi->fifoNext + 4) % fifoCapacity; + gSi->fifoNext = fifo[SVGA_FIFO_MIN] + + (gSi->fifoNext + 4 - fifo[SVGA_FIFO_MIN]) % fifoCapacity; } From axeld at mail.berlios.de Mon Jan 15 11:11:04 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 11:11:04 +0100 Subject: [Haiku-commits] r19804 - haiku/trunk/src/tests/system/kernel Message-ID: <200701151011.l0FAB4jP015795@sheep.berlios.de> Author: axeld Date: 2007-01-15 11:11:03 +0100 (Mon, 15 Jan 2007) New Revision: 19804 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19804&view=rev Modified: haiku/trunk/src/tests/system/kernel/fibo_exec.cpp haiku/trunk/src/tests/system/kernel/fibo_fork.cpp haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp Log: Now checks the return value of wait_for_thread() and print out an error message if it fails. Modified: haiku/trunk/src/tests/system/kernel/fibo_exec.cpp =================================================================== --- haiku/trunk/src/tests/system/kernel/fibo_exec.cpp 2007-01-15 09:42:08 UTC (rev 19803) +++ haiku/trunk/src/tests/system/kernel/fibo_exec.cpp 2007-01-15 10:11:03 UTC (rev 19804) @@ -83,14 +83,24 @@ return -1; } - status_t status; - while (wait_for_thread(childA, &status) == B_INTERRUPTED) - ; - result = status; + status_t status, returnValue = 0; + do { + status = wait_for_thread(childA, &returnValue); + } while (status == B_INTERRUPTED); - while (wait_for_thread(childB, &status) == B_INTERRUPTED) - ; - result += status; + if (status == B_OK) + result = returnValue; + else + fprintf(stderr, "wait_for_thread(%ld) A failed: %s\n", childA, strerror(status)); + + do { + status = wait_for_thread(childB, &returnValue); + } while (status == B_INTERRUPTED); + + if (status == B_OK) + result += returnValue; + else + fprintf(stderr, "wait_for_thread(%ld) B failed: %s\n", childB, strerror(status)); } if (silent) { Modified: haiku/trunk/src/tests/system/kernel/fibo_fork.cpp =================================================================== --- haiku/trunk/src/tests/system/kernel/fibo_fork.cpp 2007-01-15 09:42:08 UTC (rev 19803) +++ haiku/trunk/src/tests/system/kernel/fibo_fork.cpp 2007-01-15 10:11:03 UTC (rev 19804) @@ -70,14 +70,24 @@ return -1; } - status_t status; - while (wait_for_thread(childA, &status) == B_INTERRUPTED) - ; - result = status; + status_t status, returnValue = 0; + do { + status = wait_for_thread(childA, &returnValue); + } while (status == B_INTERRUPTED); - while (wait_for_thread(childB, &status) == B_INTERRUPTED) - ; - result += status; + if (status == B_OK) + result = returnValue; + else + fprintf(stderr, "wait_for_thread(%ld) A failed: %s\n", childA, strerror(status)); + + do { + status = wait_for_thread(childB, &returnValue); + } while (status == B_INTERRUPTED); + + if (status == B_OK) + result += returnValue; + else + fprintf(stderr, "wait_for_thread(%ld) B failed: %s\n", childB, strerror(status)); } if (gForked) { Modified: haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp =================================================================== --- haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp 2007-01-15 09:42:08 UTC (rev 19803) +++ haiku/trunk/src/tests/system/kernel/fibo_load_image.cpp 2007-01-15 10:11:03 UTC (rev 19804) @@ -71,13 +71,24 @@ resume_thread(threadA); resume_thread(threadB); - while (wait_for_thread(threadA, &status) == B_INTERRUPTED) - ; - result = status; + status_t returnValue = 0; + do { + status = wait_for_thread(threadA, &returnValue); + } while (status == B_INTERRUPTED); - while (wait_for_thread(threadB, &status) == B_INTERRUPTED) - ; - result += status; + if (status == B_OK) + result = returnValue; + else + fprintf(stderr, "wait_for_thread(%ld) A failed: %s\n", threadA, strerror(status)); + + do { + status = wait_for_thread(threadB, &returnValue); + } while (status == B_INTERRUPTED); + + if (status == B_OK) + result += returnValue; + else + fprintf(stderr, "wait_for_thread(%ld) B failed: %s\n", threadB, strerror(status)); } if (silent) { From axeld at mail.berlios.de Mon Jan 15 11:24:22 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 11:24:22 +0100 Subject: [Haiku-commits] r19805 - haiku/trunk/src/system/kernel/vm Message-ID: <200701151024.l0FAOMTS017286@sheep.berlios.de> Author: axeld Date: 2007-01-15 11:24:22 +0100 (Mon, 15 Jan 2007) New Revision: 19805 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19805&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm_store_device.c Log: vm_store::fault() is now called with having the vm_cache_ref locked, so it shouldn't be locked again here... Modified: haiku/trunk/src/system/kernel/vm/vm_store_device.c =================================================================== --- haiku/trunk/src/system/kernel/vm/vm_store_device.c 2007-01-15 10:11:03 UTC (rev 19804) +++ haiku/trunk/src/system/kernel/vm/vm_store_device.c 2007-01-15 10:24:22 UTC (rev 19805) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -61,6 +61,7 @@ return B_OK; } + /** this fault handler should take over the page fault routine and map the page in * * setup: the cache that this store is part of has a ref being held and will be @@ -76,7 +77,6 @@ vm_area *area; // figure out which page needs to be mapped where - mutex_lock(&cache_ref->lock); map->ops->lock(map); // cycle through all of the regions that map this cache and map the page in @@ -97,8 +97,6 @@ } map->ops->unlock(map); - mutex_unlock(&cache_ref->lock); - return B_OK; } From axeld at mail.berlios.de Mon Jan 15 12:40:14 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 12:40:14 +0100 Subject: [Haiku-commits] r19806 - haiku/trunk/src/system/kernel/vm Message-ID: <200701151140.l0FBeEZk011324@sheep.berlios.de> Author: axeld Date: 2007-01-15 12:40:13 +0100 (Mon, 15 Jan 2007) New Revision: 19806 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19806&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: Moved locking into map_backing_store() - it now gets a vm_cache_ref instead of a vm_store, so that this can be done safely. It was also needed, as it would call vm_cache_release_ref() on failure which requires you to have no vm_cache_ref locks around (as it might deadlock in this case). Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-15 10:24:22 UTC (rev 19805) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-15 11:40:13 UTC (rev 19806) @@ -69,9 +69,6 @@ static benaphore sAvailableMemoryLock; // function declarations -static vm_area *_vm_create_region_struct(vm_address_space *addressSpace, const char *name, int wiring, int lock); -static status_t map_backing_store(vm_address_space *addressSpace, vm_store *store, void **vaddr, - off_t offset, addr_t size, uint32 addressSpec, int wiring, int lock, int mapping, vm_area **_area, const char *area_name); static status_t vm_soft_fault(addr_t address, bool is_write, bool is_user); static bool vm_put_area(vm_area *area); @@ -500,18 +497,11 @@ } -/*! - The \a store's owner must be locked when calling this function. -*/ static status_t -map_backing_store(vm_address_space *addressSpace, vm_store *store, void **_virtualAddress, - off_t offset, addr_t size, uint32 addressSpec, int wiring, int protection, - int mapping, vm_area **_area, const char *areaName) +map_backing_store(vm_address_space *addressSpace, vm_cache_ref *cacheRef, + void **_virtualAddress, off_t offset, addr_t size, uint32 addressSpec, + int wiring, int protection, int mapping, vm_area **_area, const char *areaName) { - vm_cache_ref *cacheRef; - vm_cache *cache; - status_t status; - TRACE(("map_backing_store: aspace %p, store %p, *vaddr %p, offset 0x%Lx, size %lu, addressSpec %ld, wiring %d, protection %d, _area %p, area_name '%s'\n", addressSpace, store, *_virtualAddress, offset, size, addressSpec, wiring, protection, _area, areaName)); @@ -520,12 +510,17 @@ if (area == NULL) return B_NO_MEMORY; - cache = store->cache; - cacheRef = cache->ref; + mutex_lock(&cacheRef->lock); + vm_cache *cache = cacheRef->cache; + vm_store *store = cache->store; + bool unlock = true; + status_t status; + // if this is a private map, we need to create a new cache & store object // pair to handle the private copies of pages as they are written to if (mapping == REGION_PRIVATE_MAP) { + vm_cache_ref *newCacheRef; vm_cache *newCache; vm_store *newStore; @@ -549,11 +544,15 @@ goto err1; } + newCacheRef = newCache->ref; newCache->temporary = 1; newCache->scan_skip = cache->scan_skip; vm_cache_add_consumer_locked(cacheRef, newCache); + mutex_unlock(&cacheRef->lock); + mutex_lock(&newCacheRef->lock); + cache = newCache; cacheRef = newCache->ref; store = newStore; @@ -584,6 +583,7 @@ area->cache_offset = offset; // point the cache back to the area vm_cache_insert_area_locked(cacheRef, area); + mutex_unlock(&cacheRef->lock); // insert the area in the global area hash table acquire_sem_etc(sAreaHashLock, WRITE_COUNT, 0 ,0); @@ -603,9 +603,13 @@ err2: if (mapping == REGION_PRIVATE_MAP) { // we created this cache, so we must delete it again + mutex_unlock(&cacheRef->lock); vm_cache_release_ref(cacheRef); + unlock = false; } err1: + if (unlock) + mutex_unlock(&cacheRef->lock); free(area->name); free(area); return status; @@ -819,20 +823,15 @@ break; } - mutex_lock(&cache->ref->lock); + cacheRef = cache->ref; - status = map_backing_store(addressSpace, store, address, 0, size, addressSpec, wiring, - protection, REGION_NO_PRIVATE_MAP, &area, name); - - mutex_unlock(&cache->ref->lock); - + status = map_backing_store(addressSpace, cacheRef, address, 0, size, + addressSpec, wiring, protection, REGION_NO_PRIVATE_MAP, &area, name); if (status < B_OK) { - vm_cache_release_ref(cache->ref); + vm_cache_release_ref(cacheRef); goto err1; } - cacheRef = store->cache->ref; - switch (wiring) { case B_NO_LOCK: case B_LAZY_LOCK: @@ -967,6 +966,7 @@ uint32 addressSpec, addr_t size, uint32 protection, addr_t physicalAddress) { + vm_cache_ref *cacheRef; vm_area *area; vm_cache *cache; vm_store *store; @@ -1013,15 +1013,12 @@ cache->scan_skip = 1; cache->virtual_size = size; - mutex_lock(&cache->ref->lock); + cacheRef = cache->ref; - status = map_backing_store(addressSpace, store, _address, 0, size, + status = map_backing_store(addressSpace, cacheRef, _address, 0, size, addressSpec & ~B_MTR_MASK, 0, protection, REGION_NO_PRIVATE_MAP, &area, name); - - mutex_unlock(&cache->ref->lock); - if (status < B_OK) - vm_cache_release_ref(cache->ref); + vm_cache_release_ref(cacheRef); if (status >= B_OK && (addressSpec & B_MTR_MASK) != 0) { // set requested memory type @@ -1032,11 +1029,15 @@ } if (status >= B_OK) { + mutex_lock(&cacheRef->lock); + store = cacheRef->cache->store; + // make sure our area is mapped in completely // (even if that makes the fault routine pretty much useless) for (addr_t offset = 0; offset < size; offset += B_PAGE_SIZE) { store->ops->fault(store, addressSpace, offset); } + mutex_unlock(&cacheRef->lock); } vm_put_address_space(addressSpace); @@ -1060,16 +1061,16 @@ area_id -vm_create_null_area(team_id aid, const char *name, void **address, +vm_create_null_area(team_id team, const char *name, void **address, uint32 addressSpec, addr_t size) { vm_area *area; vm_cache *cache; - vm_cache_ref *cache_ref; + vm_cache_ref *cacheRef; vm_store *store; status_t status; - vm_address_space *addressSpace = vm_get_address_space_by_id(aid); + vm_address_space *addressSpace = vm_get_address_space_by_id(team); if (addressSpace == NULL) return B_BAD_TEAM_ID; @@ -1095,16 +1096,15 @@ cache->scan_skip = 1; cache->virtual_size = size; - mutex_lock(&cache->ref->lock); + cacheRef = cache->ref; - status = map_backing_store(addressSpace, store, address, 0, size, addressSpec, 0, + status = map_backing_store(addressSpace, cacheRef, address, 0, size, addressSpec, 0, B_KERNEL_READ_AREA, REGION_NO_PRIVATE_MAP, &area, name); - mutex_unlock(&cache->ref->lock); vm_put_address_space(addressSpace); if (status < B_OK) { - vm_cache_release_ref(cache->ref); + vm_cache_release_ref(cacheRef); return status; } @@ -1164,8 +1164,9 @@ */ static area_id -_vm_map_file(team_id aid, const char *name, void **_address, uint32 addressSpec, - size_t size, uint32 protection, uint32 mapping, const char *path, off_t offset, bool kernel) +_vm_map_file(team_id team, const char *name, void **_address, uint32 addressSpec, + size_t size, uint32 protection, uint32 mapping, const char *path, + off_t offset, bool kernel) { vm_cache_ref *cacheRef; vm_area *area; @@ -1179,7 +1180,7 @@ // make it into the mapped copy -- this will need quite some changes // to be done in a nice way - vm_address_space *addressSpace = vm_get_address_space_by_id(aid); + vm_address_space *addressSpace = vm_get_address_space_by_id(team); if (addressSpace == NULL) return B_BAD_TEAM_ID; @@ -1204,13 +1205,8 @@ if (status < B_OK) goto err1; - mutex_lock(&cacheRef->lock); - - status = map_backing_store(addressSpace, cacheRef->cache->store, _address, + status = map_backing_store(addressSpace, cacheRef, _address, offset, size, addressSpec, 0, protection, mapping, &area, name); - - mutex_unlock(&cacheRef->lock); - if (status < B_OK || mapping == REGION_PRIVATE_MAP) { // map_backing_store() cannot know we no longer need the ref vm_cache_release_ref(cacheRef); @@ -1302,13 +1298,9 @@ } else #endif { - mutex_lock(&sourceArea->cache_ref->lock); - - status = map_backing_store(addressSpace, sourceArea->cache_ref->cache->store, + status = map_backing_store(addressSpace, sourceArea->cache_ref, address, sourceArea->cache_offset, sourceArea->size, addressSpec, sourceArea->wiring, protection, mapping, &newArea, name); - - mutex_unlock(&sourceArea->cache_ref->lock); } if (status == B_OK && mapping != REGION_PRIVATE_MAP) { // If the mapping is REGION_PRIVATE_MAP, map_backing_store() needed @@ -1603,15 +1595,10 @@ // First, create a cache on top of the source area - mutex_lock(&cacheRef->lock); - - status = map_backing_store(addressSpace, cacheRef->cache->store, _address, + status = map_backing_store(addressSpace, cacheRef, _address, source->cache_offset, source->size, addressSpec, source->wiring, protection, writableCopy ? REGION_PRIVATE_MAP : REGION_NO_PRIVATE_MAP, &target, name); - - mutex_unlock(&cacheRef->lock); - if (status < B_OK) goto err; From axeld at mail.berlios.de Mon Jan 15 13:37:09 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 13:37:09 +0100 Subject: [Haiku-commits] r19807 - haiku/trunk/src/kits/network Message-ID: <200701151237.l0FCb9G1003506@sheep.berlios.de> Author: axeld Date: 2007-01-15 13:37:08 +0100 (Mon, 15 Jan 2007) New Revision: 19807 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19807&view=rev Modified: haiku/trunk/src/kits/network/socket.cpp Log: The R5 socket protocol constant conversion routine was broken - now, NetPositive is starting to work under Haiku. Modified: haiku/trunk/src/kits/network/socket.cpp =================================================================== --- haiku/trunk/src/kits/network/socket.cpp 2007-01-15 11:40:13 UTC (rev 19806) +++ haiku/trunk/src/kits/network/socket.cpp 2007-01-15 12:37:08 UTC (rev 19807) @@ -121,10 +121,10 @@ protocol = IPPROTO_UDP; break; case R5_IPPROTO_TCP: - protocol = R5_IPPROTO_TCP; + protocol = IPPROTO_TCP; break; case R5_IPPROTO_ICMP: - protocol = R5_IPPROTO_ICMP; + protocol = IPPROTO_ICMP; break; } } From axeld at mail.berlios.de Mon Jan 15 13:41:08 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 13:41:08 +0100 Subject: [Haiku-commits] r19808 - haiku/trunk/src/system/kernel Message-ID: <200701151241.l0FCf8p6003795@sheep.berlios.de> Author: axeld Date: 2007-01-15 13:41:08 +0100 (Mon, 15 Jan 2007) New Revision: 19808 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19808&view=rev Modified: haiku/trunk/src/system/kernel/thread.c Log: There was a race condition between removing the thread from the hash and putting its death entry into the parent team's queue - we need to do this atomically. As an effect, wait_for_thread() sometimes failed with B_BAD_THREAD_ID. Modified: haiku/trunk/src/system/kernel/thread.c =================================================================== --- haiku/trunk/src/system/kernel/thread.c 2007-01-15 12:37:08 UTC (rev 19807) +++ haiku/trunk/src/system/kernel/thread.c 2007-01-15 12:41:08 UTC (rev 19808) @@ -925,15 +925,12 @@ // boost our priority to get this over with thread->priority = thread->next_priority = B_URGENT_DISPLAY_PRIORITY; - // Stop debugging for this thread, and remove it from the hashtable, so it - // cannot be found afterwards anymore + // Stop debugging for this thread state = disable_interrupts(); GRAB_THREAD_LOCK(); debugInfo = thread->debug_info; clear_thread_debug_info(&thread->debug_info, true); - hash_remove(sThreadHash, thread); - sUsedThreads--; RELEASE_THREAD_LOCK(); restore_interrupts(state); @@ -987,6 +984,9 @@ // put the thread into the kernel team until it dies state = disable_interrupts(); GRAB_TEAM_LOCK(); + GRAB_THREAD_LOCK(); + // removing the thread and putting its death entry to the parent + // team needs to be an atomic operation // remember how long this thread lasted team->dead_threads_kernel_time += thread->kernel_time; @@ -997,6 +997,10 @@ cachedDeathSem = team->death_sem; + // remove thread from hash, so it's no longer accessible + hash_remove(sThreadHash, thread); + sUsedThreads--; + if (deleteTeam) { struct team *parent = team->parent; @@ -1013,6 +1017,8 @@ } else death = NULL; + RELEASE_THREAD_LOCK(); + // notify listeners that a new death entry is available // TODO: should that be moved to handle_signal() (for SIGCHLD)? release_sem_etc(parent->dead_children.sem, @@ -1022,16 +1028,30 @@ parent->dead_children.waiters = 0; team->group->dead_child_waiters = 0; - } + } else + RELEASE_THREAD_LOCK(); team_remove_team(team, &freeGroup); - } + } else + RELEASE_THREAD_LOCK(); + RELEASE_TEAM_LOCK(); + // swap address spaces, to make sure we're running on the kernel's pgdir vm_swap_address_space(vm_kernel_address_space()); restore_interrupts(state); TRACE(("thread_exit: thread 0x%lx now a kernel thread!\n", thread->id)); + } else { + // for kernel threads, we don't need to care about their death entries + state = disable_interrupts(); + GRAB_THREAD_LOCK(); + + hash_remove(sThreadHash, thread); + sUsedThreads--; + + RELEASE_THREAD_LOCK(); + restore_interrupts(state); } // delete the team if we're its main thread From axeld at mail.berlios.de Mon Jan 15 13:53:12 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 13:53:12 +0100 Subject: [Haiku-commits] r19809 - haiku/trunk/src/add-ons/kernel/network/protocols/tcp Message-ID: <200701151253.l0FCrC6u005240@sheep.berlios.de> Author: axeld Date: 2007-01-15 13:53:11 +0100 (Mon, 15 Jan 2007) New Revision: 19809 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19809&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/EndpointManager.cpp Log: "step" could be zero, in which case the loop would never end. Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/EndpointManager.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/EndpointManager.cpp 2007-01-15 12:41:08 UTC (rev 19808) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/EndpointManager.cpp 2007-01-15 12:53:11 UTC (rev 19809) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -272,7 +272,7 @@ for (int32 i = 1; i < 5; i++) { // try to retrieve a more or less random port uint32 counter = kFirstEphemeralPort; - uint32 step = i == 4 ? 1 : system_time() & 0x1f; + uint32 step = i == 4 ? 1 : (system_time() & 0x1f) + 1; while (counter < max) { uint16 port = counter & 0xffff; From axeld at mail.berlios.de Mon Jan 15 14:07:09 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 14:07:09 +0100 Subject: [Haiku-commits] r19810 - haiku/trunk/src/kits/network Message-ID: <200701151307.l0FD79P2007288@sheep.berlios.de> Author: axeld Date: 2007-01-15 14:07:09 +0100 (Mon, 15 Jan 2007) New Revision: 19810 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19810&view=rev Modified: haiku/trunk/src/kits/network/socket.cpp Log: accept() and bind() now accept NULL address parameters in the R5 compatibility mode. Modified: haiku/trunk/src/kits/network/socket.cpp =================================================================== --- haiku/trunk/src/kits/network/socket.cpp 2007-01-15 12:53:11 UTC (rev 19809) +++ haiku/trunk/src/kits/network/socket.cpp 2007-01-15 13:07:09 UTC (rev 19810) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ @@ -66,6 +66,9 @@ memset(to, 0, sizeof(*to)); to->sin_len = sizeof(*to); + if (from == NULL) + return; + if (from->sin_family == R5_AF_INET) to->sin_family = AF_INET; else @@ -82,6 +85,9 @@ const sockaddr_in *from = (sockaddr_in *)_from; r5_sockaddr_in *to = (r5_sockaddr_in *)_to; + if (to == NULL) + return; + memset(to, 0, sizeof(*to)); if (from->sin_family == AF_INET) to->sin_family = R5_AF_INET; @@ -259,7 +265,7 @@ args.cookie = cookie; - if (r5compatible) { + if (r5compatible && address != NULL) { args.address = &r5addr; args.address_length = sizeof(r5addr); } else { @@ -272,7 +278,7 @@ return -1; } - if (r5compatible) { + if (r5compatible && address != NULL) { convert_to_r5_sockaddr(address, &r5addr); if (_addressLength != NULL) *_addressLength = sizeof(struct r5_sockaddr_in); From axeld at mail.berlios.de Mon Jan 15 15:22:32 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 15:22:32 +0100 Subject: [Haiku-commits] r19811 - haiku/trunk/src/add-ons/kernel/network/protocols/ipv4 Message-ID: <200701151422.l0FEMW3Y014546@sheep.berlios.de> Author: axeld Date: 2007-01-15 15:22:31 +0100 (Mon, 15 Jan 2007) New Revision: 19811 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19811&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp Log: The IPv4 protocol now stores all domain receiving protocols, and only put them away on uninit. This should speed up packet retrieval a lot. Modified: haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp 2007-01-15 13:07:09 UTC (rev 19810) +++ haiku/trunk/src/add-ons/kernel/network/protocols/ipv4/ipv4.cpp 2007-01-15 14:22:31 UTC (rev 19811) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -148,6 +148,8 @@ static benaphore sRawSocketsLock; static benaphore sFragmentLock; static hash_table *sFragmentHash; +static net_protocol_module_info *sReceivingProtocol[256]; +static benaphore sReceivingProtocolLock; RawSocket::RawSocket(net_socket *socket) @@ -661,6 +663,26 @@ } +static net_protocol_module_info * +receiving_protocol(uint8 protocol) +{ + net_protocol_module_info *module = sReceivingProtocol[protocol]; + if (module != NULL) + return module; + + BenaphoreLocker locker(sReceivingProtocolLock); + + module = sReceivingProtocol[protocol]; + if (module != NULL) + return module; + + if (sStackModule->get_domain_receiving_protocol(sDomain, protocol, &module) == B_OK) + sReceivingProtocol[protocol] = module; + + return module; +} + + // #pragma mark - @@ -1126,19 +1148,13 @@ // the header is of variable size and may include IP options // (that we ignore for now) - // TODO: since we'll doing this for every packet, we may want to cache the module - // (and only put them when we're about to be unloaded) - net_protocol_module_info *module; - status = sStackModule->get_domain_receiving_protocol(sDomain, protocol, &module); - if (status < B_OK) { + net_protocol_module_info *module = receiving_protocol(protocol); + if (module == NULL) { // no handler for this packet - return status; + return EAFNOSUPPORT; } - status = module->receive_data(buffer); - sStackModule->put_domain_receiving_protocol(sDomain, protocol); - - return status; + return module->receive_data(buffer); } @@ -1183,10 +1199,14 @@ if (status < B_OK) goto err4; + status = benaphore_init(&sReceivingProtocolLock, "IPv4 receiving protocols"); + if (status < B_OK) + goto err5; + sFragmentHash = hash_init(MAX_HASH_FRAGMENTS, FragmentPacket::NextOffset(), &FragmentPacket::Compare, &FragmentPacket::Hash); if (sFragmentHash == NULL) - goto err5; + goto err6; new (&sRawSockets) RawSocketList; // static initializers do not work in the kernel, @@ -1196,17 +1216,19 @@ status = sStackModule->register_domain_protocols(AF_INET, SOCK_RAW, 0, "network/protocols/ipv4/v1", NULL); if (status < B_OK) - goto err6; + goto err7; status = sStackModule->register_domain(AF_INET, "internet", &gIPv4Module, &gIPv4AddressModule, &sDomain); if (status < B_OK) - goto err6; + goto err7; return B_OK; +err7: + hash_uninit(sFragmentHash); err6: - hash_uninit(sFragmentHash); + benaphore_destroy(&sReceivingProtocolLock); err5: benaphore_destroy(&sFragmentLock); err4: @@ -1224,12 +1246,23 @@ status_t uninit_ipv4() { + benaphore_lock(&sReceivingProtocolLock); + + // put all the domain receiving protocols we gathered so far + for (uint32 i = 0; i < 256; i++) { + if (sReceivingProtocol[i] != NULL) + sStackModule->put_domain_receiving_protocol(sDomain, i); + } + + sStackModule->unregister_domain(sDomain); + benaphore_unlock(&sReceivingProtocolLock); + hash_uninit(sFragmentHash); benaphore_destroy(&sFragmentLock); benaphore_destroy(&sRawSocketsLock); + benaphore_destroy(&sReceivingProtocolLock); - sStackModule->unregister_domain(sDomain); put_module(NET_DATALINK_MODULE_NAME); put_module(NET_BUFFER_MODULE_NAME); put_module(NET_STACK_MODULE_NAME); From axeld at mail.berlios.de Mon Jan 15 16:14:03 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 16:14:03 +0100 Subject: [Haiku-commits] r19812 - haiku/trunk/src/add-ons/kernel/network/protocols/icmp Message-ID: <200701151514.l0FFE3oc019128@sheep.berlios.de> Author: axeld Date: 2007-01-15 16:14:02 +0100 (Mon, 15 Jan 2007) New Revision: 19812 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19812&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/icmp/icmp.cpp Log: Calmed down ICMP protocol module as well. Modified: haiku/trunk/src/add-ons/kernel/network/protocols/icmp/icmp.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/icmp/icmp.cpp 2007-01-15 14:22:31 UTC (rev 19811) +++ haiku/trunk/src/add-ons/kernel/network/protocols/icmp/icmp.cpp 2007-01-15 15:14:02 UTC (rev 19812) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -20,7 +20,14 @@ #include #include +//#define TRACE_ICMP +#ifdef TRACE_ICMP +# define TRACE(x) dprintf x +#else +# define TRACE(x) ; +#endif + struct icmp_header { uint8 type; uint8 code; @@ -202,7 +209,7 @@ status_t icmp_receive_data(net_buffer *buffer) { - dprintf("ICMP received some data, buffer length %lu\n", buffer->size); + TRACE(("ICMP received some data, buffer length %lu\n", buffer->size)); NetBufferHeader bufferHeader(buffer); if (bufferHeader.Status() < B_OK) @@ -212,9 +219,10 @@ bufferHeader.Detach(); // the pointer stays valid after this - dprintf(" got type %u, code %u, checksum %u\n", header.type, header.code, - ntohs(header.checksum)); - dprintf(" computed checksum: %ld\n", gBufferModule->checksum(buffer, 0, buffer->size, true)); + TRACE((" got type %u, code %u, checksum %u\n", header.type, header.code, + ntohs(header.checksum))); + TRACE((" computed checksum: %ld\n", gBufferModule->checksum(buffer, 0, buffer->size, true))); + if (gBufferModule->checksum(buffer, 0, buffer->size, true) != 0) return B_BAD_DATA; From axeld at mail.berlios.de Mon Jan 15 17:10:14 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 17:10:14 +0100 Subject: [Haiku-commits] r19813 - haiku/trunk/src/add-ons/kernel/network/protocols/tcp Message-ID: <200701151610.l0FGAExk027052@sheep.berlios.de> Author: axeld Date: 2007-01-15 17:10:13 +0100 (Mon, 15 Jan 2007) New Revision: 19813 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19813&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp Log: fReceiveNext was not maintained correctly in case of out of order packets. Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp 2007-01-15 15:14:02 UTC (rev 19812) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/TCPEndpoint.cpp 2007-01-15 16:10:13 UTC (rev 19813) @@ -964,10 +964,9 @@ // put it in the receive buffer if (buffer->size > 0) { - if (fReceiveNext == segment.sequence) - fReceiveNext += buffer->size; -TRACE(("adding data, receive next = %lu!\n", (uint32)fReceiveNext)); fReceiveQueue.Add(buffer, segment.sequence); + fReceiveNext = fReceiveQueue.NextSequence(); +TRACE(("adding data, receive next = %lu!\n", (uint32)fReceiveNext)); release_sem_etc(fReceiveLock, 1, B_DO_NOT_RESCHEDULE); // TODO: real conditional locking needed! From axeld at mail.berlios.de Mon Jan 15 17:16:10 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 17:16:10 +0100 Subject: [Haiku-commits] r19814 - haiku/trunk/data/system/boot Message-ID: <200701151616.l0FGGAPO027608@sheep.berlios.de> Author: axeld Date: 2007-01-15 17:16:10 +0100 (Mon, 15 Jan 2007) New Revision: 19814 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19814&view=rev Modified: haiku/trunk/data/system/boot/Bootscript Log: The networking server is now launched at system startup. Modified: haiku/trunk/data/system/boot/Bootscript =================================================================== --- haiku/trunk/data/system/boot/Bootscript 2007-01-15 16:10:13 UTC (rev 19813) +++ haiku/trunk/data/system/boot/Bootscript 2007-01-15 16:16:10 UTC (rev 19814) @@ -62,11 +62,6 @@ # Sets timezone etc. runprog beos/bin/clockconfig -# Init Network -if [ "$SAFEMODE" != "yes" ]; then - launchscript $SCRIPTS/Netscript -fi - # Launch servers # We must wait for the app_server and registrar to be ready @@ -74,7 +69,12 @@ launch $SERVERS/debug_server # launch debug_server +# Init Network if [ "$SAFEMODE" != "yes" ]; then + launch $SERVERS/net_server # launch net_server +fi + +if [ "$SAFEMODE" != "yes" ]; then launch $SERVERS/app_server picasso # launch app_server else launch $SERVERS/fake_app_server picasso From axeld at mail.berlios.de Mon Jan 15 17:17:08 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 17:17:08 +0100 Subject: [Haiku-commits] r19815 - haiku/trunk/src/add-ons/kernel/drivers/network/stack Message-ID: <200701151617.l0FGH8oW027699@sheep.berlios.de> Author: axeld Date: 2007-01-15 17:17:08 +0100 (Mon, 15 Jan 2007) New Revision: 19815 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19815&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/network/stack/kernel_stack.cpp Log: * Fixed compilation with debug output turned on. * Added FIONBIO ioctl() in debug output. Modified: haiku/trunk/src/add-ons/kernel/drivers/network/stack/kernel_stack.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/network/stack/kernel_stack.cpp 2007-01-15 16:16:10 UTC (rev 19814) +++ haiku/trunk/src/add-ons/kernel/drivers/network/stack/kernel_stack.cpp 2007-01-15 16:17:08 UTC (rev 19815) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. * This file may be used under the terms of the MIT License. */ @@ -126,9 +126,6 @@ C2N(NET_STACK_SETSOCKOPT), C2N(NET_STACK_GETSOCKNAME), C2N(NET_STACK_GETPEERNAME), - C2N(NET_STACK_SYSCTL), - C2N(NET_STACK_SELECT), - C2N(NET_STACK_DESELECT), C2N(NET_STACK_GET_COOKIE), C2N(NET_STACK_NOTIFY_SOCKET_EVENT), C2N(NET_STACK_CONTROL_NET_MODULE), @@ -139,6 +136,7 @@ // C2N(NET_STACK_NEW_CONNECTION), // Standard BeOS opcodes + C2N(FIONBIO), C2N(B_SET_BLOCKING_IO), C2N(B_SET_NONBLOCKING_IO), From axeld at mail.berlios.de Mon Jan 15 17:51:27 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 17:51:27 +0100 Subject: [Haiku-commits] r19816 - haiku/trunk/src/servers/net Message-ID: <200701151651.l0FGpR0j031121@sheep.berlios.de> Author: axeld Date: 2007-01-15 17:51:27 +0100 (Mon, 15 Jan 2007) New Revision: 19816 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19816&view=rev Modified: haiku/trunk/src/servers/net/Jamfile haiku/trunk/src/servers/net/NetServer.cpp Log: The net_server is now a BServer instead of a BApplication, IOW it doesn't rely on the app_server being started anymore. Modified: haiku/trunk/src/servers/net/Jamfile =================================================================== --- haiku/trunk/src/servers/net/Jamfile 2007-01-15 16:17:08 UTC (rev 19815) +++ haiku/trunk/src/servers/net/Jamfile 2007-01-15 16:51:27 UTC (rev 19816) @@ -1,6 +1,6 @@ SubDir HAIKU_TOP src servers net ; -UsePrivateHeaders net ; +UsePrivateHeaders app net ; #UseHeaders [ FDirName $(HAIKU_TOP) src add-ons kernel network ppp shared libppp headers ] ; #UseHeaders [ FDirName $(HAIKU_TOP) src add-ons kernel network ppp shared libkernelppp headers ] ; @@ -14,13 +14,8 @@ AutoconfigLooper.cpp DHCPClient.cpp Services.cpp -; -LinkAgainst net_server : - be - libnetwork.so - $(TARGET_LIBSTDC++) - + : be libnetwork.so $(TARGET_LIBSTDC++) # for PPP #libppp.a ; Modified: haiku/trunk/src/servers/net/NetServer.cpp =================================================================== --- haiku/trunk/src/servers/net/NetServer.cpp 2007-01-15 16:17:08 UTC (rev 19815) +++ haiku/trunk/src/servers/net/NetServer.cpp 2007-01-15 16:51:27 UTC (rev 19816) @@ -13,11 +13,11 @@ #include "Settings.h" #include -#include #include #include #include #include +#include #include #include @@ -39,9 +39,9 @@ typedef std::map LooperMap; -class NetServer : public BApplication { +class NetServer : public BServer { public: - NetServer(); + NetServer(status_t& status); virtual void AboutRequested(); virtual void ReadyToRun(); @@ -235,8 +235,8 @@ // #pragma mark - -NetServer::NetServer() - : BApplication("application/x-vnd.haiku-net_server") +NetServer::NetServer(status_t& error) + : BServer("application/x-vnd.haiku-net_server", false, &error) { } @@ -883,9 +883,15 @@ int main() { - NetServer app; - app.Run(); + status_t status; + NetServer server(status); + if (status != B_OK) { + fprintf(stderr, "net_server: Failed to create application: %s\n", + strerror(status)); + return 1; + } + server.Run(); return 0; } From axeld at mail.berlios.de Mon Jan 15 19:00:40 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 19:00:40 +0100 Subject: [Haiku-commits] r19817 - haiku/trunk/src/add-ons/kernel/network/protocols/tcp Message-ID: <200701151800.l0FI0eRN020958@sheep.berlios.de> Author: axeld Date: 2007-01-15 19:00:39 +0100 (Mon, 15 Jan 2007) New Revision: 19817 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19817&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/BufferQueue.cpp Log: * Add() did not add fNumBytes in case of an out of order packet, causing all kinds of hickups on TCP connections. * Added a bit more of debug output to Add(). Modified: haiku/trunk/src/add-ons/kernel/network/protocols/tcp/BufferQueue.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/protocols/tcp/BufferQueue.cpp 2007-01-15 16:51:27 UTC (rev 19816) +++ haiku/trunk/src/add-ons/kernel/network/protocols/tcp/BufferQueue.cpp 2007-01-15 18:00:39 UTC (rev 19817) @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -71,6 +71,7 @@ { TRACE(("BufferQueue@%p::Add(buffer %p, size %lu, sequence %lu)\n", this, buffer, buffer->size, (uint32)sequence)); + TRACE((" in: first: %lu, last: %lu, num: %lu, cont: %lu\n", (uint32)fFirstSequence, (uint32)fLastSequence, fNumBytes, fContiguousBytes)); buffer->sequence = sequence; @@ -85,6 +86,7 @@ fLastSequence = sequence + buffer->size; fNumBytes += buffer->size; + TRACE((" out0: first: %lu, last: %lu, num: %lu, cont: %lu\n", (uint32)fFirstSequence, (uint32)fLastSequence, fNumBytes, fContiguousBytes)); return; } @@ -141,10 +143,13 @@ gBufferModule->remove_trailer(buffer, next->sequence - (sequence + buffer->size)); } - if (buffer == NULL) + if (buffer == NULL) { + TRACE((" out1: first: %lu, last: %lu, num: %lu, cont: %lu\n", (uint32)fFirstSequence, (uint32)fLastSequence, fNumBytes, fContiguousBytes)); return; + } fList.Insert(next, buffer); + fNumBytes += buffer->size; // we might need to update the number of bytes available @@ -160,6 +165,8 @@ buffer = (struct net_buffer *)buffer->link.next; } while (buffer != NULL && fFirstSequence + fContiguousBytes == buffer->sequence); } + + TRACE((" out2: first: %lu, last: %lu, num: %lu, cont: %lu\n", (uint32)fFirstSequence, (uint32)fLastSequence, fNumBytes, fContiguousBytes)); } From axeld at mail.berlios.de Mon Jan 15 21:48:33 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 21:48:33 +0100 Subject: [Haiku-commits] r19818 - haiku/trunk/src/bin Message-ID: <200701152048.l0FKmXhF000268@sheep.berlios.de> Author: axeld Date: 2007-01-15 21:48:32 +0100 (Mon, 15 Jan 2007) New Revision: 19818 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19818&view=rev Modified: haiku/trunk/src/bin/version.cpp Log: Applied patch by Vasilis Kaotsis, and added him as an author (because you don't really recognize the original anymore :-)). Modified: haiku/trunk/src/bin/version.cpp =================================================================== --- haiku/trunk/src/bin/version.cpp 2007-01-15 18:00:39 UTC (rev 19817) +++ haiku/trunk/src/bin/version.cpp 2007-01-15 20:48:32 UTC (rev 19818) @@ -1,94 +1,116 @@ -// Author: Ryan Fleet -// Created: 9th October 2002 -// Modified: 14th October 2002 +/* + * Copyright 2002-2007, Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Ryan Fleet + * Vasilis Kaoutsis + */ -#include -#include + +#include #include +#include +#include -void help(void) + +void +usage() { - printf("usage: version [OPTION] FILENAME [FILENAME2, ...]\n"); - printf("Returns the version of a file.\n\n"); - printf(" -h, --help this usage message\n"); - printf(" -l, --long print long version information of FILENAME\n"); - printf(" -n, --numerical print in numerical mode\n"); - printf(" (Major miDdle miNor Variety Internal)\n"); - printf(" -s, --system print system version instead of app version\n"); - printf(" --version print version information for this command\n"); + printf("usage: version [OPTION] FILENAME [FILENAME2, ...]\n" + "Returns the version of a file.\n\n" + " -h, --help this usage message\n" + " -l, --long print long version information of FILENAME\n" + " -n, --numerical print in numerical mode\n" + " (Major miDdle miNor Variety Internal)\n" + " -s, --system print system version instead of app version\n" + " --version print version information for this command\n"); } -int getversion(const char *filename, version_kind kind, bool bLongFlag, bool bNumericalFlag) +status_t +get_version(const char *filename, version_kind kind, bool longFlag, bool numericalFlag) { BFile file(filename, O_RDONLY); - if(file.InitCheck() != B_OK) - { + if (file.InitCheck() != B_OK) { printf("Couldn't get file info!\n"); - return 1; + return B_FILE_ERROR; } - + BAppFileInfo info(&file); - if(info.InitCheck() != B_OK) - { + if (info.InitCheck() != B_OK) { printf("Couldn't get file info!\n"); - return 1; + return B_FILE_ERROR; } - + version_info version; - if(info.GetVersionInfo(&version, kind) != B_OK) - { + if (info.GetVersionInfo(&version, kind) != B_OK) { printf("Version unknown!\n"); - return 1; + return B_ERROR; } - - if(true == bLongFlag) - { + + if (longFlag) { printf("%s\n", version.long_info); - return 0; + return B_OK; } - - if(true == bNumericalFlag) - { + + if (numericalFlag) { printf("%lu ", version.major); printf("%lu ", version.middle); printf("%lu ", version.minor); - switch(version.variety) - { - case 0: printf("d "); break; - case 1: printf("a "); break; - case 2: printf("b "); break; - case 3: printf("g "); break; - case 4: printf("gm "); break; - case 5: printf("f "); break; - }; + + switch (version.variety) { + case B_DEVELOPMENT_VERSION: + printf("d "); + break; + + case B_ALPHA_VERSION: + printf("a "); + break; + + case B_BETA_VERSION: + printf("b "); + break; + + case B_GAMMA_VERSION: + printf("g "); + break; + + case B_GOLDEN_MASTER_VERSION: + printf("gm "); + break; + + case B_FINAL_VERSION: + printf("f "); + break; + } + printf("%lu\n", version.internal); - return 0; + return B_OK; } - + printf("%s\n", version.short_info); - - return 0; + return B_OK; } -/* - strLessEqual(string1, string2) - determines whether string1 contains at least one or more of the characters - of string2 but none of which string2 doesn't contain. - +/*! + determines whether \a string1 contains at least one or more of the characters + of \a string2 but none of which \a string2 doesn't contain. + + examples: true == ("hel" == "help"); true == ("help" == "help"); true == ("h" == "help"); false == ("held" == "help"); false == ("helped" == "help"); */ -bool strLessEqual(const char *str1, const char *str2) +bool +str_less_equal(const char *str1, const char *str2) { char *ptr1 = const_cast(str1); char *ptr2 = const_cast(str2); - - while(*ptr1 != '\0') - { - if(*ptr1 != *ptr2) + + while (*ptr1 != '\0') { + if (*ptr1 != *ptr2) return false; ++ptr1; ++ptr2; @@ -97,105 +119,89 @@ } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { + BApplication app("application/x.vnd.Haiku-version"); version_kind kind = B_APP_VERSION_KIND; - bool bLongFlag = false; - bool bNumericalFlag = false; + bool longFlag = false; + bool numericalFlag = false; int i; - - if(argc < 2) + + if (argc < 2) { + usage(); return 0; + } - for(i = 1; i < argc; ++i) - { - if(strncmp(argv[i], "-", 1) == 0) - { + for (i = 1; i < argc; ++i) { + if (argv[i][0] == '-') { char *ptr = argv[i]; ++ptr; - - if(*ptr == '-') - { - bool lequal = false; + + if (*ptr == '-') { + bool lessEqual = false; ++ptr; - - if(*ptr == 'h') - { - lequal = strLessEqual(ptr, "help"); - if(lequal == true) - { - help(); + + if (*ptr == 'h') { + lessEqual = str_less_equal(ptr, "help"); + if (lessEqual) { + usage(); return 0; } - } - - else if(*ptr == 'l') - { - lequal = strLessEqual(ptr, "long"); - if(lequal == true) - bLongFlag = true; - } - - else if(*ptr == 'n') - { - lequal = strLessEqual(ptr, "numerical"); - if(lequal == true) - bNumericalFlag = true; - } - - else if(*ptr == 's') - { - lequal = strLessEqual(ptr, "system"); - if(lequal == true) + } else if (*ptr == 'l') { + lessEqual = str_less_equal(ptr, "long"); + if (lessEqual) + longFlag = true; + } else if (*ptr == 'n') { + lessEqual = str_less_equal(ptr, "numerical"); + if (lessEqual) + numericalFlag = true; + } else if (*ptr == 's') { + lessEqual = str_less_equal(ptr, "system"); + if (lessEqual) kind = B_SYSTEM_VERSION_KIND; - } - - else if(*ptr == 'v') - { - lequal = strLessEqual(ptr, "version"); - if(lequal == true) - { - getversion(argv[0], B_APP_VERSION_KIND, false, false); + } else if (*ptr == 'v') { + lessEqual = str_less_equal(ptr, "version"); + if (lessEqual) { + get_version(argv[0], B_APP_VERSION_KIND, false, false); return 0; } } - - if(lequal == false) + + if (!lessEqual) printf("%s unrecognized option `%s'\n", argv[0], argv[i]); - } - - else while(*ptr != '\0') - { - if(*ptr == 'h') - { - help(); - return 0; + } else { + while (*ptr != '\0') { + if (*ptr == 'h') { + usage(); + return 0; + } else if (*ptr == 's') + kind = B_SYSTEM_VERSION_KIND; + else if (*ptr == 'l') + longFlag = true; + else if (*ptr == 'n') + numericalFlag = true; + else { + printf("%s: invalid option -- %c\n", argv[0], *ptr); + return 1; + } + + if (argc < 3) { + printf("%s: missing FILENAME(S) \n", argv[0]); + return 1; + } + + ++ptr; } - else if(*ptr == 's') - kind = B_SYSTEM_VERSION_KIND; - else if(*ptr == 'l') - bLongFlag = true; - else if(*ptr == 'n') - bNumericalFlag = true; - else - printf("%s: invalid option -- %c\n", argv[0], *ptr); - - ++ptr; } } } - - int status = 0; - int retval = 0; - for(i = 1; i < argc; ++i) - { - if(strncmp(argv[i], "-", 1) != 0) - { - status = getversion(argv[i], kind, bLongFlag, bNumericalFlag); - if(status != 0) - retval = 1; - } + + for (i = 1; i < argc; ++i) { + if (argv[i][0] != '-' + && get_version(argv[i], kind, longFlag, numericalFlag) != B_OK) + return 1; } - return retval; + return 0; } From axeld at mail.berlios.de Mon Jan 15 21:52:55 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 15 Jan 2007 21:52:55 +0100 Subject: [Haiku-commits] r19819 - haiku/trunk/src/apps/abouthaiku Message-ID: <200701152052.l0FKqtJW000691@sheep.berlios.de> Author: axeld Date: 2007-01-15 21:52:55 +0100 (Mon, 15 Jan 2007) New Revision: 19819 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19819&view=rev Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp Log: Added Vasilis Kaoutsis to the list of contributors. Modified: haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp =================================================================== --- haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp 2007-01-15 20:48:32 UTC (rev 19818) +++ haiku/trunk/src/apps/abouthaiku/AboutHaiku.cpp 2007-01-15 20:52:55 UTC (rev 19819) @@ -379,6 +379,7 @@ "Matthijs Hollemans\n" "Erik Jaesler\n" "Carwyn Jones\n" + "Vasilis Kaoutsis\n" "Marcin Konicki\n" "Elad Lahav\n" "Santiago Lema\n" From mmlr at mail.berlios.de Mon Jan 15 23:16:10 2007 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Mon, 15 Jan 2007 23:16:10 +0100 Subject: [Haiku-commits] r19820 - haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid Message-ID: <200701152216.l0FMGAXu008733@sheep.berlios.de> Author: mmlr Date: 2007-01-15 23:16:10 +0100 (Mon, 15 Jan 2007) New Revision: 19820 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19820&view=rev Modified: haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/hid.c Log: * Properly initialize the whole mouse_movement structure to 0 instead of only some fields This fixes the random horizontal scrolling that happened with one-wheeled USB mice like mine or Marcus'. Modified: haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/hid.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/hid.c 2007-01-15 20:52:55 UTC (rev 19819) +++ haiku/trunk/src/add-ons/kernel/drivers/input/usb_hid/hid.c 2007-01-15 22:16:10 UTC (rev 19820) @@ -535,9 +535,8 @@ mouse_movement info; uint8 *report = (uint8*)device->buffer; uint32 i; - - info.buttons = 0; - info.clicks = 0; + + memset(&info, 0, sizeof(info)); for (i = 0; i < device->num_insns; i++) { const report_insn *insn = &device->insns [i]; int32 value = @@ -568,9 +567,7 @@ } } - info.modifiers = 0; info.timestamp = device->timestamp; - ring_buffer_write(device->rbuf, (const uint8*)&info, sizeof(info)); release_sem_etc(device->sem_cb, 1, B_DO_NOT_RESCHEDULE); } From axeld at mail.berlios.de Tue Jan 16 01:17:52 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 16 Jan 2007 01:17:52 +0100 Subject: [Haiku-commits] r19821 - haiku/trunk/src/add-ons/kernel/bus_managers/usb Message-ID: <200701160017.l0G0Hq33026172@sheep.berlios.de> Author: axeld Date: 2007-01-16 01:17:52 +0100 (Tue, 16 Jan 2007) New Revision: 19821 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19821&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/BeOSCompatibility.h Log: Fixed build under Dano/Zeta. Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/BeOSCompatibility.h =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/BeOSCompatibility.h 2007-01-15 22:16:10 UTC (rev 19820) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/BeOSCompatibility.h 2007-01-16 00:17:52 UTC (rev 19821) @@ -10,7 +10,7 @@ #define IS_USER_ADDRESS(x) (((uint32)x & 0x80000000) > 0) #define IS_KERNEL_ADDRESS(x) (((uint32)x & 0x80000000) == 0) -#ifndef B_DEV_INVALID_PIPE +#ifdef HAIKU_TARGET_PLATFORM_BEOS enum { B_DEV_INVALID_PIPE = B_DEV_DOOR_OPEN + 1, B_DEV_CRC_ERROR, From axeld at mail.berlios.de Tue Jan 16 01:28:47 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 16 Jan 2007 01:28:47 +0100 Subject: [Haiku-commits] r19822 - haiku/trunk/src/add-ons/kernel/bus_managers/usb Message-ID: <200701160028.l0G0SlmO027205@sheep.berlios.de> Author: axeld Date: 2007-01-16 01:28:46 +0100 (Tue, 16 Jan 2007) New Revision: 19822 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19822&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/BeOSCompatibility.h Log: Fixed build under BONE again... Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/BeOSCompatibility.h =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/BeOSCompatibility.h 2007-01-16 00:17:52 UTC (rev 19821) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/BeOSCompatibility.h 2007-01-16 00:28:46 UTC (rev 19822) @@ -10,7 +10,7 @@ #define IS_USER_ADDRESS(x) (((uint32)x & 0x80000000) > 0) #define IS_KERNEL_ADDRESS(x) (((uint32)x & 0x80000000) == 0) -#ifdef HAIKU_TARGET_PLATFORM_BEOS +#ifndef HAIKU_TARGET_PLATFORM_DANO enum { B_DEV_INVALID_PIPE = B_DEV_DOOR_OPEN + 1, B_DEV_CRC_ERROR, From jackburton at mail.berlios.de Tue Jan 16 09:36:35 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Tue, 16 Jan 2007 09:36:35 +0100 Subject: [Haiku-commits] r19823 - haiku/trunk/src/kits/interface Message-ID: <200701160836.l0G8aZ0u030895@sheep.berlios.de> Author: jackburton Date: 2007-01-16 09:36:35 +0100 (Tue, 16 Jan 2007) New Revision: 19823 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19823&view=rev Modified: haiku/trunk/src/kits/interface/ColumnListView.cpp Log: Actually use B_COLOR_SELECTION_TEXT when drawing. Patch by Andrea Anzani Modified: haiku/trunk/src/kits/interface/ColumnListView.cpp =================================================================== --- haiku/trunk/src/kits/interface/ColumnListView.cpp 2007-01-16 00:28:46 UTC (rev 19822) +++ haiku/trunk/src/kits/interface/ColumnListView.cpp 2007-01-16 08:36:35 UTC (rev 19823) @@ -2603,7 +2603,7 @@ fDrawBufferView->ConstrainClippingRegion(&clipRegion); fDrawBufferView->PushState(); #endif - fDrawBufferView->SetHighColor(fMasterView->Color(B_COLOR_TEXT)); + fDrawBufferView->SetHighColor(fMasterView->Color(row->fNextSelected ? B_COLOR_SELECTION_TEXT : B_COLOR_TEXT)); float baseline = floor(fieldRect.top + fh.ascent + (fieldRect.Height()+1-(fh.ascent+fh.descent))/2); fDrawBufferView->MovePenTo(fieldRect.left + 8, baseline); @@ -2616,7 +2616,7 @@ if (fFocusRow == row) { if(!fEditMode) { - fDrawBufferView->SetHighColor(0, 0, 0); + SetHighColor(fMasterView->Color(B_COLOR_SELECTION_TEXT)); fDrawBufferView->StrokeRect(BRect(-1, sourceRect.top, 10000.0, sourceRect.bottom - 1)); } } @@ -2657,7 +2657,7 @@ ConstrainClippingRegion(&clipRegion); PushState(); #endif - SetHighColor(fColorList[B_TEXT_COLOR]); + SetHighColor(fColorList[row->fNextSelected ? B_COLOR_SELECTION_TEXT : B_COLOR_TEXT]); float baseline = floor(destRect.top + fh.ascent + (destRect.Height()+1-(fh.ascent+fh.descent))/2); MovePenTo(destRect.left + 8, baseline); @@ -2670,7 +2670,7 @@ if (fFocusRow == row) { if(!fEditMode) { - SetHighColor(0, 0, 0); + SetHighColor(fColorList[B_COLOR_SELECTION_TEXT]); StrokeRect(BRect(0, destRect.top, 10000.0, destRect.bottom - 1)); } } @@ -2812,7 +2812,7 @@ ConstrainClippingRegion(&clipRegion); PushState(); #endif - SetHighColor(fMasterView->Color(B_COLOR_TEXT)); + SetHighColor(fMasterView->Color(row->fNextSelected ? B_COLOR_SELECTION_TEXT : B_COLOR_TEXT)); float baseline = floor(destRect.top + fh.ascent + (destRect.Height()+1-(fh.ascent+fh.descent))/2); MovePenTo(destRect.left + 8, baseline); @@ -2849,7 +2849,7 @@ if (fFocusRow == row && fMasterView->IsFocus() && Window()->IsActive()) { if(!fEditMode) { - SetHighColor(0, 0, 0); + SetHighColor(fMasterView->Color(B_COLOR_SELECTION_TEXT)); StrokeRect(BRect(0, line, 10000.0, line + rowHeight - 1)); } } From jackburton at mail.berlios.de Tue Jan 16 10:04:14 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Tue, 16 Jan 2007 10:04:14 +0100 Subject: [Haiku-commits] r19824 - haiku/trunk/src/kits/interface Message-ID: <200701160904.l0G94ElD001085@sheep.berlios.de> Author: jackburton Date: 2007-01-16 10:04:14 +0100 (Tue, 16 Jan 2007) New Revision: 19824 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19824&view=rev Modified: haiku/trunk/src/kits/interface/TextView.cpp Log: use Invalidate() and UpdateIfNeeded() in BTextView::SetTextRect(). Fixes bug #571 Modified: haiku/trunk/src/kits/interface/TextView.cpp =================================================================== --- haiku/trunk/src/kits/interface/TextView.cpp 2007-01-16 08:36:35 UTC (rev 19823) +++ haiku/trunk/src/kits/interface/TextView.cpp 2007-01-16 09:04:14 UTC (rev 19824) @@ -2025,8 +2025,10 @@ fTextRect = rect; - if (Window() != NULL) - Refresh(0, fText->Length(), true, false); + if (Window() != NULL) { + Invalidate(); + Window()->UpdateIfNeeded(); + } } From axeld at mail.berlios.de Tue Jan 16 15:33:23 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 16 Jan 2007 15:33:23 +0100 Subject: [Haiku-commits] r19825 - haiku/trunk/src/add-ons/kernel/file_systems/bfs Message-ID: <200701161433.l0GEXN5E009633@sheep.berlios.de> Author: axeld Date: 2007-01-16 15:33:23 +0100 (Tue, 16 Jan 2007) New Revision: 19825 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19825&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp Log: Inode::WriteAttribute() did not adopt a changed "type" when the attribute was a file, causing subsequent reads with that type to fail. Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2007-01-16 09:04:14 UTC (rev 19824) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.cpp 2007-01-16 14:33:23 UTC (rev 19825) @@ -1,10 +1,11 @@ -/* Inode - inode access functions - * - * Copyright 2001-2006, Axel D?rfler, axeld at pinc-software.de. +/* + * Copyright 2001-2007, Axel D?rfler, axeld at pinc-software.de. * This file may be used under the terms of the MIT License. */ +//! inode access functions + #include "Debug.h" #include "Inode.h" #include "BPlusTree.h" @@ -321,7 +322,7 @@ } -// #pragma mark - +// #pragma mark - attributes void @@ -753,7 +754,8 @@ */ status_t -Inode::ReadAttribute(const char *name, int32 type, off_t pos, uint8 *buffer, size_t *_length) +Inode::ReadAttribute(const char *name, int32 type, off_t pos, uint8 *buffer, + size_t *_length) { if (pos < 0) pos = 0; @@ -802,8 +804,8 @@ */ status_t -Inode::WriteAttribute(Transaction &transaction, const char *name, int32 type, off_t pos, - const uint8 *buffer, size_t *_length) +Inode::WriteAttribute(Transaction &transaction, const char *name, int32 type, + off_t pos, const uint8 *buffer, size_t *_length) { // needed to maintain the index uint8 oldBuffer[BPLUSTREE_MAX_KEY_LENGTH], *oldData = NULL; @@ -855,6 +857,11 @@ } // ToDo: check if the data fits in the inode now and delete the attribute file if so status = attribute->WriteAt(transaction, pos, buffer, _length); + if (status == B_OK) { + // The attribute type might have been changed - we need to adopt + // the new one - the attribute's inode will be written back on close + attribute->Node().type = HOST_ENDIAN_TO_BFS_INT32(type); + } attribute->Lock().UnlockWrite(); } else @@ -2313,7 +2320,7 @@ } -// #pragma mark - +// #pragma mark - AttributeIterator AttributeIterator::AttributeIterator(Inode *inode) From axeld at mail.berlios.de Tue Jan 16 15:40:15 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 16 Jan 2007 15:40:15 +0100 Subject: [Haiku-commits] r19826 - haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5 Message-ID: <200701161440.l0GEeFPT010306@sheep.berlios.de> Author: axeld Date: 2007-01-16 15:40:15 +0100 (Tue, 16 Jan 2007) New Revision: 19826 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19826&view=rev Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp Log: Ported r19825 back to the R5 version of BFS. Modified: haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp =================================================================== --- haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp 2007-01-16 14:33:23 UTC (rev 19825) +++ haiku/trunk/src/tests/add-ons/kernel/file_systems/bfs/r5/Inode.cpp 2007-01-16 14:40:15 UTC (rev 19826) @@ -1,9 +1,10 @@ -/* Inode - inode access functions -** -** Copyright 2001-2005, Axel D?rfler, axeld at pinc-software.de -** This file may be used under the terms of the MIT License. -*/ +/* + * Copyright 2001-2007, Axel D?rfler, axeld at pinc-software.de + * This file may be used under the terms of the MIT License. + */ +//! inode access functions + #include "Debug.h" #include "Inode.h" @@ -813,6 +814,12 @@ } // ToDo: check if the data fits in the inode now and delete the attribute file if so status = attribute->WriteAt(transaction, pos, buffer, _length); + if (status == B_OK) { + // The attribute type might have been changed - we need to adopt + // the new one + attribute->Node()->type = HOST_ENDIAN_TO_BFS_INT32(type); + status = attribute->WriteBack(transaction); + } attribute->Lock().UnlockWrite(); } else From jackburton at mail.berlios.de Tue Jan 16 15:43:01 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Tue, 16 Jan 2007 15:43:01 +0100 Subject: [Haiku-commits] r19827 - haiku/trunk/src/kits/interface Message-ID: <200701161443.l0GEh12S010522@sheep.berlios.de> Author: jackburton Date: 2007-01-16 15:43:01 +0100 (Tue, 16 Jan 2007) New Revision: 19827 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19827&view=rev Modified: haiku/trunk/src/kits/interface/Menu.cpp haiku/trunk/src/kits/interface/MenuBar.cpp haiku/trunk/src/kits/interface/MenuField.cpp Log: some more work on menus... fixed bug #953 and some more stuff Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2007-01-16 14:40:15 UTC (rev 19826) +++ haiku/trunk/src/kits/interface/Menu.cpp 2007-01-16 14:43:01 UTC (rev 19827) @@ -1321,9 +1321,11 @@ } if (fSuper != NULL) { + // Give supermenu the chance to continue tracking *action = fState; if (locked) - UnlockLooper(); + UnlockLooper(); + return NULL; } } @@ -1349,7 +1351,7 @@ if (IsStickyMode()) SetStickyMode(false); - + // delete the menu window recycled for all the child menus DeleteMenuWindow(); @@ -1770,7 +1772,13 @@ int BMenu::State(BMenuItem **item) const { - return 0; + if (fState == MENU_STATE_TRACKING || fState == MENU_STATE_CLOSED) + return fState; + + if (fSelected != NULL && fSelected->Submenu() != NULL) + return fSelected->Submenu()->State(item); + + return fState; } @@ -1933,7 +1941,7 @@ fSelected->Select(false); BMenu *subMenu = fSelected->Submenu(); if (subMenu != NULL && subMenu->Window() != NULL) - subMenu->_hide(); + subMenu->_hide(); } fSelected = menuItem; Modified: haiku/trunk/src/kits/interface/MenuBar.cpp =================================================================== --- haiku/trunk/src/kits/interface/MenuBar.cpp 2007-01-16 14:40:15 UTC (rev 19826) +++ haiku/trunk/src/kits/interface/MenuBar.cpp 2007-01-16 14:43:01 UTC (rev 19827) @@ -382,7 +382,7 @@ receive_data(&id, &data, sizeof(data)); BMenuBar *menuBar = data.menuBar; - if (data.useRect) + if (data.useRect) menuBar->fExtraRect = &data.rect; menuBar->SetStickyMode(data.sticky); @@ -433,7 +433,7 @@ BPoint where; ulong buttons; GetMouse(&where, &buttons, true); - + BMenuItem *menuItem = HitTestItems(where, B_ORIGIN); if (menuItem != NULL) { // Select item if: @@ -474,17 +474,24 @@ menu->SetStickyMode(true); int localAction; fChosenItem = menu->_track(&localAction, system_time()); - + if (menu->State(NULL) == MENU_STATE_TRACKING && menu->IsStickyMode()) + menu->SetStickyMode(false); + // check if the user started holding down a mouse button in a submenu if (wasSticky && !IsStickyMode()) buttons = 1; // buttons must have been pressed in the meantime + + if (localAction == MENU_STATE_CLOSED) { + if (fExtraRect != NULL && fExtraRect->Contains(where)) { + SetStickyMode(true); + fExtraRect = NULL; + } else + fState = MENU_STATE_CLOSED; + } - if (localAction == MENU_STATE_CLOSED) - fState = MENU_STATE_CLOSED; - - } else if (menuItem == NULL && fSelected != NULL - && !IsStickyMode() && fState != MENU_STATE_TRACKING_SUBMENU) { + } else if (menuItem == NULL && fSelected != NULL + && !IsStickyMode() /*&& Bounds().Contains(where)*/ && fState != MENU_STATE_TRACKING_SUBMENU) { _SelectItem(NULL); fState = MENU_STATE_TRACKING; } @@ -506,10 +513,11 @@ if (snoozeAmount > 0) snooze(snoozeAmount); } - + if (window->Lock()) { if (fSelected != NULL) - _SelectItem(NULL); + _SelectItem(NULL); + if (fChosenItem != NULL) fChosenItem->Invoke(); RestoreFocus(); @@ -534,7 +542,7 @@ // We already stole the focus, don't do anything if (fPrevFocusToken != -1) return; - + BWindow *window = Window(); if (window != NULL && window->Lock()) { BView *focus = window->CurrentFocus(); Modified: haiku/trunk/src/kits/interface/MenuField.cpp =================================================================== --- haiku/trunk/src/kits/interface/MenuField.cpp 2007-01-16 14:40:15 UTC (rev 19826) +++ haiku/trunk/src/kits/interface/MenuField.cpp 2007-01-16 14:43:01 UTC (rev 19827) @@ -282,8 +282,7 @@ fMenuBar->StartMenuBar(-1, false, true, &bounds); - fMenuTaskID = spawn_thread((thread_func)MenuTask, "_m_task_", - B_NORMAL_PRIORITY, this); + fMenuTaskID = spawn_thread((thread_func)MenuTask, "_m_task_", B_NORMAL_PRIORITY, this); if (fMenuTaskID) resume_thread(fMenuTaskID); } From jackburton at mail.berlios.de Tue Jan 16 16:22:31 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Tue, 16 Jan 2007 16:22:31 +0100 Subject: [Haiku-commits] r19828 - in haiku/trunk: headers/os/interface src/kits/interface Message-ID: <200701161522.l0GFMV3p014421@sheep.berlios.de> Author: jackburton Date: 2007-01-16 16:22:31 +0100 (Tue, 16 Jan 2007) New Revision: 19828 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19828&view=rev Modified: haiku/trunk/headers/os/interface/Menu.h haiku/trunk/src/kits/interface/Menu.cpp haiku/trunk/src/kits/interface/MenuBar.cpp Log: get rid of the now useless trackTime parameter Modified: haiku/trunk/headers/os/interface/Menu.h =================================================================== --- haiku/trunk/headers/os/interface/Menu.h 2007-01-16 14:43:01 UTC (rev 19827) +++ haiku/trunk/headers/os/interface/Menu.h 2007-01-16 15:22:31 UTC (rev 19828) @@ -190,7 +190,7 @@ void InitData(BMessage *data = NULL); bool _show(bool selectFirstItem = false); void _hide(); - BMenuItem *_track(int *action, bigtime_t trackTime, long start = -1); + BMenuItem *_track(int *action, long start = -1); void _UpdateStateOpenSelect(BMenuItem *item, bigtime_t &openTime, bigtime_t &closeTime); void _UpdateStateClose(BMenuItem *item, const BPoint &where, const uint32 &buttons); @@ -286,7 +286,7 @@ BRect *fExtraRect; float fMaxContentWidth; BPoint *fInitMatrixSize; - _ExtraMenuData_ *fExtraMenuData; // !! + _ExtraMenuData_ *fExtraMenuData; uint32 _reserved[2]; Modified: haiku/trunk/src/kits/interface/Menu.cpp =================================================================== --- haiku/trunk/src/kits/interface/Menu.cpp 2007-01-16 14:43:01 UTC (rev 19827) +++ haiku/trunk/src/kits/interface/Menu.cpp 2007-01-16 15:22:31 UTC (rev 19828) @@ -1065,7 +1065,7 @@ } int action; - BMenuItem *menuItem = _track(&action, 0); + BMenuItem *menuItem = _track(&action); SetStickyMode(false); fExtraRect = NULL; @@ -1244,7 +1244,7 @@ BMenuItem * -BMenu::_track(int *action, bigtime_t trackTime, long start) +BMenu::_track(int *action, long start) { // TODO: cleanup BMenuItem *item = NULL; @@ -1288,7 +1288,7 @@ bool wasSticky = IsStickyMode(); if (wasSticky) submenu->SetStickyMode(true); - BMenuItem *submenuItem = submenu->_track(&submenuAction, trackTime); + BMenuItem *submenuItem = submenu->_track(&submenuAction); // check if the user started holding down a mouse button in a submenu if (wasSticky && !IsStickyMode()) { Modified: haiku/trunk/src/kits/interface/MenuBar.cpp =================================================================== --- haiku/trunk/src/kits/interface/MenuBar.cpp 2007-01-16 14:43:01 UTC (rev 19827) +++ haiku/trunk/src/kits/interface/MenuBar.cpp 2007-01-16 15:22:31 UTC (rev 19828) @@ -473,7 +473,7 @@ if (wasSticky) menu->SetStickyMode(true); int localAction; - fChosenItem = menu->_track(&localAction, system_time()); + fChosenItem = menu->_track(&localAction); if (menu->State(NULL) == MENU_STATE_TRACKING && menu->IsStickyMode()) menu->SetStickyMode(false); From axeld at mail.berlios.de Tue Jan 16 18:36:23 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 16 Jan 2007 18:36:23 +0100 Subject: [Haiku-commits] r19829 - haiku/trunk/src/kits/tracker Message-ID: <200701161736.l0GHaNNo004562@sheep.berlios.de> Author: axeld Date: 2007-01-16 18:36:16 +0100 (Tue, 16 Jan 2007) New Revision: 19829 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19829&view=rev Modified: haiku/trunk/src/kits/tracker/IconCache.cpp Log: Tracker now prefers an icon coming directly from the MIME type over one specified by the application - as FileTypes already did. Modified: haiku/trunk/src/kits/tracker/IconCache.cpp =================================================================== --- haiku/trunk/src/kits/tracker/IconCache.cpp 2007-01-16 15:22:31 UTC (rev 19828) +++ haiku/trunk/src/kits/tracker/IconCache.cpp 2007-01-16 17:36:16 UTC (rev 19829) @@ -386,8 +386,13 @@ __FILE__, __LINE__, fileType)); BMimeType mime(fileType); - char preferredAppSig[B_MIME_TYPE_LENGTH]; - if (mime.GetPreferredApp(preferredAppSig) == B_OK) { + // try getting the icon directly from the metamime + if (mime.GetIcon(lazyBitmap->Get(), size) != B_OK) { + // try getting it from the preferred app of this type + char preferredAppSig[B_MIME_TYPE_LENGTH]; + if (mime.GetPreferredApp(preferredAppSig) != B_OK) + return NULL; + SharedCacheEntry *aliasTo = 0; if (entry) aliasTo = (SharedCacheEntry *)entry->ResolveIfAlias(&fSharedCache); @@ -408,11 +413,7 @@ return aliasTo; } } - - // try getting the icon directly from the metamime - if (mime.GetIcon(lazyBitmap->Get(), size) != B_OK) - return NULL; - + BBitmap *bitmap = lazyBitmap->Adopt(); if (!entry) { PRINT_ADD_ITEM(("File %s; Line %d # adding entry for type %s\n", From korli at mail.berlios.de Tue Jan 16 21:37:23 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Tue, 16 Jan 2007 21:37:23 +0100 Subject: [Haiku-commits] r19830 - haiku/trunk/src/add-ons/kernel/bus_managers/acpi Message-ID: <200701162037.l0GKbNo9020304@sheep.berlios.de> Author: korli Date: 2007-01-16 21:37:22 +0100 (Tue, 16 Jan 2007) New Revision: 19830 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19830&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_module.c haiku/trunk/src/add-ons/kernel/bus_managers/acpi/oshaiku.c Log: now uses the dpc module for AcpiExecute(). Untested with hardware events. Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c 2007-01-16 17:36:16 UTC (rev 19829) +++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_busman.c 2007-01-16 20:37:22 UTC (rev 19830) @@ -6,6 +6,7 @@ */ #include +#include #include #include @@ -23,8 +24,9 @@ #define TRACE(x...) dprintf("acpi: " x) #define ERROR(x...) dprintf("acpi: " x) +extern dpc_module_info *gDPC; +void *gDPChandle = NULL; - struct acpi_module_info acpi_module = { { { @@ -83,23 +85,12 @@ return ENOSYS; } + gDPChandle = gDPC->new_dpc_queue("acpi_task", B_NORMAL_PRIORITY, 10); + #ifdef ACPI_DEBUG_OUTPUT AcpiDbgLevel = ACPI_DEBUG_ALL | ACPI_LV_VERBOSE; AcpiDbgLayer = ACPI_ALL_COMPONENTS; #endif - - // check if safemode settings disable ACPI - settings = load_driver_settings(B_SAFEMODE_DRIVER_SETTINGS); - if (settings != NULL) { - acpiDisabled = get_driver_boolean_parameter(settings, B_SAFEMODE_DISABLE_ACPI, - false, false); - unload_driver_settings(settings); - } - - if (acpiDisabled) { - ERROR("ACPI disabled"); - return ENOSYS; - } Status = AcpiInitializeSubsystem(); if (Status != AE_OK) { @@ -135,6 +126,11 @@ ERROR("Could not bring system out of ACPI mode. Oh well.\n"); /* This isn't so terrible. We'll just fail silently */ + if (gDPChandle != NULL) { + gDPC->delete_dpc_queue(gDPChandle); + gDPChandle = NULL; + } + break; default: return B_ERROR; Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_module.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_module.c 2007-01-16 17:36:16 UTC (rev 19829) +++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/acpi_module.c 2007-01-16 20:37:22 UTC (rev 19830) @@ -6,9 +6,13 @@ #include #include + #include "acpi_priv.h" + +#include #include + //#define TRACE_ACPI_MODULE #ifdef TRACE_ACPI_MODULE # define TRACE(x) dprintf x @@ -18,10 +22,12 @@ device_manager_info *gDeviceManager; pci_module_info *gPCIManager; +dpc_module_info *gDPC; module_dependency module_dependencies[] = { {B_DEVICE_MANAGER_MODULE_NAME, (module_info **)&gDeviceManager}, {B_PCI_MODULE_NAME, (module_info **)&gPCIManager}, + {B_DPC_MODULE_NAME, (module_info **)&gDPC}, {} }; Modified: haiku/trunk/src/add-ons/kernel/bus_managers/acpi/oshaiku.c =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/acpi/oshaiku.c 2007-01-16 17:36:16 UTC (rev 19829) +++ haiku/trunk/src/add-ons/kernel/bus_managers/acpi/oshaiku.c 2007-01-16 20:37:22 UTC (rev 19830) @@ -131,6 +131,9 @@ # include #include extern pci_module_info *gPCIManager; +#include +extern dpc_module_info *gDPC; +extern void *gDPChandle; #endif #include "acpi.h" @@ -844,8 +847,7 @@ ACPI_OSD_EXEC_CALLBACK Function, void *Context) { - int priority = 10; - thread_id thread; + status_t err; switch (Type) { case OSL_GLOBAL_LOCK_HANDLER: @@ -856,17 +858,10 @@ case OSL_EC_BURST_HANDLER: break; } - - #ifndef _KERNEL_MODE - #define spawn_kernel_thread spawn_thread - #endif - thread = spawn_kernel_thread((thread_func)(Function),"ACPI Worker Thread",priority,Context); - /* We're going to cheerfully ignore the fact that ACPI_OSD_EXEC_CALLBACK - routines don't give canonical return values, as we aren't going to - check up on them, and the kernel doesn't care */ - - if (thread < B_OK) + err = gDPC->queue_dpc(gDPChandle, Function, Context); + + if (err != B_OK) return AE_ERROR; return AE_OK; } From axeld at mail.berlios.de Tue Jan 16 21:50:57 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 16 Jan 2007 21:50:57 +0100 Subject: [Haiku-commits] r19831 - haiku/trunk/src/kits/translation Message-ID: <200701162050.l0GKov2T021978@sheep.berlios.de> Author: axeld Date: 2007-01-16 21:50:56 +0100 (Tue, 16 Jan 2007) New Revision: 19831 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19831&view=rev Modified: haiku/trunk/src/kits/translation/TranslationUtils.cpp Log: * GetStyledText() is now much more forgiving when it comes to corrupted data (ie. if the text file is cut off, it will no longer return an error, but load as much as possible). * Minor cleanup. Modified: haiku/trunk/src/kits/translation/TranslationUtils.cpp =================================================================== --- haiku/trunk/src/kits/translation/TranslationUtils.cpp 2007-01-16 20:37:22 UTC (rev 19830) +++ haiku/trunk/src/kits/translation/TranslationUtils.cpp 2007-01-16 20:50:56 UTC (rev 19831) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Haiku Inc. + * Copyright 2002-2007, Haiku Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -340,47 +340,46 @@ // make sure there is enough data to fill the stream header const size_t kStreamHeaderSize = sizeof(TranslatorStyledTextStreamHeader); if (mallocIO.BufferLength() < kStreamHeaderSize) - return B_ERROR; + return B_BAD_DATA; // copy the stream header from the mallio buffer - TranslatorStyledTextStreamHeader stm_header = + TranslatorStyledTextStreamHeader header = *(reinterpret_cast(buffer)); // convert the stm_header.header struct to the host format const size_t kRecordHeaderSize = sizeof(TranslatorStyledTextRecordHeader); - if (swap_data(B_UINT32_TYPE, &stm_header.header, kRecordHeaderSize, - B_SWAP_BENDIAN_TO_HOST) != B_OK - || swap_data(B_INT32_TYPE, &stm_header.version, sizeof(int32), - B_SWAP_BENDIAN_TO_HOST) != B_OK - || stm_header.header.magic != 'STXT') - return B_ERROR; + swap_data(B_UINT32_TYPE, &header.header, kRecordHeaderSize, B_SWAP_BENDIAN_TO_HOST); + swap_data(B_INT32_TYPE, &header.version, sizeof(int32), B_SWAP_BENDIAN_TO_HOST); + if (header.header.magic != 'STXT') + return B_BAD_TYPE; + // copy the text header from the mallocIO buffer - uint32 offset = stm_header.header.header_size + - stm_header.header.data_size; + uint32 offset = header.header.header_size + header.header.data_size; const size_t kTextHeaderSize = sizeof(TranslatorStyledTextTextHeader); if (mallocIO.BufferLength() < offset + kTextHeaderSize) - return B_ERROR; + return B_BAD_DATA; TranslatorStyledTextTextHeader textHeader = *(const TranslatorStyledTextTextHeader *)(buffer + offset); // convert the stm_header.header struct to the host format - if (swap_data(B_UINT32_TYPE, &textHeader.header, kRecordHeaderSize, - B_SWAP_BENDIAN_TO_HOST) != B_OK - || swap_data(B_INT32_TYPE, &textHeader.charset, sizeof(int32), - B_SWAP_BENDIAN_TO_HOST) != B_OK - || textHeader.header.magic != 'TEXT' - || textHeader.charset != B_UNICODE_UTF8) - return B_ERROR; + swap_data(B_UINT32_TYPE, &textHeader.header, kRecordHeaderSize, B_SWAP_BENDIAN_TO_HOST); + swap_data(B_INT32_TYPE, &textHeader.charset, sizeof(int32), B_SWAP_BENDIAN_TO_HOST); + if (textHeader.header.magic != 'TEXT' || textHeader.charset != B_UNICODE_UTF8) + return B_BAD_TYPE; + offset += textHeader.header.header_size; - if (mallocIO.BufferLength() < offset + textHeader.header.data_size) - return B_ERROR; + if (mallocIO.BufferLength() < offset + textHeader.header.data_size) { + // text buffer misses its end; handle this gracefully + textHeader.header.data_size = mallocIO.BufferLength() - offset; + } const char* text = (const char*)buffer + offset; // point text pointer at the actual character data + bool hasStyles = false; if (mallocIO.BufferLength() > offset + textHeader.header.data_size) { // If the stream contains information beyond the text data @@ -389,40 +388,32 @@ offset += textHeader.header.data_size; const size_t kStyleHeaderSize = sizeof(TranslatorStyledTextStyleHeader); - if (mallocIO.BufferLength() < offset + kStyleHeaderSize) - return B_ERROR; + if (mallocIO.BufferLength() >= offset + kStyleHeaderSize) { + TranslatorStyledTextStyleHeader styleHeader = + *(reinterpret_cast(buffer + offset)); + swap_data(B_UINT32_TYPE, &styleHeader.header, kRecordHeaderSize, B_SWAP_BENDIAN_TO_HOST); + swap_data(B_UINT32_TYPE, &styleHeader.apply_offset, sizeof(uint32), B_SWAP_BENDIAN_TO_HOST); + swap_data(B_UINT32_TYPE, &styleHeader.apply_length, sizeof(uint32), B_SWAP_BENDIAN_TO_HOST); + if (styleHeader.header.magic == 'STYL') { + offset += styleHeader.header.header_size; + if (mallocIO.BufferLength() >= offset + styleHeader.header.data_size) + hasStyles = true; + } + } + } - TranslatorStyledTextStyleHeader styleHeader = - *(reinterpret_cast(buffer + offset)); - if (swap_data(B_UINT32_TYPE, &styleHeader.header, kRecordHeaderSize, - B_SWAP_BENDIAN_TO_HOST) != B_OK - || swap_data(B_UINT32_TYPE, &styleHeader.apply_offset, sizeof(uint32), - B_SWAP_BENDIAN_TO_HOST) != B_OK - || swap_data(B_UINT32_TYPE, &styleHeader.apply_length, sizeof(uint32), - B_SWAP_BENDIAN_TO_HOST) != B_OK - || styleHeader.header.magic != 'STYL') - return B_ERROR; + text_run_array *runArray = NULL; + if (hasStyles) + runArray = BTextView::UnflattenRunArray(buffer + offset); - offset += styleHeader.header.header_size; - if (mallocIO.BufferLength() < offset + styleHeader.header.data_size) - return B_ERROR; - - // get the text run array - - text_run_array *runArray = BTextView::UnflattenRunArray(buffer + offset); - if (runArray) { - intoView->Insert(intoView->TextLength(), text, - textHeader.header.data_size, runArray); + if (runArray != NULL) { + intoView->Insert(intoView->TextLength(), + text, textHeader.header.data_size, runArray); #ifdef HAIKU_TARGET_PLATFORM_HAIKU - BTextView::FreeRunArray(runArray); + BTextView::FreeRunArray(runArray); #else - free(runArray); + free(runArray); #endif - } else { - // run array seems to be garbled; the text alone must be enough - intoView->Insert(intoView->TextLength(), text, - textHeader.header.data_size); - } } else { intoView->Insert(intoView->TextLength(), text, textHeader.header.data_size); From marcusoverhagen at mail.berlios.de Tue Jan 16 23:45:20 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Tue, 16 Jan 2007 23:45:20 +0100 Subject: [Haiku-commits] r19832 - haiku/trunk/src/add-ons/kernel/busses/ide Message-ID: <200701162245.l0GMjKaC000828@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-16 23:45:20 +0100 (Tue, 16 Jan 2007) New Revision: 19832 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19832&view=rev Added: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ Log: created new directory for AHCI support From marcusoverhagen at mail.berlios.de Tue Jan 16 23:47:25 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Tue, 16 Jan 2007 23:47:25 +0100 Subject: [Haiku-commits] r19833 - haiku/trunk/src/add-ons/kernel/busses/ide/ahci Message-ID: <200701162247.l0GMlPgf001025@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-16 23:47:25 +0100 (Tue, 16 Jan 2007) New Revision: 19833 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19833&view=rev Added: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/Jamfile haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c Log: copied from the Silicon image driver to get started Copied: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/Jamfile (from rev 19831, haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/Jamfile) Copied: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c (from rev 19831, haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c) From marcusoverhagen at mail.berlios.de Wed Jan 17 00:17:42 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Wed, 17 Jan 2007 00:17:42 +0100 Subject: [Haiku-commits] r19834 - haiku/trunk/src/add-ons/kernel/busses/ide/ahci Message-ID: <200701162317.l0GNHgTI003052@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-17 00:17:41 +0100 (Wed, 17 Jan 2007) New Revision: 19834 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19834&view=rev Added: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.h Log: header file for AHCI Added: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.h =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.h 2007-01-16 22:47:25 UTC (rev 19833) +++ haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.h 2007-01-16 23:17:41 UTC (rev 19834) @@ -0,0 +1 @@ + From marcusoverhagen at mail.berlios.de Wed Jan 17 00:45:45 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Wed, 17 Jan 2007 00:45:45 +0100 Subject: [Haiku-commits] r19835 - haiku/trunk/src/add-ons/kernel/busses/ide/ahci Message-ID: <200701162345.l0GNjjbj000108@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-17 00:45:43 +0100 (Wed, 17 Jan 2007) New Revision: 19835 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19835&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.h Log: added some register definitions from AHCI 1.1 specification Modified: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.h =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.h 2007-01-16 23:17:41 UTC (rev 19834) +++ haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.h 2007-01-16 23:45:43 UTC (rev 19835) @@ -1 +1,49 @@ +/* + * Copyright 2007, Marcus Overhagen. All rights reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _AHCI_H +#define _AHCI_H + +typedef struct +{ + uint32 clb; // Command List Base Address + uint32 clbu; // Command List Base Address Upper 32-Bits + uint32 fb; // FIS Base Address + uint32 fbu; // FIS Base Address Upper 32-Bits + uint32 is; // Interrupt Status + uint32 ie; // Interrupt Enable + uint32 cmd; // Command and Status + uint32 res1; // Reserved + uint32 tfd; // Task File Data + uint32 sig; // Signature + uint32 ssts; // Serial ATA Status (SCR0: SStatus) + uint32 sctl; // Serial ATA Control (SCR2: SControl) + uint32 serr; // Serial ATA Error (SCR1: SError) + uint32 sact; // Serial ATA Active (SCR3: SActive) + uint32 ci; // Command Issue + uint32 sntf; // SNotification + uint32 res2; // Reserved for FIS-based Switching Definition + uint32 res[11]; // Reserved + uint32 vendor[2]; // Vendor Specific +} ahci_port; + + +typedef struct +{ + uint32 cap; // Host Capabilities + uint32 ghc; // Global Host Control + uint32 is; // Interrupt Status + uint32 pi; // Ports Implemented + uint32 vs; // Version + uint32 ccc_ctl; // Command Completion Coalescing Control + uint32 ccc_ports; // Command Completion Coalsecing Ports + uint32 em_loc; // Enclosure Management Location + uint32 em_ctl; // Enclosure Management Control + uint32 res[31]; // Reserved + uint32 vendor[24]; // Vendor Specific registers + ahci_port port[32]; +} ahci_hba; + +#endi From marcusoverhagen at mail.berlios.de Wed Jan 17 01:19:59 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Wed, 17 Jan 2007 01:19:59 +0100 Subject: [Haiku-commits] r19836 - haiku/trunk/headers/os/drivers/bus Message-ID: <200701170019.l0H0Jx9Q018919@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-17 01:19:59 +0100 (Wed, 17 Jan 2007) New Revision: 19836 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19836&view=rev Modified: haiku/trunk/headers/os/drivers/bus/PCI.h Log: Fixed documentation, uint16 was wrong and doesn't work. Also checked other usage of this items, but they are already correct. Modified: haiku/trunk/headers/os/drivers/bus/PCI.h =================================================================== --- haiku/trunk/headers/os/drivers/bus/PCI.h 2007-01-16 23:45:43 UTC (rev 19835) +++ haiku/trunk/headers/os/drivers/bus/PCI.h 2007-01-17 00:19:59 UTC (rev 19836) @@ -136,11 +136,11 @@ // subvendor id (uint16) #define PCI_DEVICE_SUBVENDOR_ID_ITEM "pci/subvendor_id" -// device base class (uint16) +// device base class (uint8) #define PCI_DEVICE_BASE_CLASS_ID_ITEM "pci/class/base_id" -// device subclass (uint16) +// device subclass (uint8) #define PCI_DEVICE_SUB_CLASS_ID_ITEM "pci/class/sub_id" -// device api (uint16) +// device api (uint8) #define PCI_DEVICE_API_ID_ITEM "pci/class/api_id" From marcusoverhagen at mail.berlios.de Wed Jan 17 01:39:34 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Wed, 17 Jan 2007 01:39:34 +0100 Subject: [Haiku-commits] r19837 - haiku/trunk/src/add-ons/kernel/busses/ide/ahci Message-ID: <200701170039.l0H0dYVc020350@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-17 01:39:33 +0100 (Wed, 17 Jan 2007) New Revision: 19837 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19837&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c Log: added device detection Modified: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c 2007-01-17 00:19:59 UTC (rev 19836) +++ haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c 2007-01-17 00:39:33 UTC (rev 19837) @@ -11,14 +11,14 @@ #include #include -#define TRACE(a...) dprintf("si-3112 " a) -#define FLOW(a...) dprintf("si-3112 " a) +#define TRACE(a...) dprintf("ahci " a) +#define FLOW(a...) dprintf("ahci " a) -#define DRIVER_PRETTY_NAME "Silicon Image SATA" +#define DRIVER_PRETTY_NAME "AHCI SATA" #define CONTROLLER_NAME DRIVER_PRETTY_NAME -#define CONTROLLER_MODULE_NAME "busses/ide/silicon_image_3112/device_v1" -#define CHANNEL_MODULE_NAME "busses/ide/silicon_image_3112/channel/v1" +#define CONTROLLER_MODULE_NAME "busses/ide/ahci/device_v1" +#define CHANNEL_MODULE_NAME "busses/ide/ahci/channel/v1" enum asic_type { ASIC_SI3112 = 0, @@ -118,40 +118,48 @@ controller_supports(device_node_handle parent, bool *_noConnection) { char *bus; - uint16 vendorID; - uint16 deviceID; + uint16 vendor_id; + uint16 device_id; + uint16 base_class; + uint16 sub_class; + uint16 class_api; FLOW("controller_supports\n"); // get the bus (should be PCI) - if (dm->get_attr_string(parent, B_DRIVER_BUS, &bus, false) - != B_OK) { + if (dm->get_attr_string(parent, B_DRIVER_BUS, &bus, false) != B_OK) return B_ERROR; - } - - // get vendor and device ID - if (dm->get_attr_uint16(parent, PCI_DEVICE_VENDOR_ID_ITEM, - &vendorID, false) != B_OK - || dm->get_attr_uint16(parent, PCI_DEVICE_DEVICE_ID_ITEM, - &deviceID, false) != B_OK) { + if (strcmp(bus, "pci") != 0) { free(bus); return B_ERROR; } + free(bus); - FLOW("controller_supports: checking 0x%04x 0x%04x\n", vendorID, deviceID); + if ( dm->get_attr_uint16(parent, PCI_DEVICE_VENDOR_ID_ITEM, &vendor_id, false) != B_OK + || dm->get_attr_uint16(parent, PCI_DEVICE_DEVICE_ID_ITEM, &device_id, false) != B_OK + || dm->get_attr_uint8(parent, PCI_DEVICE_BASE_CLASS_ID_ITEM, &base_class, false) != B_OK + || dm->get_attr_uint8(parent, PCI_DEVICE_SUB_CLASS_ID_ITEM, &sub_class, false) != B_OK + || dm->get_attr_uint8(parent, PCI_DEVICE_API_ID_ITEM, &class_api, false) != B_OK) + return B_ERROR; - // check, whether bus, vendor and device ID match - if (strcmp(bus, "pci") != 0 - || (vendorID != 0x1095) - || (deviceID != 0x3112 && deviceID != 0x3114)) { - free(bus); - return 0.0; + FLOW("controller_supports: checking vendor 0x%04x, device 0x%04x, base 0x%02x, sub 0x%02x, api 0x%02x\n", + vendor_id, device_id, base_class, sub_class, class_api); + + #define ID(v,d) (((v)<< 16) | (d)) + switch (ID(vendor_id,device_id)) { + case ID(0x197b, 0x2363): // JMicron + TRACE("controller_supports success, exact match\n"); + return 0.8; + default: + break; } - TRACE("controller_supports success\n"); + if (base_class == PCI_mass_storage && sub_class == PCI_sata && class_api == PCI_sata_ahci) { + TRACE("controller_supports success, class match\n"); + return 0.6; + } - free(bus); - return 0.6; + return 0.0; } @@ -170,6 +178,8 @@ TRACE("controller_probe\n"); + return B_ERROR; + if (dm->init_driver(parent, NULL, (driver_module_info **)&pci, (void **)&device) != B_OK) return B_ERROR; From marcusoverhagen at mail.berlios.de Wed Jan 17 01:40:11 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Wed, 17 Jan 2007 01:40:11 +0100 Subject: [Haiku-commits] r19838 - in haiku/trunk/src/add-ons/kernel/busses/ide: . ahci Message-ID: <200701170040.l0H0eBcs020435@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-17 01:40:11 +0100 (Wed, 17 Jan 2007) New Revision: 19838 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19838&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/ide/Jamfile haiku/trunk/src/add-ons/kernel/busses/ide/ahci/Jamfile Log: add ahci driver to build system Modified: haiku/trunk/src/add-ons/kernel/busses/ide/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/Jamfile 2007-01-17 00:39:33 UTC (rev 19837) +++ haiku/trunk/src/add-ons/kernel/busses/ide/Jamfile 2007-01-17 00:40:11 UTC (rev 19838) @@ -1,5 +1,6 @@ SubDir HAIKU_TOP src add-ons kernel busses ide ; +SubInclude HAIKU_TOP src add-ons kernel busses ide ahci ; SubInclude HAIKU_TOP src add-ons kernel busses ide generic_ide_pci ; SubInclude HAIKU_TOP src add-ons kernel busses ide ide_isa ; SubInclude HAIKU_TOP src add-ons kernel busses ide promise_tx2 ; Modified: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/ahci/Jamfile 2007-01-17 00:39:33 UTC (rev 19837) +++ haiku/trunk/src/add-ons/kernel/busses/ide/ahci/Jamfile 2007-01-17 00:40:11 UTC (rev 19838) @@ -1,7 +1,7 @@ -SubDir HAIKU_TOP src add-ons kernel busses ide silicon_image_3112 ; +SubDir HAIKU_TOP src add-ons kernel busses ide ahci ; UsePrivateHeaders kernel ; -KernelAddon silicon_image_3112 : - silicon_image_3112.c +KernelAddon ahci : + ahci.c ; From marcusoverhagen at mail.berlios.de Wed Jan 17 02:11:21 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Wed, 17 Jan 2007 02:11:21 +0100 Subject: [Haiku-commits] r19839 - haiku/trunk/build/jam Message-ID: <200701170111.l0H1BLFs022546@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-17 02:11:19 +0100 (Wed, 17 Jan 2007) New Revision: 19839 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19839&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: added ahci to the image Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-17 00:40:11 UTC (rev 19838) +++ haiku/trunk/build/jam/HaikuImage 2007-01-17 01:11:19 UTC (rev 19839) @@ -110,7 +110,7 @@ AddFilesToHaikuImage beos system add-ons kernel bus_managers : $(BEOS_ADD_ONS_BUS_MANAGERS) ; AddFilesToHaikuImage beos system add-ons kernel busses ide - : generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ; + : ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ; AddFilesToHaikuImage beos system add-ons kernel busses usb : uhci ohci ; AddFilesToHaikuImage beos system add-ons kernel console : vga_text ; From bga at mail.berlios.de Wed Jan 17 02:40:02 2007 From: bga at mail.berlios.de (bga at BerliOS) Date: Wed, 17 Jan 2007 02:40:02 +0100 Subject: [Haiku-commits] r19840 - in haiku/trunk: headers/build/os/drivers/bus/scsi headers/os/drivers/bus/scsi src/add-ons/kernel/drivers/disk/scsi/scsi_dsk src/add-ons/kernel/generic/scsi_periph src/apps/midiplayer src/apps/people src/apps/showimage src/apps/soundrecorder Message-ID: <200701170140.l0H1e2Zs025816@sheep.berlios.de> Author: bga Date: 2007-01-17 02:39:59 +0100 (Wed, 17 Jan 2007) New Revision: 19840 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19840&view=rev Added: haiku/trunk/src/add-ons/kernel/generic/scsi_periph/sync.c Modified: haiku/trunk/headers/build/os/drivers/bus/scsi/scsi_periph.h haiku/trunk/headers/os/drivers/bus/scsi/scsi_cmds.h haiku/trunk/headers/os/drivers/bus/scsi/scsi_periph.h haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_dsk/scsi_dsk.c haiku/trunk/src/add-ons/kernel/generic/scsi_periph/Jamfile haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph.c haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph_int.h haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef haiku/trunk/src/apps/people/People.rdef haiku/trunk/src/apps/showimage/ShowImage.rdef haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef Log: Implemented support for hardware cache flush. This is based on code I originally did for yellowTAB GmbH when I worked for then and is being used under permission. Modified: haiku/trunk/headers/build/os/drivers/bus/scsi/scsi_periph.h =================================================================== --- haiku/trunk/headers/build/os/drivers/bus/scsi/scsi_periph.h 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/headers/build/os/drivers/bus/scsi/scsi_periph.h 2007-01-17 01:39:59 UTC (rev 19840) @@ -154,7 +154,9 @@ // fill data with icon (for B_GET_ICON ioctl) status_t (*get_icon)( icon_type type, device_icon *data ); - + + // synchronizes (flush) the device cache + err_res(*synchronize_cache)(scsi_periph_device device, scsi_ccb *request); } scsi_periph_interface; #define SCSI_PERIPH_MODULE_NAME "generic/scsi_periph/v1" Modified: haiku/trunk/headers/os/drivers/bus/scsi/scsi_cmds.h =================================================================== --- haiku/trunk/headers/os/drivers/bus/scsi/scsi_cmds.h 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/headers/os/drivers/bus/scsi/scsi_cmds.h 2007-01-17 01:39:59 UTC (rev 19840) @@ -1023,4 +1023,21 @@ // and Mechanism status page } scsi_read_cd_sub_channel_selection; +// SYNCHRONIZE CACHE (10) + +typedef struct scsi_cmd_sync_cache { + uint8 opcode; + LBITFIELD8_4( + RelAddr : 1, + immed : 1, // 1 - return immediately, 0 - return on completion + res1_1 : 3, + LUN : 3 + ); + scsi_cd_lba lba; + uint8 res2; + uint8 nblocks_high; + uint8 nblocks_low; + uint8 control; +} scsi_cmd_sync_cache; + #endif Modified: haiku/trunk/headers/os/drivers/bus/scsi/scsi_periph.h =================================================================== --- haiku/trunk/headers/os/drivers/bus/scsi/scsi_periph.h 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/headers/os/drivers/bus/scsi/scsi_periph.h 2007-01-17 01:39:59 UTC (rev 19840) @@ -154,7 +154,9 @@ // fill data with icon (for B_GET_ICON ioctl) status_t (*get_icon)( icon_type type, device_icon *data ); - + + // synchronizes (flush) the device cache + err_res(*synchronize_cache)(scsi_periph_device device, scsi_ccb *request); } scsi_periph_interface; #define SCSI_PERIPH_MODULE_NAME "generic/scsi_periph/v1" Modified: haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_dsk/scsi_dsk.c =================================================================== --- haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_dsk/scsi_dsk.c 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_dsk/scsi_dsk.c 2007-01-17 01:39:59 UTC (rev 19840) @@ -130,6 +130,23 @@ } +static status_t +synchronize_cache(das_device_info *device) +{ + scsi_ccb *ccb; + err_res res; + + SHOW_FLOW0( 0, "" ); + + ccb = device->scsi->alloc_ccb(device->scsi_device); + + res = scsi_periph->synchronize_cache(device->scsi_periph_device, ccb); + + device->scsi->free_ccb(ccb); + + return res.error_code; +} + static int log2(uint32 x) { @@ -214,6 +231,10 @@ res = load_eject(device, true); break; + case B_FLUSH_DRIVE_CACHE: + res = synchronize_cache(device); + break; + default: res = scsi_periph->ioctl(handle->scsi_periph_handle, op, buf, len); } Modified: haiku/trunk/src/add-ons/kernel/generic/scsi_periph/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/generic/scsi_periph/Jamfile 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/src/add-ons/kernel/generic/scsi_periph/Jamfile 2007-01-17 01:39:59 UTC (rev 19840) @@ -16,4 +16,5 @@ io.c removable.c scsi_periph.c + sync.c ; Modified: haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph.c =================================================================== --- haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph.c 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph.c 2007-01-17 01:39:59 UTC (rev 19840) @@ -161,7 +161,9 @@ periph_get_media_status, periph_compose_device_name, - periph_get_icon + periph_get_icon, + + periph_synchronize_cache }; scsi_periph_interface *modules[] = { Modified: haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph_int.h =================================================================== --- haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph_int.h 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph_int.h 2007-01-17 01:39:59 UTC (rev 19840) @@ -109,4 +109,9 @@ status_t periph_get_icon(icon_type type, device_icon *data); +// sync.c + +err_res periph_synchronize_cache(scsi_periph_device_info *device, + scsi_ccb *request); + #endif /* __SCSI_PERIPH_INT_H__ */ Added: haiku/trunk/src/add-ons/kernel/generic/scsi_periph/sync.c =================================================================== --- haiku/trunk/src/add-ons/kernel/generic/scsi_periph/sync.c 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/src/add-ons/kernel/generic/scsi_periph/sync.c 2007-01-17 01:39:59 UTC (rev 19840) @@ -0,0 +1,47 @@ +/* + * Copyright 2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Bruno Albuquerque, bga at bug-br.org.br + * + * Copyright 2004-2006 yellowTAB GMbH. This file is + * based on work I did for ZETA while employed by + * yellowTAB and is used under permission. + * + */ + +#include "scsi_periph_int.h" + +#include + +#include + +err_res +periph_synchronize_cache(scsi_periph_device_info *device, scsi_ccb *request) +{ + scsi_cmd_sync_cache* cmd = (scsi_cmd_sync_cache*)request->cdb; + + request->flags = SCSI_DIR_NONE; + + request->data = NULL; + request->sg_list = NULL; + request->data_len = 0; + request->timeout = device->std_timeout; + request->sort = -1; + + memset(cmd, 0, sizeof(*cmd)); + + cmd->opcode = SCSI_OP_SYNCHRONIZE_CACHE; + cmd->immed = 0; + + // TODO(bga): Maybe we will actually want to set those one day... + cmd->nblocks_high = 0; + cmd->nblocks_low = 0; + + request->cdb_len = sizeof(*cmd); + + device->scsi->sync_io(request); + + return periph_check_error(device, request); +} Modified: haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef =================================================================== --- haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef 2007-01-17 01:39:59 UTC (rev 19840) @@ -11,12 +11,12 @@ long_info = "MidiPlayer ?2004-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + resource file_types message { "types" = "audio/x-midi" }; -resource app_flags B_SINGLE_LAUNCH; - resource large_icon array { $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" Modified: haiku/trunk/src/apps/people/People.rdef =================================================================== --- haiku/trunk/src/apps/people/People.rdef 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/src/apps/people/People.rdef 2007-01-17 01:39:59 UTC (rev 19840) @@ -1,10 +1,6 @@ resource(1, "BEOS:APP_SIG") #'MIMS' "application/x-vnd.Be-PEPL"; -resource(1, "BEOS:FILE_TYPES") message { - "types" = "application/x-person" -}; - resource app_version { major = 1, middle = 0, @@ -19,6 +15,10 @@ resource app_flags B_SINGLE_LAUNCH; +resource(1, "BEOS:FILE_TYPES") message { + "types" = "application/x-person" +}; + #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { Modified: haiku/trunk/src/apps/showimage/ShowImage.rdef =================================================================== --- haiku/trunk/src/apps/showimage/ShowImage.rdef 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/src/apps/showimage/ShowImage.rdef 2007-01-17 01:39:59 UTC (rev 19840) @@ -4,10 +4,6 @@ resource app_signature "application/x-vnd.Haiku-ShowImage"; -resource file_types message { - "types" = "image" -}; - resource app_version { major = 0, middle = 0, @@ -22,6 +18,10 @@ resource app_flags B_SINGLE_LAUNCH; +resource file_types message { + "types" = "image" +}; + #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { Modified: haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef =================================================================== --- haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef 2007-01-17 01:11:19 UTC (rev 19839) +++ haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef 2007-01-17 01:39:59 UTC (rev 19840) @@ -11,6 +11,8 @@ long_info = "SoundRecorder ?2005-2007 Haiku, Inc." }; +resource app_flags B_SINGLE_LAUNCH; + resource file_types message { "types" = "audio/basic", "types" = "audio/x-wav", @@ -22,8 +24,6 @@ "types" = "audio/riff" }; -resource app_flags B_SINGLE_LAUNCH; - #ifdef HAIKU_TARGET_PLATFORM_HAIKU resource vector_icon { From bga at bug-br.org.br Wed Jan 17 02:46:13 2007 From: bga at bug-br.org.br (Bruno G. Albuquerque) Date: Tue, 16 Jan 2007 23:46:13 -0200 BRST Subject: [Haiku-commits] =?iso-8859-15?q?r19840_-_in_haiku/trunk=3A_header?= =?iso-8859-15?q?s/build/os/drivers/bus/scsi__headers/os/drivers/bus/scsi_?= =?iso-8859-15?q?src/add-ons/kernel/drivers/disk/scsi/scsi=5Fdsk__src/add-?= =?iso-8859-15?q?ons/kernel/generic/scsi=5Fperiph_src/apps/midiplayer_src/?= =?iso-8859-15?q?apps/people_src/apps/showimage_src/apps/soundrecorder?= In-Reply-To: <200701170140.l0H1e2Zs025816@sheep.berlios.de> Message-ID: <11775920226-BeMail@guglielmo> Ops. It included some other stuff I was working on by mistake. But should be harmless anyway. Let me know if you find it cause havoc for you. :P Anyway, it would be great if Axel and Marcus could review the code. For everyone else, let me know if you have any kind of problems after this chage. And, while we are at it, why the hell do we have 2 scsi_periph.h files? Just to be on the safe side, I changed both. -Bruno On Wed, 17 Jan 2007 02:40:02 +0100, bga at BerliOS said: > Author: bga > Date: 2007-01-17 02:39:59 +0100 (Wed, 17 Jan 2007) > New Revision: 19840 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19840&view=rev > > Added: > haiku/trunk/src/add-ons/kernel/generic/scsi_periph/sync.c > Modified: > haiku/trunk/headers/build/os/drivers/bus/scsi/scsi_periph.h > haiku/trunk/headers/os/drivers/bus/scsi/scsi_cmds.h > haiku/trunk/headers/os/drivers/bus/scsi/scsi_periph.h > haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_dsk/ > scsi_dsk.c > haiku/trunk/src/add-ons/kernel/generic/scsi_periph/Jamfile > haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph.c > haiku/trunk/src/add-ons/kernel/generic/scsi_periph/ > scsi_periph_int.h > haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef > haiku/trunk/src/apps/people/People.rdef > haiku/trunk/src/apps/showimage/ShowImage.rdef > haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef > Log: > Implemented support for hardware cache flush. This is based on code I > originally > did for yellowTAB GmbH when I worked for then and is being used under > permission. > > > > Modified: haiku/trunk/headers/build/os/drivers/bus/scsi/scsi_periph.h > =================================================================== > --- haiku/trunk/headers/build/os/drivers/bus/scsi/scsi_periph.h 2007- > 01-17 01:11:19 UTC (rev 19839) > +++ haiku/trunk/headers/build/os/drivers/bus/scsi/scsi_periph.h 2007- > 01-17 01:39:59 UTC (rev 19840) > @@ -154,7 +154,9 @@ > > // fill data with icon (for B_GET_ICON ioctl) > status_t (*get_icon)( icon_type type, device_icon *data ); > - > + > + // synchronizes (flush) the device cache > + err_res(*synchronize_cache)(scsi_periph_device device, scsi_ccb * > request); > } scsi_periph_interface; > > #define SCSI_PERIPH_MODULE_NAME "generic/scsi_periph/v1" > > Modified: haiku/trunk/headers/os/drivers/bus/scsi/scsi_cmds.h > =================================================================== > --- haiku/trunk/headers/os/drivers/bus/scsi/scsi_cmds.h 2007-01-17 > 01:11:19 UTC (rev 19839) > +++ haiku/trunk/headers/os/drivers/bus/scsi/scsi_cmds.h 2007-01-17 > 01:39:59 UTC (rev 19840) > @@ -1023,4 +1023,21 @@ > // and > Mechanism status page > } scsi_read_cd_sub_channel_selection; > > +// SYNCHRONIZE CACHE (10) > + > +typedef struct scsi_cmd_sync_cache { > + uint8 opcode; > + LBITFIELD8_4( > + RelAddr : 1, > + immed : 1, // 1 - return immediately, 0 - return on > completion > + res1_1 : 3, > + LUN : 3 > + ); > + scsi_cd_lba lba; > + uint8 res2; > + uint8 nblocks_high; > + uint8 nblocks_low; > + uint8 control; > +} scsi_cmd_sync_cache; > + > #endif > > Modified: haiku/trunk/headers/os/drivers/bus/scsi/scsi_periph.h > =================================================================== > --- haiku/trunk/headers/os/drivers/bus/scsi/scsi_periph.h 2007-01-17 > 01:11:19 UTC (rev 19839) > +++ haiku/trunk/headers/os/drivers/bus/scsi/scsi_periph.h 2007-01-17 > 01:39:59 UTC (rev 19840) > @@ -154,7 +154,9 @@ > > // fill data with icon (for B_GET_ICON ioctl) > status_t (*get_icon)( icon_type type, device_icon *data ); > - > + > + // synchronizes (flush) the device cache > + err_res(*synchronize_cache)(scsi_periph_device device, scsi_ccb * > request); > } scsi_periph_interface; > > #define SCSI_PERIPH_MODULE_NAME "generic/scsi_periph/v1" > > Modified: haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_dsk/ > scsi_dsk.c > =================================================================== > --- haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_dsk/ > scsi_dsk.c 2007-01-17 01:11:19 UTC (rev 19839) > +++ haiku/trunk/src/add-ons/kernel/drivers/disk/scsi/scsi_dsk/ > scsi_dsk.c 2007-01-17 01:39:59 UTC (rev 19840) > @@ -130,6 +130,23 @@ > } > > > +static status_t > +synchronize_cache(das_device_info *device) > +{ > + scsi_ccb *ccb; > + err_res res; > + > + SHOW_FLOW0( 0, "" ); > + > + ccb = device->scsi->alloc_ccb(device->scsi_device); > + > + res = scsi_periph->synchronize_cache(device->scsi_periph_device, > ccb); > + > + device->scsi->free_ccb(ccb); > + > + return res.error_code; > +} > + > static int > log2(uint32 x) > { > @@ -214,6 +231,10 @@ > res = load_eject(device, true); > break; > > + case B_FLUSH_DRIVE_CACHE: > + res = synchronize_cache(device); > + break; > + > default: > res = scsi_periph->ioctl(handle->scsi_periph_handle, op, > buf, len); > } > > Modified: haiku/trunk/src/add-ons/kernel/generic/scsi_periph/Jamfile > =================================================================== > --- haiku/trunk/src/add-ons/kernel/generic/scsi_periph/Jamfile 2007- > 01-17 01:11:19 UTC (rev 19839) > +++ haiku/trunk/src/add-ons/kernel/generic/scsi_periph/Jamfile 2007- > 01-17 01:39:59 UTC (rev 19840) > @@ -16,4 +16,5 @@ > io.c > removable.c > scsi_periph.c > + sync.c > ; > > Modified: haiku/trunk/src/add-ons/kernel/generic/scsi_periph/ > scsi_periph.c > =================================================================== > --- haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph.c > 2007-01-17 01:11:19 UTC (rev 19839) > +++ haiku/trunk/src/add-ons/kernel/generic/scsi_periph/scsi_periph.c > 2007-01-17 01:39:59 UTC (rev 19840) > @@ -161,7 +161,9 @@ > periph_get_media_status, > > periph_compose_device_name, > - periph_get_icon > + periph_get_icon, > + > + periph_synchronize_cache > }; > > scsi_periph_interface *modules[] = { > > Modified: haiku/trunk/src/add-ons/kernel/generic/scsi_periph/ > scsi_periph_int.h > =================================================================== > --- haiku/trunk/src/add-ons/kernel/generic/scsi_periph/ > scsi_periph_int.h 2007-01-17 01:11:19 UTC (rev 19839) > +++ haiku/trunk/src/add-ons/kernel/generic/scsi_periph/ > scsi_periph_int.h 2007-01-17 01:39:59 UTC (rev 19840) > @@ -109,4 +109,9 @@ > > status_t periph_get_icon(icon_type type, device_icon *data); > > +// sync.c > + > +err_res periph_synchronize_cache(scsi_periph_device_info *device, > + scsi_ccb *request); > + > #endif /* __SCSI_PERIPH_INT_H__ */ > > Added: haiku/trunk/src/add-ons/kernel/generic/scsi_periph/sync.c > =================================================================== > --- haiku/trunk/src/add-ons/kernel/generic/scsi_periph/sync.c 2007- > 01-17 01:11:19 UTC (rev 19839) > +++ haiku/trunk/src/add-ons/kernel/generic/scsi_periph/sync.c 2007- > 01-17 01:39:59 UTC (rev 19840) > @@ -0,0 +1,47 @@ > +/* > + * Copyright 2007, Haiku, Inc. All Rights Reserved. > + * Distributed under the terms of the MIT License. > + * > + * Authors: > + * Bruno Albuquerque, bga at bug-br.org.br > + * > + * Copyright 2004-2006 yellowTAB GMbH. This file is > + * based on work I did for ZETA while employed by > + * yellowTAB and is used under permission. > + * > + */ > + > +#include "scsi_periph_int.h" > + > +#include > + > +#include > + > +err_res > +periph_synchronize_cache(scsi_periph_device_info *device, scsi_ccb * > request) > +{ > + scsi_cmd_sync_cache* cmd = (scsi_cmd_sync_cache*)request->cdb; > + > + request->flags = SCSI_DIR_NONE; > + > + request->data = NULL; > + request->sg_list = NULL; > + request->data_len = 0; > + request->timeout = device->std_timeout; > + request->sort = -1; > + > + memset(cmd, 0, sizeof(*cmd)); > + > + cmd->opcode = SCSI_OP_SYNCHRONIZE_CACHE; > + cmd->immed = 0; > + > + // TODO(bga): Maybe we will actually want to set those one day... > + cmd->nblocks_high = 0; > + cmd->nblocks_low = 0; > + > + request->cdb_len = sizeof(*cmd); > + > + device->scsi->sync_io(request); > + > + return periph_check_error(device, request); > +} > > Modified: haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef > =================================================================== > --- haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef 2007-01-17 > 01:11:19 UTC (rev 19839) > +++ haiku/trunk/src/apps/midiplayer/MidiPlayer.rdef 2007-01-17 > 01:39:59 UTC (rev 19840) > @@ -11,12 +11,12 @@ > long_info = "MidiPlayer ?2004-2007 Haiku, Inc." > }; > > +resource app_flags B_SINGLE_LAUNCH; > + > resource file_types message { > "types" = "audio/x-midi" > }; > > -resource app_flags B_SINGLE_LAUNCH; > - > resource large_icon array { > $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" > $"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" > > Modified: haiku/trunk/src/apps/people/People.rdef > =================================================================== > --- haiku/trunk/src/apps/people/People.rdef 2007-01-17 01:11:19 UTC > (rev 19839) > +++ haiku/trunk/src/apps/people/People.rdef 2007-01-17 01:39:59 UTC > (rev 19840) > @@ -1,10 +1,6 @@ > > resource(1, "BEOS:APP_SIG") #'MIMS' "application/x-vnd.Be-PEPL"; > > -resource(1, "BEOS:FILE_TYPES") message { > - "types" = "application/x-person" > -}; > - > resource app_version { > major = 1, > middle = 0, > @@ -19,6 +15,10 @@ > > resource app_flags B_SINGLE_LAUNCH; > > +resource(1, "BEOS:FILE_TYPES") message { > + "types" = "application/x-person" > +}; > + > #ifdef HAIKU_TARGET_PLATFORM_HAIKU > > resource vector_icon { > > Modified: haiku/trunk/src/apps/showimage/ShowImage.rdef > =================================================================== > --- haiku/trunk/src/apps/showimage/ShowImage.rdef 2007-01-17 01:11:19 > UTC (rev 19839) > +++ haiku/trunk/src/apps/showimage/ShowImage.rdef 2007-01-17 01:39:59 > UTC (rev 19840) > @@ -4,10 +4,6 @@ > > resource app_signature "application/x-vnd.Haiku-ShowImage"; > > -resource file_types message { > - "types" = "image" > -}; > - > resource app_version { > major = 0, > middle = 0, > @@ -22,6 +18,10 @@ > > resource app_flags B_SINGLE_LAUNCH; > > +resource file_types message { > + "types" = "image" > +}; > + > #ifdef HAIKU_TARGET_PLATFORM_HAIKU > > resource vector_icon { > > Modified: haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef > =================================================================== > --- haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef 2007-01-17 > 01:11:19 UTC (rev 19839) > +++ haiku/trunk/src/apps/soundrecorder/SoundRecorder.rdef 2007-01-17 > 01:39:59 UTC (rev 19840) > @@ -11,6 +11,8 @@ > long_info = "SoundRecorder ?2005-2007 Haiku, Inc." > }; > > +resource app_flags B_SINGLE_LAUNCH; > + > resource file_types message { > "types" = "audio/basic", > "types" = "audio/x-wav", > @@ -22,8 +24,6 @@ > "types" = "audio/riff" > }; > > -resource app_flags B_SINGLE_LAUNCH; > - > #ifdef HAIKU_TARGET_PLATFORM_HAIKU > > resource vector_icon { > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits -- Fortune Cookie Says: Skinner's Constant (or Flannagan's Finagling Factor): That quantity which, when multiplied by, divided by, added to, or subtracted from the answer you get, gives you the answer you should have gotten. From axeld at pinc-software.de Wed Jan 17 08:52:12 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 17 Jan 2007 08:52:12 +0100 (MET) Subject: [Haiku-commits] r19840 - in haiku/trunk: headers/build/os/drivers/bus/scsi headers/os/drivers/bus/scsi src/add-ons/kernel/drivers/disk/scsi/scsi_dsk src/add-ons/kernel/generic/scsi_periph src/apps/midiplayer src/apps/people src/apps/showimage src/apps/soundrecorder In-Reply-To: <11775920226-BeMail@guglielmo> Message-ID: <2648577989-BeMail@zon> "Bruno G. Albuquerque" wrote: > Ops. It included some other stuff I was working on by mistake. But > should be harmless anyway. Let me know if you find it cause havoc for > you. :P The other changes were surprising, but indeed shouldn't do any harm :-) > Anyway, it would be great if Axel and Marcus could review the code. > For > everyone else, let me know if you have any kind of problems after > this > chage. Looks good, even though I am not that familiar with SCSI myself ;-) About your TODO: while the IDE bus manager has already implemented cache flushing (just not B_FLUSH_CACHE), it also ignores the block range parameters right now. > And, while we are at it, why the hell do we have 2 scsi_periph.h > files? > Just to be on the safe side, I changed both. Ingo was a bit generous when copying the build headers (for building Haiku components on non-Haiku platforms, ie. a "mimeset" command to be used under Linux). It's not wrong to update them, but it shouldn't be needed either; maybe we should remove all unused files there, to make it clearer what kind of functionality is actually usable under the build environment. Bye, Axel. From axeld at mail.berlios.de Wed Jan 17 10:10:17 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 17 Jan 2007 10:10:17 +0100 Subject: [Haiku-commits] r19841 - in haiku/trunk: headers/os/translation src/kits/translation Message-ID: <200701170910.l0H9AHuc028274@sheep.berlios.de> Author: axeld Date: 2007-01-17 10:10:16 +0100 (Wed, 17 Jan 2007) New Revision: 19841 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19841&view=rev Modified: haiku/trunk/headers/os/translation/TranslationUtils.h haiku/trunk/src/kits/translation/Jamfile haiku/trunk/src/kits/translation/TranslationUtils.cpp Log: Added WriteStyledEditFile() variant that gets an encoding argument; it will automatically encode the text in the BTextView accordingly. Modified: haiku/trunk/headers/os/translation/TranslationUtils.h =================================================================== --- haiku/trunk/headers/os/translation/TranslationUtils.h 2007-01-17 01:39:59 UTC (rev 19840) +++ haiku/trunk/headers/os/translation/TranslationUtils.h 2007-01-17 09:10:16 UTC (rev 19841) @@ -46,80 +46,48 @@ // You don't create an instance of it; you just call its various // static member functions for utility-like operations. class BTranslationUtils { - BTranslationUtils(); - ~BTranslationUtils(); - BTranslationUtils(const BTranslationUtils &); - BTranslationUtils & operator=(const BTranslationUtils &); + BTranslationUtils(); + ~BTranslationUtils(); + BTranslationUtils(const BTranslationUtils &); + BTranslationUtils & operator=(const BTranslationUtils &); -public: + public: + // bitmap functions + static BBitmap *GetBitmap(const char *name, BTranslatorRoster *roster = NULL); + static BBitmap *GetBitmap(uint32 type, int32 id, + BTranslatorRoster *roster = NULL); + static BBitmap *GetBitmap(uint32 type, const char *name, + BTranslatorRoster *roster = NULL); + static BBitmap *GetBitmapFile(const char *name, + BTranslatorRoster *roster = NULL); + static BBitmap *GetBitmap(const entry_ref *ref, + BTranslatorRoster *roster = NULL); + static BBitmap *GetBitmap(BPositionIO *stream, + BTranslatorRoster *roster = NULL); -// BITMAP getters - allocate the BBitmap; you call delete on it! + // text functions + static status_t GetStyledText(BPositionIO *fromStream, BTextView *intoView, + BTranslatorRoster *roster = NULL); + static status_t PutStyledText(BTextView *fromView, BPositionIO *intoStream, + BTranslatorRoster *roster = NULL); + static status_t WriteStyledEditFile(BTextView *fromView, BFile *intoFile); + static status_t WriteStyledEditFile(BTextView *fromView, BFile *intoFile, + const char* encoding); -static BBitmap *GetBitmap(const char *kName, BTranslatorRoster *roster = NULL); - // Get bitmap - first try as file name, then as B_TRANSLATOR_BITMAP - // resource type from app file -- can be of any kind for which a - // translator is installed (TGA, etc) - -static BBitmap *GetBitmap(uint32 type, int32 id, - BTranslatorRoster *roster = NULL); - // Get bitmap - from app resource by id - -static BBitmap *GetBitmap(uint32 type, const char *kName, - BTranslatorRoster *roster = NULL); - // Get Bitmap - from app resource by name - -static BBitmap *GetBitmapFile(const char *kName, - BTranslatorRoster *roster = NULL); - // Get bitmap - from file only + // misc. functions + static BMessage *GetDefaultSettings(translator_id forTranslator, + BTranslatorRoster *roster = NULL); + static BMessage *GetDefaultSettings(const char *translatorName, + int32 translatorVersion); -static BBitmap *GetBitmap(const entry_ref *kRef, - BTranslatorRoster *roster = NULL); - // Get bitmap - from open file (or BMemoryIO) - -static BBitmap *GetBitmap(BPositionIO *stream, - BTranslatorRoster *roster = NULL); - // Get bitmap - from open file or IO type object - // This function does the real work for the other GetBitmap functions - -static status_t GetStyledText(BPositionIO *fromStream, BTextView *intoView, - BTranslatorRoster *roster = NULL); - //?For styled text, we can translate from a stream - // directly into a BTextView - -static status_t PutStyledText(BTextView *fromView, BPositionIO *intoStream, - BTranslatorRoster *roster = NULL); - // Saving is slightly different -- given the BTextView, a - // B_STYLED_TEXT_FORMAT stream is written to intoStream. You can then call - // Translate() yourself to translate that stream into something else if - // you want, if it is a temp file or a BMallocIO. It's also OK to write - // the B_STYLED_TEXT_FORMAT to a file, although the StyledEdit format - // (TEXT file + style attributes) is preferred. This convenience function - // is only marginally part of the Translation Kit, but what the hey :-) - -static status_t WriteStyledEditFile(BTextView *fromView, BFile *intoFile); - // Writes the styled text data from fromView to intoFile - -static BMessage *GetDefaultSettings(translator_id forTranslator, - BTranslatorRoster *roster = NULL); - // Get default settings for the translator with the id forTranslator - -static BMessage *GetDefaultSettings(const char *kTranslatorName, - int32 translatorVersion); - // Get default settings for the translator with the name kTranslatorName - -// Envious of that "Save As" menu in ShowImage? Well, you can have your own! -// AddTranslationItems will add menu items for all translations from the -// basic format you specify (B_TRANSLATOR_BITMAP, B_TRANSLATOR_TEXT etc). -// The translator ID and format constant chosen will be added to the message -// that is sent to you when the menu item is selected. - enum { - B_TRANSLATION_MENU = 'BTMN' - }; -static status_t AddTranslationItems(BMenu *intoMenu, uint32 fromType, - const BMessage *kModel = NULL, // default B_TRANSLATION_MENU - const char *kTranslatorIdName = NULL, // default "be:translator" - const char *kTranslatorTypeName = NULL, // default "be:type" - BTranslatorRoster *roster = NULL); + enum { + B_TRANSLATION_MENU = 'BTMN' + }; + static status_t AddTranslationItems(BMenu *intoMenu, uint32 fromType, + const BMessage *model = NULL, // default B_TRANSLATION_MENU + const char *translatorIdName = NULL, // default "be:translator" + const char *translatorTypeName = NULL, // default "be:type" + BTranslatorRoster *roster = NULL); }; #endif /* _TRANSLATION_UTILS_H */ Modified: haiku/trunk/src/kits/translation/Jamfile =================================================================== --- haiku/trunk/src/kits/translation/Jamfile 2007-01-17 01:39:59 UTC (rev 19840) +++ haiku/trunk/src/kits/translation/Jamfile 2007-01-17 09:10:16 UTC (rev 19841) @@ -7,7 +7,7 @@ UsePublicHeaders translation ; } -UsePrivateHeaders translation ; +UsePrivateHeaders translation textencoding ; SharedLibrary libtranslation.so : BitmapStream.cpp @@ -16,7 +16,7 @@ Translator.cpp TranslatorRoster.cpp - : be $(TARGET_LIBSTDC++) + : be libtextencoding.so $(TARGET_LIBSTDC++) ; Package haiku-translationkit-cvs : Modified: haiku/trunk/src/kits/translation/TranslationUtils.cpp =================================================================== --- haiku/trunk/src/kits/translation/TranslationUtils.cpp 2007-01-17 01:39:59 UTC (rev 19840) +++ haiku/trunk/src/kits/translation/TranslationUtils.cpp 2007-01-17 09:10:16 UTC (rev 19841) @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include #include #include @@ -24,12 +26,16 @@ #include #include #include +#include #include #include #include +using namespace BPrivate; + + BTranslationUtils::BTranslationUtils() { } @@ -587,13 +593,14 @@ \param view the view with the styled text \param file the file where the styled text is written to + \param the encoding to use, defaults to UTF-8 \return B_BAD_VALUE, if either parameter is NULL B_OK, if successful, and any possible file error if writing failed. */ status_t -BTranslationUtils::WriteStyledEditFile(BTextView* view, BFile* file) +BTranslationUtils::WriteStyledEditFile(BTextView* view, BFile* file, const char *encoding) { if (view == NULL || file == NULL) return B_BAD_VALUE; @@ -607,19 +614,63 @@ return B_ERROR; // move to the start of the file if not already there - status_t result = file->Seek(0, SEEK_SET); - if (result != B_OK) - return result; + status_t status = file->Seek(0, SEEK_SET); + if (status != B_OK) + return status; - // Write plain text data to file - ssize_t bytesWritten = file->Write(text, textLength); - if (bytesWritten != textLength) - return B_ERROR; + const BCharacterSet* characterSet = NULL; + if (encoding != NULL && strcmp(encoding, "")) + characterSet = BCharacterSetRoster::FindCharacterSetByName(encoding); + if (characterSet == NULL) { + // default encoding - UTF-8 + // Write plain text data to file + ssize_t bytesWritten = file->Write(text, textLength); + if (bytesWritten != textLength) { + if (bytesWritten < B_OK) + return bytesWritten; + return B_ERROR; + } + + // be:encoding, defaults to UTF-8 (65535) + // Note that the B_UNICODE_UTF8 constant is 0 and for some reason + // not appropriate for use here. + int32 value = 65535; + file->WriteAttr("be:encoding", B_INT32_TYPE, 0, &value, sizeof(value)); + } else { + // we need to convert the text + uint32 id = characterSet->GetConversionID(); + const char* outText = view->Text(); + int32 sourceLength = textLength; + int32 state = 0; + + textLength = 0; + + do { + char buffer[32768]; + int32 length = sourceLength; + int32 bufferSize = sizeof(buffer); + status = convert_from_utf8(id, outText, &length, buffer, &bufferSize, &state); + if (status != B_OK) + return status; + + ssize_t bytesWritten = file->Write(buffer, bufferSize); + if (bytesWritten < B_OK) + return bytesWritten; + + sourceLength -= length; + textLength += bytesWritten; + outText += length; + } while (sourceLength > 0); + + file->WriteAttr("be:encoding", B_STRING_TYPE, 0, + encoding, strlen(encoding)); + } + // truncate any extra text - result = file->SetSize(textLength); - if (result != B_OK) - return result; + status = file->SetSize(textLength); + if (status != B_OK) + return status; // Write attributes. We don't report an error anymore after this point, // as attributes aren't that crucial - not all volumes support attributes. @@ -630,14 +681,13 @@ char type[B_MIME_TYPE_LENGTH]; if (info.GetType(type) != B_OK) { // This file doesn't have a file type yet, so let's set it - result = info.SetType("text/plain"); - if (result < B_OK) + if (info.SetType("text/plain") < B_OK) return B_OK; } // word wrap setting, turned on by default int32 wordWrap = view->DoesWordWrap() ? 1 : 0; - bytesWritten = file->WriteAttr("wrap", B_INT32_TYPE, 0, + ssize_t bytesWritten = file->WriteAttr("wrap", B_INT32_TYPE, 0, &wordWrap, sizeof(int32)); if (bytesWritten != sizeof(int32)) return B_OK; @@ -649,15 +699,6 @@ if (bytesWritten != sizeof(int32)) return B_OK; - // be:encoding, defaults to UTF-8 (65535) - // Note that the B_UNICODE_UTF8 constant is 0 and for some reason - // not appropriate for use here. - int32 encoding = 65535; - bytesWritten = file->WriteAttr("be:encoding", B_INT32_TYPE, 0, - &encoding, sizeof(int32)); - if (bytesWritten != sizeof(int32)) - return B_OK; - // Write text_run_array, ie. the styles of the text text_run_array *runArray = view->RunArray(0, view->TextLength()); @@ -681,6 +722,13 @@ } +status_t +BTranslationUtils::WriteStyledEditFile(BTextView* view, BFile* file) +{ + return WriteStyledEditFile(view, file, NULL); +} + + /*! Each translator can have default settings, set by the "translations" control panel. You can read these settings to From stefano.ceccherini at gmail.com Wed Jan 17 11:10:18 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Wed, 17 Jan 2007 11:10:18 +0100 Subject: [Haiku-commits] r19841 - in haiku/trunk: headers/os/translation src/kits/translation In-Reply-To: <200701170910.l0H9AHuc028274@sheep.berlios.de> References: <200701170910.l0H9AHuc028274@sheep.berlios.de> Message-ID: <894b9700701170210k7bdaoaf0fd93f18761ea2@mail.gmail.com> 2007/1/17, axeld at BerliOS : > Log: > Added WriteStyledEditFile() variant that gets an encoding argument; it will automatically > encode the text in the BTextView accordingly. Axel, will you use this new method in StyledEdit ? From axeld at mail.berlios.de Wed Jan 17 11:46:29 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 17 Jan 2007 11:46:29 +0100 Subject: [Haiku-commits] r19842 - haiku/trunk/src/add-ons/translators/stxt Message-ID: <200701171046.l0HAkTbh006555@sheep.berlios.de> Author: axeld Date: 2007-01-17 11:46:28 +0100 (Wed, 17 Jan 2007) New Revision: 19842 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19842&view=rev Modified: haiku/trunk/src/add-ons/translators/stxt/Jamfile haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp Log: * Added the file_ascmagic() stuff from our text sniffer add-on (originally taken from BSD's file utility) to identify text files. * The translator now automatically decodes files based "be:encoding" (which can now also be a string type attribute), as well as whatever file_ascmagic() recognizes. IOW we can now finally read all text files we recognize as text files. * Added an ioExtension to force a specific encoding for Translate() (called "be:encoding" as well). * Enlarged the read buffer to 32768 bytes (instead of just 2048). * Now fails when reading/writing files >4GB in STXT format (which doesn't support those) * Translate() now writes the "be:encoding" attribute in case it detected the encoding itself. * Cleanup. Modified: haiku/trunk/src/add-ons/translators/stxt/Jamfile =================================================================== --- haiku/trunk/src/add-ons/translators/stxt/Jamfile 2007-01-17 09:10:16 UTC (rev 19841) +++ haiku/trunk/src/add-ons/translators/stxt/Jamfile 2007-01-17 10:46:28 UTC (rev 19842) @@ -2,6 +2,10 @@ SetSubDirSupportedPlatformsBeOSCompatible ; +UsePrivateHeaders textencoding ; +UseHeaders [ FDirName $(HAIKU_TOP) src servers registrar ] ; + # for the text identification + # Include BaseTranslator code from shared directory SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons translators shared ] ; @@ -16,7 +20,7 @@ STXTTranslator.cpp STXTView.cpp - : be translation + : be translation libtextencoding.so ; Package haiku-translationkit-cvs : Modified: haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp 2007-01-17 09:10:16 UTC (rev 19841) +++ haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp 2007-01-17 10:46:28 UTC (rev 19842) @@ -1,40 +1,32 @@ -/*****************************************************************************/ -// STXTTranslator -// Written by Michael Wilber, OBOS Translation Kit Team -// -// STXTTranslator.cpp -// -// This BTranslator based object is for opening and writing -// StyledEdit (STXT) files. -// -// -// Copyright (c) 2002 OpenBeOS Project -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -/*****************************************************************************/ +/* + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Michael Wilber + * Axel D?rfler, axeld at pinc-software.de + */ -#include -#include + #include "STXTTranslator.h" #include "STXTView.h" -#define READ_BUFFER_SIZE 2048 +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + +using namespace BPrivate; + + +#define READ_BUFFER_SIZE 32768 #define DATA_BUFFER_SIZE 256 // The input formats that this translator supports. @@ -109,83 +101,648 @@ make_nth_translator(int32 n, image_id you, uint32 flags, ...) { if (!n) - return new STXTTranslator(); + return new (std::nothrow) STXTTranslator(); + + return NULL; +} + + +// #pragma mark - ascmagic.c from the BSD file tool +/* + * The following code has been taken from version 4.17 of the BSD file tool, + * file ascmagic.c, modified for our purpose. + */ + +/* + * Copyright (c) Ian F. Darwin 1986-1995. + * Software written by Ian F. Darwin and others; + * maintained 1995-present by Christos Zoulas and others. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice immediately at the beginning of the file, without modification, + * this list of conditions, and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/* + * ASCII magic -- file types that we know based on keywords + * that can appear anywhere in the file. + * + * Extensively modified by Eric Fischer in July, 2000, + * to handle character codes other than ASCII on a unified basis. + * + * Joerg Wunsch wrote the original support for 8-bit + * international characters, now subsumed into this file. + */ + +#include +#include +#include +#include +#include +#include +#include "names.h" + +typedef unsigned long my_unichar; + +#define MAXLINELEN 300 /* longest sane line length */ +#define ISSPC(x) ((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n' \ + || (x) == 0x85 || (x) == '\f') + +static int looks_ascii(const unsigned char *, size_t, my_unichar *, size_t *); +static int looks_utf8(const unsigned char *, size_t, my_unichar *, size_t *); +static int looks_unicode(const unsigned char *, size_t, my_unichar *, size_t *); +static int looks_latin1(const unsigned char *, size_t, my_unichar *, size_t *); +static int looks_extended(const unsigned char *, size_t, my_unichar *, size_t *); +static void from_ebcdic(const unsigned char *, size_t, unsigned char *); +static int ascmatch(const unsigned char *, const my_unichar *, size_t); + + +static int +file_ascmagic(const unsigned char *buf, size_t nbytes, BMimeType* mimeType, + const char*& encoding) +{ + size_t i; + unsigned char *nbuf = NULL; + my_unichar *ubuf = NULL; + size_t ulen; + struct names *p; + int rv = -1; + + const char *code = NULL; + encoding = NULL; + const char *type = NULL; + const char *subtype = NULL; + const char *subtype_mime = NULL; + + int has_escapes = 0; + int has_backspace = 0; + int seen_cr = 0; + + int n_crlf = 0; + int n_lf = 0; + int n_cr = 0; + int n_nel = 0; + + int last_line_end = -1; + int has_long_lines = 0; + + if ((nbuf = (unsigned char*)malloc((nbytes + 1) * sizeof(nbuf[0]))) == NULL) + goto done; + if ((ubuf = (my_unichar*)malloc((nbytes + 1) * sizeof(ubuf[0]))) == NULL) + goto done; + + /* + * Then try to determine whether it's any character code we can + * identify. Each of these tests, if it succeeds, will leave + * the text converted into one-my_unichar-per-character Unicode in + * ubuf, and the number of characters converted in ulen. + */ + if (looks_ascii(buf, nbytes, ubuf, &ulen)) { + code = "ASCII"; + encoding = NULL; //"us-ascii"; + type = "text"; + } else if (looks_utf8(buf, nbytes, ubuf, &ulen)) { + code = "UTF-8 Unicode"; + encoding = NULL; // "UTF-8"; + type = "text"; + } else if ((i = looks_unicode(buf, nbytes, ubuf, &ulen)) != 0) { + if (i == 1) { + code = "Little-endian UTF-16 Unicode"; + encoding = "UTF-16"; + } else { + code = "Big-endian UTF-16 Unicode"; + encoding = "UTF-16"; + } + + type = "character data"; + } else if (looks_latin1(buf, nbytes, ubuf, &ulen)) { + code = "ISO-8859"; + type = "text"; + encoding = "iso-8859-1"; + } else if (looks_extended(buf, nbytes, ubuf, &ulen)) { + code = "Non-ISO extended-ASCII"; + type = "text"; + encoding = "unknown"; + } else { + from_ebcdic(buf, nbytes, nbuf); + + if (looks_ascii(nbuf, nbytes, ubuf, &ulen)) { + code = "EBCDIC"; + type = "character data"; + encoding = "ebcdic"; + } else if (looks_latin1(nbuf, nbytes, ubuf, &ulen)) { + code = "International EBCDIC"; + type = "character data"; + encoding = "ebcdic"; + } else { + rv = 0; + goto done; /* doesn't look like text at all */ + } + } + + if (nbytes <= 1) { + rv = 0; + goto done; + } + + /* + * for troff, look for . + letter + letter or .\"; + * this must be done to disambiguate tar archives' ./file + * and other trash from real troff input. + * + * I believe Plan 9 troff allows non-ASCII characters in the names + * of macros, so this test might possibly fail on such a file. + */ + if (*ubuf == '.') { + my_unichar *tp = ubuf + 1; + + while (ISSPC(*tp)) + ++tp; /* skip leading whitespace */ + if ((tp[0] == '\\' && tp[1] == '\"') || + (isascii((unsigned char)tp[0]) && + isalnum((unsigned char)tp[0]) && + isascii((unsigned char)tp[1]) && + isalnum((unsigned char)tp[1]) && + ISSPC(tp[2]))) { + subtype_mime = "text/troff"; + subtype = "troff or preprocessor input"; + goto subtype_identified; + } + } + + if ((*buf == 'c' || *buf == 'C') && ISSPC(buf[1])) { + subtype_mime = "text/fortran"; + subtype = "fortran program"; + goto subtype_identified; + } + + /* look for tokens from names.h - this is expensive! */ + + i = 0; + while (i < ulen) { + size_t end; + + /* + * skip past any leading space + */ + while (i < ulen && ISSPC(ubuf[i])) + i++; + if (i >= ulen) + break; + + /* + * find the next whitespace + */ + for (end = i + 1; end < nbytes; end++) + if (ISSPC(ubuf[end])) + break; + + /* + * compare the word thus isolated against the token list + */ + for (p = names; p < names + NNAMES; p++) { + if (ascmatch((const unsigned char *)p->name, ubuf + i, + end - i)) { + subtype = types[p->type].human; + subtype_mime = types[p->type].mime; + goto subtype_identified; + } + } + + i = end; + } + +subtype_identified: + + /* + * Now try to discover other details about the file. + */ + for (i = 0; i < ulen; i++) { + if (ubuf[i] == '\n') { + if (seen_cr) + n_crlf++; + else + n_lf++; + last_line_end = i; + } else if (seen_cr) + n_cr++; + + seen_cr = (ubuf[i] == '\r'); + if (seen_cr) + last_line_end = i; + + if (ubuf[i] == 0x85) { /* X3.64/ECMA-43 "next line" character */ + n_nel++; + last_line_end = i; + } + + /* If this line is _longer_ than MAXLINELEN, remember it. */ + if ((int)i > last_line_end + MAXLINELEN) + has_long_lines = 1; + + if (ubuf[i] == '\033') + has_escapes = 1; + if (ubuf[i] == '\b') + has_backspace = 1; + } + + rv = 1; +done: + if (nbuf) + free(nbuf); + if (ubuf) + free(ubuf); + + if (rv) { + // If we have identified the subtype, return it, otherwise just + // text/plain. + if (subtype_mime) + mimeType->SetTo(subtype_mime); + else + mimeType->SetTo("text/plain"); + } + + return rv; +} + +static int +ascmatch(const unsigned char *s, const my_unichar *us, size_t ulen) +{ + size_t i; + + for (i = 0; i < ulen; i++) { + if (s[i] != us[i]) + return 0; + } + + if (s[i]) + return 0; else - return NULL; + return 1; } -// --------------------------------------------------------------- -// Constructor -// -// Sets up the version info and the name of the translator so that -// these values can be returned when they are requested. -// -// Preconditions: -// -// Parameters: -// -// Postconditions: -// -// Returns: -// --------------------------------------------------------------- -STXTTranslator::STXTTranslator() - : BaseTranslator("StyledEdit Files", "StyledEdit files translator", - STXT_TRANSLATOR_VERSION, - gInputFormats, sizeof(gInputFormats) / sizeof(translation_format), - gOutputFormats, sizeof(gOutputFormats) / sizeof(translation_format), - "STXTTranslator_Settings", - gDefaultSettings, sizeof(gDefaultSettings) / sizeof(TranSetting), - B_TRANSLATOR_TEXT, B_STYLED_TEXT_FORMAT) +/* + * This table reflects a particular philosophy about what constitutes + * "text," and there is room for disagreement about it. + * + * Version 3.31 of the file command considered a file to be ASCII if + * each of its characters was approved by either the isascii() or + * isalpha() function. On most systems, this would mean that any + * file consisting only of characters in the range 0x00 ... 0x7F + * would be called ASCII text, but many systems might reasonably + * consider some characters outside this range to be alphabetic, + * so the file command would call such characters ASCII. It might + * have been more accurate to call this "considered textual on the + * local system" than "ASCII." + * + * It considered a file to be "International language text" if each + * of its characters was either an ASCII printing character (according + * to the real ASCII standard, not the above test), a character in + * the range 0x80 ... 0xFF, or one of the following control characters: + * backspace, tab, line feed, vertical tab, form feed, carriage return, + * escape. No attempt was made to determine the language in which files + * of this type were written. + * + * + * The table below considers a file to be ASCII if all of its characters + * are either ASCII printing characters (again, according to the X3.4 + * standard, not isascii()) or any of the following controls: bell, + * backspace, tab, line feed, form feed, carriage return, esc, nextline. + * + * I include bell because some programs (particularly shell scripts) + * use it literally, even though it is rare in normal text. I exclude + * vertical tab because it never seems to be used in real text. I also + * include, with hesitation, the X3.64/ECMA-43 control nextline (0x85), + * because that's what the dd EBCDIC->ASCII table maps the EBCDIC newline + * character to. It might be more appropriate to include it in the 8859 + * set instead of the ASCII set, but it's got to be included in *something* + * we recognize or EBCDIC files aren't going to be considered textual. + * Some old Unix source files use SO/SI (^N/^O) to shift between Greek + * and Latin characters, so these should possibly be allowed. But they + * make a real mess on VT100-style displays if they're not paired properly, + * so we are probably better off not calling them text. + * + * A file is considered to be ISO-8859 text if its characters are all + * either ASCII, according to the above definition, or printing characters + * from the ISO-8859 8-bit extension, characters 0xA0 ... 0xFF. + * + * Finally, a file is considered to be international text from some other + * character code if its characters are all either ISO-8859 (according to + * the above definition) or characters in the range 0x80 ... 0x9F, which + * ISO-8859 considers to be control characters but the IBM PC and Macintosh + * consider to be printing characters. + */ + +#define F 0 /* character never appears in text */ +#define T 1 /* character appears in plain ASCII text */ +#define I 2 /* character appears in ISO-8859 text */ +#define X 3 /* character appears in non-ISO extended ASCII (Mac, IBM PC) */ + +static char text_chars[256] = { + /* BEL BS HT LF FF CR */ + F, F, F, F, F, F, F, T, T, T, T, F, T, T, F, F, /* 0x0X */ + /* ESC */ + F, F, F, F, F, F, F, F, F, F, F, T, F, F, F, F, /* 0x1X */ + T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x2X */ + T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x3X */ + T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x4X */ + T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x5X */ + T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, /* 0x6X */ + T, T, T, T, T, T, T, T, T, T, T, T, T, T, T, F, /* 0x7X */ + /* NEL */ + X, X, X, X, X, T, X, X, X, X, X, X, X, X, X, X, /* 0x8X */ + X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, X, /* 0x9X */ + I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xaX */ + I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xbX */ + I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xcX */ + I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xdX */ + I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, /* 0xeX */ + I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I /* 0xfX */ +}; + +static int +looks_ascii(const unsigned char *buf, size_t nbytes, my_unichar *ubuf, + size_t *ulen) { + int i; + + *ulen = 0; + + for (i = 0; i < (int)nbytes; i++) { + int t = text_chars[buf[i]]; + + if (t != T) + return 0; + + ubuf[(*ulen)++] = buf[i]; + } + + return 1; } -// --------------------------------------------------------------- -// Destructor -// -// Does nothing -// -// Preconditions: -// -// Parameters: -// -// Postconditions: -// -// Returns: -// --------------------------------------------------------------- -STXTTranslator::~STXTTranslator() +static int +looks_latin1(const unsigned char *buf, size_t nbytes, my_unichar *ubuf, size_t *ulen) { + int i; + + *ulen = 0; + + for (i = 0; i < (int)nbytes; i++) { + int t = text_chars[buf[i]]; + + if (t != T && t != I) + return 0; + + ubuf[(*ulen)++] = buf[i]; + } + + return 1; } -// --------------------------------------------------------------- -// identify_stxt_header -// -// Determines if the data in inSource is of the STXT format. -// -// Preconditions: -// -// Parameters: header, the STXT stream header read in by -// Identify() or Translate() -// -// inSource, The stream with the STXT data -// -// outInfo, information about the type of data -// from inSource is stored here -// -// outType, the desired output type for the -// data in inSource -// -// ptxtheader if this is not NULL, the TEXT -// header from inSource is copied -// to it -// -// Postconditions: -// -// Returns: B_OK, if the data appears to be in the STXT format, -// B_NO_TRANSLATOR, if the data is not in the STXT format or -// returns B_ERROR if errors were encountered in trying to -// determine the format, or another error code if there was an -// error calling BPostionIO::Read() -// --------------------------------------------------------------- +static int +looks_extended(const unsigned char *buf, size_t nbytes, my_unichar *ubuf, + size_t *ulen) +{ + int i; + + *ulen = 0; + + for (i = 0; i < (int)nbytes; i++) { + int t = text_chars[buf[i]]; + + if (t != T && t != I && t != X) + return 0; + + ubuf[(*ulen)++] = buf[i]; + } + + return 1; +} + +static int +looks_utf8(const unsigned char *buf, size_t nbytes, my_unichar *ubuf, size_t *ulen) +{ + int i, n; + my_unichar c; + int gotone = 0; + + *ulen = 0; + + for (i = 0; i < (int)nbytes; i++) { + if ((buf[i] & 0x80) == 0) { /* 0xxxxxxx is plain ASCII */ + /* + * Even if the whole file is valid UTF-8 sequences, + * still reject it if it uses weird control characters. + */ + + if (text_chars[buf[i]] != T) + return 0; + + ubuf[(*ulen)++] = buf[i]; + } else if ((buf[i] & 0x40) == 0) { /* 10xxxxxx never 1st byte */ + return 0; + } else { /* 11xxxxxx begins UTF-8 */ + int following; + + if ((buf[i] & 0x20) == 0) { /* 110xxxxx */ + c = buf[i] & 0x1f; + following = 1; + } else if ((buf[i] & 0x10) == 0) { /* 1110xxxx */ + c = buf[i] & 0x0f; + following = 2; + } else if ((buf[i] & 0x08) == 0) { /* 11110xxx */ + c = buf[i] & 0x07; + following = 3; + } else if ((buf[i] & 0x04) == 0) { /* 111110xx */ + c = buf[i] & 0x03; + following = 4; + } else if ((buf[i] & 0x02) == 0) { /* 1111110x */ + c = buf[i] & 0x01; + following = 5; + } else + return 0; + + for (n = 0; n < following; n++) { + i++; + if (i >= (int)nbytes) + goto done; + + if ((buf[i] & 0x80) == 0 || (buf[i] & 0x40)) + return 0; + + c = (c << 6) + (buf[i] & 0x3f); + } + + ubuf[(*ulen)++] = c; + gotone = 1; + } + } +done: + return gotone; /* don't claim it's UTF-8 if it's all 7-bit */ +} + +static int +looks_unicode(const unsigned char *buf, size_t nbytes, my_unichar *ubuf, + size_t *ulen) +{ + int bigend; + int i; + + if (nbytes < 2) + return 0; + + if (buf[0] == 0xff && buf[1] == 0xfe) + bigend = 0; + else if (buf[0] == 0xfe && buf[1] == 0xff) + bigend = 1; + else + return 0; + + *ulen = 0; + + for (i = 2; i + 1 < (int)nbytes; i += 2) { + /* XXX fix to properly handle chars > 65536 */ + + if (bigend) + ubuf[(*ulen)++] = buf[i + 1] + 256 * buf[i]; + else + ubuf[(*ulen)++] = buf[i] + 256 * buf[i + 1]; + + if (ubuf[*ulen - 1] == 0xfffe) + return 0; + if (ubuf[*ulen - 1] < 128 && + text_chars[(size_t)ubuf[*ulen - 1]] != T) + return 0; + } + + return 1 + bigend; +} + +#undef F +#undef T +#undef I +#undef X + +/* + * This table maps each EBCDIC character to an (8-bit extended) ASCII + * character, as specified in the rationale for the dd(1) command in + * draft 11.2 (September, 1991) of the POSIX P1003.2 standard. + * + * Unfortunately it does not seem to correspond exactly to any of the + * five variants of EBCDIC documented in IBM's _Enterprise Systems + * Architecture/390: Principles of Operation_, SA22-7201-06, Seventh + * Edition, July, 1999, pp. I-1 - I-4. + * + * Fortunately, though, all versions of EBCDIC, including this one, agree + * on most of the printing characters that also appear in (7-bit) ASCII. + * Of these, only '|', '!', '~', '^', '[', and ']' are in question at all. + * + * Fortunately too, there is general agreement that codes 0x00 through + * 0x3F represent control characters, 0x41 a nonbreaking space, and the + * remainder printing characters. + * + * This is sufficient to allow us to identify EBCDIC text and to distinguish + * between old-style and internationalized examples of text. + */ + +static unsigned char ebcdic_to_ascii[] = { + 0, 1, 2, 3, 156, 9, 134, 127, 151, 141, 142, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 157, 133, 8, 135, 24, 25, 146, 143, 28, 29, 30, 31, +128, 129, 130, 131, 132, 10, 23, 27, 136, 137, 138, 139, 140, 5, 6, 7, +144, 145, 22, 147, 148, 149, 150, 4, 152, 153, 154, 155, 20, 21, 158, 26, +' ', 160, 161, 162, 163, 164, 165, 166, 167, 168, 213, '.', '<', '(', '+', '|', +'&', 169, 170, 171, 172, 173, 174, 175, 176, 177, '!', '$', '*', ')', ';', '~', +'-', '/', 178, 179, 180, 181, 182, 183, 184, 185, 203, ',', '%', '_', '>', '?', +186, 187, 188, 189, 190, 191, 192, 193, 194, '`', ':', '#', '@', '\'','=', '"', +195, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 196, 197, 198, 199, 200, 201, +202, 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', '^', 204, 205, 206, 207, 208, +209, 229, 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 210, 211, 212, '[', 214, 215, +216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, ']', 230, 231, +'{', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 232, 233, 234, 235, 236, 237, +'}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 238, 239, 240, 241, 242, 243, +'\\',159, 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 244, 245, 246, 247, 248, 249, +'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 250, 251, 252, 253, 254, 255 +}; + +#ifdef notdef +/* + * The following EBCDIC-to-ASCII table may relate more closely to reality, + * or at least to modern reality. It comes from + * + * http://ftp.s390.ibm.com/products/oe/bpxqp9.html + * + * and maps the characters of EBCDIC code page 1047 (the code used for + * Unix-derived software on IBM's 390 systems) to the corresponding + * characters from ISO 8859-1. + * + * If this table is used instead of the above one, some of the special + * cases for the NEL character can be taken out of the code. + */ + +static unsigned char ebcdic_1047_to_8859[] = { +0x00,0x01,0x02,0x03,0x9C,0x09,0x86,0x7F,0x97,0x8D,0x8E,0x0B,0x0C,0x0D,0x0E,0x0F, +0x10,0x11,0x12,0x13,0x9D,0x0A,0x08,0x87,0x18,0x19,0x92,0x8F,0x1C,0x1D,0x1E,0x1F, +0x80,0x81,0x82,0x83,0x84,0x85,0x17,0x1B,0x88,0x89,0x8A,0x8B,0x8C,0x05,0x06,0x07, +0x90,0x91,0x16,0x93,0x94,0x95,0x96,0x04,0x98,0x99,0x9A,0x9B,0x14,0x15,0x9E,0x1A, +0x20,0xA0,0xE2,0xE4,0xE0,0xE1,0xE3,0xE5,0xE7,0xF1,0xA2,0x2E,0x3C,0x28,0x2B,0x7C, +0x26,0xE9,0xEA,0xEB,0xE8,0xED,0xEE,0xEF,0xEC,0xDF,0x21,0x24,0x2A,0x29,0x3B,0x5E, +0x2D,0x2F,0xC2,0xC4,0xC0,0xC1,0xC3,0xC5,0xC7,0xD1,0xA6,0x2C,0x25,0x5F,0x3E,0x3F, +0xF8,0xC9,0xCA,0xCB,0xC8,0xCD,0xCE,0xCF,0xCC,0x60,0x3A,0x23,0x40,0x27,0x3D,0x22, +0xD8,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0xAB,0xBB,0xF0,0xFD,0xFE,0xB1, +0xB0,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0xAA,0xBA,0xE6,0xB8,0xC6,0xA4, +0xB5,0x7E,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0xA1,0xBF,0xD0,0x5B,0xDE,0xAE, +0xAC,0xA3,0xA5,0xB7,0xA9,0xA7,0xB6,0xBC,0xBD,0xBE,0xDD,0xA8,0xAF,0x5D,0xB4,0xD7, +0x7B,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0xAD,0xF4,0xF6,0xF2,0xF3,0xF5, +0x7D,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0xB9,0xFB,0xFC,0xF9,0xFA,0xFF, +0x5C,0xF7,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0xB2,0xD4,0xD6,0xD2,0xD3,0xD5, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0xB3,0xDB,0xDC,0xD9,0xDA,0x9F +}; +#endif + +/* + * Copy buf[0 ... nbytes-1] into out[], translating EBCDIC to ASCII. + */ +static void +from_ebcdic(const unsigned char *buf, size_t nbytes, unsigned char *out) +{ + int i; + + for (i = 0; i < (int)nbytes; i++) { + out[i] = ebcdic_to_ascii[buf[i]]; + } +} + + +// #pragma mark - + + +/*! + Determines if the data in inSource is of the STXT format. + + \param header the STXT stream header read in by Identify() or Translate() + \param inSource the stream with the STXT data + \param outInfo information about the type of data from inSource is stored here + \param outType the desired output type for the data in inSource + \param ptxtheader if this is not NULL, the TEXT header from + inSource is copied to it +*/ status_t identify_stxt_header(const TranslatorStyledTextStreamHeader &header, BPositionIO *inSource, translator_info *outInfo, uint32 outType, @@ -264,218 +821,54 @@ } -static bool -valid_utf8_char(const uint8* bytes, size_t& length) -{ - length = 1; +/*! + Determines if the data in \a inSource is of the UTF8 plain - if (bytes[0] & 0x80) { - if (bytes[0] & 0x40) { - if (bytes[0] & 0x20) { - if (bytes[0] & 0x10) { - if (bytes[0] & 0x08) { - // A five byte char?! - return false; - } - - // A four byte char - length = 4; - return true; - } - - /* A three byte char */ - length = 3; - return true; - } - - /* A two byte char */ - length = 2; - return true; - } - - return false; - } - - if (bytes[0] == 0) - return false; - - return true; -} - - -// --------------------------------------------------------------- -// identify_txt_header -// -// Determines if the data in inSource is of the UTF8 plain -// text format. -// -// Preconditions: data must point to a buffer at least -// DATA_BUFFER_SIZE bytes long -// -// Parameters: data, buffer containing data already read -// from the stream -// -// nread, number of bytes that have already -// been read from the stream -// -// header, the STXT stream header read in by -// Identify() or Translate() -// -// inSource, The stream with the STXT data -// -// outInfo, information about the type of data -// from inSource is stored here -// -// outType the desired output type for the -// data in inSource -// -// -// Postconditions: -// -// Returns: B_OK, if the data appears to be in the STXT format, -// B_NO_TRANSLATOR, if the data is not in the STXT format or -// returns B_ERROR if errors were encountered in trying to -// determine the format -// --------------------------------------------------------------- + \param data buffer containing data already read (must be at + least DATA_BUFFER_SIZE bytes large) + \param nread number of bytes that have already been read from the stream + \param header the STXT stream header read in by Identify() or Translate() + \param inSource the stream with the STXT data + \param outInfo information about the type of data from inSource is stored here + \param outType the desired output type for the data in inSource +*/ status_t -identify_txt_header(uint8 *data, int32 bytesRead, - BPositionIO *inSource, translator_info *outInfo, uint32 outType) +identify_text(uint8* data, int32 bytesRead, BPositionIO* source, + translator_info* outInfo, uint32 outType, const char*& encoding) { - ssize_t readLater = inSource->Read(data + bytesRead, DATA_BUFFER_SIZE - bytesRead); - if (readLater < 0) + ssize_t readLater = source->Read(data + bytesRead, DATA_BUFFER_SIZE - bytesRead); + if (readLater < B_OK) return B_NO_TRANSLATOR; bytesRead += readLater; - float capability = TEXT_IN_CAPABILITY; - int32 bad = 0; - // TODO: use the same mechanism as the TextSnifferAddon class in the registrar - // and add support for indicating other character sets as well - for (int32 i = 0; i < bytesRead; i++) { - uint8 c = data[i]; - size_t length; - - // if any null characters or control characters - // are found, reduce our ability to handle the data - if (c < 0x20 - && c != 0x08 // backspace - && c != 0x09 // tab - && c != 0x0A // line feed - && c != 0x0C // form feed - && c != 0x0D) { // carriage return - bad++; - } else if ((c & 0x80) != 0 && valid_utf8_char(data + i, length)) { - int32 j = 1; - for (; j < (int32)length && i + j < bytesRead; j++) { - if ((data[i + j] & 0xc0) != 0x80) { - bad++; - break; - } - } - - i += j - 1; - } else if (c & 0x80) - bad++; - } - -// TODO: enable me once bug #675 is fixed -#if 0 - // if more than 1/3 of the characters are bad, we don't accept the text - if (bad > bytesRead / 3) + // TODO: identify encoding as possible! + BMimeType type; + if (!file_ascmagic((const unsigned char*)data, bytesRead, &type, encoding)) return B_NO_TRANSLATOR; -#endif - capability *= (bytesRead - bad) / (float)bytesRead; + float capability = TEXT_IN_CAPABILITY; + if (bytesRead < 20) + capability = .1f; // return information about the data in the stream outInfo->type = B_TRANSLATOR_TEXT; outInfo->group = B_TRANSLATOR_TEXT; outInfo->quality = TEXT_IN_QUALITY; outInfo->capability = capability; - strcpy(outInfo->name, "Plain text file"); + + char description[B_MIME_TYPE_LENGTH]; + if (type.GetLongDescription(description) == B_OK) + strlcpy(outInfo->name, description, sizeof(outInfo->name)); + else + strlcpy(outInfo->name, "Plain text file", sizeof(outInfo->name)); + + //strlcpy(outInfo->MIME, type.Type(), sizeof(outInfo->MIME)); strcpy(outInfo->MIME, "text/plain"); - return B_OK; } -// --------------------------------------------------------------- -// Identify -// -// Examines the data from inSource and determines if it is in a -// format that this translator knows how to work with. -// -// Preconditions: -// -// Parameters: inSource, where the data to examine is -// -// inFormat, a hint about the data in inSource, -// it is ignored since it is only a hint -// -// ioExtension, configuration settings for the -// translator (not used) -// -// outInfo, information about what data is in -// inSource and how well this translator -// can handle that data is stored here -// -// outType, The format that the user wants -// the data in inSource to be [... truncated: 542 lines follow ...] From axeld at mail.berlios.de Wed Jan 17 12:08:39 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 17 Jan 2007 12:08:39 +0100 Subject: [Haiku-commits] r19843 - haiku/trunk/src/kits/textencoding Message-ID: <200701171108.l0HB8d1p008198@sheep.berlios.de> Author: axeld Date: 2007-01-17 12:08:39 +0100 (Wed, 17 Jan 2007) New Revision: 19843 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19843&view=rev Modified: haiku/trunk/src/kits/textencoding/character_sets.cpp Log: Looks like Be and Andrew mixed up UCS-2 and UTF-16; I added the UTF-16 conversion as well now (which has a marker at the beginning of the file, unlike UCS-2). Modified: haiku/trunk/src/kits/textencoding/character_sets.cpp =================================================================== --- haiku/trunk/src/kits/textencoding/character_sets.cpp 2007-01-17 10:46:28 UTC (rev 19842) +++ haiku/trunk/src/kits/textencoding/character_sets.cpp 2007-01-17 11:08:39 UTC (rev 19843) @@ -165,10 +165,10 @@ // IANA aliases "csUnicode", // java aliases - "UTF_16BE", "X-UTF-16BE", "UnicodeBigUnmarked", + "UTF-16BE", "X-UTF-16BE", "UnicodeBigUnmarked", NULL }; -static const BCharacterSet unicode2(16,1000,"Unicode (UTF-16)","ISO-10646-UCS-2",NULL,unicode2aliases); +static const BCharacterSet unicode2(16,1000,"Unicode (UCS-2)","ISO-10646-UCS-2",NULL,unicode2aliases); static const char * KOI8Raliases[] = { // IANA aliases @@ -262,6 +262,16 @@ }; static const BCharacterSet gb18030(26,114,"Chinese GB18030","GB18030",NULL,gb18030aliases); +static const char* kUTF16Aliases[] = { + // IANA aliases + "UTF-16", + // java aliases + "UTF-16BE", "X-UTF-16BE", "UnicodeBigUnmarked", + NULL +}; +static const BCharacterSet kUTF16(27, 1000, "Unicode", "UTF-16", "UTF-16", + kUTF16Aliases); + /** * The following initializes the global character set array. * It is organized by id for efficient retrieval using predefined constants in UTF8.h and Font.h. @@ -281,6 +291,7 @@ &IBM866, &IBM437, &eucKR, &iso13, &iso14, &iso15, // R5 convert_to/from_utf8 encodings end here &big5,&gb18030, + &kUTF16, }; const uint32 character_sets_by_id_count = sizeof(character_sets_by_id)/sizeof(const BCharacterSet*); From axeld at mail.berlios.de Wed Jan 17 12:18:34 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 17 Jan 2007 12:18:34 +0100 Subject: [Haiku-commits] r19844 - haiku/trunk/src/kits/textencoding Message-ID: <200701171118.l0HBIY8T009128@sheep.berlios.de> Author: axeld Date: 2007-01-17 12:18:33 +0100 (Wed, 17 Jan 2007) New Revision: 19844 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19844&view=rev Modified: haiku/trunk/src/kits/textencoding/utf8_conversions.cpp Log: While investigating why our UTF-16 files are broken (with a smaller output buffer), I noticed that "state" was never set, but as expected this doesn't help at all: we just can't use iconv() this way, I'll open a bug for this. Modified: haiku/trunk/src/kits/textencoding/utf8_conversions.cpp =================================================================== --- haiku/trunk/src/kits/textencoding/utf8_conversions.cpp 2007-01-17 11:08:39 UTC (rev 19843) +++ haiku/trunk/src/kits/textencoding/utf8_conversions.cpp 2007-01-17 11:18:33 UTC (rev 19844) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2003-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -40,17 +40,24 @@ return B_OK; } + // TODO: this doesn't work, as the state is reset every time! iconv_t conversion = iconv_open(to, from); if (conversion == (iconv_t)-1) { DEBPRINT(("iconv_open failed\n")); return B_ERROR; } - if (state == NULL || *state == 0) - iconv(conversion, 0, 0, 0, 0); + size_t outputLeft = *dstLen; + + if (state == NULL || *state == 0) { + if (state != NULL) + *state = 1; + + iconv(conversion, NULL, NULL, &dst, &outputLeft); + } + char** inputBuffer = const_cast(&src); size_t inputLeft = *srcLen; - size_t outputLeft = *dstLen; do { size_t nonReversibleConversions = iconv(conversion, inputBuffer, &inputLeft, &dst, &outputLeft); From axeld at mail.berlios.de Wed Jan 17 12:40:00 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 17 Jan 2007 12:40:00 +0100 Subject: [Haiku-commits] r19845 - haiku/trunk/src/apps/stylededit Message-ID: <200701171140.l0HBe05t028191@sheep.berlios.de> Author: axeld Date: 2007-01-17 12:39:56 +0100 (Wed, 17 Jan 2007) New Revision: 19845 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19845&view=rev Modified: haiku/trunk/src/apps/stylededit/StyledEditApp.cpp haiku/trunk/src/apps/stylededit/StyledEditView.cpp haiku/trunk/src/apps/stylededit/StyledEditView.h Log: StyledEdit now makes use of the new BTranslationUtils functions which simplify the code quite a lot. Modified: haiku/trunk/src/apps/stylededit/StyledEditApp.cpp =================================================================== --- haiku/trunk/src/apps/stylededit/StyledEditApp.cpp 2007-01-17 11:18:33 UTC (rev 19844) +++ haiku/trunk/src/apps/stylededit/StyledEditApp.cpp 2007-01-17 11:39:56 UTC (rev 19845) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -84,7 +84,12 @@ BCharacterSetRoster roster; BCharacterSet charset; while (roster.GetNextCharacterSet(&charset) == B_NO_ERROR) { - BString name(charset.GetPrintName()); + BString name; + if (charset.GetFontID() == B_UNICODE_UTF8) + name = "Default"; + else + name = charset.GetPrintName(); + const char* mime = charset.GetMIMEName(); if (mime) { name.Append(" ("); Modified: haiku/trunk/src/apps/stylededit/StyledEditView.cpp =================================================================== --- haiku/trunk/src/apps/stylededit/StyledEditView.cpp 2007-01-17 11:18:33 UTC (rev 19844) +++ haiku/trunk/src/apps/stylededit/StyledEditView.cpp 2007-01-17 11:39:56 UTC (rev 19845) @@ -1,10 +1,11 @@ /* - * Copyright 2002-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: * Mattias Sundblad * Andrew Bachmann + * Axel D?rfler, axeld at pinc-software.de */ @@ -23,17 +24,17 @@ #include #include + using namespace BPrivate; StyledEditView::StyledEditView(BRect viewFrame, BRect textBounds, BHandler *handler) : BTextView(viewFrame, "textview", textBounds, - B_FOLLOW_ALL, B_FRAME_EVENTS|B_WILL_DRAW) + B_FOLLOW_ALL, B_FRAME_EVENTS | B_WILL_DRAW) { fHandler = handler; fMessenger = new BMessenger(handler); fSuppressChanges = false; - fEncoding = 0; } @@ -79,7 +80,8 @@ StyledEditView::GetStyledText(BPositionIO* stream) { fSuppressChanges = true; - status_t result = BTranslationUtils::GetStyledText(stream, this, NULL); + status_t result = BTranslationUtils::GetStyledText(stream, this, + fEncoding.String()); fSuppressChanges = false; if (result != B_OK) @@ -87,25 +89,29 @@ BNode* node = dynamic_cast(stream); if (node != NULL) { - ssize_t bytesRead; - // decode encoding - int32 encoding; - bytesRead = node->ReadAttr("be:encoding", 0, 0, &encoding, sizeof(encoding)); - if (bytesRead == (ssize_t)sizeof(encoding)) { - if (encoding == 65535) { - // UTF-8 - fEncoding = 0; - } else { - const BCharacterSet* characterSet - = BCharacterSetRoster::GetCharacterSetByConversionID(encoding); - if (characterSet != 0) - fEncoding = characterSet->GetFontID(); + // get encoding + if (node->ReadAttrString("be:encoding", &fEncoding) != B_OK) { + // try to read as "int32" + int32 encoding; + ssize_t bytesRead = node->ReadAttr("be:encoding", B_INT32_TYPE, 0, + &encoding, sizeof(encoding)); + if (bytesRead == (ssize_t)sizeof(encoding)) { + if (encoding == 65535) { + fEncoding = "UTF-8"; + } else { + const BCharacterSet* characterSet + = BCharacterSetRoster::GetCharacterSetByConversionID(encoding); + if (characterSet != NULL) + fEncoding = characterSet->GetName(); + } } } + // TODO: move those into BTranslationUtils::GetStyledText() as well? + // restore alignment int32 align; - bytesRead = node->ReadAttr("alignment", 0, 0, &align, sizeof(align)); + ssize_t bytesRead = node->ReadAttr("alignment", 0, 0, &align, sizeof(align)); if (bytesRead == (ssize_t)sizeof(align)) SetAlignment((alignment)align); @@ -126,63 +132,6 @@ } } - if (fEncoding != 0) { - int32 length = stream->Seek(0, SEEK_END); - - // Here we save the run_array before it gets overwritten... - text_run_array* runArray = RunArray(0, length); - uint32 id = BCharacterSetRoster::GetCharacterSetByFontID(fEncoding)->GetConversionID(); - - fSuppressChanges = true; - SetText(""); - fSuppressChanges = false; - - char inBuffer[32768]; - off_t location = 0; - int32 textOffset = 0; - int32 state = 0; - int32 bytesRead; - while ((bytesRead = stream->ReadAt(location, inBuffer, sizeof(inBuffer))) > 0) { - char* inPtr = inBuffer; - char textBuffer[32768]; - int32 textLength = sizeof(textBuffer); - int32 bytes = bytesRead; - while (textLength > 0 && bytes > 0) { - result = convert_to_utf8(id, inPtr, &bytes, textBuffer, &textLength, &state); - if (result != B_OK) - return result; - - fSuppressChanges = true; - InsertText(textBuffer, textLength, textOffset); - fSuppressChanges = false; - textOffset += textLength; - inPtr += bytes; - location += bytes; - bytesRead -= bytes; - bytes = bytesRead; - if (textLength > 0) - textLength = sizeof(textBuffer); - } - } - - // ... and here we restore it - SetRunArray(0, length, runArray); - - #ifdef HAIKU_TARGET_PLATFORM_BEOS - // FreeRunArray does not exist on R5 - - // Call destructors explicitly - for (int32 i = 0; i < runArray->count; i++) - runArray->runs[i].font.~BFont(); - - free(runArray); - - #else - FreeRunArray(runArray); - #endif - - } - return result; } @@ -190,63 +139,8 @@ status_t StyledEditView::WriteStyledEditFile(BFile* file) { - status_t result = B_OK; - ssize_t bytes = 0; - result = BTranslationUtils::WriteStyledEditFile(this, file); - if (result != B_OK) - return result; - - if (fEncoding == 0) { - int32 encoding = 65535; - bytes = file->WriteAttr("be:encoding", B_INT32_TYPE, 0, &encoding, sizeof(encoding)); - if (bytes < 0) - return bytes; - } else { - result = file->SetSize(0); - if (result != B_OK) - return result; - - bytes = file->Seek(0, SEEK_SET); - if (bytes != 0) - return bytes; - - const BCharacterSet* cs = BCharacterSetRoster::GetCharacterSetByFontID(fEncoding); - if (cs != 0) { - uint32 id = cs->GetConversionID(); - const char * outText = Text(); - int32 sourceLength = TextLength(); - int32 state = 0; - char buffer[32768]; - while (sourceLength > 0) { - int32 length = sourceLength; - int32 written = 32768; - result = convert_from_utf8(id,outText,&length,buffer,&written,&state); - if (result != B_OK) { - return result; - } - bytes = file->Write(buffer,written); - if (bytes < 0) - return bytes; - sourceLength -= length; - outText += length; - } - bytes = file->WriteAttr("be:encoding", B_INT32_TYPE, 0, &id, sizeof(id)); - if (bytes < 0) - return bytes; - } - } - - int32 align = Alignment(); - bytes = file->WriteAttr("alignment", B_INT32_TYPE, 0, &align, sizeof(align)); - if (bytes < 0) - return bytes; - - bool wrap = DoesWordWrap(); - bytes = file->WriteAttr("wrap", B_BOOL_TYPE, 0, &wrap, sizeof(wrap)); - if (bytes < 0) - return bytes; - - return result; + return BTranslationUtils::WriteStyledEditFile(this, file, + fEncoding.String()); } @@ -255,6 +149,7 @@ { fSuppressChanges = true; SetText(""); + fEncoding = ""; fSuppressChanges = false; } @@ -272,14 +167,30 @@ void StyledEditView::SetEncoding(uint32 encoding) { - fEncoding = encoding; + if (encoding == 0) { + fEncoding = ""; + return; + } + + const BCharacterSet* set = BCharacterSetRoster::GetCharacterSetByFontID(encoding); + if (set != NULL) + fEncoding = set->GetName(); + else + fEncoding = ""; } uint32 StyledEditView::GetEncoding() const { - return fEncoding; + if (fEncoding == "") + return 0; + + const BCharacterSet* set = BCharacterSetRoster::FindCharacterSetByName(fEncoding.String()); + if (set != NULL) + return set->GetFontID(); + + return 0; } Modified: haiku/trunk/src/apps/stylededit/StyledEditView.h =================================================================== --- haiku/trunk/src/apps/stylededit/StyledEditView.h 2007-01-17 11:18:33 UTC (rev 19844) +++ haiku/trunk/src/apps/stylededit/StyledEditView.h 2007-01-17 11:39:56 UTC (rev 19845) @@ -1,18 +1,20 @@ /* - * Copyright 2002-2006, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: * Mattias Sundblad * Andrew Bachmann + * Axel D?rfler, axeld at pinc-software.de */ #ifndef STYLED_EDIT_VIEW_H #define STYLED_EDIT_VIEW_H #include +#include +#include #include -#include class StyledEditView : public BTextView { @@ -26,7 +28,7 @@ virtual void Reset(); virtual status_t GetStyledText(BPositionIO * stream); virtual status_t WriteStyledEditFile(BFile * file); - + virtual void SetEncoding(uint32 encoding); virtual uint32 GetEncoding() const; @@ -39,7 +41,7 @@ BMessage *fChangeMessage; BMessenger *fMessenger; bool fSuppressChanges; - uint32 fEncoding; + BString fEncoding; }; #endif // STYLED_EDIT_VIEW_H From axeld at pinc-software.de Wed Jan 17 12:41:16 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 17 Jan 2007 12:41:16 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19841_-_in_haiku/trunk=3A_header?= =?iso-8859-15?q?s/os/translation_src/kits/translation?= In-Reply-To: <894b9700701170210k7bdaoaf0fd93f18761ea2@mail.gmail.com> Message-ID: <16391955840-BeMail@zon> "Stefano Ceccherini" wrote: > 2007/1/17, axeld at BerliOS : > > Log: > > Added WriteStyledEditFile() variant that gets an encoding argument; > > it will automatically > > encode the text in the BTextView accordingly. > Axel, will you use this new method in StyledEdit ? Does r19845 answer your question? :-) Unfortunately, I broke its R5 build again with this - that is, if you don't use our libtranslation.so and libtextencoding.so. Bye, Axel. From axeld at mail.berlios.de Wed Jan 17 13:02:07 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 17 Jan 2007 13:02:07 +0100 Subject: [Haiku-commits] r19846 - haiku/trunk/src/add-ons/translators/stxt Message-ID: <200701171202.l0HC27OX027813@sheep.berlios.de> Author: axeld Date: 2007-01-17 13:02:06 +0100 (Wed, 17 Jan 2007) New Revision: 19846 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19846&view=rev Modified: haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp Log: Minor fixes: * the "state" variable was reset for each loop cycle. * since the inner loop tested for "bytes" instead of "bytesLeft", convert_to_utf8() was called twice for each chunk read. Modified: haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp 2007-01-17 11:39:56 UTC (rev 19845) +++ haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp 2007-01-17 12:02:06 UTC (rev 19846) @@ -1180,6 +1180,7 @@ off_t outputSize = 0; ssize_t bytesRead; + int32 state = 0; // output the actual text part of the data do { @@ -1205,7 +1206,6 @@ // decode text file to UTF-8 char* pos = (char*)buffer; int32 encodingLength = encodingIO.BufferLength(); - int32 state = 0; int32 bytesLeft = bytesRead; int32 bytes; do { @@ -1229,7 +1229,7 @@ pos += bytes; bytesLeft -= bytes; outputSize += encodingLength; - } while (encodingLength > 0 && bytes > 0); + } while (encodingLength > 0 && bytesLeft > 0); } } while (bytesRead > 0); From axeld at mail.berlios.de Wed Jan 17 13:04:04 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 17 Jan 2007 13:04:04 +0100 Subject: [Haiku-commits] r19847 - in haiku/trunk: headers/os/translation src/kits/translation Message-ID: <200701171204.l0HC44v8030250@sheep.berlios.de> Author: axeld Date: 2007-01-17 13:04:02 +0100 (Wed, 17 Jan 2007) New Revision: 19847 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19847&view=rev Modified: haiku/trunk/headers/os/translation/TranslationUtils.h haiku/trunk/src/kits/translation/TranslationUtils.cpp Log: Added another GetStyledText() function to force a specific encoding. Modified: haiku/trunk/headers/os/translation/TranslationUtils.h =================================================================== --- haiku/trunk/headers/os/translation/TranslationUtils.h 2007-01-17 12:02:06 UTC (rev 19846) +++ haiku/trunk/headers/os/translation/TranslationUtils.h 2007-01-17 12:04:02 UTC (rev 19847) @@ -1,39 +1,11 @@ -/*****************************************************************************/ -// File: TranslationUtils.h -// Class: BTranslationUtils -// Reimplemented by: Michael Wilber, Translation Kit Team -// Reimplementation: 2002-04 -// -// Description: Utility functions for the Translation Kit -// -// -// Copyright (c) 2002 OpenBeOS Project -// -// Original Version: Copyright 1998, Be Incorporated, All Rights Reserved. -// Copyright 1995-1997, Jon Watte -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -/*****************************************************************************/ - -#if !defined(_TRANSLATION_UTILS_H) +/* + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ +#ifndef _TRANSLATION_UTILS_H #define _TRANSLATION_UTILS_H + #include #include @@ -42,10 +14,9 @@ class BPositionIO; class BMenu; -// This class is a little different from many other classes. -// You don't create an instance of it; you just call its various -// static member functions for utility-like operations. + class BTranslationUtils { + private: BTranslationUtils(); ~BTranslationUtils(); BTranslationUtils(const BTranslationUtils &); @@ -66,8 +37,10 @@ BTranslatorRoster *roster = NULL); // text functions - static status_t GetStyledText(BPositionIO *fromStream, BTextView *intoView, + static status_t GetStyledText(BPositionIO* fromStream, BTextView* intoView, BTranslatorRoster *roster = NULL); + static status_t GetStyledText(BPositionIO* fromStream, BTextView* intoView, + const char* encoding, BTranslatorRoster* roster = NULL); static status_t PutStyledText(BTextView *fromView, BPositionIO *intoStream, BTranslatorRoster *roster = NULL); static status_t WriteStyledEditFile(BTextView *fromView, BFile *intoFile); @@ -84,9 +57,9 @@ B_TRANSLATION_MENU = 'BTMN' }; static status_t AddTranslationItems(BMenu *intoMenu, uint32 fromType, - const BMessage *model = NULL, // default B_TRANSLATION_MENU - const char *translatorIdName = NULL, // default "be:translator" - const char *translatorTypeName = NULL, // default "be:type" + const BMessage *model = NULL, // default B_TRANSLATION_MENU + const char *translatorIdName = NULL, // default "be:translator" + const char *translatorTypeName = NULL, // default "be:type" BTranslatorRoster *roster = NULL); }; Modified: haiku/trunk/src/kits/translation/TranslationUtils.cpp =================================================================== --- haiku/trunk/src/kits/translation/TranslationUtils.cpp 2007-01-17 12:02:06 UTC (rev 19846) +++ haiku/trunk/src/kits/translation/TranslationUtils.cpp 2007-01-17 12:04:02 UTC (rev 19847) @@ -312,19 +312,20 @@ defined in /boot/develop/headers/be/translation/TranslatorFormats.h - \param fromStream the stream with the styled text + \param source the stream with the styled text \param intoView the view where the test will be inserted roster, BTranslatorRoster used to do the translation + \param the encoding to use, defaults to UTF-8 \return B_BAD_VALUE, if fromStream or intoView is NULL \return B_ERROR, if any other error occurred \return B_OK, if successful */ status_t -BTranslationUtils::GetStyledText(BPositionIO *fromStream, BTextView *intoView, - BTranslatorRoster *roster) +BTranslationUtils::GetStyledText(BPositionIO* source, BTextView* intoView, + const char* encoding, BTranslatorRoster* roster) { - if (fromStream == NULL || intoView == NULL) + if (source == NULL || intoView == NULL) return B_BAD_VALUE; // Use default Translator if none is specified @@ -334,10 +335,14 @@ return B_ERROR; } + BMessage config; + if (encoding != NULL && encoding[0]) + config.AddString("be:encoding", encoding); + // Translate the file from whatever format it is to B_STYLED_TEXT_FORMAT // we understand BMallocIO mallocIO; - if (roster->Translate(fromStream, NULL, NULL, &mallocIO, + if (roster->Translate(source, NULL, &config, &mallocIO, B_STYLED_TEXT_FORMAT) < B_OK) return B_BAD_TYPE; @@ -429,6 +434,14 @@ } +status_t +BTranslationUtils::GetStyledText(BPositionIO* source, BTextView* intoView, + BTranslatorRoster* roster) +{ + return GetStyledText(source, intoView, NULL, roster); +} + + /*! This function takes styled text data from fromView and writes it to intoStream. The plain text data and styled text data are combined From stefano.ceccherini at gmail.com Wed Jan 17 13:09:18 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Wed, 17 Jan 2007 13:09:18 +0100 Subject: [Haiku-commits] r19845 - haiku/trunk/src/apps/stylededit In-Reply-To: <200701171140.l0HBe05t028191@sheep.berlios.de> References: <200701171140.l0HBe05t028191@sheep.berlios.de> Message-ID: <894b9700701170409w3f3aeec6ibd13cdcb13c57cfb@mail.gmail.com> 2007/1/17, axeld at BerliOS : > Author: axeld > Date: 2007-01-17 12:39:56 +0100 (Wed, 17 Jan 2007) > New Revision: 19845 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19845&view=rev > > Modified: > haiku/trunk/src/apps/stylededit/StyledEditApp.cpp > haiku/trunk/src/apps/stylededit/StyledEditView.cpp > haiku/trunk/src/apps/stylededit/StyledEditView.h > Log: > StyledEdit now makes use of the new BTranslationUtils functions which > simplify the code quite a lot. > > - int32 align = Alignment(); > - bytes = file->WriteAttr("alignment", B_INT32_TYPE, 0, &align, sizeof(align)); > - if (bytes < 0) > - return bytes; > - > - bool wrap = DoesWordWrap(); > - bytes = file->WriteAttr("wrap", B_BOOL_TYPE, 0, &wrap, sizeof(wrap)); > - if (bytes < 0) > - return bytes; > - > - return result; > + return BTranslationUtils::WriteStyledEditFile(this, file, > + fEncoding.String()); > } > Axel, did you remove also this part on purpose ? The alignment and word wrapping aren't written anymore now. From stefano.ceccherini at gmail.com Wed Jan 17 13:10:17 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Wed, 17 Jan 2007 13:10:17 +0100 Subject: [Haiku-commits] r19841 - in haiku/trunk: headers/os/translation src/kits/translation In-Reply-To: <16391955840-BeMail@zon> References: <894b9700701170210k7bdaoaf0fd93f18761ea2@mail.gmail.com> <16391955840-BeMail@zon> Message-ID: <894b9700701170410j29f04447obbb48b60985aa7cc@mail.gmail.com> 2007/1/17, Axel D?rfler : > Does r19845 answer your question? :-) Indeed :) > Unfortunately, I broke its R5 build again with this - that is, if you > don't use our libtranslation.so and libtextencoding.so. We don't care a lot about R5, do we ? :) From axeld at pinc-software.de Wed Jan 17 13:20:46 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 17 Jan 2007 13:20:46 +0100 (MET) Subject: [Haiku-commits] r19845 - haiku/trunk/src/apps/stylededit In-Reply-To: <894b9700701170409w3f3aeec6ibd13cdcb13c57cfb@mail.gmail.com> Message-ID: <18764058752-BeMail@zon> "Stefano Ceccherini" wrote: > Axel, did you remove also this part on purpose ? The alignment and > word wrapping aren't written anymore now. Are you sure they won't be written anymore? BTranslationUtils::WriteStyledEditFile() is supposed to write those attributes (and already contained code for this before; AFAICT they were written twice). Bye, Axel. From axeld at pinc-software.de Wed Jan 17 13:55:41 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 17 Jan 2007 13:55:41 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19841_-_in_haiku/trunk=3A_header?= =?iso-8859-15?q?s/os/translation_src/kits/translation?= In-Reply-To: <894b9700701170410j29f04447obbb48b60985aa7cc@mail.gmail.com> Message-ID: <20858836746-BeMail@zon> "Stefano Ceccherini" wrote: > > Unfortunately, I broke its R5 build again with this - that is, if > > you > > don't use our libtranslation.so and libtextencoding.so. > We don't care a lot about R5, do we ? :) Depends on the component, I'd guess :-) Bye, Axel. From john at nextraweb.com Wed Jan 17 15:26:28 2007 From: john at nextraweb.com (John Drinkwater) Date: Wed, 17 Jan 2007 14:26:28 +0000 Subject: [Haiku-commits] r19843 - haiku/trunk/src/kits/textencoding In-Reply-To: <200701171108.l0HB8d1p008198@sheep.berlios.de> References: <200701171108.l0HB8d1p008198@sheep.berlios.de> Message-ID: <45AE3214.5000008@nextraweb.com> axeld at BerliOS wrote: > Author: axeld > Date: 2007-01-17 12:08:39 +0100 (Wed, 17 Jan 2007) > New Revision: 19843 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19843&view=rev > > Modified: > haiku/trunk/src/kits/textencoding/character_sets.cpp > Log: > Looks like Be and Andrew mixed up UCS-2 and UTF-16; I added the UTF-16 conversion as well > now (which has a marker at the beginning of the file, unlike UCS-2). > > > Modified: haiku/trunk/src/kits/textencoding/character_sets.cpp > =================================================================== > --- haiku/trunk/src/kits/textencoding/character_sets.cpp 2007-01-17 10:46:28 UTC (rev 19842) > +++ haiku/trunk/src/kits/textencoding/character_sets.cpp 2007-01-17 11:08:39 UTC (rev 19843) > @@ -165,10 +165,10 @@ > // IANA aliases > "csUnicode", > // java aliases > - "UTF_16BE", "X-UTF-16BE", "UnicodeBigUnmarked", > + "UTF-16BE", "X-UTF-16BE", "UnicodeBigUnmarked", If I remember correctly, this is an intentional use of _, Java has UTF_16BE as an alias of UTF-16BE. > NULL > }; > -static const BCharacterSet unicode2(16,1000,"Unicode (UTF-16)","ISO-10646-UCS-2",NULL,unicode2aliases); > +static const BCharacterSet unicode2(16,1000,"Unicode (UCS-2)","ISO-10646-UCS-2",NULL,unicode2aliases); > > static const char * KOI8Raliases[] = { > // IANA aliases > @@ -262,6 +262,16 @@ > }; > static const BCharacterSet gb18030(26,114,"Chinese GB18030","GB18030",NULL,gb18030aliases); > > +static const char* kUTF16Aliases[] = { > + // IANA aliases > + "UTF-16", > + // java aliases > + "UTF-16BE", "X-UTF-16BE", "UnicodeBigUnmarked", Same change. But shouldn't this either contain LE, or require another entry for little endian UTF-16s ? > + NULL > +}; > +static const BCharacterSet kUTF16(27, 1000, "Unicode", "UTF-16", "UTF-16", > + kUTF16Aliases); > + John -- John ?[Beta]? Drinkwater | john at nextraweb.com http://johndrinkwater.name/ | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: OpenPGP digital signature URL: From bga at mail.berlios.de Wed Jan 17 17:02:20 2007 From: bga at mail.berlios.de (bga at BerliOS) Date: Wed, 17 Jan 2007 17:02:20 +0100 Subject: [Haiku-commits] r19848 - haiku/trunk/src/system/kernel/vm Message-ID: <200701171602.l0HG2K9I020145@sheep.berlios.de> Author: bga Date: 2007-01-17 17:02:19 +0100 (Wed, 17 Jan 2007) New Revision: 19848 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19848&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: Fix build with TRACE enabled. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-17 12:04:02 UTC (rev 19847) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-17 16:02:19 UTC (rev 19848) @@ -502,8 +502,8 @@ void **_virtualAddress, off_t offset, addr_t size, uint32 addressSpec, int wiring, int protection, int mapping, vm_area **_area, const char *areaName) { - TRACE(("map_backing_store: aspace %p, store %p, *vaddr %p, offset 0x%Lx, size %lu, addressSpec %ld, wiring %d, protection %d, _area %p, area_name '%s'\n", - addressSpace, store, *_virtualAddress, offset, size, addressSpec, + TRACE(("map_backing_store: aspace %p, cacheref %p, *vaddr %p, offset 0x%Lx, size %lu, addressSpec %ld, wiring %d, protection %d, _area %p, area_name '%s'\n", + addressSpace, cacheRef, *_virtualAddress, offset, size, addressSpec, wiring, protection, _area, areaName)); vm_area *area = _vm_create_area_struct(addressSpace, areaName, wiring, protection); From axeld at pinc-software.de Wed Jan 17 18:24:15 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 17 Jan 2007 18:24:15 +0100 (MET) Subject: [Haiku-commits] r19843 - haiku/trunk/src/kits/textencoding In-Reply-To: <45AE3214.5000008@nextraweb.com> Message-ID: <36975899048-BeMail@zon> John Drinkwater wrote: > axeld at BerliOS wrote: > > // java aliases > > - "UTF_16BE", "X-UTF-16BE", "UnicodeBigUnmarked", > > + "UTF-16BE", "X-UTF-16BE", "UnicodeBigUnmarked", > If I remember correctly, this is an intentional use of _, Java has > UTF_16BE as an alias of UTF-16BE. I could only find UTF-16BE, but maybe we want to add both. > > +static const char* kUTF16Aliases[] = { > > + // IANA aliases > > + "UTF-16", > > + // java aliases > > + "UTF-16BE", "X-UTF-16BE", "UnicodeBigUnmarked", > Same change. But shouldn't this either contain LE, or require > another entry for little endian UTF-16s ? We could add another entry for LE; UTF-16 can read both, but always writes BE. But then we should really think about starting to hide some entries from the user. But the charset API needs some finetuning anyway (but since it's private, maybe not for R1). Bye, Axel. From axeld at mail.berlios.de Wed Jan 17 20:38:59 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 17 Jan 2007 20:38:59 +0100 Subject: [Haiku-commits] r19849 - in haiku/trunk: headers/os/interface src/kits/interface Message-ID: <200701171938.l0HJcxmA017939@sheep.berlios.de> Author: axeld Date: 2007-01-17 20:38:58 +0100 (Wed, 17 Jan 2007) New Revision: 19849 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19849&view=rev Modified: haiku/trunk/headers/os/interface/Window.h haiku/trunk/src/kits/interface/Window.cpp Log: One step closer to the Switcher - still doesn't work, though, but at least the BWindow code looks okay now. Modified: haiku/trunk/headers/os/interface/Window.h =================================================================== --- haiku/trunk/headers/os/interface/Window.h 2007-01-17 16:02:19 UTC (rev 19848) +++ haiku/trunk/headers/os/interface/Window.h 2007-01-17 19:38:58 UTC (rev 19849) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -343,7 +343,7 @@ BView* _FindNextNavigable(BView *focus, uint32 flags); BView* _FindPreviousNavigable(BView *focus, uint32 flags); - bool _HandleKeyDown(char key, uint32 modifiers); + bool _HandleKeyDown(BMessage* event); void _KeyboardNavigation(); // Debug (TODO: to be removed) Modified: haiku/trunk/src/kits/interface/Window.cpp =================================================================== --- haiku/trunk/src/kits/interface/Window.cpp 2007-01-17 16:02:19 UTC (rev 19848) +++ haiku/trunk/src/kits/interface/Window.cpp 2007-01-17 19:38:58 UTC (rev 19849) @@ -962,20 +962,15 @@ case B_KEY_DOWN: { - uint32 modifiers; - int32 rawChar; - const char *string = NULL; - msg->FindInt32("modifiers", (int32*)&modifiers); - msg->FindInt32("raw_char", &rawChar); - msg->FindString("bytes", &string); - - // TODO: cannot use "string" here if we support having different - // font encoding per view (it's supposed to be converted by - // _HandleKeyDown() one day) - if (!_HandleKeyDown(string[0], (uint32)modifiers)) { - if (BView* view = dynamic_cast(target)) - view->KeyDown(string, strlen(string)); - else + if (!_HandleKeyDown(msg)) { + if (BView* view = dynamic_cast(target)) { + // TODO: cannot use "string" here if we support having different + // font encoding per view (it's supposed to be converted by + // _HandleKeyDown() one day) + const char *string = NULL; + if (msg->FindString("bytes", &string) == B_OK) + view->KeyDown(string, strlen(string)); + } else target->MessageReceived(msg); } break; @@ -3092,10 +3087,18 @@ TODO: must also convert the incoming key to the font encoding of the target */ bool -BWindow::_HandleKeyDown(char key, uint32 modifiers) +BWindow::_HandleKeyDown(BMessage* event) { - // TODO: ask people if using 'raw_char' is OK ? + const char *string = NULL; + if (event->FindString("bytes", &string) != B_OK) + return false; + char key = string[0]; + + uint32 modifiers; + if (event->FindInt32("modifiers", (int32*)&modifiers) != B_OK) + modifiers = 0; + // handle BMenuBar key if (key == B_ESCAPE && (modifiers & B_COMMAND_KEY) != 0 && fKeyMenuBar) { @@ -3116,9 +3119,13 @@ // Deskbar's Switcher if (key == B_TAB && (modifiers & B_CONTROL_KEY) != 0) { BMessenger deskbar(kDeskbarSignature); - if (deskbar.IsValid()) { + int32 rawKey; + if (event->FindInt32("key", &rawKey) == B_OK + && !event->HasInt32("be:key_repeat") + && deskbar.IsValid()) { + // only send the first key press, no repeats BMessage message('TASK'); - message.AddInt32("key", B_TAB); + message.AddInt32("key", rawKey); message.AddInt32("modifiers", modifiers); message.AddInt64("when", system_time()); message.AddInt32("team", Team()); From axeld at mail.berlios.de Wed Jan 17 22:26:54 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 17 Jan 2007 22:26:54 +0100 Subject: [Haiku-commits] r19850 - haiku/trunk/src/kits/interface Message-ID: <200701172126.l0HLQsSm025617@sheep.berlios.de> Author: axeld Date: 2007-01-17 22:26:54 +0100 (Wed, 17 Jan 2007) New Revision: 19850 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19850&view=rev Modified: haiku/trunk/src/kits/interface/View.cpp haiku/trunk/src/kits/interface/Window.cpp Log: Turns out our pulse mechanism was broken; we need to honour the rate set by SetPulseRate() even if it is 0. BView::_Attach() and BView::SetFlags() now just set the previous pulse rate again (which will start pulsing in case there is no fPulseRunner yet). Modified: haiku/trunk/src/kits/interface/View.cpp =================================================================== --- haiku/trunk/src/kits/interface/View.cpp 2007-01-17 19:38:58 UTC (rev 19849) +++ haiku/trunk/src/kits/interface/View.cpp 2007-01-17 21:26:54 UTC (rev 19850) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -843,7 +843,7 @@ if (flags & B_PULSE_NEEDED) { check_lock_no_pick(); if (fOwner->fPulseRunner == NULL) - fOwner->SetPulseRate(500000); + fOwner->SetPulseRate(fOwner->PulseRate()); } if (flags & (B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE @@ -4503,7 +4503,7 @@ if (fFlags & B_PULSE_NEEDED) { check_lock_no_pick(); if (fOwner->fPulseRunner == NULL) - fOwner->SetPulseRate(500000); + fOwner->SetPulseRate(fOwner->PulseRate()); } if (!fOwner->IsHidden()) Modified: haiku/trunk/src/kits/interface/Window.cpp =================================================================== --- haiku/trunk/src/kits/interface/Window.cpp 2007-01-17 19:38:58 UTC (rev 19849) +++ haiku/trunk/src/kits/interface/Window.cpp 2007-01-17 21:26:54 UTC (rev 19850) @@ -1448,7 +1448,6 @@ BWindow::ScreenChanged(BRect screen_size, color_space depth) { // Hook function - // does nothing } @@ -1456,7 +1455,7 @@ BWindow::SetPulseRate(bigtime_t rate) { // TODO: What about locking?!? - if (rate < 0 || rate == fPulseRate) + if (rate < 0 || rate == fPulseRate || !(rate == 0 ^ fPulseRunner == NULL)) return; fPulseRate = rate; @@ -1480,7 +1479,6 @@ bigtime_t BWindow::PulseRate() const { - // TODO: What about locking?!? return fPulseRate; } @@ -2378,12 +2376,10 @@ AddShortcut('V', B_COMMAND_KEY, new BMessage(B_PASTE), NULL); AddShortcut('A', B_COMMAND_KEY, new BMessage(B_SELECT_ALL), NULL); - fPulseRate = 0; + // We set the default pulse rate, but we don't start the pulse + fPulseRate = 500000; fPulseRunner = NULL; - // TODO: is this correct??? should the thread loop be started??? - //SetPulseRate( 500000 ); - // TODO: see if you can use 'fViewsNeedPulse' fIsFilePanel = false; From korli at mail.berlios.de Wed Jan 17 23:15:07 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Wed, 17 Jan 2007 23:15:07 +0100 Subject: [Haiku-commits] r19851 - haiku/trunk/src/preferences/devices Message-ID: <200701172215.l0HMF70g029569@sheep.berlios.de> Author: korli Date: 2007-01-17 23:15:06 +0100 (Wed, 17 Jan 2007) New Revision: 19851 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19851&view=rev Modified: haiku/trunk/src/preferences/devices/pci.ids Log: update pci ids Modified: haiku/trunk/src/preferences/devices/pci.ids =================================================================== --- haiku/trunk/src/preferences/devices/pci.ids 2007-01-17 21:26:54 UTC (rev 19850) +++ haiku/trunk/src/preferences/devices/pci.ids 2007-01-17 22:15:06 UTC (rev 19851) @@ -11,7 +11,7 @@ # This file can be distributed under either the GNU General Public License # (version 2 or higher) or the 3-clause BSD License. # -# Daily snapshot on Mon 2006-09-11 01:05:01 +# Daily snapshot on Wed 2007-01-17 02:05:01 # # Vendors, devices and subsystems. Please keep sorted. @@ -1289,7 +1289,7 @@ 0e11 4050 Integrated Smart Array 0e11 4051 Integrated Smart Array 0e11 4058 Integrated Smart Array - 103c 10c2 Hewlett-Packard NetRAID-4M + 103c 10c2 NetRAID-4M 12d9 000a IP Telephony card 4c53 1050 CT7 mainboard 4c53 1051 CE7 mainboard @@ -2262,6 +2262,7 @@ 4030 zx2 System Bus Adapter 4031 zx2 I/O Controller 4037 PCIe Local Bus Adapter + 403b PCIe Root Port 60e8 NetRAID-2M : ZX1/M (OEM AMI MegaRAID 493) 103e Solliday Engineering 103f Synopsys/Logic Modeling Group @@ -3011,20 +3012,22 @@ 2200 QLA2200 64-bit Fibre Channel Adapter 1077 0002 QLA2200 2300 QLA2300 64-bit Fibre Channel Adapter - 2312 QLA2312 Fibre Channel Adapter + 2312 ISP2312-based 2Gb Fibre Channel to PCI-X HBA 103c 0131 2Gb Fibre Channel - Single port [A7538A] 103c 12ba 2Gb Fibre Channel - Dual port [A6826A] - 2322 QLA2322 Fibre Channel Adapter - 2422 QLA2422 Fibre Channel Adapter + 2322 ISP2322-based 2Gb Fibre Channel to PCI-X HBA + 2422 ISP2422-based 4Gb Fibre Channel to PCI-X HBA 103c 12d7 4Gb Fibre Channel [AB379A] 103c 12dd 4Gb Fibre Channel [AB429A] - 2432 QLA2432 Fibre Channel Adapter - 3010 QLA3010 Network Adapter - 3022 QLA3022 Network Adapter - 4010 QLA4010 iSCSI TOE Adapter - 4022 QLA4022 iSCSI TOE Adapter - 6312 QLA6312 Fibre Channel Adapter - 6322 QLA6322 Fibre Channel Adapter + 2432 ISP2432-based 4Gb Fibre Channel to PCI Express HBA + 3022 ISP4022-based Ethernet NIC + 3032 ISP4032-based Ethernet NIC + 4010 ISP4010-based iSCSI TOE HBA + 4022 ISP4022-based iSCSI TOE HBA + 4032 ISP4032-based iSCSI TOE IPv6 HBA + 5432 SP232-based 4Gb Fibre Channel to PCI Express HBA + 6312 SP202-based 2Gb Fibre Channel to PCI-X HBA + 6322 SP212-based 2Gb Fibre Channel to PCI-X HBA 1078 Cyrix Corporation 0000 5510 [Grappa] 0001 PCI Master @@ -4180,8 +4183,10 @@ 147b 1c0b NF8 Mainboard 00e0 nForce3 250Gb LPC Bridge 10de 0c11 Winfast NF3250K8AA + 1462 7030 K8N Neo-FSR v2.0 147b 1c0b NF8 Mainboard 00e1 nForce3 250Gb Host Bridge + 1462 7030 K8N Neo-FSR v2.0 147b 1c0b NF8 Mainboard 00e2 nForce3 250Gb AGP Host to PCI Bridge 00e3 CK8S Serial ATA Controller (v2.5) @@ -4189,16 +4194,20 @@ 147b 1c0b NF8 Mainboard 00e4 nForce 250Gb PCI System Management 105b 0c43 Winfast NF3250K8AA + 1462 7030 K8N Neo-FSR v2.0 147b 1c0b NF8 Mainboard 00e5 CK8S Parallel ATA Controller (v2.5) 105b 0c43 Winfast NF3250K8AA + 1462 7030 K8N Neo-FSR v2.0 147b 1c0b NF8 Mainboard 00e6 CK8S Ethernet Controller 00e7 CK8S USB Controller 105b 0c43 Winfast NF3250K8AA + 1462 7030 K8N Neo-FSR v2.0 147b 1c0b NF8 Mainboard 00e8 nForce3 EHCI USB 2.0 Controller 105b 0c43 Winfast NF3250K8AA + 1462 7030 K8N Neo-FSR v2.0 147b 1c0b NF8 Mainboard 00ea nForce3 250Gb AC'97 Audio Controller 105b 0c43 Winfast NF3250K8AA @@ -6051,6 +6060,7 @@ 0140 HT2100 PCI-Express Bridge 0141 HT2100 PCI-Express Bridge 0142 HT2100 PCI-Express Bridge + 0144 HT2100 PCI-Express Bridge 0200 OSB4 South Bridge 0201 CSB5 South Bridge 4c53 1080 CT8 mainboard @@ -8686,7 +8696,7 @@ 0e11 00e3 NC7761 Gigabit Server Adapter 1654 NetXtreme BCM5705_2 Gigabit Ethernet 0e11 00e3 NC7761 Gigabit Server Adapter - 103c 3100 NC1020 HP ProLiant Gigabit Server Adapter 32 PCI + 103c 3100 NC1020 ProLiant Gigabit Server Adapter 32 PCI 103c 3226 NC150T 4-port Gigabit Combo Switch & Adapter 1659 NetXtreme BCM5721 Gigabit Ethernet PCI Express 1014 02c6 eServer xSeries server mainboard @@ -8726,7 +8736,7 @@ 167e NetXtreme BCM5751F Fast Ethernet PCI Express 1693 NetLink BCM5787M Gigabit Ethernet PCI Express 1696 NetXtreme BCM5782 Gigabit Ethernet - 103c 12bc HP d530 CMT (DG746A) + 103c 12bc d530 CMT (DG746A) 14e4 000d NetXtreme BCM5782 1000Base-T 169a NetLink BCM5786 Gigabit Ethernet PCI Express 169b NetLink BCM5787 Gigabit Ethernet PCI Express @@ -9740,7 +9750,7 @@ 1260 ARC-1260 16-Port PCI-Express to SATA RAID Controller 17d5 S2io Inc. 5831 Xframe 10 Gigabit Ethernet PCI-X - 103c 12d5 HP PCI-X 133MHz 10GbE SR Fiber + 103c 12d5 PCI-X 133MHz 10GbE SR Fiber 10a9 8020 Single Port 10 Gigabit Ethernet (PCI-X, Fiber) 10a9 8024 Single Port 10 Gigabit Ethernet (PCI-X, Fiber) 5832 Xframe II 10Gbps Ethernet @@ -10404,9 +10414,9 @@ 0962 80960RM [i960RM Bridge] 0964 80960RP [i960 RP Microprocessor/Bridge] 1000 82542 Gigabit Ethernet Controller - 0e11 b0df NC1632 Gigabit Ethernet Adapter (1000-SX) - 0e11 b0e0 NC1633 Gigabit Ethernet Adapter (1000-LX) - 0e11 b123 NC1634 Gigabit Ethernet Adapter (1000-SX) + 0e11 b0df NC6132 Gigabit Ethernet Adapter (1000-SX) + 0e11 b0e0 NC6133 Gigabit Ethernet Adapter (1000-LX) + 0e11 b123 NC6134 Gigabit Ethernet Adapter (1000-LX) 1014 0119 Netfinity Gigabit Ethernet SX Adapter 8086 1000 PRO/1000 Gigabit Server Adapter 1001 82543GC Gigabit Ethernet Controller (Fiber) @@ -10558,7 +10568,9 @@ 16be 1040 V.9X DSP Data Fax Modem 1043 PRO/Wireless LAN 2100 3B Mini PCI Adapter 103c 08b0 tc1100 tablet + 8086 2522 Samsung P30 integrated WLAN 8086 2527 MIM2000/Centrino + 8086 2581 Toshiba Satellite M10 1048 PRO/10GbE LR Server Adapter 8086 a01f PRO/10GbE LR Server Adapter 8086 a11f PRO/10GbE LR Server Adapter @@ -10576,6 +10588,10 @@ 1051 82801EB/ER (ICH5/ICH5R) integrated LAN Controller 1052 PRO/100 VM Network Connection 1053 PRO/100 VM Network Connection + 1054 PRO/100 VE Network Connection + 1055 PRO/100 VM Network Connection + 1056 PRO/100 VE Network Connection + 1057 PRO/100 VE Network Connection 1059 82551QM Ethernet Controller 105b 82546GB Gigabit Ethernet Controller (Copper) 105e 82571EB Gigabit Ethernet Controller @@ -10622,8 +10638,8 @@ 1078 82541ER Gigabit Ethernet Controller 8086 1078 82541ER-based Network Connection 1079 82546GB Gigabit Ethernet Controller - 103c 12a6 HP Dual Port 1000Base-T [A9900A] - 103c 12cf HP Core Dual Port 1000Base-T [AB352A] + 103c 12a6 Dual Port 1000Base-T [A9900A] + 103c 12cf Core Dual Port 1000Base-T [AB352A] 1775 10d0 V5D Single Board Computer Gigabit Ethernet 1775 ce90 CE9 1fc1 0027 Niagara 2261 Failover NIC @@ -10634,7 +10650,7 @@ 8086 1179 PRO/1000 MT Dual Port Server Adapter 8086 117a PRO/1000 MT Dual Port Server Adapter 107a 82546GB Gigabit Ethernet Controller - 103c 12a8 HP Dual Port 1000base-SX [A9899A] + 103c 12a8 Dual Port 1000base-SX [A9899A] 8086 107a PRO/1000 MF Dual Port Server Adapter 8086 127a PRO/1000 MF Dual Port Server Adapter 107b 82546GB Gigabit Ethernet Controller @@ -10665,20 +10681,31 @@ 108b 82573V Gigabit Ethernet Controller (Copper) 108c 82573E Gigabit Ethernet Controller (Copper) 108e 82573E KCS (Active Management) - 108f Intel(R) Active Management Technology - SOL - 1092 Intel(R) PRO/100 VE Network Connection + 108f Active Management Technology - SOL + 1091 PRO/100 VM Network Connection + 1092 PRO/100 VE Network Connection + 1093 PRO/100 VM Network Connection + 1094 PRO/100 VE Network Connection + 1095 PRO/100 VE Network Connection 1096 80003ES2LAN Gigabit Ethernet Controller (Copper) 1097 631xESB/632xESB DPT LAN Controller (Fiber) 1098 80003ES2LAN Gigabit Ethernet Controller (Serdes) 1099 82546GB Gigabit Ethernet Controller (Copper) 8086 1099 PRO/1000 GT Quad Port Server Adapter 109a 82573L Gigabit Ethernet Controller + 1179 ff10 PRO/1000 PL 17aa 2001 ThinkPad T60 17aa 207e Thinkpad X60s 8086 109a PRO/1000 PL Network Connection 109b 82546GB PRO/1000 GF Quad Port Server Adapter + 109e 82597EX 10GbE Ethernet Controller + 8086 a01f PRO/10GbE CX4 Server Adapter + 8086 a11f PRO/10GbE CX4 Server Adapter 10a0 82571EB PRO/1000 AT Quad Port Bypass Adapter 10a1 82571EB PRO/1000 AF Quad Port Bypass Adapter + 10a4 82571EB Gigabit Ethernet Controller + 8086 10a4 PRO/1000 PT Quad Port Server Adapter + 8086 11a4 PRO/1000 PT Quad Port Server Adapter 10b0 82573L PRO/1000 PL Network Connection 10b2 82573V PRO/1000 PM Network Connection 10b3 82573E PRO/1000 PM Network Connection @@ -10692,6 +10719,11 @@ 8086 1093 PRO/1000 PT Desktop Adapter 10ba 80003ES2LAN Gigabit Ethernet Controller (Copper) 10bb 80003ES2LAN Gigabit Ethernet Controller (Serdes) + 10bc 82571EB Gigabit Ethernet Controller (Copper) + 8086 10bc PRO/1000 PT Quad Port LP Server Adapter + 8086 11bc PRO/1000 PT Quad Port LP Server Adapter + 10c4 82562GT 10/100 Network Connection + 10c5 82562G 10/100 Network Connection 1107 PRO/1000 MF Server Adapter (LX) 1130 82815 815 Chipset Host Bridge and Memory Controller Hub 1025 1016 Travelmate 612 TX @@ -10709,7 +10741,7 @@ 1161 82806AA PCI64 Hub Advanced Programmable Interrupt Controller 8086 1161 82806AA PCI64 Hub APIC 1162 Xscale 80200 Big Endian Companion Chip - 1200 Intel IXP1200 Network Processor + 1200 IXP1200 Network Processor 172a 0000 AEP SSL Accelerator 1209 8255xER/82551IT Fast Ethernet Controller 4c53 1050 CT7 mainboard @@ -10803,6 +10835,8 @@ 8086 0006 82557 10/100 with Wake on LAN 8086 0007 82558 10/100 Adapter 8086 0008 82558 10/100 with Wake on LAN +# 8086:0009 revision 5, 82558B based + 8086 0009 PRO/100+ PCI (TP) 8086 000a EtherExpress PRO/100+ Management Adapter 8086 000b EtherExpress PRO/100+ 8086 000c EtherExpress PRO/100+ Management Adapter @@ -10878,6 +10912,7 @@ 8086 3010 EtherExpress PRO/100 S Network Connection 8086 3011 EtherExpress PRO/100 S Network Connection 8086 3012 EtherExpress PRO/100 Network Connection + 8086 301a S845WD1-E mainboard 8086 3411 SDS2 Mainboard 122d 430FX - 82437FX TSC [Triton I] 122e 82371FB PIIX ISA [Triton I] @@ -10915,10 +10950,10 @@ 1028 0467 PowerEdge Expandable RAID Controller 2/DC 1028 1111 PowerEdge Expandable RAID Controller 2/SC 103c 03a2 MegaRAID - 103c 10c6 MegaRAID 438, HP NetRAID-3Si - 103c 10c7 MegaRAID T5, Integrated HP NetRAID - 103c 10cc MegaRAID, Integrated HP NetRAID - 103c 10cd HP NetRAID-1Si + 103c 10c6 MegaRAID 438, NetRAID-3Si + 103c 10c7 MegaRAID T5, Integrated NetRAID + 103c 10cc MegaRAID, Integrated NetRAID + 103c 10cd NetRAID-1Si 105a 0000 SuperTrak 105a 2168 SuperTrak Pro 105a 5168 SuperTrak66/100 @@ -10939,6 +10974,9 @@ 1a31 82845 845 (Brookdale) Chipset AGP Bridge 1a38 5000 Series Chipset DMA Engine 1a48 PRO/10GbE SR Server Adapter + 1b48 82597EX 10GbE Ethernet Controller + 8086 a01f PRO/10GbE LR Server Adapter + 8086 a11f PRO/10GbE LR Server Adapter 2410 82801AA ISA Bridge (LPC) 2411 82801AA IDE 2412 82801AA USB @@ -10962,6 +11000,7 @@ 2426 82801AB AC'97 Modem 2428 82801AB PCI Bridge 2440 82801BA ISA Bridge (LPC) + 8086 5744 S845WD1-E 2442 82801BA/BAM USB (Hub #1) 1014 01c6 Netvista A40/A40p 1025 1016 Travelmate 612 TX @@ -10972,6 +11011,7 @@ 147b 0507 TH7II-RAID 8086 4532 D815EEA2 mainboard 8086 4557 D815EGEW Mainboard + 8086 5744 S845WD1-E mainboard 2443 82801BA/BAM SMBus 1014 01c6 Netvista A40/A40p 1025 1016 Travelmate 612 TX @@ -10982,6 +11022,7 @@ 147b 0507 TH7II-RAID 8086 4532 D815EEA2 mainboard 8086 4557 D815EGEW Mainboard + 8086 5744 S845WD1-E mainboard 2444 82801BA/BAM USB (Hub #2) 1025 1016 Travelmate 612 TX 1028 00c7 Dimension 8100 @@ -10990,7 +11031,9 @@ 104d 80df Vaio PCG-FX403 147b 0507 TH7II-RAID 8086 4532 D815EEA2 mainboard + 8086 5744 S845WD1-E mainboard 2445 82801BA/BAM AC'97 Audio + 0e11 000b Compaq Deskpro EN Audio 0e11 0088 Evo D500 1014 01c6 Netvista A40/A40p 1025 1016 Travelmate 612 TX @@ -11003,6 +11046,7 @@ 104d 80df Vaio PCG-FX403 2448 82801 Mobile PCI Bridge 103c 099c NX6110/NC6120 + 144d c00c P30 notebook 1734 1055 Amilo M1420 2449 82801BA/BAM/CA/CAM Ethernet Controller 0e11 0012 EtherExpress PRO/100 VM @@ -11046,6 +11090,7 @@ 147b 0507 TH7II-RAID 8086 4532 D815EEA2 mainboard 8086 4557 D815EGEW Mainboard + 8086 5744 S845WD1-E mainboard 244c 82801BAM ISA Bridge (LPC) 244e 82801 PCI Bridge 1014 0267 NetVista A30p @@ -11122,6 +11167,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1462 5800 845PE Max (MS-6580) 1509 2990 Averatec 5110H laptop 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) @@ -11137,6 +11183,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30/P35 notebook 1458 24c2 GA-8PE667 Ultra 1462 5800 845PE Max (MS-6580) 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) @@ -11153,6 +11200,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1462 5800 845PE Max (MS-6580) 1509 2990 Averatec 5110H 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) @@ -11170,6 +11218,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1458 a002 GA-8PE667 Ultra 1462 5800 845PE Max (MS-6580) 1734 1005 D1451 (SCENIC N300, i845GV) Sigmatel STAC9750T @@ -11183,6 +11232,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 24c7 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) USB UHCI Controller #3 1014 0267 NetVista A30p 1014 052d Thinkpad R50e model 1634 @@ -11194,6 +11244,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1462 5800 845PE Max (MS-6580) 1509 2990 Averatec 5110H 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) @@ -11208,6 +11259,7 @@ 103c 0890 NC6000 laptop 103c 08b0 tc1100 tablet 1071 8160 MIM2000 + 144d c00c P30 notebook 1734 1055 Amilo M1420 8086 4541 Latitude D400 24cb 82801DB (ICH4) IDE Controller @@ -11218,6 +11270,7 @@ 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 4c53 1090 Cx9 / Vx9 mainboard 24cc 82801DBM (ICH4-M) LPC Interface Bridge + 144d c00c P30 notebook 1734 1055 Amilo M1420 24cd 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller 1014 0267 NetVista A30p @@ -11233,6 +11286,7 @@ 103c 08b0 tc1100 tablet 1071 8160 MIM2000 1179 ff00 Satellite 2430 + 144d c00c P30 notebook 1462 3981 845PE Max (MS-6580) 1509 1968 Averatec 5110H 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) @@ -11271,6 +11325,7 @@ 1014 02ed xSeries server mainboard 1028 0156 Precision 360 1028 0169 Precision 470 + 103c 12bc d330 uT 1043 80a6 P4P800 Mainboard 1458 24d2 GA-8IPE1000 Pro2 motherboard (865PE) 1462 7280 865PE Neo2 (MS-6728) @@ -11297,6 +11352,7 @@ 8086 4c43 Desktop Board D865GLC 8086 524c D865PERL mainboard 24d5 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller + 100a 147b Abit IS7-E motherboard 1028 0169 Precision 470 103c 006a NX9500 103c 12bc d330 uT @@ -11420,6 +11476,7 @@ 1734 1004 D1451 Mainboard (SCENIC N300, i845GV) 2570 82865G/PE/P DRAM Controller/Host-Hub Interface 103c 006a NX9500 + 103c 12bc d330 uT 1043 80f2 P5P800-MX Mainboard 1458 2570 GA-8IPE1000 Pro2 motherboard (865PE) 2571 82865G/PE/P PCI to AGP Controller @@ -11438,19 +11495,19 @@ 2579 82875P Processor to AGP Controller 257b 82875P/E7210 Processor to PCI to CSA Bridge 257e 82875P/E7210 Processor to I/O Memory Interface - 2580 915G/P/GV/GL/PL/910GL Express Memory Controller Hub + 2580 82915G/P/GV/GL/PL/910GL Memory Controller Hub 1458 2580 GA-8I915ME-G Mainboard 1462 7028 915P/G Neo2 1734 105b Scenic W620 - 2581 915G/P/GV/GL/PL/910GL Express PCI Express Root Port - 2582 82915G/GV/910GL Express Chipset Family Graphics Controller + 2581 82915G/P/GV/GL/PL/910GL PCI Express Root Port + 2582 82915G/GV/910GL Integrated Graphics Controller 1028 1079 Optiplex GX280 103c 3006 DC7100 SFF(DX878AV) 1043 2582 P5GD1-VW Mainboard 1458 2582 GA-8I915ME-G Mainboard 1734 105b Scenic W620 - 2584 925X/XE Express Memory Controller Hub - 2585 925X/XE Express PCI Express Root Port + 2584 82925X/XE Memory Controller Hub + 2585 82925X/XE PCI Express Root Port 2588 E7220/E7221 Memory Controller Hub 2589 E7220/E7221 PCI Express Root Port 258a E7221 Integrated Graphics Controller @@ -11526,7 +11583,7 @@ 25e5 5000 Series Chipset PCI Express x4 Port 5 25e6 5000 Series Chipset PCI Express x4 Port 6 25e7 5000 Series Chipset PCI Express x4 Port 7 - 25f0 5000 Series Chipset Error Reporting Registers + 25f0 5000 Series Chipset FSB Registers 25f1 5000 Series Chipset Reserved Registers 25f3 5000 Series Chipset Reserved Registers 25f5 5000 Series Chipset FBD Registers @@ -11547,7 +11604,7 @@ 2609 E8500/E8501 PCI Express x8 Port B 260a E8500/E8501 PCI Express x8 Port A 260c E8500/E8501 IMI Registers - 2610 E8500/E8501 Front Side Bus, Boot, and Interrupt Registers + 2610 E8500/E8501 FSB Registers 2611 E8500/E8501 Address Mapping Registers 2612 E8500/E8501 RAS Registers 2613 E8500/E8501 Reserved Registers @@ -11674,38 +11731,43 @@ 269a 631xESB/632xESB High Definition Audio Controller 269b 631xESB/632xESB/3100 Chipset SMBus Controller 269e 631xESB/632xESB IDE Controller - 2770 945G/GZ/P/PL Express Memory Controller Hub + 2770 82945G/GZ/P/PL Memory Controller Hub 107b 5048 E4500 8086 544e DeskTop Board D945GTP - 2771 945G/GZ/P/PL Express PCI Express Root Port - 2772 945G/GZ Express Integrated Graphics Controller + 2771 82945G/GZ/P/PL PCI Express Root Port + 2772 82945G/GZ Integrated Graphics Controller 8086 544e DeskTop Board D945GTP - 2774 955X Express Memory Controller Hub - 2775 955X Express PCI Express Root Port - 2776 945G/GZ Express Integrated Graphics Controller - 2778 E7230 Memory Controller Hub - 2779 E7230 PCI Express Root Port - 277a 975X Express PCI Express Root Port - 277c 975X Express Memory Controller Hub - 277d 975X Express PCI Express Root Port - 2782 82915G Express Chipset Family Graphics Controller + 2774 82955X Memory Controller Hub + 2775 82955X PCI Express Root Port + 2776 82945G/GZ Integrated Graphics Controller + 2778 E7230/3000/3010 Memory Controller Hub + 2779 E7230/3000/3010 PCI Express Root Port + 277a 82975X/3010 PCI Express Root Port + 277c 82975X Memory Controller Hub + 277d 82975X PCI Express Root Port + 2782 82915G Integrated Graphics Controller 1043 2582 P5GD1-VW Mainboard 1734 105b Scenic W620 2792 Mobile 915GM/GMS/910GML Express Graphics Controller 103c 099c NX6110/NC6120 1043 1881 GMA 900 915GM Integrated Graphics 27a0 Mobile 945GM/PM/GMS/940GML and 945GT Express Memory Controller Hub + 103c 30a1 NC2400 17aa 2017 Thinkpad R60e model 0657 27a1 Mobile 945GM/PM/GMS/940GML and 945GT Express PCI Express Root Port 27a2 Mobile 945GM/GMS/940GML Express Integrated Graphics Controller + 103c 30a1 NC2400 17aa 201a Thinkpad R60e model 0657 27a6 Mobile 945GM/GMS/940GML Express Integrated Graphics Controller + 103c 30a1 NC2400 17aa 201a Thinkpad R60e model 0657 27b0 82801GH (ICH7DH) LPC Interface Bridge 27b8 82801GB/GR (ICH7 Family) LPC Interface Bridge 107b 5048 E4500 8086 544e DeskTop Board D945GTP 27b9 82801GBM (ICH7-M) LPC Interface Bridge + 103c 30a1 NC2400 + 10f7 8338 Panasonic CF-Y5 laptop 17aa 2009 ThinkPad T60/R60 series 27bd 82801GHM (ICH7-M DH) LPC Interface Bridge 27c0 82801GB/GR/GH (ICH7 Family) Serial ATA Storage Controller IDE @@ -11718,22 +11780,27 @@ 17aa 200d Thinkpad R60e model 0657 27c6 82801GHM (ICH7-M DH) Serial ATA Storage Controller RAID 27c8 82801G (ICH7 Family) USB UHCI #1 + 103c 30a1 NC2400 107b 5048 E4500 17aa 200a ThinkPad T60/R60 series 8086 544e DeskTop Board D945GTP 27c9 82801G (ICH7 Family) USB UHCI #2 + 103c 30a1 NC2400 107b 5048 E4500 17aa 200a ThinkPad T60/R60 series 8086 544e DeskTop Board D945GTP 27ca 82801G (ICH7 Family) USB UHCI #3 + 103c 30a1 NC2400 107b 5048 E4500 17aa 200a ThinkPad T60/R60 series 8086 544e DeskTop Board D945GTP 27cb 82801G (ICH7 Family) USB UHCI #4 + 103c 30a1 NC2400 107b 5048 E4500 17aa 200a ThinkPad T60/R60 series 8086 544e DeskTop Board D945GTP 27cc 82801G (ICH7 Family) USB2 EHCI Controller + 103c 30a1 NC2400 17aa 200b ThinkPad T60/R60 series 8086 544e DeskTop Board D945GTP 27d0 82801G (ICH7 Family) PCI Express Port 1 @@ -11741,9 +11808,15 @@ 27d4 82801G (ICH7 Family) PCI Express Port 3 27d6 82801G (ICH7 Family) PCI Express Port 4 27d8 82801G (ICH7 Family) High Definition Audio Controller + 103c 30a1 NC2400 107b 5048 E4500 + 10f7 8338 Panasonic CF-Y5 laptop + 1179 ff31 Toshiba America Information Systems:AC97 Data Fax SoftModem with SmartCP + 152d 0753 Softmodem + 1734 10ad Conexant softmodem SmartCP 17aa 2010 ThinkPad T60/R60 series 27da 82801G (ICH7 Family) SMBus Controller + 10f7 8338 Panasonic CF-Y5 laptop 17aa 200f ThinkPad T60/R60 series 8086 544e DeskTop Board D945GTP 27dc 82801G (ICH7 Family) LAN Controller @@ -11751,7 +11824,9 @@ 27dd 82801G (ICH7 Family) AC'97 Modem Controller 27de 82801G (ICH7 Family) AC'97 Audio Controller 27df 82801G (ICH7 Family) IDE Controller + 103c 30a1 NC2400 107b 5048 E4500 + 10f7 8338 Panasonic CF-Y5 laptop 17aa 200c Thinkpad R60e model 0657 8086 544e DeskTop Board D945GTP 27e0 82801GR/GH/GHM (ICH7 Family) PCI Express Port 5 @@ -11762,21 +11837,28 @@ 2814 82801HO (ICH8DO) LPC Interface Controller 2815 Mobile LPC Interface Controller 2820 82801H (ICH8 Family) 4 port SATA IDE Controller - 2821 82801HB (ICH8) SATA AHCI Controller + 1462 7235 P965 Neo MS-7235 mainboard + 2821 82801HR/HO/HH (ICH8R/DO/DH) 6 port SATA AHCI Controller 2822 82801HR/HO/HH (ICH8R/DO/DH) SATA RAID Controller - 2824 82801HR/HO/HH (ICH8R/DO/DH) SATA AHCI Controller + 2824 82801HB (ICH8) 4 port SATA AHCI Controller 2825 82801H (ICH8 Family) 2 port SATA IDE Controller + 1462 7235 P965 Neo MS-7235 mainboard 2828 Mobile SATA IDE Controller 2829 Mobile SATA AHCI Controller 282a Mobile SATA RAID Controller 2830 82801H (ICH8 Family) USB UHCI #1 + 1462 7235 P965 Neo MS-7235 mainboard 2831 82801H (ICH8 Family) USB UHCI #2 + 1462 7235 P965 Neo MS-7235 mainboard 2832 82801H (ICH8 Family) USB UHCI #3 2834 82801H (ICH8 Family) USB UHCI #4 + 1462 7235 P965 Neo MS-7235 mainboard 2835 82801H (ICH8 Family) USB UHCI #5 2836 82801H (ICH8 Family) USB2 EHCI #1 + 1462 7235 P965 Neo MS-7235 mainboard 283a 82801H (ICH8 Family) USB2 EHCI #2 283e 82801H (ICH8 Family) SMBus Controller + 1462 7235 P965 Neo MS-7235 mainboard 283f 82801H (ICH8 Family) PCI Express Port 1 2841 82801H (ICH8 Family) PCI Express Port 2 2843 82801H (ICH8 Family) PCI Express Port 3 @@ -11786,45 +11868,111 @@ 284b 82801H (ICH8 Family) HD Audio Controller 284f 82801H (ICH8 Family) Thermal Reporting Device 2850 Mobile IDE Controller - 2970 946GZ/PL/GL Memory Controller Hub - 2971 946GZ/PL/GL PCI Express Root Port - 2972 946GZ/GL Integrated Graphics Controller - 2973 946GZ/GL Integrated Graphics Controller - 2974 946GZ/GL HECI Controller - 2975 946GZ/GL HECI Controller - 2976 946GZ/GL PT IDER Controller - 2977 946GZ/GL KT Controller + 2910 LPC Interface Controller + 2920 4 port SATA IDE Controller + 2921 2 port SATA IDE Controller + 2922 6 port SATA AHCI Controller + 2923 4 port SATA AHCI Controller + 2925 SATA RAID Controller + 2926 2 port SATA IDE Controller + 2928 Mobile 2 port SATA IDE Controller + 292d Mobile 2 port SATA IDE Controller + 292e Mobile 1 port SATA IDE Controller + 2930 SMBus Controller + 2932 Thermal Subsystem + 2934 USB UHCI Controller #1 + 2935 USB UHCI Controller #2 + 2936 USB UHCI Controller #3 + 2937 USB UHCI Controller #4 + 2938 USB UHCI Controller #5 + 2939 USB UHCI Controller #6 + 293a USB2 EHCI Controller #1 + 293c USB2 EHCI Controller #2 + 293e HD Audio Controller + 2940 PCI Express Port 1 + 2942 PCI Express Port 2 + 2944 PCI Express Port 3 + 2946 PCI Express Port 4 + 2948 PCI Express Port 5 + 294a PCI Express Port 6 + 294c Gigabit Ethernet Controller + 2970 82946GZ/PL/GL Memory Controller Hub + 2971 82946GZ/PL/GL PCI Express Root Port + 2972 82946GZ/GL Integrated Graphics Controller + 2973 82946GZ/GL Integrated Graphics Controller + 2974 82946GZ/GL HECI Controller + 2975 82946GZ/GL HECI Controller + 2976 82946GZ/GL PT IDER Controller + 2977 82946GZ/GL KT Controller 2980 965 G1 Memory Controller Hub 2981 965 G1 PCI Express Root Port 2982 965 G1 Integrated Graphics Controller - 2990 Q963/Q965 Memory Controller Hub - 2991 Q963/Q965 PCI Express Root Port - 2992 Q963/Q965 Integrated Graphics Controller - 2993 Q963/Q965 Integrated Graphics Controller - 2994 Q963/Q965 HECI Controller - 2995 Q963/Q965 HECI Controller - 2996 Q963/Q965 PT IDER Controller - 2997 Q963/Q965 KT Controller - 29a0 P965/G965 Memory Controller Hub - 29a1 P965/G965 PCI Express Root Port - 29a2 G965 Integrated Graphics Controller - 29a3 G965 Integrated Graphics Controller - 29a4 P965/G965 HECI Controller - 29a5 P965/G965 HECI Controller - 29a6 P965/G965 PT IDER Controller - 29a7 P965/G965 KT Controller + 2990 82Q963/Q965 Memory Controller Hub + 2991 82Q963/Q965 PCI Express Root Port + 2992 82Q963/Q965 Integrated Graphics Controller + 2993 82Q963/Q965 Integrated Graphics Controller + 2994 82Q963/Q965 HECI Controller + 2995 82Q963/Q965 HECI Controller + 2996 82Q963/Q965 PT IDER Controller + 2997 82Q963/Q965 KT Controller + 29a0 82P965/G965 Memory Controller Hub + 29a1 82P965/G965 PCI Express Root Port + 29a2 82G965 Integrated Graphics Controller + 29a3 82G965 Integrated Graphics Controller + 29a4 82P965/G965 HECI Controller + 29a5 82P965/G965 HECI Controller + 29a6 82P965/G965 PT IDER Controller + 29a7 82P965/G965 KT Controller + 29b0 DRAM Controller + 29b1 PCI Express Root Port + 29b2 Integrated Graphics Controller + 29b3 Integrated Graphics Controller + 29b4 HECI Controller + 29b5 HECI Controller + 29b6 PT IDER Controller + 29b7 Serial KT Controller + 29c0 DRAM Controller + 29c1 PCI Express Root Port + 29c2 Integrated Graphics Controller + 29c3 Integrated Graphics Controller + 29c4 HECI Controller + 29c5 HECI Controller + 29c6 PT IDER Controller + 29c7 Serial KT Controller + 29cf Virtual HECI Controller + 29e0 DRAM Controller + 29e1 Host-Primary PCI Express Bridge + 29e4 HECI Controller + 29e5 HECI Controller + 29e6 PT IDER Controller + 29e7 Serial KT Controller + 29e9 Host-Secondary PCI Express Bridge + 29f0 Server DRAM Controller + 29f1 Server Host-Primary PCI Express Bridge + 29f4 Server HECI Controller + 29f5 Server HECI Controller + 29f6 Server PT IDER Controller + 29f7 Server Serial KT Controller + 29f9 Server Host-Secondary PCI Express Bridge 2a00 Mobile Memory Controller Hub 2a01 Mobile PCI Express Root Port 2a02 Mobile Integrated Graphics Controller 2a03 Mobile Integrated Graphics Controller + 2a04 Mobile HECI Controller + 2a05 Mobile HECI Controller + 2a06 Mobile PT IDER Controller + 2a07 Mobile KT Controller 3092 Integrated RAID 3200 GD31244 PCI-X SATA HBA + 1775 c200 C2K onboard SATA host bus adapter 3340 82855PM Processor to I/O Controller 1025 005a TravelMate 290 103c 088c NC8000 laptop 103c 0890 NC6000 laptop - 103c 08b0 HP tc1100 laptop + 103c 08b0 tc1100 tablet + 144d c00c P30 notebook 3341 82855PM Processor to AGP Controller + 144d c00c P30 notebook 3500 6311ESB/6321ESB PCI Express Upstream Port 3501 6310ESB PCI Express Upstream Port 3504 6311ESB/6321ESB I/OxAPIC Interrupt Controller @@ -11911,7 +12059,42 @@ 35b6 3100 Chipset PCI Express Port A 35b7 3100 Chipset PCI Express Port A1 35c8 3100 Extended Configuration Test Overflow Registers + 3600 Server Memory Controller Hub + 3604 Server PCI Express Port 1 + 3605 Server PCI Express Port 2 + 3606 Server PCI Express Port 3 + 3607 Server PCI Express Port 4 + 3608 Server PCI Express Port 5 + 3609 Server PCI Express Port 6 + 360a Server PCI Express Port 7 + 360b Server IOAT DMA Controller + 360c Server FSB Registers + 360d Server Snoop Filter Registers + 360e Server Reserved Registers + 360f Server FBD Branch 0 Registers + 3610 Server FBD Branch 1 Registers + 4000 Memory Controller Hub + 4008 Memory Controller Hub + 4010 Memory Controller Hub + 4021 PCI Express Port 1 + 4022 PCI Express Port 2 + 4023 PCI Express Port 3 + 4024 PCI Express Port 4 + 4025 PCI Express Port 5 + 4026 PCI Express Port 6 + 4027 PCI Express Port 7 + 4028 PCI Express Port 8 + 4029 PCI Express Port 9 + 402d IBIST Registers + 402e IBIST Registers + 402f DMA/DCA Engine + 4030 FSB Registers + 4032 I/OxAPIC + 4035 FBD Registers + 4036 FBD Registers 4220 PRO/Wireless 2200BG Network Connection + 2731 8086 WLAN-Adapter + 8086 2731 Samsung P35 integrated WLAN 4222 PRO/Wireless 3945ABG Network Connection 8086 1005 PRO/Wireless 3945BG Network Connection 8086 1034 PRO/Wireless 3945BG Network Connection @@ -11927,6 +12110,23 @@ 5201 EtherExpress PRO/100 Intelligent Server 8086 0001 EtherExpress PRO/100 Server Ethernet Adapter 530d 80310 IOP [IO Processor] + 65c0 Memory Controller Hub + 65e2 PCI Express x4 Port 2 + 65e3 PCI Express x4 Port 3 + 65e4 PCI Express x4 Port 4 + 65e5 PCI Express x4 Port 5 + 65e6 PCI Express x4 Port 6 + 65e7 PCI Express x4 Port 7 + 65f0 FSB Registers + 65f1 Reserved Registers + 65f3 Reserved Registers + 65f5 DDR Channel 0 Registers + 65f6 DDR Channel 1 Registers + 65f7 PCI Express x8 Port 2-3 + 65f8 PCI Express x8 Port 4-5 + 65f9 PCI Express x8 Port 6-7 + 65fa PCI Express x16 Port 4-7 + 65ff DMA Engine 7000 82371SB PIIX3 ISA [Natoma/Triton II] 7010 82371SB PIIX3 IDE [Natoma/Triton II] 7020 82371SB PIIX3 USB [Natoma/Triton II] @@ -12013,7 +12213,7 @@ 84e4 460GX - 84460GX Memory Data Controller (MDC) 84e6 460GX - 82466GX Wide and fast PCI eXpander Bridge (WXB) 84ea 460GX - 84460GX AGP Bridge (GXB function 1) - 8500 IXP4XX Intel Network Processor (IXP420/421/422/425/IXC1100) + 8500 IXP4XX Network Processor (IXP420/421/422/425/IXC1100) 1993 0ded mGuard-PCI AV#2 1993 0dee mGuard-PCI AV#1 1993 0def mGuard-PCI AV#0 @@ -12025,6 +12225,7 @@ 9622 Integrated RAID 9641 Integrated RAID 96a1 Integrated RAID + a620 6400/6402 Advanced Memory Buffer (AMB) b152 21152 PCI-to-PCI Bridge # observed, and documented in Intel revision note; new mask of 1011:0026 b154 21154 PCI-to-PCI Bridge From darkwyrm at mail.berlios.de Thu Jan 18 00:58:13 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Thu, 18 Jan 2007 00:58:13 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage Message-ID: <200701172358.l0HNwDFh005214@sheep.berlios.de> Author: darkwyrm Date: 2007-01-18 00:58:06 +0100 (Thu, 18 Jan 2007) New Revision: 19852 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19852&view=rev Modified: haiku/trunk/src/apps/showimage/ResizerWindow.cpp haiku/trunk/src/apps/showimage/ShowImageWindow.cpp Log: Usability fixes: Moved Dither Image to the View menu (where it really belongs) Made some menu item labels less technical A couple of capitalization fixes Fixed layout problems in the Resize window Modified: haiku/trunk/src/apps/showimage/ResizerWindow.cpp =================================================================== --- haiku/trunk/src/apps/showimage/ResizerWindow.cpp 2007-01-17 22:15:06 UTC (rev 19851) +++ haiku/trunk/src/apps/showimage/ResizerWindow.cpp 2007-01-17 23:58:06 UTC (rev 19852) @@ -43,7 +43,7 @@ static const char* kWidthLabel = "Width:"; static const char* kHeightLabel = "Height:"; -static const char* kKeepAspectRatioLabel = "Keep Aspect Ratio"; +static const char* kKeepAspectRatioLabel = "Keep Proportions"; static const char* kApplyLabel = "Apply"; static const float kLineDistance = 5; @@ -56,7 +56,8 @@ , fOriginalHeight(height) , fTarget(target) { - BView* back_view = new BBox(Bounds(), "", B_FOLLOW_ALL); + BView* back_view = new BView(Bounds(), "", B_FOLLOW_ALL, B_WILL_DRAW); + back_view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); AddChild(back_view); const float widthLabelWidth = back_view->StringWidth(kWidthLabel); @@ -64,7 +65,7 @@ const float column2 = max_c(widthLabelWidth, heightLabelWidth); const float textControlWidth = column2 + back_view->StringWidth("999999"); - const float keepAspectRatioLabelWidth = back_view->StringWidth(kKeepAspectRatioLabel); + const float keepAspectRatioLabelWidth = 15 + back_view->StringWidth(kKeepAspectRatioLabel); const float width2 = 2 * kHorizontalIndent + max_c(textControlWidth, keepAspectRatioLabelWidth); ResizeTo(width2+1, Bounds().Height()+1); @@ -89,8 +90,6 @@ fAspectRatio->SetValue(B_CONTROL_ON); AddControl(back_view, fAspectRatio, column2, rect); - AddSeparatorLine(back_view, rect); - fApply = new BButton(rect, "apply", kApplyLabel, new BMessage(kApplyMsg)); fApply->MakeDefault(true); AddControl(back_view, fApply, column2, rect); Modified: haiku/trunk/src/apps/showimage/ShowImageWindow.cpp =================================================================== --- haiku/trunk/src/apps/showimage/ShowImageWindow.cpp 2007-01-17 22:15:06 UTC (rev 19851) +++ haiku/trunk/src/apps/showimage/ShowImageWindow.cpp 2007-01-17 23:58:06 UTC (rev 19852) @@ -245,7 +245,8 @@ menu->AddSeparatorItem(); - AddItemMenu(menu, "Scale Bilinear", MSG_SCALE_BILINEAR, 0, 0, 'W', true); + AddItemMenu(menu, "High-Quality Zooming", MSG_SCALE_BILINEAR, 0, 0, 'W', true); + AddItemMenu(menu, "Stippled Zooming", MSG_DITHER_IMAGE, 0, 0, 'W', true); menu->AddSeparatorItem(); @@ -326,7 +327,7 @@ AddItemMenu(menu, "Last Page", MSG_PAGE_LAST, B_RIGHT_ARROW, B_SHIFT_KEY, 'W', true); AddItemMenu(menu, "Previous Page", MSG_PAGE_PREV, B_LEFT_ARROW, 0, 'W', true); AddItemMenu(menu, "Next Page", MSG_PAGE_NEXT, B_RIGHT_ARROW, 0, 'W', true); - fGoToPageMenu = new BMenu("Go To Page"); + fGoToPageMenu = new BMenu("Go to Page"); fGoToPageMenu->SetRadioMode(true); menu->AddItem(fGoToPageMenu); menu->AddSeparatorItem(); @@ -335,20 +336,18 @@ bar->AddItem(menu); menu = new BMenu("Image"); - AddItemMenu(menu, "Dither Image", MSG_DITHER_IMAGE, 0, 0, 'W', true); + AddItemMenu(menu, "Rotate Counterclockwise", MSG_ROTATE_270, '[', 0, 'W', true); + AddItemMenu(menu, "Rotate Clockwise", MSG_ROTATE_90, ']', 0, 'W', true); menu->AddSeparatorItem(); - AddItemMenu(menu, "Rotate -90?", MSG_ROTATE_270, '[', 0, 'W', true); - AddItemMenu(menu, "Rotate +90?", MSG_ROTATE_90, ']', 0, 'W', true); + AddItemMenu(menu, "Flip Left to Right", MSG_FLIP_LEFT_TO_RIGHT, 0, 0, 'W', true); + AddItemMenu(menu, "Flip Top to Bottom", MSG_FLIP_TOP_TO_BOTTOM, 0, 0, 'W', true); menu->AddSeparatorItem(); - AddItemMenu(menu, "Flip Left To Right", MSG_FLIP_LEFT_TO_RIGHT, 0, 0, 'W', true); - AddItemMenu(menu, "Flip Top To Bottom", MSG_FLIP_TOP_TO_BOTTOM, 0, 0, 'W', true); + AddItemMenu(menu, "Invert Colors", MSG_INVERT, 0, 0, 'W', true); menu->AddSeparatorItem(); - AddItemMenu(menu, "Invert", MSG_INVERT, 0, 0, 'W', true); - menu->AddSeparatorItem(); - AddItemMenu(menu, "Resize " B_UTF8_ELLIPSIS, MSG_OPEN_RESIZER_WINDOW, 0, 0, 'W', true); + AddItemMenu(menu, "Resize" B_UTF8_ELLIPSIS, MSG_OPEN_RESIZER_WINDOW, 0, 0, 'W', true); bar->AddItem(menu); menu->AddSeparatorItem(); - AddItemMenu(menu, "As Desktop Background", MSG_DESKTOP_BACKGROUND, 0, 0, 'W', true); + AddItemMenu(menu, "Use as Desktop Background", MSG_DESKTOP_BACKGROUND, 0, 0, 'W', true); } From korli at users.berlios.de Thu Jan 18 09:18:22 2007 From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=) Date: Thu, 18 Jan 2007 09:18:22 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <200701172358.l0HNwDFh005214@sheep.berlios.de> References: <200701172358.l0HNwDFh005214@sheep.berlios.de> Message-ID: Hi Darkwyrm, 2007/1/18, darkwyrm at BerliOS : > Author: darkwyrm > Date: 2007-01-18 00:58:06 +0100 (Thu, 18 Jan 2007) > New Revision: 19852 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19852&view=rev > > Modified: > haiku/trunk/src/apps/showimage/ResizerWindow.cpp > haiku/trunk/src/apps/showimage/ShowImageWindow.cpp > Modified: haiku/trunk/src/apps/showimage/ResizerWindow.cpp > =================================================================== > --- haiku/trunk/src/apps/showimage/ResizerWindow.cpp 2007-01-17 22:15:06 UTC (rev 19851) > +++ haiku/trunk/src/apps/showimage/ResizerWindow.cpp 2007-01-17 23:58:06 UTC (rev 19852) > @@ -56,7 +56,8 @@ > , fOriginalHeight(height) > , fTarget(target) > { > - BView* back_view = new BBox(Bounds(), "", B_FOLLOW_ALL); > + BView* back_view = new BView(Bounds(), "", B_FOLLOW_ALL, B_WILL_DRAW); > + back_view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); > AddChild(back_view); > > const float widthLabelWidth = back_view->StringWidth(kWidthLabel); Is there a reason why not use a BBox anymore ? Bye, J?r?me From axeld at pinc-software.de Thu Jan 18 11:20:45 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 18 Jan 2007 11:20:45 +0100 (MET) Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: Message-ID: <2641443989-BeMail@zon> "J?r?me Duval" wrote: > Is there a reason why not use a BBox anymore ? If you ask me: yes, there is :-) If there should be a border around every window, the window decorator should draw it. In Be's apps, this was handled quite inconsistently; and with the Dano look, some of those apps looked broken, others didn't. And we might want to change the look one day, too. Whenever I touched an application, I removed those borders where I saw them, btw. Bye, Axel. From axeld at pinc-software.de Thu Jan 18 11:24:29 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 18 Jan 2007 11:24:29 +0100 (MET) Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <200701172358.l0HNwDFh005214@sheep.berlios.de> Message-ID: <2864858295-BeMail@zon> darkwyrm at BerliOS wrote: > -static const char* kKeepAspectRatioLabel = "Keep Aspect Ratio"; > +static const char* kKeepAspectRatioLabel = "Keep Proportions"; Is "proportions" really the word to use here? I know I'm a foreign speaker, but I understand "aspect ratio" without thinking, while I would need to adapt "proportions" to the situation first before I would know what it means in this place. > - AddItemMenu(menu, "Scale Bilinear", MSG_SCALE_BILINEAR, 0, 0, 'W', > true); > + AddItemMenu(menu, "High-Quality Zooming", MSG_SCALE_BILINEAR, 0, 0, > 'W', true); > + AddItemMenu(menu, "Stippled Zooming", MSG_DITHER_IMAGE, 0, 0, 'W', > true); While "High Quality Zooming" more or less fits, "Stippled Zooming" certainly doesn't; dithering has nothing to do with zooming. Furthermore, dithering is a known word for this effect. IMO please revert this. Bye, Axel. From mmu_man at mail.berlios.de Thu Jan 18 11:29:19 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 18 Jan 2007 11:29:19 +0100 Subject: [Haiku-commits] r19853 - haiku/trunk/src/bin Message-ID: <200701181029.l0IATJs6032058@sheep.berlios.de> Author: mmu_man Date: 2007-01-18 11:29:19 +0100 (Thu, 18 Jan 2007) New Revision: 19853 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19853&view=rev Modified: haiku/trunk/src/bin/open.cpp Log: When an app sig has been given, use it instead of the mime type to open docs. This way 'open application/x-vnd.Be-NPOS foo.html' would work as expected, instead of opening NetPos and open the file in the default browser. Modified: haiku/trunk/src/bin/open.cpp =================================================================== --- haiku/trunk/src/bin/open.cpp 2007-01-17 23:58:06 UTC (rev 19852) +++ haiku/trunk/src/bin/open.cpp 2007-01-18 10:29:19 UTC (rev 19853) @@ -20,7 +20,7 @@ const char *kTrackerSignature = "application/x-vnd.Be-TRAK"; -const char *openWith = kTrackerSignature; +const char *openWith = NULL; status_t OpenFile(BEntry &entry, int32 line=-1, int32 col=-1) @@ -29,7 +29,7 @@ entry_ref ref; entry.GetRef(&ref); - BMessenger target(openWith); + BMessenger target(openWith?openWith:kTrackerSignature); if (target.IsValid()) { BMessage message(B_REFS_RECEIVED); message.AddRef("refs", &ref); @@ -89,7 +89,7 @@ mimeType.Append(arg, arg.FindFirst(":")); char *args[2] = { *argv, NULL }; - status = be_roster->Launch(mimeType.String(), 1, args); + status = be_roster->Launch(openWith?openWith:mimeType.String(), 1, args); if (status == B_OK) continue; From wkornewald at haiku-os.org Thu Jan 18 11:40:05 2007 From: wkornewald at haiku-os.org (Waldemar Kornewald) Date: Thu, 18 Jan 2007 11:40:05 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <2864858295-BeMail@zon> References: <200701172358.l0HNwDFh005214@sheep.berlios.de> <2864858295-BeMail@zon> Message-ID: On 1/18/07, Axel D?rfler wrote: > darkwyrm at BerliOS wrote: > > -static const char* kKeepAspectRatioLabel = "Keep Aspect Ratio"; > > +static const char* kKeepAspectRatioLabel = "Keep Proportions"; > > Is "proportions" really the word to use here? I know I'm a foreign > speaker, but I understand "aspect ratio" without thinking, while I > would need to adapt "proportions" to the situation first before I would > know what it means in this place. I'd prefer "Proportions" because even an inexperienced user should be able to understand it whereas "Aspect Ratio" sounds like a term you first have to learn. Bye, Waldemar Kornewald From wkornewald at haiku-os.org Thu Jan 18 11:45:33 2007 From: wkornewald at haiku-os.org (Waldemar Kornewald) Date: Thu, 18 Jan 2007 11:45:33 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <200701172358.l0HNwDFh005214@sheep.berlios.de> References: <200701172358.l0HNwDFh005214@sheep.berlios.de> Message-ID: On 1/18/07, darkwyrm at BerliOS wrote: > - AddItemMenu(menu, "Scale Bilinear", MSG_SCALE_BILINEAR, 0, 0, 'W', true); > + AddItemMenu(menu, "High-Quality Zooming", MSG_SCALE_BILINEAR, 0, 0, 'W', true); What's the disadvantage of *always* zooming with high quality? Why would you ever want to zoom with low quality? Is it just slightly slower? This option doesn't make sense to me. Bye, Waldemar Kornewald From marcusoverhagen at arcor.de Thu Jan 18 12:01:29 2007 From: marcusoverhagen at arcor.de (Marcus Overhagen) Date: Thu, 18 Jan 2007 12:01:29 +0100 (CET) Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: References: <200701172358.l0HNwDFh005214@sheep.berlios.de> <2864858295-BeMail@zon> Message-ID: <31876461.1169118089016.JavaMail.ngmail@webmail17> Waldemar Kornewald wrote: > On 1/18/07, Axel D?rfler wrote: > > Is "proportions" really the word to use here? I know I'm a foreign > > speaker, but I understand "aspect ratio" without thinking, while I > > would need to adapt "proportions" to the situation first before I would > > know what it means in this place. > > I'd prefer "Proportions" because even an inexperienced user should be > able to understand it whereas "Aspect Ratio" sounds like a term you > first have to learn. Please revert this change and use aspect ratio. It is the correct term for this. Haiku is not aiming at dumb users. I even looked this up at wikipedi, it's also used for paper size, tires, aircraft and birds. http://en.wikipedia.org/wiki/Aspect_ratio http://en.wikipedia.org/wiki/Proportions btw, MediaPlayer also uses "Keep Aspect Ratio" regards Marcus Viel oder wenig? Schnell oder langsam? Unbegrenzt surfen + telefonieren ohne Zeit- und Volumenbegrenzung? DAS TOP ANGEBOT JETZT bei Arcor: g?nstig und schnell mit DSL - das All-Inclusive-Paket f?r clevere Doppel-Sparer, nur 44,85 ? inkl. DSL- und ISDN-Grundgeb?hr! http://www.arcor.de/rd/emf-dsl-2 From axeld at pinc-software.de Thu Jan 18 12:07:43 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 18 Jan 2007 12:07:43 +0100 (MET) Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: Message-ID: <5447003562-BeMail@zon> "Waldemar Kornewald" wrote: > On 1/18/07, Axel D?rfler wrote: > > darkwyrm at BerliOS wrote: > > > -static const char* kKeepAspectRatioLabel = "Keep Aspect Ratio"; > > > +static const char* kKeepAspectRatioLabel = "Keep Proportions"; > > Is "proportions" really the word to use here? I know I'm a foreign > > speaker, but I understand "aspect ratio" without thinking, while I > > would need to adapt "proportions" to the situation first before I > > would > > know what it means in this place. > I'd prefer "Proportions" because even an inexperienced user should be > able to understand it whereas "Aspect Ratio" sounds like a term you > first have to learn. "Aspect ratio" is the correct term to use here, I don't see what you would need to learn here; it doesn't have anything to do with computers. Good luck with finding a single person that calls the aspect ratio of your monitor or TV or photo proportions. I'm slowly getting sick of this inexperienced user idiocy. Bye, Axel. From axeld at pinc-software.de Thu Jan 18 12:09:19 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 18 Jan 2007 12:09:19 +0100 (MET) Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: Message-ID: <5556273158-BeMail@zon> "Waldemar Kornewald" wrote: > On 1/18/07, darkwyrm at BerliOS wrote: > > - AddItemMenu(menu, "Scale Bilinear", MSG_SCALE_BILINEAR, 0, > > 0, 'W', true); > > + AddItemMenu(menu, "High-Quality Zooming", > > MSG_SCALE_BILINEAR, 0, 0, 'W', true); > What's the disadvantage of *always* zooming with high quality? Why > would you ever want to zoom with low quality? Is it just slightly > slower? This option doesn't make sense to me. Indeed, why not just making it depend on the speed of your system? Bye, Axel. From axeld at mail.berlios.de Thu Jan 18 12:12:17 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 18 Jan 2007 12:12:17 +0100 Subject: [Haiku-commits] r19854 - haiku/trunk/src/bin Message-ID: <200701181112.l0IBCHRM004555@sheep.berlios.de> Author: axeld Date: 2007-01-18 12:12:16 +0100 (Thu, 18 Jan 2007) New Revision: 19854 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19854&view=rev Modified: haiku/trunk/src/bin/open.cpp Log: * Fixed all those style issue mmu_man introduced over the years - thanks, man! * Some possible errors weren't propagated. Modified: haiku/trunk/src/bin/open.cpp =================================================================== --- haiku/trunk/src/bin/open.cpp 2007-01-18 10:29:19 UTC (rev 19853) +++ haiku/trunk/src/bin/open.cpp 2007-01-18 11:12:16 UTC (rev 19854) @@ -1,53 +1,55 @@ /* - * Copyright 2003-2005, Axel D?rfler, axeld at pinc-software.de. All rights reserved. - * Copyright 2005-2006, Fran?ois Revol, revol at free.fr. + * Copyright 2003-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2005-2007, Fran?ois Revol, revol at free.fr. * Distributed under the terms of the MIT License. */ -/* Launches an application/document from the shell */ +/*! Launches an application/document from the shell */ +#include +#include #include -#include #include -#include +#include #include #include #include -#include const char *kTrackerSignature = "application/x-vnd.Be-TRAK"; -const char *openWith = NULL; - -status_t OpenFile(BEntry &entry, int32 line=-1, int32 col=-1) +status_t +open_file(const char* openWith, BEntry &entry, int32 line = -1, int32 col = -1) { - status_t status; entry_ref ref; - entry.GetRef(&ref); + status_t status = entry.GetRef(&ref); + if (status < B_OK) + return status; - BMessenger target(openWith?openWith:kTrackerSignature); - if (target.IsValid()) { - BMessage message(B_REFS_RECEIVED); - message.AddRef("refs", &ref); - if (line > -1) - message.AddInt32("be:line", line); - if (col > -1) - message.AddInt32("be:column", col); - // tell the app to open the file - status = target.SendMessage(&message); - } else - status = be_roster->Launch(&ref); - return status; + BMessenger target(openWith ? openWith : kTrackerSignature); + if (!target.IsValid()) + return be_roster->Launch(&ref); + + BMessage message(B_REFS_RECEIVED); + message.AddRef("refs", &ref); + if (line > -1) + message.AddInt32("be:line", line); + if (col > -1) + message.AddInt32("be:column", col); + + // tell the app to open the file + return target.SendMessage(&message); } + int main(int argc, char **argv) { int exitcode = EXIT_SUCCESS; + const char *openWith = NULL; char *progName = argv[0]; if (strrchr(progName, '/')) @@ -62,14 +64,12 @@ BEntry entry(*argv); if ((status = entry.InitCheck()) == B_OK && entry.Exists()) { - status = OpenFile(entry); + status = open_file(openWith, entry); } else if (!strncasecmp("application/", *argv, 12)) { // maybe it's an application-mimetype? - + // subsequent files are open with that app openWith = *argv; - // clear possible ENOENT from above - status = B_OK; // in the case the app is already started, // don't start it twice if we have other args @@ -79,6 +79,8 @@ if (teams.IsEmpty()) status = be_roster->Launch(*argv); + else + status = B_OK; } else if (strchr(*argv, ':')) { // try to open it as an URI BString mimeType = "application/x-vnd.Be.URL."; @@ -89,37 +91,40 @@ mimeType.Append(arg, arg.FindFirst(":")); char *args[2] = { *argv, NULL }; - status = be_roster->Launch(openWith?openWith:mimeType.String(), 1, args); + status = be_roster->Launch(openWith ? openWith : mimeType.String(), 1, args); if (status == B_OK) continue; - + // maybe it's "file:line" or "file:line:col" int line = 0, col = 0, i; status = B_ENTRY_NOT_FOUND; // remove gcc error's last : - if (arg[arg.Length()-1] == ':') - arg.Truncate(arg.Length()-1); + if (arg[arg.Length() - 1] == ':') + arg.Truncate(arg.Length() - 1); + i = arg.FindLast(':'); if (i > 0) { - line = atoi(arg.String()+i+1); + line = atoi(arg.String() + i + 1); arg.Truncate(i); - entry.SetTo(arg.String()); - if (entry.Exists()) - status = OpenFile(entry, line-1, col-1); + + status = entry.SetTo(arg.String()); + if (status == B_OK && entry.Exists()) + status = open_file(openWith, entry, line - 1, col - 1); if (status == B_OK) continue; - // get the col + + // get the column col = line; i = arg.FindLast(':'); - line = atoi(arg.String()+i+1); + line = atoi(arg.String() + i + 1); arg.Truncate(i); - entry.SetTo(arg.String()); - if (entry.Exists()) - status = OpenFile(entry, line-1, col-1); + + status = entry.SetTo(arg.String()); + if (status == B_OK && entry.Exists()) + status = open_file(openWith, entry, line - 1, col - 1); } - } else { + } else status = B_ENTRY_NOT_FOUND; - } if (status != B_OK && status != B_ALREADY_RUNNING) { fprintf(stderr, "%s: \"%s\": %s\n", progName, *argv, strerror(status)); From darkwyrm at earthlink.net Thu Jan 18 12:13:14 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Thu, 18 Jan 2007 06:13:14 -0500 EST Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: Message-ID: <932039798-BeMail@sapphire> > Hi Darkwyrm, > > 2007/1/18, darkwyrm at BerliOS : > > Author: darkwyrm > > Date: 2007-01-18 00:58:06 +0100 (Thu, 18 Jan 2007) > > New Revision: 19852 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19852&view=rev > > > > Modified: > > haiku/trunk/src/apps/showimage/ResizerWindow.cpp > > haiku/trunk/src/apps/showimage/ShowImageWindow.cpp > > Modified: haiku/trunk/src/apps/showimage/ResizerWindow.cpp > > =================================================================== > > --- haiku/trunk/src/apps/showimage/ResizerWindow.cpp 2007-01-17 > > 22:15:06 UTC (rev 19851) > > +++ haiku/trunk/src/apps/showimage/ResizerWindow.cpp 2007-01-17 > > 23:58:06 UTC (rev 19852) > > @@ -56,7 +56,8 @@ > > , fOriginalHeight(height) > > , fTarget(target) > > { > > - BView* back_view = new BBox(Bounds(), "", B_FOLLOW_ALL); > > + BView* back_view = new BView(Bounds(), "", B_FOLLOW_ALL, > > B_WILL_DRAW); > > + back_view-> > > SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); > > AddChild(back_view); > > > > const float widthLabelWidth = back_view-> > > StringWidth(kWidthLabel); > > Is there a reason why not use a BBox anymore ? Actually, yes. The only reason it was used was for the bevel and I replaced it with a regular BView for visual consistency. When opened over the regular ShowImage window, it really didn't look right IMO. That's all. :^) --DW From wkornewald at haiku-os.org Thu Jan 18 12:18:10 2007 From: wkornewald at haiku-os.org (Waldemar Kornewald) Date: Thu, 18 Jan 2007 12:18:10 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <31876461.1169118089016.JavaMail.ngmail@webmail17> References: <200701172358.l0HNwDFh005214@sheep.berlios.de> <2864858295-BeMail@zon> <31876461.1169118089016.JavaMail.ngmail@webmail17> Message-ID: On 1/18/07, Marcus Overhagen wrote: > Please revert this change and use aspect ratio. It is the correct term for this. > Haiku is not aiming at dumb users. > > I even looked this up at wikipedi, it's also used for paper size, tires, aircraft and birds. > > http://en.wikipedia.org/wiki/Aspect_ratio > http://en.wikipedia.org/wiki/Proportions You're right. Hmm, I guess it was just me being a foreign speaker, then...I had the impression that it was a highly technical term. Bye, Waldemar Kornewald From darkwyrm at earthlink.net Thu Jan 18 12:20:54 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Thu, 18 Jan 2007 06:20:54 -0500 EST Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <2864858295-BeMail@zon> Message-ID: <1392186432-BeMail@sapphire> > darkwyrm at BerliOS wrote: > > -static const char* kKeepAspectRatioLabel = "Keep Aspect Ratio"; > > +static const char* kKeepAspectRatioLabel = "Keep Proportions"; > > Is "proportions" really the word to use here? I know I'm a foreign > speaker, but I understand "aspect ratio" without thinking, while I > would need to adapt "proportions" to the situation first before I > would > know what it means in this place. I'd be willing to change "proportions" to something else, but "Aspect Ratio" is IMO not an option. Not that you don't count and while it is true that you are a foreign speaker, you are also highly technical. It wasn't until I really got into image processing some years ago that I knew what an aspect ratio was. Suggestions for something else, anyone? > > - AddItemMenu(menu, "Scale Bilinear", MSG_SCALE_BILINEAR, 0, 0, > > 'W', > > true); > > + AddItemMenu(menu, "High-Quality Zooming", MSG_SCALE_BILINEAR, > > 0, 0, > > 'W', true); > > + AddItemMenu(menu, "Stippled Zooming", MSG_DITHER_IMAGE, 0, 0, > > 'W', > > true); > > While "High Quality Zooming" more or less fits, "Stippled Zooming" > certainly doesn't; dithering has nothing to do with zooming. > Furthermore, dithering is a known word for this effect. IMO please > revert this. When I woke up this morning, I planned on changing "Stippled Zooming" because that, too, is technical and isn't at all accurate. "Dithering" is also a technical word. I would also welcome suggestions on this one. I won't have time to make the changes today (serious case of Real Life), but I will make the the changes. :^) --DW From darkwyrm at earthlink.net Thu Jan 18 12:21:58 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Thu, 18 Jan 2007 06:21:58 -0500 EST Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: Message-ID: <1456326976-BeMail@sapphire> > On 1/18/07, darkwyrm at BerliOS wrote: > > - AddItemMenu(menu, "Scale Bilinear", MSG_SCALE_BILINEAR, 0, > > 0, 'W', true); > > + AddItemMenu(menu, "High-Quality Zooming", > > MSG_SCALE_BILINEAR, 0, 0, 'W', true); > > What's the disadvantage of *always* zooming with high quality? Why > would you ever want to zoom with low quality? Is it just slightly > slower? This option doesn't make sense to me. Yes. It is noticeably slower even on my Athlon XP 2000+. At the same time, I think that it should be on by default. --DW From wkornewald at haiku-os.org Thu Jan 18 12:39:34 2007 From: wkornewald at haiku-os.org (Waldemar Kornewald) Date: Thu, 18 Jan 2007 12:39:34 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <1392186432-BeMail@sapphire> References: <2864858295-BeMail@zon> <1392186432-BeMail@sapphire> Message-ID: On 1/18/07, DarkWyrm wrote: > > darkwyrm at BerliOS wrote: > > > -static const char* kKeepAspectRatioLabel = "Keep Aspect Ratio"; > > > +static const char* kKeepAspectRatioLabel = "Keep Proportions"; > > > > Is "proportions" really the word to use here? I know I'm a foreign > > speaker, but I understand "aspect ratio" without thinking, while I > > would need to adapt "proportions" to the situation first before I > > would > > know what it means in this place. > I'd be willing to change "proportions" to something else, but "Aspect > Ratio" is IMO not an option. Not that you don't count and while it is > true that you are a foreign speaker, you are also highly technical. It > wasn't until I really got into image processing some years ago that I > knew what an aspect ratio was. Suggestions for something else, anyone? Did you look at how GIMP does it? It adds a "connector" toggle-button next to both text fields. Maybe we can do something similar? In any case, I've seen the term "Aspect Ratio" pretty often, but never "Proportions". Maybe we should go with the standard here (if the toggle-button is not an option). Bye, Waldemar Kornewald From darkwyrm at earthlink.net Thu Jan 18 12:47:55 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Thu, 18 Jan 2007 06:47:55 -0500 EST Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <2864858295-BeMail@zon> Message-ID: <185075632-BeMail@sapphire> > While "High Quality Zooming" more or less fits, "Stippled Zooming" > certainly doesn't; dithering has nothing to do with zooming. > Furthermore, dithering is a known word for this effect. IMO please > revert this. I just got to thinking about the dithering option. Do we even need this? --DW From korli at users.berlios.de Thu Jan 18 13:26:29 2007 From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=) Date: Thu, 18 Jan 2007 13:26:29 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <2641443989-BeMail@zon> References: <2641443989-BeMail@zon> Message-ID: 2007/1/18, Axel D?rfler : > "J?r?me Duval" wrote: > > Is there a reason why not use a BBox anymore ? > > If you ask me: yes, there is :-) > If there should be a border around every window, the window decorator > should draw it. > In Be's apps, this was handled quite inconsistently; and with the Dano > look, some of those apps looked broken, others didn't. And we might > want to change the look one day, too. Without coming again with consistency and maybe I don't like rules, but there could be a reason to have a different look for this window : to differenciate with other windows of the app. The usage of a window could be a reason for a different look. > > Whenever I touched an application, I removed those borders where I saw > them, btw. > So we could call you a "serial border remover" :) Bye, J?r?me From axeld at pinc-software.de Thu Jan 18 13:46:26 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 18 Jan 2007 13:46:26 +0100 (MET) Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <185075632-BeMail@sapphire> Message-ID: <11383942902-BeMail@zon> "DarkWyrm" wrote: > > While "High Quality Zooming" more or less fits, "Stippled Zooming" > > certainly doesn't; dithering has nothing to do with zooming. > > Furthermore, dithering is a known word for this effect. IMO please > > revert this. > I just got to thinking about the dithering option. Do we even need > this? To be honest, I never understood why it was there in the first place :- ) If no one comes up with a good reason, I think it would be another good candidate for removal. Bye, Axel. From axeld at pinc-software.de Thu Jan 18 13:48:56 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 18 Jan 2007 13:48:56 +0100 (MET) Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <1392186432-BeMail@sapphire> Message-ID: <11534110145-BeMail@zon> "DarkWyrm" wrote: > > darkwyrm at BerliOS wrote: > > > -static const char* kKeepAspectRatioLabel = "Keep Aspect Ratio"; > > > +static const char* kKeepAspectRatioLabel = "Keep Proportions"; > > Is "proportions" really the word to use here? I know I'm a foreign > > speaker, but I understand "aspect ratio" without thinking, while I > > would need to adapt "proportions" to the situation first before I > > would know what it means in this place. > I'd be willing to change "proportions" to something else, but "Aspect > Ratio" is IMO not an option. Not that you don't count and while it is > true that you are a foreign speaker, you are also highly technical. > It > wasn't until I really got into image processing some years ago that I > knew what an aspect ratio was. Suggestions for something else, > anyone? Did you regret having learnt about "aspect ratio"? Why would you prevent ShowImage from teaching you the right language? Even if you wouldn't know it, you'll certainly have no problems identifying its consequences. IMO "aspect ratio" is the only option to choose. Bye, Axel. From mmu_man at mail.berlios.de Thu Jan 18 13:49:53 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 18 Jan 2007 13:49:53 +0100 Subject: [Haiku-commits] r19855 - haiku/trunk/src/bin Message-ID: <200701181249.l0ICnrCD024582@sheep.berlios.de> Author: mmu_man Date: 2007-01-18 13:49:52 +0100 (Thu, 18 Jan 2007) New Revision: 19855 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19855&view=rev Added: haiku/trunk/src/bin/dpms.cpp Modified: haiku/trunk/src/bin/Jamfile Log: An old cli tool I wrote, controlls DPMS monitor caps and reports status. Modified: haiku/trunk/src/bin/Jamfile =================================================================== --- haiku/trunk/src/bin/Jamfile 2007-01-18 11:12:16 UTC (rev 19854) +++ haiku/trunk/src/bin/Jamfile 2007-01-18 12:49:52 UTC (rev 19855) @@ -76,6 +76,7 @@ beep.cpp clipboard.cpp df.cpp + dpms.cpp draggers.cpp dstcheck.cpp # factor.cpp Added: haiku/trunk/src/bin/dpms.cpp =================================================================== --- haiku/trunk/src/bin/dpms.cpp 2007-01-18 11:12:16 UTC (rev 19854) +++ haiku/trunk/src/bin/dpms.cpp 2007-01-18 12:49:52 UTC (rev 19855) @@ -0,0 +1,49 @@ +/* + * dpms CLI tool + * (c) Fran?ois Revol, revol at free.fr + */ + +#include +#include +#include +#include + +int usage(char *prog) +{ + printf("%s on|standby|suspend|off|caps|state\n", prog); + printf("on|standby|suspend|off\tsets corresponding state\n"); + printf("caps\tprints capabilities\n"); + printf("state\tprints the current state\n"); + return 1; +} + +int main(int argc, char **argv) +{ + BApplication app("application/x-vnd.mmu_man.dpms"); + BScreen bs; + if (argc < 2) + return usage(argv[0]); + if (!strcmp(argv[1], "on")) + bs.SetDPMS(B_DPMS_ON); + else if (!strcmp(argv[1], "standby")) + bs.SetDPMS(B_DPMS_STAND_BY); + else if (!strcmp(argv[1], "suspend")) + bs.SetDPMS(B_DPMS_SUSPEND); + else if (!strcmp(argv[1], "off")) + bs.SetDPMS(B_DPMS_OFF); + else if (!strcmp(argv[1], "caps")) { + uint32 caps = bs.DPMSCapabilites(); // nice typo... + printf("dpms capabilities: %s%s%s%s\n", (caps & B_DPMS_ON)?("on"):(""), + (caps & B_DPMS_STAND_BY)?(", standby"):(""), + (caps & B_DPMS_SUSPEND)?(", suspend"):(""), + (caps & B_DPMS_OFF)?(", off"):("")); + } else if (!strcmp(argv[1], "state")) { + uint32 st = bs.DPMSState(); + printf("%s\n", (st & B_DPMS_ON)?("on"): + ((st & B_DPMS_STAND_BY)?("standby"): + ((st & B_DPMS_SUSPEND)?("suspend"): + ((st & B_DPMS_OFF)?("off"):("?"))))); + } else + return usage(argv[0]); + return 0; +} From michael.pfeiffer at utanet.at Thu Jan 18 14:03:46 2007 From: michael.pfeiffer at utanet.at (Michael Pfeiffer) Date: Thu, 18 Jan 2007 14:03:46 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <11383942902-BeMail@zon> References: <11383942902-BeMail@zon> Message-ID: Am 18.01.2007, 13:46 Uhr, schrieb : > "DarkWyrm" wrote: >> > While "High Quality Zooming" more or less fits, "Stippled Zooming" >> > certainly doesn't; dithering has nothing to do with zooming. >> > Furthermore, dithering is a known word for this effect. IMO please >> > revert this. >> I just got to thinking about the dithering option. Do we even need >> this? > > To be honest, I never understood why it was there in the first place :- > ) > If no one comes up with a good reason, I think it would be another good > candidate for removal. Fine with me, but then it should be used implicitly if the display mode uses 8bpp or less. - Michael From michael.pfeiffer at utanet.at Thu Jan 18 13:00:04 2007 From: michael.pfeiffer at utanet.at (Michael Pfeiffer) Date: Thu, 18 Jan 2007 13:00:04 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <185075632-BeMail@sapphire> References: <185075632-BeMail@sapphire> Message-ID: Am 18.01.2007, 12:47 Uhr, schrieb DarkWyrm : >> While "High Quality Zooming" more or less fits, "Stippled Zooming" >> certainly doesn't; dithering has nothing to do with zooming. >> Furthermore, dithering is a known word for this effect. IMO please >> revert this. > I just got to thinking about the dithering option. Do we even need > this? It is needed for display mode with 8 bpp. Not sure if this is still a use case these days. - Michael From stefano.ceccherini at gmail.com Thu Jan 18 14:59:58 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Thu, 18 Jan 2007 14:59:58 +0100 Subject: [Haiku-commits] r19845 - haiku/trunk/src/apps/stylededit In-Reply-To: <18764058752-BeMail@zon> References: <894b9700701170409w3f3aeec6ibd13cdcb13c57cfb@mail.gmail.com> <18764058752-BeMail@zon> Message-ID: <894b9700701180559y209ea402hb13bae8d672f6115@mail.gmail.com> 2007/1/17, Axel D?rfler : > Are you sure they won't be written anymore? > BTranslationUtils::WriteStyledEditFile() is supposed to write those > attributes (and already contained code for this before; AFAICT they > were written twice). You are right. From stefano.ceccherini at gmail.com Thu Jan 18 15:09:19 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Thu, 18 Jan 2007 15:09:19 +0100 Subject: [Haiku-commits] r19850 - haiku/trunk/src/kits/interface In-Reply-To: <200701172126.l0HLQsSm025617@sheep.berlios.de> References: <200701172126.l0HLQsSm025617@sheep.berlios.de> Message-ID: <894b9700701180609p6da3380fjaa76ab11de3096bb@mail.gmail.com> 2007/1/17, axeld at BerliOS : > Author: axeld > Date: 2007-01-17 22:26:54 +0100 (Wed, 17 Jan 2007) > New Revision: 19850 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19850&view=rev > > Modified: > haiku/trunk/src/kits/interface/View.cpp > haiku/trunk/src/kits/interface/Window.cpp > Log: > Turns out our pulse mechanism was broken; we need to honour the rate set by > SetPulseRate() even if it is 0. BView::_Attach() and BView::SetFlags() now > just set the previous pulse rate again (which will start pulsing in case > there is no fPulseRunner yet). After this commit, the caret doesn't blink correctly anymore in StyledEdit. At least under vmware. From darkwyrm at earthlink.net Thu Jan 18 15:11:38 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Thu, 18 Jan 2007 09:11:38 -0500 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: References: <11383942902-BeMail@zon> Message-ID: <45AF801A.8080105@earthlink.net> > Fine with me, but then it should be used implicitly if the display mode > uses 8bpp or less. > Agreed. --Dw From axeld at pinc-software.de Thu Jan 18 16:07:18 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 18 Jan 2007 16:07:18 +0100 (MET) Subject: [Haiku-commits] r19850 - haiku/trunk/src/kits/interface In-Reply-To: <894b9700701180609p6da3380fjaa76ab11de3096bb@mail.gmail.com> Message-ID: <19838753413-BeMail@zon> "Stefano Ceccherini" wrote: > > Modified: > > haiku/trunk/src/kits/interface/View.cpp > > haiku/trunk/src/kits/interface/Window.cpp > > Log: > > Turns out our pulse mechanism was broken; we need to honour the > > rate set by > > SetPulseRate() even if it is 0. BView::_Attach() and > > BView::SetFlags() now > > just set the previous pulse rate again (which will start pulsing in > > case > > there is no fPulseRunner yet). > After this commit, the caret doesn't blink correctly anymore in > StyledEdit. > At least under vmware. Okay, thanks, I'll look into it later. Bye, Axel. From axeld at mail.berlios.de Thu Jan 18 17:04:01 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 18 Jan 2007 17:04:01 +0100 Subject: [Haiku-commits] r19856 - haiku/trunk/src/kits/interface Message-ID: <200701181604.l0IG41TW021472@sheep.berlios.de> Author: axeld Date: 2007-01-18 17:04:01 +0100 (Thu, 18 Jan 2007) New Revision: 19856 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19856&view=rev Modified: haiku/trunk/src/kits/interface/Window.cpp Log: Messed up logic last time - the cursor should now work as expected again in BTextView. Modified: haiku/trunk/src/kits/interface/Window.cpp =================================================================== --- haiku/trunk/src/kits/interface/Window.cpp 2007-01-18 12:49:52 UTC (rev 19855) +++ haiku/trunk/src/kits/interface/Window.cpp 2007-01-18 16:04:01 UTC (rev 19856) @@ -1455,7 +1455,7 @@ BWindow::SetPulseRate(bigtime_t rate) { // TODO: What about locking?!? - if (rate < 0 || rate == fPulseRate || !(rate == 0 ^ fPulseRunner == NULL)) + if (rate < 0 || (rate == fPulseRate && !(rate == 0 ^ fPulseRunner == NULL))) return; fPulseRate = rate; From darkwyrm at earthlink.net Thu Jan 18 17:18:55 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Thu, 18 Jan 2007 11:18:55 -0500 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <31876461.1169118089016.JavaMail.ngmail@webmail17> References: <200701172358.l0HNwDFh005214@sheep.berlios.de> <2864858295-BeMail@zon> <31876461.1169118089016.JavaMail.ngmail@webmail17> Message-ID: <45AF9DEF.1090303@earthlink.net> Marcus wrote: > Please revert this change and use aspect ratio. It is the correct term for this. > Haiku is not aiming at dumb users. > > I even looked this up at wikipedi, it's also used for paper size, tires, aircraft and birds. > > http://en.wikipedia.org/wiki/Aspect_ratio > http://en.wikipedia.org/wiki/Proportions > > btw, MediaPlayer also uses "Keep Aspect Ratio" > Users aren't dumb, nor am I implying that they are. They just want to get work done with as few hinderances as possible. Also, there are only 2 different places I've ever heard the term used: image processing and in discussions of TV format (16:9 vs 4:3). I've never heard of it used for paper size or anything else you've mentioned. Waldemar wrote: > Did you look at how GIMP does it? It adds a "connector" toggle-button > next to both text fields. Maybe we can do something similar? > The GIMP isn't the only app to do that, but I think that would be an excellent idea. Axel wrote: >> Did you regret having learnt about "aspect ratio"? Why would you >> prevent ShowImage from teaching you the right language? >> Even if you wouldn't know it, you'll certainly have no problems >> identifying its consequences. >> IMO "aspect ratio" is the only option to choose. I can't be used as an example of what other users should be expected to do in this case. I, too, am a developer. I figured it out based on my computer expertise that I had at that point along with context. I took a quick survey around work today with people of varying levels of computer expertise. *None* of them knew what aspect ratio was. None. These are people with bachelor's and master's degrees. They're not stupid. Their expertise is in other fields. If I were to ask someone to sing in a choir I was directing, I wouldn't make them learn words like counterpoint, hemiola, or basso continuo before they could come to rehearsal. Those terms aren't needed so long as the basic skills, such as note reading, are there. The same thing goes for computer use. The user needs to have basic skills ("hunt & peck typing", knowing what a mouse is for, where the power button is, etc). I'm not advocating making Haiku a kiddie OS, but the bar needs to be set lower than you might think. All of us obviously have a passion for computers, and it sets us apart -- our level of expertise reflects that passion. Also, who, would all of you say is our target audience? Other developers? Hardly. This is an app which everyone will end up using unless they decide that there is a third party app which does a better job that the user goes out of there way to download and install. We need to keep that in mind. It is possible to describe features in everyday language and it should be used for apps which target such a broad audience. I'll be the first to admit I haven't hit the mark the first time on a number of occasions when it comes to balancing simple vs technical, but I'm willing to work to find a way to make things simple for regular people without annoying the rest of us much, if at all. And I would definitely not call something like this 'idiocy', either. --DW From darkwyrm at earthlink.net Thu Jan 18 17:21:42 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Thu, 18 Jan 2007 11:21:42 -0500 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <5556273158-BeMail@zon> References: <5556273158-BeMail@zon> Message-ID: <45AF9E96.8030106@earthlink.net> > Indeed, why not just making it depend on the speed of your system? > Considering it's also dependent on image size, how would you define the cutoff? --DW From wkornewald at haiku-os.org Thu Jan 18 18:41:08 2007 From: wkornewald at haiku-os.org (Waldemar Kornewald) Date: Thu, 18 Jan 2007 18:41:08 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <45AF9DEF.1090303@earthlink.net> References: <200701172358.l0HNwDFh005214@sheep.berlios.de> <2864858295-BeMail@zon> <31876461.1169118089016.JavaMail.ngmail@webmail17> <45AF9DEF.1090303@earthlink.net> Message-ID: On 1/18/07, DarkWyrm wrote: > I can't be used as an example of what other users should be expected to > do in this case. I, too, am a developer. I figured it out based on my > computer expertise that I had at that point along with context. I took a > quick survey around work today with people of varying levels of computer > expertise. *None* of them knew what aspect ratio was. None. These are > people with bachelor's and master's degrees. They're not stupid. Their > expertise is in other fields. If I were to ask someone to sing in a > choir I was directing, I wouldn't make them learn words like > counterpoint, hemiola, or basso continuo before they could come to > rehearsal. Those terms aren't needed so long as the basic skills, such > as note reading, are there. The same thing goes for computer use. The > user needs to have basic skills ("hunt & peck typing", knowing what a > mouse is for, where the power button is, etc). I'm not advocating making > Haiku a kiddie OS, but the bar needs to be set lower than you might > think. All of us obviously have a passion for computers, and it sets us > apart -- our level of expertise reflects that passion. > > Also, who, would all of you say is our target audience? Other > developers? Hardly. This is an app which everyone will end up using > unless they decide that there is a third party app which does a better > job that the user goes out of there way to download and install. We need > to keep that in mind. It is possible to describe features in everyday > language and it should be used for apps which target such a broad > audience. I'll be the first to admit I haven't hit the mark the first > time on a number of occasions when it comes to balancing simple vs > technical, but I'm willing to work to find a way to make things simple > for regular people without annoying the rest of us much, if at all. And > I would definitely not call something like this 'idiocy', either. Amen. I'm getting sick of constantly getting beaten for anything that aims at making computers easier to use. Of course, I (we?) don't always get it right the first time, but this is where you can help us and point out flaws in our "theories". We're always thankful for a nice hint. Our discussions often sound like nitpicking, but in the end these "minor" issues sum up and really make the difference. I think that people who want to improve usability should not be disrespected (sometimes nearly offended!) like they currently are by some of our developers. You can help us stay realistic, but please be more open (remember our philosophy?) and consider that not everyone has your level of technical knowledge. Am I asking for too much? Bye, Waldemar Kornewald From axeld at mail.berlios.de Thu Jan 18 18:45:19 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 18 Jan 2007 18:45:19 +0100 Subject: [Haiku-commits] r19857 - in haiku/trunk: headers/os/app headers/private/app src/kits/app src/kits/interface src/servers/registrar Message-ID: <200701181745.l0IHjJ87031573@sheep.berlios.de> Author: axeld Date: 2007-01-18 18:45:08 +0100 (Thu, 18 Jan 2007) New Revision: 19857 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19857&view=rev Modified: haiku/trunk/headers/os/app/Roster.h haiku/trunk/headers/private/app/RegistrarDefs.h haiku/trunk/headers/private/app/RosterPrivate.h haiku/trunk/src/kits/app/Roster.cpp haiku/trunk/src/kits/interface/Window.cpp haiku/trunk/src/servers/registrar/Registrar.cpp haiku/trunk/src/servers/registrar/TRoster.cpp haiku/trunk/src/servers/registrar/TRoster.h Log: Turns out the whole "active app" mechanism in the registrar wasn't used at all; the Switcher now works as expected. * Renamed TRoster::ActivateApp() to UpdateActiveApp(), as the app is already activated at that point (the registrar only keeps track of it). * BWindow::DispatchMessage() now calls the new BRoster::Private::UpdateActiveApp() method when it receives a B_WINDOW_ACTIVATED message. * Added BRoster::_UpdateActiveApp() which calls the new B_REG_UPDATE_ACTIVE_APP. * Removed now unused B_REG_ACTIVATE_APP. * Minor cleanup. Modified: haiku/trunk/headers/os/app/Roster.h =================================================================== --- haiku/trunk/headers/os/app/Roster.h 2007-01-18 16:04:01 UTC (rev 19856) +++ haiku/trunk/headers/os/app/Roster.h 2007-01-18 17:45:08 UTC (rev 19857) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -146,7 +146,7 @@ const BList *messageList, int argc, const char *const *args, team_id *appTeam) const; - bool _UpdateActiveApp(team_id team) const; + status_t _UpdateActiveApp(team_id team) const; void _SetAppFlags(team_id team, uint32 flags) const; void _DumpRoster() const; status_t _ResolveApp(const char *inType, entry_ref *ref, entry_ref *appRef, Modified: haiku/trunk/headers/private/app/RegistrarDefs.h =================================================================== --- haiku/trunk/headers/private/app/RegistrarDefs.h 2007-01-18 16:04:01 UTC (rev 19856) +++ haiku/trunk/headers/private/app/RegistrarDefs.h 2007-01-18 17:45:08 UTC (rev 19857) @@ -1,35 +1,20 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: RegistrarDefs.h -// Author(s): Ingo Weinhold (bonefish at users.sf.net) -// Description: API classes - registrar interface. -//------------------------------------------------------------------------------ - +/* + * Copyright 2001-2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold, bonefish at users.sf.net + */ #ifndef REGISTRAR_DEFS_H #define REGISTRAR_DEFS_H +//! API classes - registrar interface. + + #include #include + namespace BPrivate { // names @@ -62,7 +47,7 @@ B_REG_SET_SIGNATURE = 'rgss', B_REG_GET_APP_INFO = 'rgai', B_REG_GET_APP_LIST = 'rgal', - B_REG_ACTIVATE_APP = 'rgac', + B_REG_UPDATE_ACTIVE_APP = 'rgua', B_REG_BROADCAST = 'rgbc', B_REG_START_WATCHING = 'rgwa', B_REG_STOP_WATCHING = 'rgsw', Modified: haiku/trunk/headers/private/app/RosterPrivate.h =================================================================== --- haiku/trunk/headers/private/app/RosterPrivate.h 2007-01-18 16:04:01 UTC (rev 19856) +++ haiku/trunk/headers/private/app/RosterPrivate.h 2007-01-18 17:45:08 UTC (rev 19857) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -75,6 +75,9 @@ void ApplicationCrashed(team_id team) const { fRoster->_ApplicationCrashed(team); } + void UpdateActiveApp(team_id team) const + { fRoster->_UpdateActiveApp(team); } + static void InitBeRoster(); static void DeleteBeRoster(); Modified: haiku/trunk/src/kits/app/Roster.cpp =================================================================== --- haiku/trunk/src/kits/app/Roster.cpp 2007-01-18 16:04:01 UTC (rev 19856) +++ haiku/trunk/src/kits/app/Roster.cpp 2007-01-18 17:45:08 UTC (rev 19857) @@ -1,9 +1,10 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Ingo Weinhold (bonefish at users.sf.net) + * Axel D?rfler, axeld at pinc-software.de */ /*! BRoster class lets you launch apps and keeps track of apps @@ -510,13 +511,14 @@ status_t BRoster::GetActiveAppInfo(app_info *info) const { - status_t error = (info ? B_OK : B_BAD_VALUE); + if (info == NULL) + return B_BAD_VALUE; + // compose the request message BMessage request(B_REG_GET_APP_INFO); // send the request BMessage reply; - if (error == B_OK) - error = fMessenger.SendMessage(&request, &reply); + status_t error = fMessenger.SendMessage(&request, &reply); // evaluate the reply if (error == B_OK) { if (reply.what == B_REG_SUCCESS) @@ -1732,7 +1734,34 @@ } -// _LaunchApp +/*! + Tells the registrar which application is currently active. + It's called from within BWindow on B_WINDOW_ACTIVATED messages. +*/ +status_t +BRoster::_UpdateActiveApp(team_id team) const +{ + if (team < B_OK) + return B_BAD_TEAM_ID; + + // compose the request message + BMessage request(B_REG_UPDATE_ACTIVE_APP); + status_t status = request.AddInt32("team", team); + + // send the request + BMessage reply; + if (status == B_OK) + status = fMessenger.SendMessage(&request, &reply); + + // evaluate the reply + if (status == B_OK && reply.what != B_REG_SUCCESS + && reply.FindInt32("error", &status) != B_OK) + status = B_ERROR; + + return status; +} + + /*! \brief Launches the application associated with the supplied MIME type or the entry referred to by the supplied entry_ref. Modified: haiku/trunk/src/kits/interface/Window.cpp =================================================================== --- haiku/trunk/src/kits/interface/Window.cpp 2007-01-18 16:04:01 UTC (rev 19856) +++ haiku/trunk/src/kits/interface/Window.cpp 2007-01-18 17:45:08 UTC (rev 19857) @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -905,12 +906,18 @@ if (msg->FindBool("active", &active) == B_OK && active != fActive) { fActive = active; + if (active) { + // notify registrar about the active app + BRoster::Private roster; + roster.UpdateActiveApp(be_app->Team()); + } + WindowActivated(active); - + // call hook function 'WindowActivated(bool)' for all // views attached to this window. fTopView->_Activate(active); - + // we notify the input server if we are gaining or losing focus // from a view which has the B_INPUT_METHOD_AWARE on a window // (de)activation Modified: haiku/trunk/src/servers/registrar/Registrar.cpp =================================================================== --- haiku/trunk/src/servers/registrar/Registrar.cpp 2007-01-18 16:04:01 UTC (rev 19856) +++ haiku/trunk/src/servers/registrar/Registrar.cpp 2007-01-18 17:45:08 UTC (rev 19857) @@ -1,16 +1,14 @@ -// Registrar.cpp +/* + * Copyright 2001-2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold, bonefish at users.sf.net + */ + #include "Debug.h" -#include -#include - -#include -#include -#include -#include -#include - #include "ClipboardHandler.h" #include "EventQueue.h" #include "MessageDeliverer.h" @@ -22,6 +20,16 @@ #include "ShutdownProcess.h" #include "TRoster.h" +#include +#include +#include +#include +#include + +#include +#include + + /*! \class Registrar \brief The application class of the registrar. @@ -38,20 +46,20 @@ //! Time interval between two roster sanity checks (1 s). static const bigtime_t kRosterSanityEventInterval = 1000000LL; -// constructor + /*! \brief Creates the registrar application class. \param error Passed to the BApplication constructor for returning an error code. */ Registrar::Registrar(status_t *error) - : BServer(kRegistrarSignature, false, error), - fRoster(NULL), - fClipboardHandler(NULL), - fMIMEManager(NULL), - fEventQueue(NULL), - fMessageRunnerManager(NULL), - fSanityEvent(NULL), - fShutdownProcess(NULL) + : BServer(kRegistrarSignature, false, error), + fRoster(NULL), + fClipboardHandler(NULL), + fMIMEManager(NULL), + fEventQueue(NULL), + fMessageRunnerManager(NULL), + fSanityEvent(NULL), + fShutdownProcess(NULL) { FUNCTION_START(); } @@ -147,8 +155,8 @@ case B_REG_GET_APP_LIST: fRoster->HandleGetAppList(message); break; - case B_REG_ACTIVATE_APP: - fRoster->HandleActivateApp(message); + case B_REG_UPDATE_ACTIVE_APP: + fRoster->HandleUpdateActiveApp(message); break; case B_REG_BROADCAST: fRoster->HandleBroadcast(message); @@ -347,7 +355,10 @@ ShutdownProcess::SendReply(request, error); } -// main + +// #pragma mark - + + /*! \brief Creates and runs the registrar application. The main thread is renamed. Modified: haiku/trunk/src/servers/registrar/TRoster.cpp =================================================================== --- haiku/trunk/src/servers/registrar/TRoster.cpp 2007-01-18 16:04:01 UTC (rev 19856) +++ haiku/trunk/src/servers/registrar/TRoster.cpp 2007-01-18 17:45:08 UTC (rev 19857) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Ingo Weinhold, bonefish at users.sf.net. + * Copyright 2001-2007, Ingo Weinhold, bonefish at users.sf.net. * Distributed under the terms of the MIT License. */ @@ -718,20 +718,22 @@ FUNCTION_END(); } -// HandleActivateApp -/*! \brief Handles a ActivateApp() request. + +/*! \brief Handles a _UpdateActiveApp() request. + + This is sent from a BWindow when it receives a B_WINDOW_ACTIVATED message. + \param request The request message */ void -TRoster::HandleActivateApp(BMessage *request) +TRoster::HandleUpdateActiveApp(BMessage *request) { FUNCTION_START(); BAutolock _(fLock); + // get the parameters status_t error = B_OK; - - // get the parameters team_id team; if (request->FindInt32("team", &team) != B_OK) error = B_BAD_VALUE; @@ -739,7 +741,7 @@ // activate the app if (error == B_OK) { if (RosterAppInfo *info = fRegisteredApps.InfoFor(team)) - ActivateApp(info); + UpdateActiveApp(info); else error = B_BAD_TEAM_ID; } @@ -1223,7 +1225,7 @@ } } -// ActivateApp + /*! \brief Activates the application identified by \a info. The currently active application is deactivated and the one whose @@ -1233,7 +1235,7 @@ \param info The info of the app to be activated */ void -TRoster::ActivateApp(RosterAppInfo *info) +TRoster::UpdateActiveApp(RosterAppInfo *info) { BAutolock _(fLock); @@ -1243,6 +1245,7 @@ fActiveApp = NULL; if (oldActiveApp) _AppDeactivated(oldActiveApp); + // activate the new app if (info) { fActiveApp = info; @@ -1449,7 +1452,7 @@ if (info) { // deactivate the app, if it was the active one if (info == fActiveApp) - ActivateApp(NULL); + UpdateActiveApp(NULL); // notify the watchers BMessage message(B_SOME_APP_QUIT); _AddMessageWatchingInfo(&message, info); Modified: haiku/trunk/src/servers/registrar/TRoster.h =================================================================== --- haiku/trunk/src/servers/registrar/TRoster.h 2007-01-18 16:04:01 UTC (rev 19856) +++ haiku/trunk/src/servers/registrar/TRoster.h 2007-01-18 17:45:08 UTC (rev 19857) @@ -1,45 +1,24 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: TRoster.h -// Author: Ingo Weinhold (bonefish at users.sf.net) -// Description: TRoster is the incarnation of The Roster. It manages the -// running applications. -//------------------------------------------------------------------------------ - +/* + * Copyright 2001-2007, Ingo Weinhold, bonefish at users.sf.net. + * Distributed under the terms of the MIT License. + */ #ifndef T_ROSTER_H #define T_ROSTER_H -#include -#include -#include -#include -#include - #include "AppInfoList.h" #include "RecentApps.h" #include "RecentEntries.h" #include "WatchingService.h" +#include +#include +#include + +#include +#include + + #if __GNUC__ >= 4 using __gnu_cxx::hash_set; #endif @@ -65,7 +44,7 @@ void HandleSetSignature(BMessage *request); void HandleGetAppInfo(BMessage *request); void HandleGetAppList(BMessage *request); - void HandleActivateApp(BMessage *request); + void HandleUpdateActiveApp(BMessage *request); void HandleBroadcast(BMessage *request); void HandleStartWatching(BMessage *request); void HandleStopWatching(BMessage *request); @@ -86,7 +65,7 @@ status_t AddApp(RosterAppInfo *info); void RemoveApp(RosterAppInfo *info); - void ActivateApp(RosterAppInfo *info); + void UpdateActiveApp(RosterAppInfo *info); void CheckSanity(); From leavengood at gmail.com Thu Jan 18 19:25:40 2007 From: leavengood at gmail.com (Ryan Leavengood) Date: Thu, 18 Jan 2007 13:25:40 -0500 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: References: <200701172358.l0HNwDFh005214@sheep.berlios.de> <2864858295-BeMail@zon> <31876461.1169118089016.JavaMail.ngmail@webmail17> <45AF9DEF.1090303@earthlink.net> Message-ID: I agree there is sometimes excessive negative feedback when usability changes are made. One of my first changes to ShowImage was renaming the flipping menu items because even I was confused (and I'm pretty technical.) Even that generated a lot of discussion. But now it seems everyone is happy with "Flip Left to Right" and "Flip Top to Bottom". So let's be careful in rejecting changes too quickly just because they seem different. Since ShowImage is one of my most familiar applications in Haiku, let me add some of my thoughts. I agree Dithering should be changed to only be used at 8 bpp. For me it always made images look worse at 24 or 32 bpp. The bilinear filter should always be on my default, but should still be able to be turned off for people with slower computers. I do think the delay built-in before filtering when zooming helps. In regards to aspect ratio versus proportions, I checked some applications on my Windows laptop and "Nero PhotoSnap" uses "Contrain Proportions" for this checkbox. So the use of that word is not unheard of. But right below that in the interface for resizing is a combo box with a bunch of technical "resize modes", so maybe Nero isn't the best example for usability ;) Personally I've found the little "chain link" button used in the GIMP annoying at times. Though really it isn't much different than a checkbox... Ryan From leavengood at gmail.com Thu Jan 18 19:29:03 2007 From: leavengood at gmail.com (Ryan Leavengood) Date: Thu, 18 Jan 2007 13:29:03 -0500 Subject: [Haiku-commits] r19857 - in haiku/trunk: headers/os/app headers/private/app src/kits/app src/kits/interface src/servers/registrar In-Reply-To: <200701181745.l0IHjJ87031573@sheep.berlios.de> References: <200701181745.l0IHjJ87031573@sheep.berlios.de> Message-ID: On 1/18/07, axeld at BerliOS wrote: > > Turns out the whole "active app" mechanism in the registrar wasn't used at all; the > Switcher now works as expected. I told you the active app stuff wasn't working right :) So do applications properly get activated now when they are relaunched but are B_SINGLE_LAUNCH? Last time I tested it only worked when they were launched from the Terminal. Launching from Tracker or the Deskbar did not activate them again. Ryan From axeld at mail.berlios.de Thu Jan 18 19:35:13 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 18 Jan 2007 19:35:13 +0100 Subject: [Haiku-commits] r19858 - haiku/trunk/src/apps/deskbar Message-ID: <200701181835.l0IIZD8N016806@sheep.berlios.de> Author: axeld Date: 2007-01-18 19:35:13 +0100 (Thu, 18 Jan 2007) New Revision: 19858 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19858&view=rev Modified: haiku/trunk/src/apps/deskbar/Switcher.cpp haiku/trunk/src/apps/deskbar/Switcher.h Log: * Moved non-public classes into the source file. * Fixed vector icon drawing under Haiku; but it might now look strange in non-32 bit modes (background gets a slightly different color, but this might be an app_server bug). * Got rid of the TSwitchManager::IdleTime()/Touch() stuff. * Key repetitions are now accepted in the switcher, only the first (tab) key repetition to bring up the window is not. * Cleanup. Modified: haiku/trunk/src/apps/deskbar/Switcher.cpp =================================================================== --- haiku/trunk/src/apps/deskbar/Switcher.cpp 2007-01-18 17:45:08 UTC (rev 19857) +++ haiku/trunk/src/apps/deskbar/Switcher.cpp 2007-01-18 18:35:13 UTC (rev 19858) @@ -32,8 +32,14 @@ All rights reserved. */ -#define _ALLOW_STICKY_ 0 +#include "tracker_private.h" +#include "BarApp.h" +#include "Switcher.h" +#include "ResourceSet.h" +#include "WindowMenuItem.h" +#include "icons.h" + #include #include #include @@ -48,17 +54,9 @@ #include #include -#include "tracker_private.h" -#include "BarApp.h" -#include "Switcher.h" -#include "ResourceSet.h" -#include "WindowMenuItem.h" -#include "icons.h" -static bool IsKeyDown(int32 key); -static bool OKToUse(const TTeamGroup *); -static bool IsWindowOK(const window_info *); -static int SmartStrcmp(const char *s1, const char *s2); +#define _ALLOW_STICKY_ 0 + // allows you to press 's' to keep the switcher window on screen #if __HAIKU__ static const color_space kIconFormat = B_RGBA32; @@ -67,6 +65,167 @@ #endif +class TTeamGroup { + public: + TTeamGroup(); + TTeamGroup(BList *teams, uint32 flags, char *name, const char *sig); + virtual ~TTeamGroup(); + + void Draw(BView *, BRect bounds, bool main); + + BList *TeamList() const + { return fTeams; } + const char *Name() const + { return fName; } + const char *Signature() const + { return fSignature; } + uint32 Flags() const + { return fFlags; } + const BBitmap *SmallIcon() const + { return fSmallIcon; } + const BBitmap *LargeIcon() const + { return fLargeIcon; } + + private: + BList *fTeams; + uint32 fFlags; + char fSignature[B_MIME_TYPE_LENGTH]; + char *fName; + BBitmap *fSmallIcon; + BBitmap *fLargeIcon; +}; + +class TSwitcherWindow : public BWindow { + public: + TSwitcherWindow(BRect frame, TSwitchManager *mgr); + virtual ~TSwitcherWindow(); + + virtual bool QuitRequested(); + virtual void MessageReceived(BMessage *message); + virtual void Show(); + virtual void Hide(); + virtual void WindowActivated(bool state); + + void DoKey(uint32 key, uint32 mods); + TIconView *IconView(); + TWindowView *WindowView(); + TBox *TopView(); + bool HairTrigger(); + void Update(int32 previous, int32 current, int32 prevSlot, + int32 currentSlot, bool forward); + int32 SlotOf(int32); + void Redraw(int32 index); + + private: + TSwitchManager *fManager; + TIconView *fIconView; + TBox *fTopView; + TWindowView *fWindowView; + bool fHairTrigger; + bool fSkipKeyRepeats; +}; + +class TWindowView : public BView { + public: + TWindowView(BRect frame, TSwitchManager *manager, TSwitcherWindow *switcher); + + void UpdateGroup(int32 groupIndex, int32 windowIndex); + + virtual void AttachedToWindow(); + virtual void Draw(BRect update); + virtual void Pulse(); + virtual void GetPreferredSize(float *w, float *h); + void ScrollTo(float x, float y) + { ScrollTo(BPoint(x,y)); } + virtual void ScrollTo(BPoint where); + + void ShowIndex(int32 windex); + BRect FrameOf(int32 index) const; + + private: + int32 fCurrentToken; + float fItemHeight; + TSwitcherWindow *fSwitcher; + TSwitchManager *fManager; + bool fLocal; +}; + +class TIconView : public BView { + public: + TIconView(BRect frame, TSwitchManager *manager, TSwitcherWindow *switcher); + ~TIconView(); + + void Showing(); + void Hiding(); + + virtual void KeyDown(const char *bytes, int32 numBytes); + virtual void Pulse(); + virtual void MouseDown(BPoint ); + virtual void Draw(BRect ); + + void ScrollTo(float x, float y) + { ScrollTo(BPoint(x,y)); } + virtual void ScrollTo(BPoint where); + void Update(int32 previous, int32 current, int32 previousSlot, + int32 currentSlot, bool forward); + void DrawTeams(BRect update); + int32 SlotOf(int32) const; + BRect FrameOf(int32) const; + int32 ItemAtPoint(BPoint) const; + int32 IndexAt(int32 slot) const; + void CenterOn(int32 index); + + private: + void CacheIcons(TTeamGroup *); + void AnimateIcon(BBitmap *startIcon, BBitmap *endIcon); + + bool fAutoScrolling; + bool fCapsState; + TSwitcherWindow *fSwitcher; + TSwitchManager *fManager; + BBitmap *fOffBitmap; + BView *fOffView; + BBitmap *fCurrentSmall; + BBitmap *fCurrentLarge; +}; + +class TBox : public BBox { + public: + TBox(BRect bounds, TSwitchManager *manager, TSwitcherWindow *, TIconView *iconView); + + virtual void Draw(BRect update); + virtual void AllAttached(); + virtual void DrawIconScrollers(bool force); + virtual void DrawWindowScrollers(bool force); + virtual void MouseDown(BPoint where); + + private: + TSwitchManager *fManager; + TSwitcherWindow *fWindow; + TIconView *fIconView; + BRect fCenter; + bool fLeftScroller; + bool fRightScroller; + bool fUpScroller; + bool fDownScroller; +}; + + +const int32 kHorizontalMargin = 11; +const int32 kVerticalMargin = 10; + +// SLOT_SIZE must be divisible by 4. That's because of the scrolling +// animation. If this needs to change then look at TIconView::Update() + +const int32 kSlotSize = 36; +const int32 kScrollStep = kSlotSize / 2; +const int32 kNumSlots = 7; +const int32 kCenterSlot = 3; + + +// #pragma mark - + + static int32 LowBitIndex(uint32 value) { @@ -101,6 +260,89 @@ } +bool +IsKeyDown(int32 key) +{ + key_info keyInfo; + + get_key_info(&keyInfo); + return (keyInfo.key_states[key >> 3] & (1 << ((7 - key) & 7))) != 0; +} + + +bool +IsWindowOK(const window_info *windowInfo) +{ + // is_mini (true means that the window is minimized). + // if not, then + // show_hide >= 1 means that the window is hidden. + // + // If the window is both minimized and hidden, then you get : + // TWindow->is_mini = false; + // TWindow->was_mini = true; + // TWindow->show_hide >= 1; + + if (windowInfo->w_type != _STD_W_TYPE_) + return false; + + if (windowInfo->is_mini) + return true; + + return windowInfo->show_hide_level <= 0; +} + + +bool +OKToUse(const TTeamGroup *teamGroup) +{ + if (!teamGroup) + return false; + + // skip background applications + if ((teamGroup->Flags() & B_BACKGROUND_APP) != 0) + return false; + + // skip the Deakbar itself + if (strcasecmp(teamGroup->Signature(), kDeskbarSignature) == 0) + return false; + + return true; +} + + +int +SmartStrcmp(const char *s1, const char *s2) +{ + if (strcasecmp(s1, s2) == 0) + return 0; + + // if the strings on differ in spaces or underscores they still match + while (*s1 && *s2) { + if ((*s1 == ' ') || (*s1 == '_')) { + s1++; + continue; + } + if ((*s2 == ' ') || (*s2 == '_')) { + s2++; + continue; + } + if (*s1 != *s2) + return 1; // they differ + s1++; + s2++; + } + + // if one of the strings ended before the other + // ??? could process trailing spaces & underscores! + if (*s1) + return 1; + if (*s2) + return 1; + + return 0; +} + + // #pragma mark - @@ -160,12 +402,12 @@ if (main) { rect = fLargeIcon->Bounds(); rect.OffsetTo(bounds.LeftTop()); - rect.OffsetBy(2,2); + rect.OffsetBy(2, 2); view->DrawBitmap(fLargeIcon, rect); } else { rect = fSmallIcon->Bounds(); rect.OffsetTo(bounds.LeftTop()); - rect.OffsetBy(10,10); + rect.OffsetBy(10, 10); view->DrawBitmap(fSmallIcon, rect); } } @@ -173,17 +415,7 @@ // #pragma mark - -const int32 kHorizontalMargin = 11; -const int32 kVerticalMargin = 10; -// SLOT_SIZE must be divisible by 4. That's because of the scrolling -// animation. If this needs to change then look at TIconView::Update() - -const int32 kSlotSize = 36; -const int32 kScrollStep = kSlotSize / 2; -const int32 kNumSlots = 7; -const int32 kCenterSlot = 3; - TSwitchManager::TSwitchManager(BPoint point) : BHandler("SwitchManager"), fMainMonitor(create_sem(1, "main_monitor")), @@ -192,8 +424,7 @@ fGroupList(10), fCurrentIndex(0), fCurrentSlot(0), - fWindowID(-1), - fLastActivity(0) + fWindowID(-1) { BRect rect(point.x, point.y, point.x + (kSlotSize * kNumSlots) - 1 + (2 * kHorizontalMargin), @@ -237,8 +468,6 @@ void TSwitchManager::MessageReceived(BMessage *message) { - status_t err; - switch (message->what) { case B_SOME_APP_QUIT: { @@ -296,7 +525,7 @@ } TTeamGroup *tinfo = new TTeamGroup(teams, flags, strdup(name), signature); - + fGroupList.AddItem(tinfo); if (OKToUse(tinfo)) fWindow->Redraw(fGroupList.CountItems() - 1); @@ -307,7 +536,7 @@ case msg_AddTeam: { const char *signature = message->FindString("sig"); - team_id team = message->FindInt32("team"); + team_id team = message->FindInt32("team"); int32 numItems = fGroupList.CountItems(); for (int32 i = 0; i < numItems; i++) { @@ -351,18 +580,18 @@ if (time < fSkipUntil) break; - err = acquire_sem_etc(fMainMonitor, 1, B_TIMEOUT, 0); - if (err != B_OK) { + status_t status = acquire_sem_etc(fMainMonitor, 1, B_TIMEOUT, 0); + if (status != B_OK) { if (!fWindow->IsHidden() && !fBlock) { // Want to skip TASK msgs posted before the window // was made visible. Better UI feel if we do this. if (time > fSkipUntil) { - uint32 mods; - message->FindInt32("modifiers", (int32 *)&mods); - Process((mods & B_SHIFT_KEY) == 0, (mods & B_OPTION_KEY) != 0); + uint32 modifiers; + message->FindInt32("modifiers", (int32 *)&modifiers); + Process((modifiers & B_SHIFT_KEY) == 0, (modifiers & B_OPTION_KEY) != 0); } } - } else + } else MainEntry(message); break; @@ -390,7 +619,6 @@ int32 index; fCurrentIndex = (FindTeam(appInfo.team, &index) != NULL) ? index : 0; - int32 key; message->FindInt32("key", (int32 *)&key); @@ -448,7 +676,6 @@ hidden = fWindow->IsHidden(); fWindow->Unlock(); } - if (byWindow) { // If hidden we need to get things started by switching to correct app if (hidden) @@ -606,9 +833,9 @@ // anymore then get info about first window. If that doesn't exist then // do nothing. window_info *windowInfo = WindowInfo(fCurrentIndex, fCurrentWindow); - if (!windowInfo) { + if (windowInfo == NULL) { windowInfo = WindowInfo(fCurrentIndex, 0); - if (!windowInfo) + if (windowInfo == NULL) return false; } @@ -621,19 +848,19 @@ do_window_action(windowInfo->id, B_BRING_TO_FRONT, BRect(0, 0, 0, 0), false); - if (!forceShow && windowInfo->is_mini) + if (!forceShow && windowInfo->is_mini) { // we aren't unhiding minimized windows, so we can't do // anything here result = false; - else if (!allowWorkspaceSwitch - && (windowInfo->workspaces & (1 << currentWorkspace)) == 0) + } else if (!allowWorkspaceSwitch + && (windowInfo->workspaces & (1 << currentWorkspace)) == 0) { // we're not supposed to switch workspaces so abort. result = false; - else { + } else { result = true; be_roster->ActivateApp((team_id)teamGroup->TeamList()->ItemAt(0)); } - + ASSERT(windowInfo); free(windowInfo); return result; @@ -763,12 +990,12 @@ TTeamGroup *teamGroup = (TTeamGroup *) fGroupList.ItemAt(groupIndex); if (!teamGroup) return NULL; - + int32 tokenCount; int32 *tokens = get_token_list(-1, &tokenCount); if (!tokens) return NULL; - + int32 matches = 0; // Want to find the "windowIndex'th" window in window order that belongs @@ -855,10 +1082,10 @@ int32 index; TTeamGroup*teamGroup = FindTeam(team, &index); - // cycle through the window in the active application + // cycle through the windows in the active application int32 count; int32 *tokens = get_token_list(-1, &count); - for (int32 i = count-1; i>=0; i--) { + for (int32 i = count-1; i >= 0; i--) { window_info *windowInfo; windowInfo = get_window_info(tokens[i]); if (windowInfo && IsVisibleInCurrentWorkspace(windowInfo) @@ -912,19 +1139,12 @@ } -bigtime_t -TSwitchManager::IdleTime() -{ - return system_time() - fLastActivity; -} - - // #pragma mark - TBox::TBox(BRect bounds, TSwitchManager *manager, TSwitcherWindow *window, TIconView *iview) - : BBox(bounds, "top", B_FOLLOW_NONE, B_WILL_DRAW, B_PLAIN_BORDER), + : BBox(bounds, "top", B_FOLLOW_NONE, B_WILL_DRAW, B_NO_BORDER), fManager(manager), fWindow(window), fIconView(iview), @@ -1288,29 +1508,20 @@ } - void -TSwitcherWindow::DispatchMessage(BMessage *message, BHandler *handler) -{ - if (message->what == B_KEY_DOWN) { - // large timeout - effective kills key repeats - if (fManager->IdleTime() < 10000000) - return; - - fManager->Touch(); - } else if (message->what == B_KEY_UP) - fManager->Touch(true); - - BWindow::DispatchMessage(message, handler); -} - - -void TSwitcherWindow::MessageReceived(BMessage *message) { switch (message->what) { case B_KEY_DOWN: { + int32 repeats = 0; + if (message->FindInt32("be:key_repeat", &repeats) == B_OK + && (fSkipKeyRepeats || (repeats % 6) != 0)) + break; + + // The first actual key press let's us listening to repeated keys + fSkipKeyRepeats = false; + uint32 rawChar; uint32 modifiers; message->FindInt32("raw_char", 0, (int32 *)&rawChar); @@ -1435,9 +1646,9 @@ TSwitcherWindow::Show() { fHairTrigger = true; + fSkipKeyRepeats = true; fIconView->Showing(); SetPulseRate(100000); - fManager->Touch(); SetLook(B_MODAL_WINDOW_LOOK); BWindow::Show(); } @@ -1457,6 +1668,27 @@ } +inline int32 +TSwitcherWindow::SlotOf(int32 i) +{ + return fIconView->SlotOf(i); +} + + +inline TIconView * +TSwitcherWindow::IconView() +{ + return fIconView; +} + + +inline TWindowView * +TSwitcherWindow::WindowView() +{ + return fWindowView; +} + + // #pragma mark - @@ -1537,7 +1769,7 @@ destRect.OffsetBy(BPoint(off, off)); fOffBitmap->Lock(); - fOffView->SetDrawingMode(B_OP_OVER); + fOffView->SetDrawingMode(B_OP_ALPHA); for (int i = 0; i < 2; i++) { startIconBounds.InsetBy(amount,amount); snooze(20000); @@ -1996,90 +2228,3 @@ free(windowInfo); } - -// #pragma mark - - - -bool -IsKeyDown(int32 key) -{ - key_info keyInfo; - - get_key_info(&keyInfo); - return (keyInfo.key_states[key >> 3] & (1 << ((7 - key) & 7))) != 0; -} - - -bool -IsWindowOK(const window_info *windowInfo) -{ - // is_mini (true means that the window is minimized). - // if not, then - // show_hide >= 1 means that the window is hidden. - // - // If the window is both minimized and hidden, then you get : - // TWindow->is_mini = false; - // TWindow->was_mini = true; - // TWindow->show_hide >= 1; - - if (windowInfo->w_type != _STD_W_TYPE_) - return false; - - if (windowInfo->is_mini) - return true; - - return windowInfo->show_hide_level <= 0; -} - - -bool -OKToUse(const TTeamGroup *teamGroup) -{ - if (!teamGroup) - return false; - - // skip background applications - if ((teamGroup->Flags() & B_BACKGROUND_APP) != 0) - return false; - - // skip the Deakbar itself - if (strcasecmp(teamGroup->Signature(), kDeskbarSignature) == 0) - return false; - - return true; -} - - -int -SmartStrcmp(const char *s1, const char *s2) -{ - if (strcasecmp(s1, s2) == 0) - return 0; - - // if the strings on differ in spaces or underscores they still match - while (*s1 && *s2) { - if ((*s1 == ' ') || (*s1 == '_')) { - s1++; - continue; - } - if ((*s2 == ' ') || (*s2 == '_')) { - s2++; - continue; - } - if (*s1 != *s2) - return 1; // they differ - s1++; - s2++; - } - - // if one of the strings ended before the other - // ??? could process trailing spaces & underscores! - if (*s1) - return 1; - if (*s2) - return 1; - - return 0; -} - - Modified: haiku/trunk/src/apps/deskbar/Switcher.h =================================================================== --- haiku/trunk/src/apps/deskbar/Switcher.h 2007-01-18 17:45:08 UTC (rev 19857) +++ haiku/trunk/src/apps/deskbar/Switcher.h 2007-01-18 18:35:13 UTC (rev 19858) @@ -41,36 +41,7 @@ #include -class TTeamGroup { - public: - TTeamGroup(); - TTeamGroup(BList *teams, uint32 flags, char *name, const char *sig); - virtual ~TTeamGroup(); - - void Draw(BView *, BRect bounds, bool main); - - BList *TeamList() const - { return fTeams; } - const char *Name() const - { return fName; } - const char *Signature() const - { return fSignature; } - uint32 Flags() const - { return fFlags; } - const BBitmap *SmallIcon() const - { return fSmallIcon; } - const BBitmap *LargeIcon() const - { return fLargeIcon; } - - private: - BList *fTeams; - uint32 fFlags; - char fSignature[B_MIME_TYPE_LENGTH]; - char *fName; - BBitmap *fSmallIcon; - BBitmap *fLargeIcon; -}; - +class TTeamGroup; class TIconView; class TBox; class TWindowView; @@ -97,9 +68,6 @@ void CycleWindow(bool forward, bool wrap = true); void SwitchToApp(int32 prevIndex, int32 newIndex, bool forward); - void Touch(bool zero = false); - bigtime_t IdleTime(); - window_info *WindowInfo(int32 groupIndex, int32 wdIndex); int32 CountWindows(int32 groupIndex, bool inCurrentWorkspace = false); TTeamGroup *FindTeam(team_id, int32 *index); @@ -121,146 +89,6 @@ int32 fCurrentWindow; int32 fCurrentSlot; int32 fWindowID; - bigtime_t fLastActivity; }; -class TSwitcherWindow : public BWindow { - public: - TSwitcherWindow(BRect frame, TSwitchManager *mgr); - virtual ~TSwitcherWindow(); - - virtual bool QuitRequested(); - virtual void DispatchMessage(BMessage *message, BHandler *target); - virtual void MessageReceived(BMessage *message); - virtual void Show(); - virtual void Hide(); - virtual void WindowActivated(bool state); - - void DoKey(uint32 key, uint32 mods); - TIconView *IconView(); - TWindowView *WindowView(); - TBox *TopView(); - bool HairTrigger(); - void Update(int32 previous, int32 current, int32 prevSlot, - int32 currentSlot, bool forward); - int32 SlotOf(int32); - void Redraw(int32 index); - - private: - TSwitchManager *fManager; - TIconView *fIconView; - TBox *fTopView; - TWindowView *fWindowView; - bool fHairTrigger; -}; - -class TWindowView : public BView { - public: - TWindowView(BRect frame, TSwitchManager *manager, TSwitcherWindow *switcher); - - void UpdateGroup(int32 groupIndex, int32 windowIndex); - - virtual void AttachedToWindow(); - virtual void Draw(BRect update); - virtual void Pulse(); - virtual void GetPreferredSize(float *w, float *h); - void ScrollTo(float x, float y) - { ScrollTo(BPoint(x,y)); } - virtual void ScrollTo(BPoint where); - - void ShowIndex(int32 windex); - BRect FrameOf(int32 index) const; - - private: - int32 fCurrentToken; - float fItemHeight; - TSwitcherWindow *fSwitcher; - TSwitchManager *fManager; - bool fLocal; -}; - -class TIconView : public BView { - public: - TIconView(BRect frame, TSwitchManager *manager, TSwitcherWindow *switcher); - ~TIconView(); - - void Showing(); - void Hiding(); - - virtual void KeyDown(const char *bytes, int32 numBytes); - virtual void Pulse(); - virtual void MouseDown(BPoint ); - virtual void Draw(BRect ); - - void ScrollTo(float x, float y) - { ScrollTo(BPoint(x,y)); } - virtual void ScrollTo(BPoint where); - void Update(int32 previous, int32 current, int32 previousSlot, - int32 currentSlot, bool forward); - void DrawTeams(BRect update); - int32 SlotOf(int32) const; - BRect FrameOf(int32) const; - int32 ItemAtPoint(BPoint) const; - int32 IndexAt(int32 slot) const; - void CenterOn(int32 index); - - private: - void CacheIcons(TTeamGroup *); - void AnimateIcon(BBitmap *startIcon, BBitmap *endIcon); - - bool fAutoScrolling; - bool fCapsState; - TSwitcherWindow *fSwitcher; - TSwitchManager *fManager; - BBitmap *fOffBitmap; - BView *fOffView; - BBitmap *fCurrentSmall; - BBitmap *fCurrentLarge; -}; - -class TBox : public BBox { - public: - TBox(BRect bounds, TSwitchManager *manager, TSwitcherWindow *, TIconView *iconView); - - virtual void Draw(BRect update); - virtual void AllAttached(); - virtual void DrawIconScrollers(bool force); - virtual void DrawWindowScrollers(bool force); - virtual void MouseDown(BPoint where); - - private: - TSwitchManager *fManager; - TSwitcherWindow *fWindow; - TIconView *fIconView; - BRect fCenter; - bool fLeftScroller; - bool fRightScroller; - bool fUpScroller; - bool fDownScroller; -}; - -inline int32 -TSwitcherWindow::SlotOf(int32 i) -{ - return fIconView->SlotOf(i); -} - -inline TIconView * -TSwitcherWindow::IconView() -{ - return fIconView; -} - -inline TWindowView * -TSwitcherWindow::WindowView() -{ - return fWindowView; -} - -inline void -TSwitchManager::Touch(bool zero) -{ - fLastActivity = zero ? 0 : system_time(); -} - #endif /* SWITCHER_H */ From wkornewald at haiku-os.org Thu Jan 18 20:08:29 2007 From: wkornewald at haiku-os.org (Waldemar Kornewald) Date: Thu, 18 Jan 2007 20:08:29 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: References: <200701172358.l0HNwDFh005214@sheep.berlios.de> <2864858295-BeMail@zon> <31876461.1169118089016.JavaMail.ngmail@webmail17> <45AF9DEF.1090303@earthlink.net> Message-ID: Hi Ryan, On 1/18/07, Ryan Leavengood wrote: > Since ShowImage is one of my most familiar applications in Haiku, let > me add some of my thoughts. I agree Dithering should be changed to > only be used at 8 bpp. For me it always made images look worse at 24 > or 32 bpp. Agreed. The option should should be enabled automatically when you are in 8bpp mode (also when switching between workspaces with different bpp). > The bilinear filter should always be on my default, but should still > be able to be turned off for people with slower computers. I do think > the delay built-in before filtering when zooming helps. Agreed, enabled by default. > Personally I've found the little "chain link" button used in the GIMP > annoying at times. Though really it isn't much different than a > checkbox... I've had much better experience with the "chain link". I've primarily seen very inexperienced users having problems with understanding the "aspect ratio" checkbox. The "chain link" wasn't immediately intuitive, either, but people learned its meaning more quickly. I think that a little textual description or an icon next to the "chain link" would have helped with the initial understanding. I have to admit that some of those people I'm talking about at first couldn't imagine that by not keeping the aspect ratio the image will look very silly because of incorrect proportions, so they were really inexperienced. I don't know, maybe they expected the image to be cut off at the sides, automatically, to match the new size. Bye, Waldemar Kornewald From darkwyrm at earthlink.net Thu Jan 18 20:39:53 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Thu, 18 Jan 2007 14:39:53 -0500 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: References: <200701172358.l0HNwDFh005214@sheep.berlios.de> <2864858295-BeMail@zon> <31876461.1169118089016.JavaMail.ngmail@webmail17> <45AF9DEF.1090303@earthlink.net> Message-ID: <45AFCD09.3090508@earthlink.net> Waldemar Kornewald wrote: > Hi Ryan, > > On 1/18/07, Ryan Leavengood wrote: > >> Since ShowImage is one of my most familiar applications in Haiku, let >> me add some of my thoughts. I agree Dithering should be changed to >> only be used at 8 bpp. For me it always made images look worse at 24 >> or 32 bpp. >> > > Agreed. The option should should be enabled automatically when you are > in 8bpp mode (also when switching between workspaces with different > bpp). > > I also think this is a very good idea. > I've had much better experience with the "chain link". I've primarily > seen very inexperienced users having problems with understanding the > "aspect ratio" checkbox. The "chain link" wasn't immediately > intuitive, either, but people learned its meaning more quickly. I > think that a little textual description or an icon next to the "chain > link" would have helped with the initial understanding. I have to > admit that some of those people I'm talking about at first couldn't > imagine that by not keeping the aspect ratio the image will look veryu > silly because of incorrect proportions, so they were really > inexperienced. I don't know, maybe they expected the image to be cut > off at the sides, automatically, to match the new size. > > Perhaps what we need is something a little wordier for the checkbox, then. What do you think of something along the lines of "Keep Height-to-Width Proportions" ? It sounds a little clunky to me, but I doubt it could be any clearer. --DW From axeld at pinc-software.de Thu Jan 18 20:56:07 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 18 Jan 2007 20:56:07 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19857_-_in_haiku/trunk=3A_header?= =?iso-8859-15?q?s/os/app_headers/private/app_src/kits/app_src/kits?= =?iso-8859-15?q?/interface_src/servers/registrar?= In-Reply-To: Message-ID: <37169945938-BeMail@zon> "Ryan Leavengood" wrote: > On 1/18/07, axeld at BerliOS wrote: > > Turns out the whole "active app" mechanism in the registrar wasn't > > used at all; the > > Switcher now works as expected. > I told you the active app stuff wasn't working right :) I remember a bit, it was just in a completely different context :) > So do applications properly get activated now when they are > relaunched > but are B_SINGLE_LAUNCH? Last time I tested it only worked when they > were launched from the Terminal. Launching from Tracker or the > Deskbar > did not activate them again. I only fixed keeping track of the active app in the registrar - because Switcher wouldn't work correctly before. What exactly do you mean with properly activated? How do you perceive activation? Bye, Axel. From leavengood at gmail.com Thu Jan 18 21:14:01 2007 From: leavengood at gmail.com (Ryan Leavengood) Date: Thu, 18 Jan 2007 15:14:01 -0500 Subject: [Haiku-commits] r19857 - in haiku/trunk: headers/os/app headers/private/app src/kits/app src/kits/interface src/servers/registrar In-Reply-To: <37169945938-BeMail@zon> References: <37169945938-BeMail@zon> Message-ID: On 1/18/07, Axel D?rfler wrote: > > What exactly do you mean with properly activated? How do you perceive > activation? The application comes to the front in the z-order and has the focus. Ryan From wkornewald at haiku-os.org Thu Jan 18 21:31:22 2007 From: wkornewald at haiku-os.org (Waldemar Kornewald) Date: Thu, 18 Jan 2007 21:31:22 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <45AFCD09.3090508@earthlink.net> References: <200701172358.l0HNwDFh005214@sheep.berlios.de> <2864858295-BeMail@zon> <31876461.1169118089016.JavaMail.ngmail@webmail17> <45AF9DEF.1090303@earthlink.net> <45AFCD09.3090508@earthlink.net> Message-ID: On 1/18/07, DarkWyrm wrote: > Perhaps what we need is something a little wordier for the checkbox, > then. What do you think of something along the lines of "Keep > Height-to-Width Proportions" ? It sounds a little clunky to me, but I > doubt it could be any clearer. Isn't width always listed before height ("Width-to-Height")? Hmm, what I'm wondering is: how did you ask your colleagues about "aspect ratio"? Did you tell them that it's in the context of resizing an image? "Aspect ratio" seems to be a kind of standard and I'd like to make sure that we really have to break with that standard. If we have to, I think "Keep Width-to-Height Proportions" would be worth a try (maybe it overloads that simple dialog too much, though). Bye, Waldemar Kornewald From axeld at pinc-software.de Thu Jan 18 21:53:12 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Thu, 18 Jan 2007 21:53:12 +0100 (MET) Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: Message-ID: <40593858960-BeMail@zon> "Waldemar Kornewald" wrote: > On 1/18/07, DarkWyrm wrote: > > I can't be used as an example of what other users should be > > expected to > > do in this case. I, too, am a developer. I figured it out based on > > my [...] I wouldn't even regard aspect ratio as a technical term, especially, knowing about it or not has definitely nothing to do with being a developer; it has *nothing* to do with computers. [...] > > expertise. *None* of them knew what aspect ratio was. None. These > > are [...] That reminds me of those interrogations of the "c't magazin" a German TV show. They often ask around what a specific (computer) term means and then explain it afterwards. Anyway, this must be some American thing, "aspect ratio" is even the 1:1 translation of the (only possible, non-technical) German term "Seitenverh?ltnis" used for this - which you could also translate to "relation of sides", or even "proportion of sides". It's neither a foreign word nor a technical term, it's just plain English. I'm pretty sure I learned that term in school, even though I had an American teacher ;-) It surprises me that none of your colleagues know this term, but you should even be able to derive its meaning when hearing the words, though. But anyway, if you're targetting the ignorant folks, then "Keep Proportions" would probably do it as well - it's just slightly more confusing for those who know. My view of the English language is of course a non-native one, but I would never had gotten the idea that "aspect ratio" is even a technical term for anybody. In this case, I think the lock symbol is the way to go; it's often used for this, and would also make a good example (to copy) in our sources. [...] > > Also, who, would all of you say is our target audience? Other > > developers? Hardly. This is an app which everyone will end up using For R1? Mostly technically experienced people. For R2? Who knows? I doubt we'll getting a much bigger piece of the cake then. [...] > > audience. I'll be the first to admit I haven't hit the mark the > > first > > time on a number of occasions when it comes to balancing simple vs > > technical, but I'm willing to work to find a way to make things > > simple > > for regular people without annoying the rest of us much, if at all. > > And > > I would definitely not call something like this 'idiocy', either. > Amen. I'm getting sick of constantly getting beaten for anything that > aims at making computers easier to use. Of course, I (we?) don't [...] The way you are pursuing this, you will constantly be beaten for this in the future, too, sorry. It's okay to try to make things simpler, but it always depends on how you'll do it. Most of the time, it makes more sense to keep the focus on the actual problems, and not those you made up. From my point of view, I waste a serious amount of time with bloated discussions like these. > You can help us stay realistic, but please be more open (remember our > philosophy?) and consider that not everyone has your level of > technical knowledge. Am I asking for too much? Most of the time, yes. At least I can foresee I won't always have the patience to talk you out of some stupid ideas, and the way you insist on them. For example, a bug tracker is a tool for *developers*, not end-users. They only should be able to easily enter a bug report (and scan the existing ones). If any usability feature is going in the way of the target audience, it's misplaced and should be removed. Bye, Axel. From marcusoverhagen at mail.berlios.de Thu Jan 18 22:30:43 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Thu, 18 Jan 2007 22:30:43 +0100 Subject: [Haiku-commits] r19859 - haiku/trunk/build/jam Message-ID: <200701182130.l0ILUhQJ002893@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-18 22:30:38 +0100 (Thu, 18 Jan 2007) New Revision: 19859 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19859&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: added ahci to bootlinks, so the system will try it during boot Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-18 18:35:13 UTC (rev 19858) +++ haiku/trunk/build/jam/HaikuImage 2007-01-18 21:30:38 UTC (rev 19859) @@ -251,7 +251,7 @@ AddBootModuleSymlinks config_manager bfs block_io fast_log generic_ide_pci $(X86_ONLY)isa ide ide_adapter $(X86_ONLY)ide_isa intel locked_pool $(PPC_ONLY)openpic pci scsi scsi_cd scsi_dsk scsi_periph - silicon_image_3112 + ahci silicon_image_3112 ; # add-ons From mmlr at mail.berlios.de Thu Jan 18 23:25:05 2007 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Thu, 18 Jan 2007 23:25:05 +0100 Subject: [Haiku-commits] r19860 - haiku/trunk/src/add-ons/kernel/bus_managers/usb Message-ID: <200701182225.l0IMP5su009611@sheep.berlios.de> Author: mmlr Date: 2007-01-18 23:25:02 +0100 (Thu, 18 Jan 2007) New Revision: 19860 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19860&view=rev Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/BusManager.cpp haiku/trunk/src/add-ons/kernel/bus_managers/usb/Device.cpp haiku/trunk/src/add-ons/kernel/bus_managers/usb/Hub.cpp haiku/trunk/src/add-ons/kernel/bus_managers/usb/Pipe.cpp haiku/trunk/src/add-ons/kernel/bus_managers/usb/Stack.cpp haiku/trunk/src/add-ons/kernel/bus_managers/usb/usb.cpp haiku/trunk/src/add-ons/kernel/bus_managers/usb/usb_p.h haiku/trunk/src/add-ons/kernel/bus_managers/usb/usbspec_p.h Log: * Revised locking of the USB stack classes * Implemented the Hub destructor to properly free all of its child devices * Added FreeDevice() and FreeAddress() to the BusManager class * Added timeout to ControlPipe::SendRequest() * Changed how the recursive device reporting works so that it respects the support descriptors of a driver * Enabled driver rescanning for drivers that are not currently loaded but still registered (R5 only as the devfs function is yet missing from Haiku) * Changed the way usb_ids are handed out so that free ones are reused instead of just running out of ids * Fixed driver registration so that each driver is only added once (and devices are reported once per driver) * Unified debug output and fixed some warnings with debug output turned on * Fixed some style issues and removed stray whitespaces Overall the USB stack should now be much more reliable. It should not crash on disconnects anymore and repluging of a device should be noticed by all drivers. Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/BusManager.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/BusManager.cpp 2007-01-18 21:30:38 UTC (rev 19859) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/BusManager.cpp 2007-01-18 22:25:02 UTC (rev 19860) @@ -15,7 +15,7 @@ fRootHub(NULL) { if (benaphore_init(&fLock, "usb busmanager lock") < B_OK) { - TRACE_ERROR(("usb BusManager: failed to create busmanager lock\n")); + TRACE_ERROR(("USB BusManager: failed to create busmanager lock\n")); return; } @@ -26,6 +26,7 @@ // Clear the device map for (int32 i = 0; i < 128; i++) fDeviceMap[i] = false; + fDeviceIndex = 0; // Set the default pipes to NULL (these will be created when needed) for (int32 i = 0; i <= USB_SPEED_MAX; i++) @@ -41,6 +42,7 @@ benaphore_destroy(&fLock); for (int32 i = 0; i <= USB_SPEED_MAX; i++) delete fDefaultPipes[i]; + delete fRootObject; } @@ -74,35 +76,60 @@ if (!Lock()) return -1; - int8 deviceAddress = -1; - for (int32 i = 1; i < 128; i++) { - if (fDeviceMap[i] == false) { - deviceAddress = i; - fDeviceMap[i] = true; - break; + int8 tries = 127; + int8 address = fDeviceIndex; + while (tries-- > 0) { + if (fDeviceMap[address] == false) { + fDeviceIndex = (address + 1) % 127; + fDeviceMap[address] = true; + Unlock(); + return address + 1; } + + address = (address + 1) % 127; } + TRACE_ERROR(("USB BusManager: the busmanager has run out of device addresses\n")); Unlock(); - return deviceAddress; + return -1; } +void +BusManager::FreeAddress(int8 address) +{ + address--; + if (address < 0) + return; + + if (!Lock()) + return; + + if (!fDeviceMap[address]) { + TRACE_ERROR(("USB BusManager: freeing address %d which was not allocated\n", address)); + } + + fDeviceMap[address] = false; + Unlock(); +} + + Device * -BusManager::AllocateNewDevice(Hub *parent, usb_speed speed) +BusManager::AllocateDevice(Hub *parent, usb_speed speed) { // Check if there is a free entry in the device map (for the device number) int8 deviceAddress = AllocateAddress(); if (deviceAddress < 0) { - TRACE_ERROR(("usb BusManager::AllocateNewDevice(): could not get a new address\n")); + TRACE_ERROR(("USB BusManager: could not allocate an address\n")); return NULL; } - TRACE(("usb BusManager::AllocateNewDevice(): setting device address to %d\n", deviceAddress)); + TRACE(("USB BusManager: setting device address to %d\n", deviceAddress)); ControlPipe *defaultPipe = _GetDefaultPipe(speed); - + if (!defaultPipe) { - TRACE(("usb BusManager::AllocateNewDevice(): Error getting the default pipe for speed %d\n", (int)speed)); + TRACE(("USB BusManager: error getting the default pipe for speed %d\n", (int)speed)); + FreeAddress(deviceAddress); return NULL; } @@ -126,7 +153,8 @@ } if (result < B_OK) { - TRACE_ERROR(("usb BusManager::AllocateNewDevice(): error while setting device address\n")); + TRACE_ERROR(("USB BusManager: error while setting device address\n")); + FreeAddress(deviceAddress); return NULL; } @@ -143,19 +171,20 @@ size_t actualLength = 0; usb_device_descriptor deviceDescriptor; - TRACE(("usb BusManager::AllocateNewDevice(): getting the device descriptor\n")); + TRACE(("USB BusManager: getting the device descriptor\n")); pipe.SendRequest( USB_REQTYPE_DEVICE_IN | USB_REQTYPE_STANDARD, // type USB_REQUEST_GET_DESCRIPTOR, // request USB_DESCRIPTOR_DEVICE << 8, // value 0, // index - 8, // length + 8, // length (void *)&deviceDescriptor, // buffer 8, // buffer length &actualLength); // actual length if (actualLength != 8) { - TRACE_ERROR(("usb BusManager::AllocateNewDevice(): error while getting the device descriptor\n")); + TRACE_ERROR(("USB BusManager: error while getting the device descriptor\n")); + FreeAddress(deviceAddress); return NULL; } @@ -170,16 +199,18 @@ // Create a new instance based on the type (Hub or Device) if (deviceDescriptor.device_class == 0x09) { - TRACE(("usb BusManager::AllocateNewDevice(): creating new hub\n")); + TRACE(("USB BusManager: creating new hub\n")); Hub *hub = new(std::nothrow) Hub(parent, deviceDescriptor, deviceAddress, speed); if (!hub) { - TRACE_ERROR(("usb BusManager::AllocateNewDevice(): no memory to allocate hub\n")); + TRACE_ERROR(("USB BusManager: no memory to allocate hub\n")); + FreeAddress(deviceAddress); return NULL; } if (hub->InitCheck() < B_OK) { - TRACE_ERROR(("usb BusManager::AllocateNewDevice(): hub failed init check\n")); + TRACE_ERROR(("USB BusManager: hub failed init check\n")); + FreeAddress(deviceAddress); delete hub; return NULL; } @@ -187,16 +218,18 @@ return (Device *)hub; } - TRACE(("usb BusManager::AllocateNewDevice(): creating new device\n")); + TRACE(("USB BusManager: creating new device\n")); Device *device = new(std::nothrow) Device(parent, deviceDescriptor, deviceAddress, speed); if (!device) { - TRACE_ERROR(("usb BusManager::AllocateNewDevice(): no memory to allocate device\n")); + TRACE_ERROR(("USB BusManager: no memory to allocate device\n")); + FreeAddress(deviceAddress); return NULL; } if (device->InitCheck() < B_OK) { - TRACE_ERROR(("usb BusManager::AllocateNewDevice(): device failed init check\n")); + TRACE_ERROR(("USB BusManager: device failed init check\n")); + FreeAddress(deviceAddress); delete device; return NULL; } @@ -205,6 +238,14 @@ } +void +BusManager::FreeDevice(Device *device) +{ + FreeAddress(device->DeviceAddress()); + delete device; +} + + status_t BusManager::Start() { @@ -234,24 +275,22 @@ return B_ERROR; } + ControlPipe * BusManager::_GetDefaultPipe(usb_speed speed) { if (!Lock()) return NULL; - if (fDefaultPipes[speed] == NULL) { fDefaultPipes[speed] = new(std::nothrow) ControlPipe(fRootObject, - 0, 0, speed, 8); - if (!fDefaultPipes[speed]) { - TRACE_ERROR(("usb BusManager: failed to allocate default pipe\n")); - Unlock(); - return NULL; - } + 0, 0, speed, 8); } - + + if (!fDefaultPipes[speed]) { + TRACE_ERROR(("USB BusManager: failed to allocate default pipe for speed %d\n", speed)); + } + Unlock(); - return fDefaultPipes[speed]; } Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/Device.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/Device.cpp 2007-01-18 21:30:38 UTC (rev 19859) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/Device.cpp 2007-01-18 22:25:02 UTC (rev 19860) @@ -20,17 +20,15 @@ fSpeed(speed), fDeviceAddress(deviceAddress) { - TRACE(("USB Device: new device\n")); + TRACE(("USB Device %d: creating device\n", fDeviceAddress)); fDefaultPipe = new(std::nothrow) ControlPipe(this, deviceAddress, 0, fSpeed, fDeviceDescriptor.max_packet_size_0); if (!fDefaultPipe) { - TRACE_ERROR(("USB Device: could not allocate default pipe\n")); + TRACE_ERROR(("USB Device %d: could not allocate default pipe\n", fDeviceAddress)); return; } - fMaxPacketIn[0] = fMaxPacketOut[0] = fDeviceDescriptor.max_packet_size_0; - // Get the device descriptor // We already have a part of it, but we want it all size_t actualLength; @@ -38,7 +36,7 @@ (void *)&fDeviceDescriptor, sizeof(fDeviceDescriptor), &actualLength); if (status < B_OK || actualLength != sizeof(fDeviceDescriptor)) { - TRACE_ERROR(("USB Device: error while getting the device descriptor\n")); + TRACE_ERROR(("USB Device %d: error while getting the device descriptor\n", fDeviceAddress)); return; } @@ -62,7 +60,7 @@ fConfigurations = (usb_configuration_info *)malloc( fDeviceDescriptor.num_configurations * sizeof(usb_configuration_info)); if (fConfigurations == NULL) { - TRACE_ERROR(("USB Device: out of memory during config creations!\n")); + TRACE_ERROR(("USB Device %d: out of memory during config creations!\n", fDeviceAddress)); return; } @@ -77,7 +75,7 @@ return; } - TRACE(("USB Device %d: configuration %d\n", fDeviceAddress, i)); + TRACE(("USB Device %d: configuration %ld\n", fDeviceAddress, i)); TRACE(("\tlength:..............%d\n", configDescriptor.length)); TRACE(("\tdescriptor_type:.....0x%02x\n", configDescriptor.descriptor_type)); TRACE(("\ttotal_length:........%d\n", configDescriptor.total_length)); @@ -263,11 +261,11 @@ USB_REQUEST_GET_DESCRIPTOR, // request (descriptorType << 8) | index, // value languageID, // index - dataLength, // length + dataLength, // length data, // buffer dataLength, // buffer length actualLength); // actual length -} +} const usb_configuration_info * @@ -320,7 +318,7 @@ USB_REQUEST_SET_CONFIGURATION, // request fConfigurations[index].descr->configuration_value, // value 0, // index - 0, // length + 0, // length NULL, // buffer 0, // buffer length NULL); // actual length @@ -388,7 +386,7 @@ USB_REQUEST_SET_CONFIGURATION, // request 0, // value 0, // index - 0, // length + 0, // length NULL, // buffer 0, // buffer length NULL); // actual length @@ -404,7 +402,7 @@ usb_interface_info *interfaceInfo = fCurrentConfiguration->interface[0].active; for (size_t i = 0; i < interfaceInfo->endpoint_count; i++) { - usb_endpoint_info *endpoint = &interfaceInfo->endpoint[i]; + usb_endpoint_info *endpoint = &interfaceInfo->endpoint[i]; delete (Pipe *)GetStack()->GetObject(endpoint->handle); endpoint->handle = 0; } @@ -426,11 +424,7 @@ uint32 supportDescriptorCount, const usb_notify_hooks *hooks, usb_driver_cookie **cookies, bool added) { - TRACE(("USB Device ReportDevice\n")); - if ((added && hooks->device_added == NULL) - || (!added && hooks->device_removed == NULL)) - return B_BAD_VALUE; - + TRACE(("USB Device %d: reporting device\n", fDeviceAddress)); bool supported = false; if (supportDescriptorCount == 0 || supportDescriptors == NULL) supported = true; @@ -441,7 +435,7 @@ || (supportDescriptors[i].product != 0 && fDeviceDescriptor.product_id != supportDescriptors[i].product)) continue; - + if ((supportDescriptors[i].dev_class == 0 || fDeviceDescriptor.device_class == supportDescriptors[i].dev_class) && (supportDescriptors[i].dev_subclass == 0 @@ -469,17 +463,26 @@ } } - if (supported) { - usb_id id = USBID(); - if (added) { - usb_driver_cookie *cookie = new(std::nothrow) usb_driver_cookie; - status_t result = hooks->device_added(id, &cookie->cookie); + if (!supported) + return B_UNSUPPORTED; + + if ((added && hooks->device_added == NULL) + || (!added && hooks->device_removed == NULL)) { + // hooks are not installed, but report success to indicate that + // the driver supports the device + return B_OK; + } + + usb_id id = USBID(); + if (added) { + usb_driver_cookie *cookie = new(std::nothrow) usb_driver_cookie; + if (hooks->device_added(id, &cookie->cookie) >= B_OK) { cookie->device = id; cookie->link = *cookies; *cookies = cookie; - return result; - } - + } else + delete cookie; + } else { usb_driver_cookie **pointer = cookies; usb_driver_cookie *cookie = *cookies; while (cookie) { @@ -489,15 +492,18 @@ cookie = cookie->link; } - if (cookie) { - hooks->device_removed(cookie->cookie); - *pointer = cookie->link; - delete cookie; + if (!cookie) { + // the device is supported, but there is no cookie. this most + // probably means that the device_added hook above failed. return B_OK; } + + hooks->device_removed(cookie->cookie); + *pointer = cookie->link; + delete cookie; } - return B_UNSUPPORTED; + return B_OK; } Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/Hub.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/Hub.cpp 2007-01-18 21:30:38 UTC (rev 19859) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/Hub.cpp 2007-01-18 22:25:02 UTC (rev 19860) @@ -15,36 +15,41 @@ usb_speed speed) : Device(parent, desc, deviceAddress, speed) { - TRACE(("USB Hub is being initialised\n")); + TRACE(("USB Hub %d: creating hub\n", DeviceAddress())); if (!fInitOK) { - TRACE_ERROR(("USB Hub: Device failed to initialize\n")); + TRACE_ERROR(("USB Hub %d: device failed to initialize\n", DeviceAddress())); return; } // Set to false again for the hub init. fInitOK = false; + if (benaphore_init(&fLock, "usb hub lock") < B_OK) { + TRACE_ERROR(("USB Hub %d: failed to create hub lock\n", DeviceAddress())); + return; + } + for (int32 i = 0; i < 8; i++) fChildren[i] = NULL; if (fDeviceDescriptor.device_class != 9) { - TRACE_ERROR(("USB Hub: wrong class! Bailing out\n")); + TRACE_ERROR(("USB Hub %d: wrong class! bailing out\n", DeviceAddress())); return; } - TRACE(("USB Hub: Getting hub descriptor...\n")); + TRACE(("USB Hub %d: Getting hub descriptor...\n", DeviceAddress())); size_t actualLength; status_t status = GetDescriptor(USB_DESCRIPTOR_HUB, 0, 0, (void *)&fHubDescriptor, sizeof(usb_hub_descriptor), &actualLength); // we need at least 8 bytes if (status < B_OK || actualLength < 8) { - TRACE_ERROR(("USB Hub: Error getting hub descriptor\n")); + TRACE_ERROR(("USB Hub %d: Error getting hub descriptor\n", DeviceAddress())); return; } - TRACE(("USB Hub: Hub descriptor (%d bytes):\n", actualLength)); + TRACE(("USB Hub %d: hub descriptor (%ld bytes):\n", DeviceAddress(), actualLength)); TRACE(("\tlength:..............%d\n", fHubDescriptor.length)); TRACE(("\tdescriptor_type:.....0x%02x\n", fHubDescriptor.descriptor_type)); TRACE(("\tnum_ports:...........%d\n", fHubDescriptor.num_ports)); @@ -55,7 +60,7 @@ Object *object = GetStack()->GetObject(Configuration()->interface->active->endpoint[0].handle); if (!object || (object->Type() & USB_OBJECT_INTERRUPT_PIPE) == 0) { - TRACE_ERROR(("USB Hub: no interrupt pipe found\n")); + TRACE_ERROR(("USB Hub %d: no interrupt pipe found\n", DeviceAddress())); return; } @@ -72,17 +77,50 @@ USB_REQUEST_SET_FEATURE, PORT_POWER, i + 1, 0, NULL, 0, NULL); if (status < B_OK) - TRACE_ERROR(("USB Hub: power up failed on port %ld\n", i)); + TRACE_ERROR(("USB Hub %d: power up failed on port %ld\n", DeviceAddress(), i)); } // Wait for power to stabilize snooze(fHubDescriptor.power_on_to_power_good * 2000); fInitOK = true; - TRACE(("USB Hub: initialised ok\n")); + TRACE(("USB Hub %d: initialised ok\n", DeviceAddress())); } +Hub::~Hub() +{ + Lock(); + benaphore_destroy(&fLock); + + // Remove all child devices + for (int32 i = 0; i < fHubDescriptor.num_ports; i++) { + if (!fChildren[i]) + continue; + + TRACE(("USB Hub %d: removing device 0x%08lx\n", DeviceAddress(), fChildren[i])); + GetStack()->NotifyDeviceChange(fChildren[i], false); + GetBusManager()->FreeDevice(fChildren[i]); + } + + delete fInterruptPipe; +} + + +bool +Hub::Lock() +{ + return (benaphore_lock(&fLock) == B_OK); +} + + +void +Hub::Unlock() +{ + benaphore_unlock(&fLock); +} + + status_t Hub::UpdatePortStatus(uint8 index) { @@ -93,7 +131,7 @@ 4, &actualLength); if (result < B_OK || actualLength < 4) { - TRACE_ERROR(("USB Hub: error updating port status\n")); + TRACE_ERROR(("USB Hub %d: error updating port status\n", DeviceAddress())); return B_ERROR; } @@ -124,7 +162,7 @@ } if ((fPortStatus[index].change & C_PORT_RESET) == 0) { - TRACE_ERROR(("USB Hub: port %d won't reset\n", index)); + TRACE_ERROR(("USB Hub %d: port %d won't reset\n", DeviceAddress(), index)); return B_ERROR; } @@ -136,7 +174,7 @@ // wait for reset recovery snooze(USB_DELAY_PORT_RESET_RECOVERY); - TRACE(("USB Hub: port %d was reset successfully\n", index)); + TRACE(("USB Hub %d: port %d was reset successfully\n", DeviceAddress(), index)); return B_OK; } @@ -146,7 +184,7 @@ { for (int32 i = 0; i < fHubDescriptor.num_ports; i++) { if (i >= 8) { - TRACE(("USB Hub: hub supports more ports than we do (%d)\n", fHubDescriptor.num_ports)); + TRACE(("USB Hub %d: hub supports more ports than we do (%d)\n", DeviceAddress(), fHubDescriptor.num_ports)); fHubDescriptor.num_ports = 8; continue; } @@ -157,8 +195,8 @@ #ifdef TRACE_USB if (fPortStatus[i].change) { - TRACE(("USB Hub: port %d: status: 0x%04x; change: 0x%04x\n", i, fPortStatus[i].status, fPortStatus[i].change)); - TRACE(("USB Hub: device at port %d: 0x%08x\n", i, fChildren[i])); + TRACE(("USB Hub %d: port %ld: status: 0x%04x; change: 0x%04x\n", DeviceAddress(), i, fPortStatus[i].status, fPortStatus[i].change)); + TRACE(("USB Hub %d: device at port %ld: 0x%08lx\n", DeviceAddress(), i, fChildren[i])); } #endif @@ -170,7 +208,7 @@ if (fPortStatus[i].status & PORT_STATUS_CONNECTION) { // new device attached! - TRACE(("USB Hub: Explore(): New device connected\n")); + TRACE(("USB Hub %d: new device connected\n", DeviceAddress())); // wait some time for the device to power up snooze(USB_DELAY_DEVICE_POWER_UP); @@ -186,7 +224,7 @@ if ((fPortStatus[i].status & PORT_STATUS_CONNECTION) == 0) { // device has vanished after reset, ignore - TRACE(("USB Hub: device disappeared on reset\n")); + TRACE(("USB Hub %d: device disappeared on reset\n", DeviceAddress())); continue; } @@ -196,13 +234,16 @@ if (fPortStatus[i].status & PORT_STATUS_HIGH_SPEED) speed = USB_SPEED_HIGHSPEED; - Device *newDevice = GetBusManager()->AllocateNewDevice(this, - speed); + Device *newDevice = GetBusManager()->AllocateDevice(this, speed); - if (newDevice) { + if (newDevice && Lock()) { fChildren[i] = newDevice; + Unlock(); GetStack()->NotifyDeviceChange(fChildren[i], true); } else { + if (newDevice) + GetBusManager()->FreeDevice(newDevice); + // the device failed to setup correctly, disable the port // so that the device doesn't get in the way of future // addressing. @@ -212,40 +253,44 @@ } } else { // Device removed... - TRACE(("USB Hub Explore(): Device removed\n")); + TRACE(("USB Hub %d: device removed\n", DeviceAddress())); if (fChildren[i]) { - TRACE(("USB Hub: removing device 0x%08x\n", fChildren[i])); + TRACE(("USB Hub %d: removing device 0x%08lx\n", DeviceAddress(), fChildren[i])); GetStack()->NotifyDeviceChange(fChildren[i], false); - delete fChildren[i]; - fChildren[i] = NULL; + + if (Lock()) { + GetBusManager()->FreeDevice(fChildren[i]); + fChildren[i] = NULL; + Unlock(); + } } } } // other port changes we do not really handle, report and clear them if (fPortStatus[i].change & PORT_STATUS_ENABLE) { - TRACE_ERROR(("USB Hub Explore(): port %ld %sabled\n", i, (fPortStatus[i].status & PORT_STATUS_ENABLE) ? "en" : "dis")); + TRACE_ERROR(("USB Hub %d: port %ld %sabled\n", DeviceAddress(), i, (fPortStatus[i].status & PORT_STATUS_ENABLE) ? "en" : "dis")); DefaultPipe()->SendRequest(USB_REQTYPE_CLASS | USB_REQTYPE_OTHER_OUT, USB_REQUEST_CLEAR_FEATURE, C_PORT_ENABLE, i + 1, 0, NULL, 0, NULL); } if (fPortStatus[i].change & PORT_STATUS_SUSPEND) { - TRACE_ERROR(("USB Hub Explore(): port %ld is %ssuspended\n", i, (fPortStatus[i].status & PORT_STATUS_SUSPEND) ? "" : "not ")); + TRACE_ERROR(("USB Hub %d: port %ld is %ssuspended\n", DeviceAddress(), i, (fPortStatus[i].status & PORT_STATUS_SUSPEND) ? "" : "not ")); DefaultPipe()->SendRequest(USB_REQTYPE_CLASS | USB_REQTYPE_OTHER_OUT, USB_REQUEST_CLEAR_FEATURE, C_PORT_SUSPEND, i + 1, 0, NULL, 0, NULL); } if (fPortStatus[i].change & PORT_STATUS_OVER_CURRENT) { - TRACE_ERROR(("USB Hub Explore(): port %ld is %sin an over current state\n", i, (fPortStatus[i].status & PORT_STATUS_OVER_CURRENT) ? "" : "not ")); + TRACE_ERROR(("USB Hub %d: port %ld is %sin an over current state\n", DeviceAddress(), i, (fPortStatus[i].status & PORT_STATUS_OVER_CURRENT) ? "" : "not ")); DefaultPipe()->SendRequest(USB_REQTYPE_CLASS | USB_REQTYPE_OTHER_OUT, USB_REQUEST_CLEAR_FEATURE, C_PORT_OVER_CURRENT, i + 1, 0, NULL, 0, NULL); } if (fPortStatus[i].change & PORT_RESET) { - TRACE_ERROR(("USB Hub Explore(): port %ld was reset\n", i)); + TRACE_ERROR(("USB Hub %d: port %ld was reset\n", DeviceAddress(), i)); DefaultPipe()->SendRequest(USB_REQTYPE_CLASS | USB_REQTYPE_OTHER_OUT, USB_REQUEST_CLEAR_FEATURE, C_PORT_RESET, i + 1, 0, NULL, 0, NULL); @@ -266,7 +311,7 @@ Hub::InterruptCallback(void *cookie, status_t status, void *data, size_t actualLength) { - TRACE(("USB Hub: interrupt callback!\n")); + TRACE(("USB Hub %d: interrupt callback!\n", ((Hub *)data)->DeviceAddress())); } @@ -279,11 +324,11 @@ USB_REQUEST_GET_DESCRIPTOR, // request (descriptorType << 8) | index, // value languageID, // index - dataLength, // length + dataLength, // length data, // buffer dataLength, // buffer length actualLength); // actual length -} +} status_t @@ -291,13 +336,16 @@ uint32 supportDescriptorCount, const usb_notify_hooks *hooks, usb_driver_cookie **cookies, bool added) { - TRACE(("USB Hub ReportDevice\n")); + TRACE(("USB Hub %d: reporting hub\n", DeviceAddress())); // Report ourselfs first status_t result = Device::ReportDevice(supportDescriptors, supportDescriptorCount, hooks, cookies, added); // Then report all of our children + if (!Lock()) + return B_ERROR; + for (int32 i = 0; i < fHubDescriptor.num_ports; i++) { if (!fChildren[i]) continue; @@ -307,6 +355,7 @@ result = B_OK; } + Unlock(); return result; } Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/Pipe.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/Pipe.cpp 2007-01-18 21:30:38 UTC (rev 19859) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/Pipe.cpp 2007-01-18 22:25:02 UTC (rev 19860) @@ -41,7 +41,7 @@ status_t Pipe::CancelQueuedTransfers() { - TRACE_ERROR(("Pipe: cancelling transfers is not implemented!\n")); + TRACE_ERROR(("USB Pipe: cancelling transfers is not implemented!\n")); return B_ERROR; } @@ -120,7 +120,7 @@ transfer->SetData((uint8 *)data, dataLength); transfer->SetCallback(callback, callbackCookie); - status_t result = SubmitTransfer(transfer); + status_t result = GetBusManager()->SubmitTransfer(transfer); if (result < B_OK) delete transfer; return result; @@ -151,7 +151,7 @@ transfer->SetData((uint8 *)data, dataLength); transfer->SetCallback(callback, callbackCookie); - status_t result = SubmitTransfer(transfer); + status_t result = GetBusManager()->SubmitTransfer(transfer); if (result < B_OK) delete transfer; return result; @@ -169,7 +169,7 @@ transfer->SetVector(vector, vectorCount); transfer->SetCallback(callback, callbackCookie); - status_t result = SubmitTransfer(transfer); + status_t result = GetBusManager()->SubmitTransfer(transfer); if (result < B_OK) delete transfer; return result; @@ -261,7 +261,7 @@ size_t *actualLength) { transfer_result_data transferResult; - transferResult.notify_sem = create_sem(0, "Send Request Notify Sem"); + transferResult.notify_sem = create_sem(0, "usb send request notify"); if (transferResult.notify_sem < B_OK) return B_NO_MORE_SEMS; @@ -272,11 +272,21 @@ return result; } - // the sem will be released in the callback after - // the result data was filled into the provided struct - acquire_sem(transferResult.notify_sem); + // the sem will be released in the callback after the result data was + // filled into the provided struct. use a 5 seconds timeout to avoid + // hanging applications. + if (acquire_sem_etc(transferResult.notify_sem, 1, B_RELATIVE_TIMEOUT, 5000000) < B_OK) { + TRACE_ERROR(("USB ControlPipe: timeout waiting for queued request to complete\n")); + + delete_sem(transferResult.notify_sem); + if (actualLength) + *actualLength = 0; + + // ToDo: cancel the transfer at the bus manager + return B_TIMED_OUT; + } + delete_sem(transferResult.notify_sem); - if (actualLength) *actualLength = transferResult.actual_length; @@ -320,7 +330,7 @@ transfer->SetData((uint8 *)data, dataLength); transfer->SetCallback(callback, callbackCookie); - status_t result = SubmitTransfer(transfer); + status_t result = GetBusManager()->SubmitTransfer(transfer); if (result < B_OK) delete transfer; return result; Modified: haiku/trunk/src/add-ons/kernel/bus_managers/usb/Stack.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/usb/Stack.cpp 2007-01-18 21:30:38 UTC (rev 19859) +++ haiku/trunk/src/add-ons/kernel/bus_managers/usb/Stack.cpp 2007-01-18 22:25:02 UTC (rev 19860) @@ -13,6 +13,9 @@ #include "usb_p.h" #include "PhysicalMemoryAllocator.h" +#ifdef HAIKU_TARGET_PLATFORM_HAIKU +#include +#endif Stack::Stack() : fExploreThread(-1), @@ -23,10 +26,10 @@ fObjectArray(NULL), fDriverList(NULL) { - TRACE(("usb stack: stack init\n")); + TRACE(("USB Stack: stack init\n")); - if (benaphore_init(&fLock, "USB Stack Master Lock") < B_OK) { - TRACE_ERROR(("usb stack: failed to create benaphore lock\n")); + if (benaphore_init(&fLock, "usb stack lock") < B_OK) { + TRACE_ERROR(("USB Stack: failed to create benaphore lock\n")); return; } @@ -37,7 +40,7 @@ fAllocator = new(std::nothrow) PhysicalMemoryAllocator("USB Stack Allocator", 8, B_PAGE_SIZE * 4, 64); if (!fAllocator || fAllocator->InitCheck() < B_OK) { - TRACE_ERROR(("usb stack: failed to allocate the allocator\n")); + TRACE_ERROR(("USB Stack: failed to allocate the allocator\n")); delete fAllocator; return; } @@ -47,10 +50,10 @@ char moduleName[B_PATH_NAME_LENGTH]; size_t bufferSize = sizeof(moduleName); - TRACE(("usb stack: Looking for host controller modules\n")); + TRACE(("USB Stack: looking for host controller modules\n")); while(read_next_module_name(moduleList, moduleName, &bufferSize) == B_OK) { bufferSize = sizeof(moduleName); - TRACE(("usb stack: Found module %s\n", moduleName)); + TRACE(("USB Stack: found module %s\n", moduleName)); host_controller_info *module = NULL; if (get_module(moduleName, (module_info **)&module) != B_OK) @@ -59,19 +62,14 @@ if (module->add_to(this) < B_OK) continue; - TRACE(("usb stack: module %s successfully loaded\n", moduleName)); + TRACE(("USB Stack: module %s successfully loaded\n", moduleName)); } if (fBusManagers.Count() == 0) { - TRACE_ERROR(("usb stack: no bus managers available\n")); + TRACE_ERROR(("USB Stack: no bus managers available\n")); return; } - if (benaphore_init(&fExploreLock, "usb explore lock") < B_OK) { - TRACE_ERROR(("usb stack: failed to create benaphore explore lock\n")); - return; - } - fExploreThread = spawn_kernel_thread(ExploreThread, "usb explore", B_LOW_PRIORITY, this); resume_thread(fExploreThread); @@ -99,7 +97,7 @@ } delete fAllocator; -} +} status_t @@ -132,16 +130,22 @@ if (!Lock()) return 0; - if (fObjectIndex >= fObjectMaxCount) { - Unlock(); - return 0; + uint32 id = fObjectIndex; + uint32 tries = fObjectMaxCount; + while (tries-- > 0) { + if (fObjectArray[id] == NULL) { + fObjectIndex = (id + 1) % fObjectMaxCount; + fObjectArray[id] = object; + Unlock(); + return (usb_id)id; + } + + id = (id + 1) % fObjectMaxCount; } - uint32 id = fObjectIndex++; - fObjectArray[id] = object; + TRACE_ERROR(("USB Stack: the stack did run out of usb_ids\n")); Unlock(); - - return (usb_id)id; + return 0; } @@ -152,7 +156,7 @@ return; if (id >= fObjectMaxCount) { - TRACE_ERROR(("usb stack: tried to put invalid usb_id!\n")); + TRACE_ERROR(("USB Stack: tried to put an invalid usb_id\n")); Unlock(); return; } @@ -169,14 +173,14 @@ return NULL; if (id >= fObjectMaxCount) { - TRACE_ERROR(("usb stack: tried to get object with invalid id\n")); + TRACE_ERROR(("USB Stack: tried to get object with invalid usb_id\n")); Unlock(); return NULL; } Object *result = fObjectArray[id]; + Unlock(); - return result; } @@ -187,9 +191,6 @@ Stack *stack = (Stack *)data; while (!stack->fStopThreads) { - if (benaphore_lock(&stack->fExploreLock) != B_OK) - continue; - for (int32 i = 0; i < stack->fBusManagers.Count(); i++) { Hub *rootHub = stack->fBusManagers.ElementAt(i)->GetRootHub(); if (rootHub) @@ -197,7 +198,6 @@ } stack->fFirstExploreDone = true; - benaphore_unlock(&stack->fExploreLock); snooze(USB_DELAY_HUB_EXPLORE); } @@ -228,7 +228,7 @@ status_t Stack::FreeChunk(void *logicalAddress, void *physicalAddress, size_t size) -{ +{ return fAllocator->Deallocate(size, logicalAddress, physicalAddress); } @@ -237,7 +237,7 @@ Stack::AllocateArea(void **logicalAddress, void **physicalAddress, size_t size, const char *name) { - TRACE(("usb stack: allocating %ld bytes for %s\n", size, name)); + TRACE(("USB Stack: allocating %ld bytes for %s\n", size, name)); void *logAddress; size = (size + B_PAGE_SIZE - 1) & ~(B_PAGE_SIZE - 1); @@ -245,7 +245,7 @@ B_FULL_LOCK | B_CONTIGUOUS, 0); if (area < B_OK) { - TRACE_ERROR(("usb stack: couldn't allocate area %s\n", name)); + TRACE_ERROR(("USB Stack: couldn't allocate area %s\n", name)); return B_ERROR; } @@ -253,7 +253,7 @@ status_t result = get_memory_map(logAddress, size, &physicalEntry, 1); if (result < B_OK) { delete_area(area); - TRACE_ERROR(("usb stack: couldn't map area %s\n", name)); + TRACE_ERROR(("USB Stack: couldn't map area %s\n", name)); return B_ERROR; } @@ -264,7 +264,7 @@ if (physicalAddress) *physicalAddress = physicalEntry.address; - TRACE(("usb stack: area = 0x%08x, size = %ld, log = 0x%08x, phy = 0x%08x\n", + TRACE(("USB Stack: area = 0x%08lx, size = %ld, log = 0x%08lx, phy = 0x%08lx\n", area, size, logAddress, physicalEntry.address)); return area; } @@ -273,24 +273,33 @@ void Stack::NotifyDeviceChange(Device *device, bool added) { - TRACE(("usb stack: device %s\n", added ? "added" : "removed")); + TRACE(("USB Stack: device %s\n", added ? "added" : "removed")); usb_driver_info *element = fDriverList; while (element) { - if ((added && element->notify_hooks.device_added != NULL) - || (!added && element->notify_hooks.device_removed != NULL)) { [... truncated: 434 lines follow ...] From mmlr at mail.berlios.de Thu Jan 18 23:28:34 2007 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Thu, 18 Jan 2007 23:28:34 +0100 Subject: [Haiku-commits] r19861 - haiku/trunk/src/add-ons/kernel/busses/usb Message-ID: <200701182228.l0IMSYDJ010314@sheep.berlios.de> Author: mmlr Date: 2007-01-18 23:28:34 +0100 (Thu, 18 Jan 2007) New Revision: 19861 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19861&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp haiku/trunk/src/add-ons/kernel/busses/usb/uhci_hardware.h Log: * Implemented clearing port enabled change * Fixed build with debug output turned on * Cleaned up the uhci_hardware header a bit Modified: haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp 2007-01-18 22:25:02 UTC (rev 19860) +++ haiku/trunk/src/add-ons/kernel/busses/usb/uhci.cpp 2007-01-18 22:28:34 UTC (rev 19861) @@ -280,8 +280,6 @@ dprintf("USB UHCI Queue:\n"); dprintf("link phy: 0x%08lx; link type: %s; terminate: %s\n", fQueueHead->link_phy & 0xfff0, fQueueHead->link_phy & 0x0002 ? "QH" : "TD", fQueueHead->link_phy & 0x0001 ? "yes" : "no"); dprintf("elem phy: 0x%08lx; elem type: %s; terminate: %s\n", fQueueHead->element_phy & 0xfff0, fQueueHead->element_phy & 0x0002 ? "QH" : "TD", fQueueHead->element_phy & 0x0001 ? "yes" : "no"); - dprintf("elements:\n"); - print_descriptor_chain(fQueueTop); #endif } @@ -990,6 +988,10 @@ case C_PORT_CONNECTION: WriteReg16(portRegister, portStatus | UHCI_PORTSC_STATCHA); return B_OK; + + case C_PORT_ENABLE: + WriteReg16(portRegister, portStatus | UHCI_PORTSC_ENABCHA); + return B_OK; } return B_BAD_VALUE; Modified: haiku/trunk/src/add-ons/kernel/busses/usb/uhci_hardware.h =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/usb/uhci_hardware.h 2007-01-18 22:25:02 UTC (rev 19860) +++ haiku/trunk/src/add-ons/kernel/busses/usb/uhci_hardware.h 2007-01-18 22:28:34 UTC (rev 19861) @@ -23,53 +23,53 @@ #define PCI_LEGSUP_USBPIRQDEN 0x2000 // Registers -#define UHCI_USBCMD 0x0 // USB Command - word - R/W -#define UHCI_USBSTS 0x2 // USB Status - word - R/WC -#define UHCI_USBINTR 0x4 // USB Interrupt Enable - word - R/W -#define UHCI_FRNUM 0x6 // Frame number - word - R/W** -#define UHCI_FRBASEADD 0x08 // Frame List BAse Address - dword - R/W -#define UHCI_SOFMOD 0xC // Start of Frame Modify - byte - R/W -#define UHCI_PORTSC1 0x10 // Port 1 Status/Control - word - R/WC** -#define UHCI_PORTSC2 0x12 // Port 2 Status/Control - word - R/WC** +#define UHCI_USBCMD 0x00 // USB Command - word - R/W +#define UHCI_USBSTS 0x02 // USB Status - word - R/WC +#define UHCI_USBINTR 0x04 // USB Interrupt Enable - word - R/W +#define UHCI_FRNUM 0x06 // Frame number - word - R/W** +#define UHCI_FRBASEADD 0x08 // Frame List BAse Address - dword - R/W +#define UHCI_SOFMOD 0x0c // Start of Frame Modify - byte - R/W +#define UHCI_PORTSC1 0x10 // Port 1 Status/Control - word - R/WC** +#define UHCI_PORTSC2 0x12 // Port 2 Status/Control - word - R/WC** // USBCMD -#define UHCI_USBCMD_RS 0x1 // Run/Stop -#define UHCI_USBCMD_HCRESET 0x2 // Host Controller Reset -#define UHCI_USBCMD_GRESET 0x4 // Global Reset -#define UHCI_USBCMD_EGSM 0x8 // Enter Global Suspensd mode -#define UHCI_USBCMD_FGR 0x10 // Force Global resume -#define UHCI_USBCMD_SWDBG 0x20 // Software Debug -#define UHCI_USBCMD_CF 0x40 // Configure Flag -#define UHCI_USBCMD_MAXP 0x80 // Max packet +#define UHCI_USBCMD_RS 0x01 // Run/Stop +#define UHCI_USBCMD_HCRESET 0x02 // Host Controller Reset +#define UHCI_USBCMD_GRESET 0x04 // Global Reset +#define UHCI_USBCMD_EGSM 0x08 // Enter Global Suspensd mode +#define UHCI_USBCMD_FGR 0x10 // Force Global resume +#define UHCI_USBCMD_SWDBG 0x20 // Software Debug +#define UHCI_USBCMD_CF 0x40 // Configure Flag +#define UHCI_USBCMD_MAXP 0x80 // Max packet //USBSTS -#define UHCI_USBSTS_USBINT 0x1 // USB interrupt -#define UHCI_USBSTS_ERRINT 0x2 // USB error interrupt -#define UHCI_USBSTS_RESDET 0x4 // Resume Detect -#define UHCI_USBSTS_HOSTERR 0x8 // Host System Error -#define UHCI_USBSTS_HCPRERR 0x10// Host Controller Process error -#define UHCI_USBSTS_HCHALT 0x20 // HCHalted -#define UHCI_INTERRUPT_MASK 0x3F //Mask for all the interrupts +#define UHCI_USBSTS_USBINT 0x01 // USB interrupt +#define UHCI_USBSTS_ERRINT 0x02 // USB error interrupt +#define UHCI_USBSTS_RESDET 0x04 // Resume Detect +#define UHCI_USBSTS_HOSTERR 0x08 // Host System Error +#define UHCI_USBSTS_HCPRERR 0x10 // Host Controller Process error +#define UHCI_USBSTS_HCHALT 0x20 // HCHalted +#define UHCI_INTERRUPT_MASK 0x3f // Mask for all the interrupts //USBINTR -#define UHCI_USBINTR_CRC 0x1 // Timeout/ CRC interrupt enable -#define UHCI_USBINTR_RESUME 0x2 // Resume interrupt enable -#define UHCI_USBINTR_IOC 0x4 // Interrupt on complete enable -#define UHCI_USBINTR_SHORT 0x8 // Short packet interrupt enable +#define UHCI_USBINTR_CRC 0x01 // Timeout/ CRC interrupt enable +#define UHCI_USBINTR_RESUME 0x02 // Resume interrupt enable +#define UHCI_USBINTR_IOC 0x04 // Interrupt on complete enable +#define UHCI_USBINTR_SHORT 0x08 // Short packet interrupt enable //PORTSC -#define UHCI_PORTSC_CURSTAT 0x1 // Current connect status -#define UHCI_PORTSC_STATCHA 0x2 // Current connect status change -#define UHCI_PORTSC_ENABLED 0x4 // Port enabled/disabled -#define UHCI_PORTSC_ENABCHA 0x8 // Change in enabled/disabled -#define UHCI_PORTSC_LINE_0 0x10 // The status of D+ /D- -#define UHCI_PORTSC_LINE_1 0x20 -#define UHCI_PORTSC_RESUME 0x40 // Something with the suspend state ??? -#define UHCI_PORTSC_LOWSPEED 0x100// Low speed device attached? -#define UHCI_PORTSC_RESET 0x200// Port is in reset -#define UHCI_PORTSC_SUSPEND 0x1000//Set port in suspend state +#define UHCI_PORTSC_CURSTAT 0x0001 // Current connect status +#define UHCI_PORTSC_STATCHA 0x0002 // Current connect status change +#define UHCI_PORTSC_ENABLED 0x0004 // Port enabled/disabled +#define UHCI_PORTSC_ENABCHA 0x0008 // Change in enabled/disabled +#define UHCI_PORTSC_LINE_0 0x0010 // The status of D+ +#define UHCI_PORTSC_LINE_1 0x0020 // The status of D- +#define UHCI_PORTSC_RESUME 0x0040 // Something with the suspend state ??? +#define UHCI_PORTSC_LOWSPEED 0x0100 // Low speed device attached? +#define UHCI_PORTSC_RESET 0x0200 // Port is in reset +#define UHCI_PORTSC_SUSPEND 0x1000 // Set port in suspend state -#define UHCI_PORTSC_DATAMASK 0x13F5 //Mask that excludes the change bits of portsc +#define UHCI_PORTSC_DATAMASK 0x13f5 // Mask that excludes the change bits /************************************************************ * Hardware structs * From mmlr at mail.berlios.de Thu Jan 18 23:40:51 2007 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Thu, 18 Jan 2007 23:40:51 +0100 Subject: [Haiku-commits] r19862 - haiku/trunk/build/jam Message-ID: <200701182240.l0IMepsw012057@sheep.berlios.de> Author: mmlr Date: 2007-01-18 23:40:50 +0100 (Thu, 18 Jan 2007) New Revision: 19862 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19862&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: Added the EHCI module to the image. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-18 22:28:34 UTC (rev 19861) +++ haiku/trunk/build/jam/HaikuImage 2007-01-18 22:40:50 UTC (rev 19862) @@ -112,7 +112,7 @@ AddFilesToHaikuImage beos system add-ons kernel busses ide : ahci generic_ide_pci $(X86_ONLY)ide_isa silicon_image_3112 ; AddFilesToHaikuImage beos system add-ons kernel busses usb - : uhci ohci ; + : uhci ohci ehci ; AddFilesToHaikuImage beos system add-ons kernel console : vga_text ; AddFilesToHaikuImage beos system add-ons kernel file_systems : $(BEOS_ADD_ONS_FILESYSTEMS) ; AddFilesToHaikuImage beos system add-ons kernel generic From marcusoverhagen at mail.berlios.de Thu Jan 18 23:44:11 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Thu, 18 Jan 2007 23:44:11 +0100 Subject: [Haiku-commits] r19863 - in haiku/trunk/src/add-ons/kernel/busses/ide: ahci silicon_image_3112 Message-ID: <200701182244.l0IMiBAm013196@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-18 23:44:11 +0100 (Thu, 18 Jan 2007) New Revision: 19863 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19863&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c Log: reworked device identification, calmed down debug output Modified: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c 2007-01-18 22:40:50 UTC (rev 19862) +++ haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c 2007-01-18 22:44:11 UTC (rev 19863) @@ -11,8 +11,8 @@ #include #include -#define TRACE(a...) dprintf("ahci " a) -#define FLOW(a...) dprintf("ahci " a) +#define TRACE(a...) dprintf("ahci: " a) +#define FLOW(a...) dprintf("ahci: " a) #define DRIVER_PRETTY_NAME "AHCI SATA" @@ -120,11 +120,9 @@ char *bus; uint16 vendor_id; uint16 device_id; - uint16 base_class; - uint16 sub_class; - uint16 class_api; - - FLOW("controller_supports\n"); + uint8 base_class; + uint8 sub_class; + uint8 class_api; // get the bus (should be PCI) if (dm->get_attr_string(parent, B_DRIVER_BUS, &bus, false) != B_OK) @@ -142,24 +140,12 @@ || dm->get_attr_uint8(parent, PCI_DEVICE_API_ID_ITEM, &class_api, false) != B_OK) return B_ERROR; - FLOW("controller_supports: checking vendor 0x%04x, device 0x%04x, base 0x%02x, sub 0x%02x, api 0x%02x\n", - vendor_id, device_id, base_class, sub_class, class_api); + if (base_class != PCI_mass_storage || sub_class != PCI_sata || class_api != PCI_sata_ahci) + return 0.0f; - #define ID(v,d) (((v)<< 16) | (d)) - switch (ID(vendor_id,device_id)) { - case ID(0x197b, 0x2363): // JMicron - TRACE("controller_supports success, exact match\n"); - return 0.8; - default: - break; - } + TRACE("controller found! vendor 0x%04x, device 0x%04x\n", vendor_id, device_id); - if (base_class == PCI_mass_storage && sub_class == PCI_sata && class_api == PCI_sata_ahci) { - TRACE("controller_supports success, class match\n"); - return 0.6; - } - - return 0.0; + return 0.8f; } Modified: haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-18 22:40:50 UTC (rev 19862) +++ haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-18 22:44:11 UTC (rev 19863) @@ -11,8 +11,8 @@ #include #include -#define TRACE(a...) dprintf("si-3112 " a) -#define FLOW(a...) dprintf("si-3112 " a) +#define TRACE(a...) dprintf("si-3112: " a) +#define FLOW(a...) dprintf("si-3112: " a) #define DRIVER_PRETTY_NAME "Silicon Image SATA" @@ -118,40 +118,37 @@ controller_supports(device_node_handle parent, bool *_noConnection) { char *bus; - uint16 vendorID; - uint16 deviceID; + uint16 vendor_id; + uint16 device_id; - FLOW("controller_supports\n"); - // get the bus (should be PCI) - if (dm->get_attr_string(parent, B_DRIVER_BUS, &bus, false) - != B_OK) { + if (dm->get_attr_string(parent, B_DRIVER_BUS, &bus, false) != B_OK) return B_ERROR; + if (strcmp(bus, "pci") != 0) { + free(bus); + return B_ERROR; } + free(bus); // get vendor and device ID - if (dm->get_attr_uint16(parent, PCI_DEVICE_VENDOR_ID_ITEM, - &vendorID, false) != B_OK - || dm->get_attr_uint16(parent, PCI_DEVICE_DEVICE_ID_ITEM, - &deviceID, false) != B_OK) { - free(bus); + if (dm->get_attr_uint16(parent, PCI_DEVICE_VENDOR_ID_ITEM, &vendor_id, false) != B_OK + || dm->get_attr_uint16(parent, PCI_DEVICE_DEVICE_ID_ITEM, &device_id, false) != B_OK) { return B_ERROR; } - FLOW("controller_supports: checking 0x%04x 0x%04x\n", vendorID, deviceID); - // check, whether bus, vendor and device ID match - if (strcmp(bus, "pci") != 0 - || (vendorID != 0x1095) - || (deviceID != 0x3112 && deviceID != 0x3114)) { - free(bus); - return 0.0; + #define ID(v,d) (((v)<< 16) | (d)) + switch (ID(vendor_id, device_id)) { + case ID(0x1095, 0x3112): + case ID(0x1095, 0x3114): + break; + default: + return 0.0f; } - TRACE("controller_supports success\n"); + TRACE("controller found! vendor 0x%04x, device 0x%04x\n", vendor_id, device_id); - free(bus); - return 0.6; + return 0.8f; } From mmu_man at mail.berlios.de Fri Jan 19 04:24:14 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Fri, 19 Jan 2007 04:24:14 +0100 Subject: [Haiku-commits] r19864 - haiku/trunk/src/add-ons/kernel/file_systems/nfs Message-ID: <200701190324.l0J3OEsj015157@sheep.berlios.de> Author: mmu_man Date: 2007-01-19 04:24:13 +0100 (Fri, 19 Jan 2007) New Revision: 19864 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19864&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/ksocket.h Log: Hey, we do seem to have a socket_module of some sort. Hope it works. Added wrapper code for ksocket header. Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/ksocket.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/ksocket.h 2007-01-18 22:44:11 UTC (rev 19863) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/ksocket.h 2007-01-19 03:24:13 UTC (rev 19864) @@ -8,7 +8,7 @@ #include -#ifndef _KERNEL_MODE +#ifndef _KERNEL_MODE /* userland wrapper */ #define ksocket socket #define kbind bind @@ -16,6 +16,8 @@ #define kgetsockname getsockname #define kgetpeername getpeername #define kaccept accept +#define ksendmsg sendmsg +#define krecvmsg recvmsg #define krecvfrom recvfrom #define ksendto sendto #define krecv recv @@ -28,6 +30,43 @@ #define kmessage(fmt, ...) printf(fmt "\n", ##__VA_ARGS__) #define KSOCKET_MODULE_DECL /* nothing */ +#elif defined(__HAIKU__) + +/* Haiku socket module */ +#include + +extern struct socket_module_info *gSocket; +#define ksocket (gSocket->socket) +#define kbind (gSocket->bind) +#define kconnect (gSocket->connect) +#define kgetsockname (gSocket->getsockname) +#define kgetpeername (gSocket->getpeername) +#define kaccept (gSocket->accept) +//#define kaccept(_fd, _addr, _sz) ({int thesock; thesock = (gSocket->accept)(_fd, _addr, _sz); dprintf("kaccept(%d, , ) = %d\n", _fd, thesock); thesock; }) +#define ksendmsg (gSocket->sendmsg) +#define krecvmsg (gSocket->recvmsg) +#define krecvfrom (gSocket->recvfrom) +#define ksendto (gSocket->sendto) +#define krecv (gSocket->recv) +#define ksend (gSocket->send) +#define klisten (gSocket->listen) +#define kshutdown (gSocket->shutdown) +#define kclosesocket close +#define kmessage(fmt, ...) dprintf("ksocket: " fmt "\n", ##__VA_ARGS__) + +extern status_t ksocket_init (); +extern status_t ksocket_cleanup (); + +#define KSOCKET_MODULE_DECL \ +struct socket_module_info *gSocket; \ +status_t ksocket_init () { \ + return get_module(B_SOCKET_MODULE_NAME, (module_info **)&gSocket); \ +} \ + \ +status_t ksocket_cleanup () { \ + return put_module(B_SOCKET_MODULE_NAME); \ +} + #elif defined(BONE_VERSION) /* BONE socket module */ @@ -42,6 +81,8 @@ #define kgetpeername (gSocket->getpeername) #define kaccept (gSocket->accept) //#define kaccept(_fd, _addr, _sz) ({int thesock; thesock = (gSocket->accept)(_fd, _addr, _sz); dprintf("kaccept(%d, , ) = %d\n", _fd, thesock); thesock; }) +#define ksendmsg _ERROR_no_sendmsg_in_BONE +#define krecvmsg _ERROR_no_recvmsg_in_BONE #define krecvfrom (gSocket->recvfrom) #define ksendto (gSocket->sendto) #define krecv (gSocket->recv) From superstippi at gmx.de Fri Jan 19 04:27:49 2007 From: superstippi at gmx.de (Stephan Assmus) Date: Fri, 19 Jan 2007 04:27:49 +0100 Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <2641443989-BeMail@zon> References: <2641443989-BeMail@zon> Message-ID: <20070119042749.850.2@stippis.1169175804.fake> Axel D?rfler wrote: > "J?r?me Duval" wrote: > > Is there a reason why not use a BBox anymore ? > > If you ask me: yes, there is :-) > If there should be a border around every window, the window decorator > should draw it. > In Be's apps, this was handled quite inconsistently; and with the Dano > look, some of those apps looked broken, others didn't. And we might want > to change the look one day, too. > > Whenever I touched an application, I removed those borders where I saw > them, btw. There is however a problem with this argument. I always use a raised border inside the windows in my apps, but I use groups of elements too, which would not be possible if the window drew the border. Best regards, -Stephan From bonefish at cs.tu-berlin.de Fri Jan 19 10:42:49 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Fri, 19 Jan 2007 10:42:49 +0100 Subject: [Haiku-commits] r19857 - in haiku/trunk: headers/os/app headers/private/app src/kits/app src/kits/interface src/servers/registrar In-Reply-To: <200701181745.l0IHjJ87031573@sheep.berlios.de> References: <200701181745.l0IHjJ87031573@sheep.berlios.de> Message-ID: <20070119104249.2855.1@cs.tu-berlin.de> On 2007-01-18 at 18:45:19 [+0100], axeld at BerliOS wrote: > Author: axeld > Date: 2007-01-18 18:45:08 +0100 (Thu, 18 Jan 2007) > New Revision: 19857 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19857&view=rev > > Modified: > haiku/trunk/headers/os/app/Roster.h > haiku/trunk/headers/private/app/RegistrarDefs.h > haiku/trunk/headers/private/app/RosterPrivate.h > haiku/trunk/src/kits/app/Roster.cpp > haiku/trunk/src/kits/interface/Window.cpp > haiku/trunk/src/servers/registrar/Registrar.cpp > haiku/trunk/src/servers/registrar/TRoster.cpp > haiku/trunk/src/servers/registrar/TRoster.h > Log: > Turns out the whole "active app" mechanism in the registrar wasn't used at > all; Please review this thread: http://www.freelists.org/archives/haiku-appserver/07-2005/msg00021.html I didn't (and still don't) think having the registrar's "active app" state depend on messages from client apps is a good idea. The app server should directly notify the registrar. CU, Ingo From axeld at pinc-software.de Fri Jan 19 17:26:00 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Fri, 19 Jan 2007 17:26:00 +0100 (MET) Subject: [Haiku-commits] r19852 - haiku/trunk/src/apps/showimage In-Reply-To: <20070119042749.850.2@stippis.1169175804.fake> Message-ID: <23707319462-BeMail@zon> Stephan Assmus wrote: > Axel D?rfler wrote: > > "J?r?me Duval" wrote: > > > Is there a reason why not use a BBox anymore ? > > If you ask me: yes, there is :-) > > If there should be a border around every window, the window > > decorator > > should draw it. > > In Be's apps, this was handled quite inconsistently; and with the > > Dano > > look, some of those apps looked broken, others didn't. And we might > > want > > to change the look one day, too. > > > > Whenever I touched an application, I removed those borders where I > > saw > > them, btw. > There is however a problem with this argument. I always use a raised > border > inside the windows in my apps, but I use groups of elements too, > which > would not be possible if the window drew the border. Well, that's what a BBox is for, for grouping content. I'm not against using it this way, I'm just against putting it in every window out there for no reason at all; when it's used, there should be a reason to put it there other than "the developer liked it better". Be aware, though, that a changed look might cause visual problems with your apps like you can see with some apps and Dano. Bye, Axel. From axeld at pinc-software.de Fri Jan 19 17:27:19 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Fri, 19 Jan 2007 17:27:19 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19857_-_in_haiku/trunk=3A_header?= =?iso-8859-15?q?s/os/app_headers/private/app_src/kits/app_src/kits?= =?iso-8859-15?q?/interface_src/servers/registrar?= In-Reply-To: Message-ID: <23780997590-BeMail@zon> "Ryan Leavengood" wrote: > On 1/18/07, Axel D?rfler wrote: > > What exactly do you mean with properly activated? How do you > > perceive > > activation? > The application comes to the front in the z-order and has the focus. The registrar is not really part of this whole thing, though. Could you check again if you can reproduce your problems, and if you can, create a bug report for this? Bye, Axel. From axeld at mail.berlios.de Fri Jan 19 17:42:00 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 19 Jan 2007 17:42:00 +0100 Subject: [Haiku-commits] r19865 - in haiku/trunk/src: kits/app kits/interface servers/app servers/registrar Message-ID: <200701191642.l0JGg0RX011206@sheep.berlios.de> Author: axeld Date: 2007-01-19 17:41:58 +0100 (Fri, 19 Jan 2007) New Revision: 19865 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19865&view=rev Modified: haiku/trunk/src/kits/app/Roster.cpp haiku/trunk/src/kits/interface/Window.cpp haiku/trunk/src/servers/app/ServerApp.cpp haiku/trunk/src/servers/registrar/TRoster.cpp Log: As per Ingo's request, I moved calling BRoster::Private::UpdateActiveApp() into the app_server (and updated all comments that said otherwise). Modified: haiku/trunk/src/kits/app/Roster.cpp =================================================================== --- haiku/trunk/src/kits/app/Roster.cpp 2007-01-19 03:24:13 UTC (rev 19864) +++ haiku/trunk/src/kits/app/Roster.cpp 2007-01-19 16:41:58 UTC (rev 19865) @@ -1736,7 +1736,8 @@ /*! Tells the registrar which application is currently active. - It's called from within BWindow on B_WINDOW_ACTIVATED messages. + It's called from within the app_server when the active application is + changed. */ status_t BRoster::_UpdateActiveApp(team_id team) const Modified: haiku/trunk/src/kits/interface/Window.cpp =================================================================== --- haiku/trunk/src/kits/interface/Window.cpp 2007-01-19 03:24:13 UTC (rev 19864) +++ haiku/trunk/src/kits/interface/Window.cpp 2007-01-19 16:41:58 UTC (rev 19865) @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -906,11 +905,6 @@ if (msg->FindBool("active", &active) == B_OK && active != fActive) { fActive = active; - if (active) { - // notify registrar about the active app - BRoster::Private roster; - roster.UpdateActiveApp(be_app->Team()); - } WindowActivated(active); Modified: haiku/trunk/src/servers/app/ServerApp.cpp =================================================================== --- haiku/trunk/src/servers/app/ServerApp.cpp 2007-01-19 03:24:13 UTC (rev 19864) +++ haiku/trunk/src/servers/app/ServerApp.cpp 2007-01-19 16:41:58 UTC (rev 19865) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -41,6 +41,12 @@ #include "SystemPalette.h" #include "WindowLayer.h" +#include +#include +#include +#include +#include + #include #include #include @@ -48,11 +54,6 @@ #include #include -#include -#include -#include -#include - #include #include #include @@ -298,6 +299,10 @@ fIsActive = value; if (fIsActive) { + // notify registrar about the active app + BRoster::Private roster; + roster.UpdateActiveApp(ClientTeam()); + if (_HasWindowUnderMouse()) { // Set the cursor to the application cursor, if any fDesktop->SetCursor(CurrentCursor()); Modified: haiku/trunk/src/servers/registrar/TRoster.cpp =================================================================== --- haiku/trunk/src/servers/registrar/TRoster.cpp 2007-01-19 03:24:13 UTC (rev 19864) +++ haiku/trunk/src/servers/registrar/TRoster.cpp 2007-01-19 16:41:58 UTC (rev 19865) @@ -721,7 +721,8 @@ /*! \brief Handles a _UpdateActiveApp() request. - This is sent from a BWindow when it receives a B_WINDOW_ACTIVATED message. + This is sent from the app_server when the current active application + is changed. \param request The request message */ From axeld at pinc-software.de Fri Jan 19 17:43:17 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Fri, 19 Jan 2007 17:43:17 +0100 (MET) Subject: [Haiku-commits] r19857 - in haiku/trunk: headers/os/app headers/private/app src/kits/app src/kits/interface src/servers/registrar In-Reply-To: <20070119104249.2855.1@cs.tu-berlin.de> Message-ID: <24744424931-BeMail@zon> Ingo Weinhold wrote: > I didn't (and still don't) think having the registrar's "active app" > state > depend on messages from client apps is a good idea. The app server > should > directly notify the registrar. Okay, sounds reasonable, I moved it into the app_server now; it makes indeed more sense there. Bye, Axel. From axeld at pinc-software.de Fri Jan 19 17:59:46 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Fri, 19 Jan 2007 17:59:46 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19864_-_haiku/trunk/src/add-ons/?= =?iso-8859-15?q?kernel/file=5Fsystems/nfs?= In-Reply-To: <200701190324.l0J3OEsj015157@sheep.berlios.de> Message-ID: <25734075567-BeMail@zon> mmu_man at BerliOS wrote: > Log: > Hey, we do seem to have a socket_module of some sort. Hope it works. > Added wrapper code for ksocket header. It's supposed to work, but it has never been tested... but good luck with it! :-) Bye, Axel. From axeld at mail.berlios.de Fri Jan 19 21:59:37 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 19 Jan 2007 21:59:37 +0100 Subject: [Haiku-commits] r19866 - haiku/trunk/src/kits/tracker Message-ID: <200701192059.l0JKxbHv002007@sheep.berlios.de> Author: axeld Date: 2007-01-19 21:59:37 +0100 (Fri, 19 Jan 2007) New Revision: 19866 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19866&view=rev Modified: haiku/trunk/src/kits/tracker/IconCache.cpp Log: As Marcus noticed, some icons were gone after my last change; in fact no icons were shown for all files without an own icon, and without one from its MIME type. Modified: haiku/trunk/src/kits/tracker/IconCache.cpp =================================================================== --- haiku/trunk/src/kits/tracker/IconCache.cpp 2007-01-19 16:41:58 UTC (rev 19865) +++ haiku/trunk/src/kits/tracker/IconCache.cpp 2007-01-19 20:59:37 UTC (rev 19866) @@ -393,27 +393,30 @@ if (mime.GetPreferredApp(preferredAppSig) != B_OK) return NULL; - SharedCacheEntry *aliasTo = 0; + SharedCacheEntry *aliasTo = NULL; if (entry) aliasTo = (SharedCacheEntry *)entry->ResolveIfAlias(&fSharedCache); + // look for icon defined by preferred app from metamime aliasTo = (SharedCacheEntry *)GetIconForPreferredApp(fileType, preferredAppSig, mode, size, lazyBitmap, aliasTo); - if (aliasTo) { - // make an aliased entry so that the next time we get a - // hit on the first FindItem in here - if (!entry) { - PRINT_ADD_ITEM(("File %s; Line %d # adding entry as alias for type %s\n", - __FILE__, __LINE__, fileType)); - entry = fSharedCache.AddItem(&aliasTo, fileType); - entry->SetAliasFor(&fSharedCache, aliasTo); - } - ASSERT(aliasTo->HaveIconBitmap(mode, size)); - return aliasTo; + if (aliasTo == NULL) + return NULL; + + // make an aliased entry so that the next time we get a + // hit on the first FindItem in here + if (!entry) { + PRINT_ADD_ITEM(("File %s; Line %d # adding entry as alias for type %s\n", + __FILE__, __LINE__, fileType)); + entry = fSharedCache.AddItem(&aliasTo, fileType); + entry->SetAliasFor(&fSharedCache, aliasTo); } + ASSERT(aliasTo->HaveIconBitmap(mode, size)); + return aliasTo; } + // at this point, we've found an icon for the MIME type BBitmap *bitmap = lazyBitmap->Adopt(); if (!entry) { PRINT_ADD_ITEM(("File %s; Line %d # adding entry for type %s\n", From marcusoverhagen at mail.berlios.de Fri Jan 19 22:49:42 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Fri, 19 Jan 2007 22:49:42 +0100 Subject: [Haiku-commits] r19867 - haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112 Message-ID: <200701192149.l0JLng73013996@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-19 22:49:41 +0100 (Fri, 19 Jan 2007) New Revision: 19867 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19867&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c Log: remove debug output from interrupt handler Modified: haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-19 20:59:37 UTC (rev 19866) +++ haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-19 21:49:41 UTC (rev 19867) @@ -816,7 +816,7 @@ int32 result, ret; int i; - FLOW("handle_interrupt\n"); +// FLOW("handle_interrupt\n"); result = B_UNHANDLED_INTERRUPT; From marcusoverhagen at mail.berlios.de Fri Jan 19 23:32:36 2007 From: marcusoverhagen at mail.berlios.de (marcusoverhagen at BerliOS) Date: Fri, 19 Jan 2007 23:32:36 +0100 Subject: [Haiku-commits] r19868 - haiku/trunk/src/kits/interface Message-ID: <200701192232.l0JMWaiY017779@sheep.berlios.de> Author: marcusoverhagen Date: 2007-01-19 23:32:35 +0100 (Fri, 19 Jan 2007) New Revision: 19868 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19868&view=rev Modified: haiku/trunk/src/kits/interface/Control.cpp Log: Modified SetValue to do nothing when the value is already set. This seems also be done it BeOS R5 and does remove the constant flickering in the MediaPlayer slider. Modified: haiku/trunk/src/kits/interface/Control.cpp =================================================================== --- haiku/trunk/src/kits/interface/Control.cpp 2007-01-19 21:49:41 UTC (rev 19867) +++ haiku/trunk/src/kits/interface/Control.cpp 2007-01-19 22:32:35 UTC (rev 19868) @@ -298,6 +298,9 @@ void BControl::SetValue(int32 value) { + if (value == fValue) + return; + fValue = value; Invalidate(); } From axeld at pinc-software.de Fri Jan 19 23:55:16 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Fri, 19 Jan 2007 23:55:16 +0100 (MET) Subject: [Haiku-commits] r19868 - haiku/trunk/src/kits/interface In-Reply-To: <200701192232.l0JMWaiY017779@sheep.berlios.de> Message-ID: <47067034025-BeMail@zon> marcusoverhagen at BerliOS wrote: > Log: > Modified SetValue to do nothing when the value is already set. > This seems also be done it BeOS R5 and does remove the constant > flickering in the MediaPlayer slider. Oops, cool! :-) Bye, Axel. From axeld at mail.berlios.de Fri Jan 19 23:59:28 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 19 Jan 2007 23:59:28 +0100 Subject: [Haiku-commits] r19869 - haiku/trunk/headers/private/storage Message-ID: <200701192259.l0JMxShr019907@sheep.berlios.de> Author: axeld Date: 2007-01-19 23:59:28 +0100 (Fri, 19 Jan 2007) New Revision: 19869 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19869&view=rev Modified: haiku/trunk/headers/private/storage/DiskDeviceList.h Log: Now it's self-containing. Modified: haiku/trunk/headers/private/storage/DiskDeviceList.h =================================================================== --- haiku/trunk/headers/private/storage/DiskDeviceList.h 2007-01-19 22:32:35 UTC (rev 19868) +++ haiku/trunk/headers/private/storage/DiskDeviceList.h 2007-01-19 22:59:28 UTC (rev 19869) @@ -1,11 +1,12 @@ -//---------------------------------------------------------------------- -// This software is part of the Haiku distribution and is covered -// by the MIT license. -//--------------------------------------------------------------------- +/* + * Copyright 2003-2007, Haiku Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + */ #ifndef _DISK_DEVICE_LIST_H #define _DISK_DEVICE_LIST_H +#include #include #include #include From axeld at mail.berlios.de Sat Jan 20 00:01:42 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 20 Jan 2007 00:01:42 +0100 Subject: [Haiku-commits] r19870 - haiku/trunk/src/kits/tracker Message-ID: <200701192301.l0JN1gnn020318@sheep.berlios.de> Author: axeld Date: 2007-01-20 00:01:42 +0100 (Sat, 20 Jan 2007) New Revision: 19870 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19870&view=rev Modified: haiku/trunk/src/kits/tracker/Jamfile haiku/trunk/src/kits/tracker/MountMenu.cpp Log: * To get away with that empty mount menu, it now at least shows all mounted and mountable volumes - there are no icons yet, and it will also not work at all, that is, you cannot mount/unmount any volumes yet. * Got rid of _INCLUDES_CLASS_DEVICE_MAP in MountMenu.cpp. Modified: haiku/trunk/src/kits/tracker/Jamfile =================================================================== --- haiku/trunk/src/kits/tracker/Jamfile 2007-01-19 22:59:28 UTC (rev 19869) +++ haiku/trunk/src/kits/tracker/Jamfile 2007-01-19 23:01:42 UTC (rev 19870) @@ -3,8 +3,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ; AddSubDirSupportedPlatforms libbe_test ; -UsePrivateHeaders shared ; -UsePrivateHeaders tracker ; +UsePrivateHeaders shared storage tracker ; UseLibraryHeaders icon ; Modified: haiku/trunk/src/kits/tracker/MountMenu.cpp =================================================================== --- haiku/trunk/src/kits/tracker/MountMenu.cpp 2007-01-19 22:59:28 UTC (rev 19869) +++ haiku/trunk/src/kits/tracker/MountMenu.cpp 2007-01-19 23:01:42 UTC (rev 19870) @@ -48,23 +48,111 @@ #include "Tracker.h" #include "Bitmaps.h" -#if OPEN_TRACKER +#ifdef __HAIKU__ +# include +# include +#else # include "DeviceMap.h" -#else -# include #endif #define SHOW_NETWORK_VOLUMES -MountMenu::MountMenu(const char *name) - : BMenu(name) +#ifdef __HAIKU__ +// #pragma mark - Haiku Disk Device API + + +class AddMenuItemVisitor : public BDiskDeviceVisitor { + public: + AddMenuItemVisitor(BMenu* menu); + virtual ~AddMenuItemVisitor(); + + virtual bool Visit(BDiskDevice *device); + virtual bool Visit(BPartition *partition, int32 level); + + private: + BMenu* fMenu; +}; + + +AddMenuItemVisitor::AddMenuItemVisitor(BMenu* menu) + : + fMenu(menu) { - SetFont(be_plain_font); } -#if _INCLUDES_CLASS_DEVICE_MAP +AddMenuItemVisitor::~AddMenuItemVisitor() +{ +} + + +bool +AddMenuItemVisitor::Visit(BDiskDevice *device) +{ + return Visit(device, 0); +} + + +bool +AddMenuItemVisitor::Visit(BPartition *partition, int32 level) +{ + if (!partition->ContainsFileSystem()) + return NULL; + + // get name (and eventually the type) + BString name = partition->ContentName(); + if (name.Length() == 0) { + name = partition->Name(); + if (name.Length() == 0) { + const char *type = partition->ContentType(); + if (type == NULL) + return NULL; + + name = "(unnamed "; + name << type; + name << ")"; + } + } + + // get icon + BBitmap *icon = new BBitmap(BRect(0, 0, B_MINI_ICON - 1, B_MINI_ICON - 1), + B_CMAP8); + if (partition->GetIcon(icon, B_MINI_ICON) != B_OK) { + delete icon; + icon = NULL; + } + + BMessage *message = new BMessage(partition->IsMounted() ? + kUnmountVolume : kMountVolume); + message->AddInt32("id", partition->ID()); + + // TODO: for now, until we actually have disk device icons + BMenuItem *item; + if (icon != NULL) + item = new IconMenuItem(name.String(), message, icon); + else + item = new BMenuItem(name.String(), message); + if (partition->IsMounted()) { + item->SetMarked(true); + + BVolume volume; + if (partition->GetVolume(&volume) == B_OK) { + BVolume bootVolume; + BVolumeRoster().GetBootVolume(&bootVolume); + if (volume == bootVolume) + item->SetEnabled(false); + } + } + + fMenu->AddItem(item); + return false; +} + +#else // !__HAIKU__ +// #pragma mark - R5 DeviceMap API + + struct AddOneAsMenuItemParams { BMenu *mountMenu; }; @@ -127,13 +215,23 @@ return NULL; } -#endif // _INCLUDES_CLASS_DEVICE_MAP +#endif // !__HAIKU__ +// #pragma mark - + + +MountMenu::MountMenu(const char *name) + : BMenu(name) +{ + SetFont(be_plain_font); +} + + bool MountMenu::AddDynamicItem(add_state) { -#if _INCLUDES_CLASS_DEVICE_MAP + // remove old items for (;;) { BMenuItem *item = RemoveItem(0L); if (item == NULL) @@ -141,6 +239,14 @@ delete item; } +#ifdef __HAIKU__ + BDiskDeviceList devices; + status_t status = devices.Fetch(); + if (status == B_OK) { + AddMenuItemVisitor visitor(this); + devices.VisitEachPartition(&visitor); + } +#else AddOneAsMenuItemParams params; params.mountMenu = this; @@ -149,6 +255,7 @@ autoMounter->CheckVolumesNow(); autoMounter->EachPartition(&AddOnePartitionAsMenuItem, ¶ms); +#endif #ifdef SHOW_NETWORK_VOLUMES // iterate the volume roster and look for volumes with the @@ -185,12 +292,14 @@ AddSeparatorItem(); +#ifndef __HAIKU__ // add an option to rescan the scsii bus, etc. BMenuItem *rescanItem = NULL; if (modifiers() & B_SHIFT_KEY) { rescanItem = new BMenuItem("Rescan Devices", new BMessage(kAutomounterRescan)); AddItem(rescanItem); } +#endif BMenuItem *mountAll = new BMenuItem("Mount All", new BMessage(kMountAllNow)); AddItem(mountAll); @@ -200,9 +309,10 @@ SetTargetForItems(be_app); +#ifndef __HAIKU__ if (rescanItem) rescanItem->SetTarget(autoMounter); -#endif // _INCLUDES_CLASS_DEVICE_MAP +#endif return false; } From axeld at mail.berlios.de Sat Jan 20 00:16:41 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 20 Jan 2007 00:16:41 +0100 Subject: [Haiku-commits] r19871 - haiku/trunk/src/kits/tracker Message-ID: <200701192316.l0JNGfMo021306@sheep.berlios.de> Author: axeld Date: 2007-01-20 00:16:41 +0100 (Sat, 20 Jan 2007) New Revision: 19871 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19871&view=rev Modified: haiku/trunk/src/kits/tracker/Bitmaps.cpp haiku/trunk/src/kits/tracker/ContainerWindow.cpp haiku/trunk/src/kits/tracker/FSUtils.cpp haiku/trunk/src/kits/tracker/Jamfile haiku/trunk/src/kits/tracker/TrackerInitialState.cpp haiku/trunk/src/kits/tracker/Utilities.cpp Log: * Fixed build under R5/Dano that was broken since Stippi added vector icon support. * Separated Haiku's icon stuff a bit better, so that Tracker can still be built without having Haiku headers around. * Minor cleanup. Modified: haiku/trunk/src/kits/tracker/Bitmaps.cpp =================================================================== --- haiku/trunk/src/kits/tracker/Bitmaps.cpp 2007-01-19 23:01:42 UTC (rev 19870) +++ haiku/trunk/src/kits/tracker/Bitmaps.cpp 2007-01-19 23:16:41 UTC (rev 19871) @@ -32,17 +32,20 @@ All rights reserved. */ +#include "Bitmaps.h" +#include "Utilities.h" + #include #include #include #include #include -#include #include #include -#include "Bitmaps.h" -#include "Utilities.h" +#ifdef __HAIKU__ +# include +#endif BImageResources::BImageResources(void *memAddr) @@ -138,11 +141,12 @@ size_t length = 0; const void *data; +#ifdef __HAIKU__ // try to load vector icon data = LoadResource(B_VECTOR_ICON_TYPE, id, &length); - - if (data && BIconUtils::GetVectorIcon((uint8*)data, length, dest) == B_OK) + if (data != NULL && BIconUtils::GetVectorIcon((uint8*)data, length, dest) == B_OK) return B_OK; +#endif // fall back to R5 icon if (size != B_LARGE_ICON && size != B_MINI_ICON) @@ -151,21 +155,20 @@ length = 0; data = LoadResource(size == B_LARGE_ICON ? 'ICON' : 'MICN', id, &length); - if (data == 0 || length != (size_t)(size == B_LARGE_ICON ? 1024 : 256)) { + if (data == NULL || length != (size_t)(size == B_LARGE_ICON ? 1024 : 256)) { TRESPASS(); return B_ERROR; } - status_t ret = B_OK; - +#ifdef __HAIKU__ if (dest->ColorSpace() != B_CMAP8) { - ret = BIconUtils::ConvertFromCMAP8((uint8*)data, size, size, + return BIconUtils::ConvertFromCMAP8((uint8*)data, size, size, size, dest); - } else { - dest->SetBits(data, (int32)length, 0, B_CMAP8); } +#endif - return ret; + dest->SetBits(data, (int32)length, 0, B_CMAP8); + return B_OK; } @@ -173,17 +176,20 @@ BImageResources::GetIconResource(int32 id, const uint8** iconData, size_t* iconSize) const { +#ifdef __HAIKU__ // try to load vector icon data from resources size_t length = 0; const void* data = LoadResource(B_VECTOR_ICON_TYPE, id, &length); - - if (!data) + if (data == NULL) return B_ERROR; *iconData = (const uint8*)data; *iconSize = length; return B_OK; +#else + return B_ERROR; +#endif } Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp =================================================================== --- haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2007-01-19 23:01:42 UTC (rev 19870) +++ haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2007-01-19 23:16:41 UTC (rev 19871) @@ -3428,7 +3428,7 @@ if (fContainerWindowFlags & kIsHidden) Minimize(true); -#if __HAIKU__ +#ifdef __HAIKU__ // restore window decor settings int32 size = node->Contains(kAttrWindowDecor, B_RAW_TYPE); if (size > 0) { @@ -3476,7 +3476,7 @@ if (fContainerWindowFlags & kIsHidden) Minimize(true); -#if __HAIKU__ +#ifdef __HAIKU__ // restore window decor settings BMessage decorSettings; if ((fContainerWindowFlags & kRestoreDecor) @@ -3509,7 +3509,7 @@ node->Write(workspaceAttributeName, 0, B_INT32_TYPE, sizeof(uint32), &workspaces); -#if __HAIKU__ +#ifdef __HAIKU__ BMessage decorSettings; if (GetDecoratorSettings(&decorSettings) == B_OK) { int32 size = decorSettings.FlattenedSize(); @@ -3541,7 +3541,7 @@ message.AddRect(rectAttributeName, frame); message.AddInt32(workspaceAttributeName, (int32)Workspaces()); -#if __HAIKU__ +#ifdef __HAIKU__ BMessage decorSettings; if (GetDecoratorSettings(&decorSettings) == B_OK) { message.AddMessage(kAttrWindowDecor, &decorSettings); Modified: haiku/trunk/src/kits/tracker/FSUtils.cpp =================================================================== --- haiku/trunk/src/kits/tracker/FSUtils.cpp 2007-01-19 23:01:42 UTC (rev 19870) +++ haiku/trunk/src/kits/tracker/FSUtils.cpp 2007-01-19 23:16:41 UTC (rev 19871) @@ -2145,21 +2145,20 @@ size_t size; const void* data = GetTrackerResources()-> LoadResource('ICON', kResDeskIcon, &size); - - if (data) + if (data != NULL) deskDir->WriteAttr(kAttrLargeIcon, 'ICON', 0, data, size); data = GetTrackerResources()-> LoadResource('MICN', kResDeskIcon, &size); - - if (data) + if (data != NULL) deskDir->WriteAttr(kAttrMiniIcon, 'MICN', 0, data, size); +#ifdef __HAIKU__ data = GetTrackerResources()-> LoadResource(B_VECTOR_ICON_TYPE, kResDeskIcon, &size); - - if (data) + if (data != NULL) deskDir->WriteAttr(kAttrIcon, B_VECTOR_ICON_TYPE, 0, data, size); +#endif return B_OK; } @@ -2647,22 +2646,24 @@ size_t size; const void* data = GetTrackerResources()-> LoadResource('ICON', kResTrashIcon, &size); - if (data) { + if (data != NULL) { trashDir.WriteAttr(kAttrLargeIcon, 'ICON', 0, data, size); } data = GetTrackerResources()-> LoadResource('MICN', kResTrashIcon, &size); - if (data) { + if (data != NULL) { trashDir.WriteAttr(kAttrMiniIcon, 'MICN', 0, data, size); } +#ifdef __HAIKU data = GetTrackerResources()-> LoadResource(B_VECTOR_ICON_TYPE, kResTrashIcon, &size); - if (data) { + if (data != NULL) { trashDir.WriteAttr(kAttrIcon, B_VECTOR_ICON_TYPE, 0, data, size); } +#endif } } } Modified: haiku/trunk/src/kits/tracker/Jamfile =================================================================== --- haiku/trunk/src/kits/tracker/Jamfile 2007-01-19 23:01:42 UTC (rev 19870) +++ haiku/trunk/src/kits/tracker/Jamfile 2007-01-19 23:16:41 UTC (rev 19871) @@ -17,6 +17,11 @@ # -D_SILENTLY_CORRECT_FILE_NAMES=1 ; +local vector_icon_libs ; +if $(TARGET_PLATFORM) = haiku { + vector_icon_libs = libicon.a libagg.a ; +} + SharedLibrary libtracker.so : AttributeStream.cpp AutoMounter.cpp @@ -88,7 +93,7 @@ VolumeWindow.cpp WidgetAttributeText.cpp - : be translation libicon.a libagg.a + : be translation $(vector_icon_libs) ; Modified: haiku/trunk/src/kits/tracker/TrackerInitialState.cpp =================================================================== --- haiku/trunk/src/kits/tracker/TrackerInitialState.cpp 2007-01-19 23:01:42 UTC (rev 19870) +++ haiku/trunk/src/kits/tracker/TrackerInitialState.cpp 2007-01-19 23:16:41 UTC (rev 19871) @@ -164,7 +164,7 @@ # define B_BITMAP_NO_SERVER_LINK 0 #endif -#if __HAIKU__ +#ifdef __HAIKU__ BBitmap vectorIcon(BRect(0, 0, 31, 31), B_BITMAP_NO_SERVER_LINK, B_RGB32); #endif BBitmap largeIcon(BRect(0, 0, 31, 31), B_BITMAP_NO_SERVER_LINK, B_CMAP8); @@ -175,7 +175,7 @@ bool installed = mime.IsInstalled(); if (!installed -#if __HAIKU__ +#ifdef __HAIKU__ || (bitsID >= 0 && ((forceMask & kForceLargeIcon) || mime.GetIcon(&vectorIcon, B_LARGE_ICON) != B_OK)) #endif @@ -194,7 +194,7 @@ mime.Install(); if (bitsID >= 0) { -#if __HAIKU__ +#ifdef __HAIKU__ const uint8* iconData; size_t iconSize; if (GetTrackerResources()-> Modified: haiku/trunk/src/kits/tracker/Utilities.cpp =================================================================== --- haiku/trunk/src/kits/tracker/Utilities.cpp 2007-01-19 23:01:42 UTC (rev 19870) +++ haiku/trunk/src/kits/tracker/Utilities.cpp 2007-01-19 23:16:41 UTC (rev 19871) @@ -32,18 +32,21 @@ All rights reserved. */ -#include -#include -#include -#include -#include -#include +#include "Attributes.h" +#include "MimeTypes.h" +#include "Model.h" +#include "Utilities.h" +#include "ContainerWindow.h" +#ifdef __HAIKU__ +# include +#endif + #include #include #include +#include #include -#include #include #include #include @@ -54,25 +57,24 @@ #include #include +#include +#include +#include +#include +#include +#include + + #if B_BEOS_VERSION_DANO -#define _IMPEXP_BE +# define _IMPEXP_BE #endif extern _IMPEXP_BE const uint32 LARGE_ICON_TYPE; extern _IMPEXP_BE const uint32 MINI_ICON_TYPE; #if B_BEOS_VERSION_DANO -#undef _IMPEXP_BE +# undef _IMPEXP_BE #endif -#include "Attributes.h" -#include "MimeTypes.h" -#include "Model.h" -#include "Utilities.h" -#include "ContainerWindow.h" -#include - - - FILE *logFile = NULL; static const float kMinSeparatorStubX = 10; From mmu_man at mail.berlios.de Sat Jan 20 01:35:17 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 01:35:17 +0100 Subject: [Haiku-commits] r19872 - haiku/trunk/src/bin Message-ID: <200701200035.l0K0ZHTV010952@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 01:35:17 +0100 (Sat, 20 Jan 2007) New Revision: 19872 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19872&view=rev Modified: haiku/trunk/src/bin/mount.c Log: Allow device-less mounts for things like googlefs... Accept -o as -p; update usage text. Modified: haiku/trunk/src/bin/mount.c =================================================================== --- haiku/trunk/src/bin/mount.c 2007-01-19 23:16:41 UTC (rev 19871) +++ haiku/trunk/src/bin/mount.c 2007-01-20 00:35:17 UTC (rev 19872) @@ -18,9 +18,11 @@ usage(const char *programName) { - printf("usage: %s [-ro] [-t fstype] [-p parameter] device directory\n" + printf("usage: %s [-ro] [-t fstype] [-p parameter] [device] directory\n" "\t-ro\tmounts the volume read-only\n" - "\t-t\tspecifies the file system to use (defaults to automatic recognition)\n",programName); + "\t-t\tspecifies the file system to use (defaults to automatic recognition)\n" + "\t-p\tspecifies parameters to pass to the file system (-o also accepted)\n" + "\tif device is not specified, NULL is passed (for in-memory filesystems)\n",programName); exit(1); } @@ -29,7 +31,8 @@ main(int argc, char **argv) { const char *programName = argv[0]; - const char *device, *mountPoint; + const char *device = NULL; + const char *mountPoint; const char *parameter = NULL; const char *fs = NULL; struct stat mountStat; @@ -56,7 +59,7 @@ break; fs = *++argv; argc--; - } else if (!strcmp(arg, "p") && parameter == NULL) { + } else if ((!strcmp(arg, "p") || !strcmp(arg, "o")) && parameter == NULL) { if (argc <= 1) break; parameter = *++argv; @@ -67,10 +70,14 @@ /* check the arguments */ - device = argv[0]; - mountPoint = argv[1]; + if (argc > 1) { + device = argv[0]; + argv++; + argc--; + } + mountPoint = argv[0]; - if (device == NULL || mountPoint == NULL) + if (mountPoint == NULL) usage(programName); if (stat(mountPoint, &mountStat) < 0) { From mmu_man at mail.berlios.de Sat Jan 20 03:05:03 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 03:05:03 +0100 Subject: [Haiku-commits] r19873 - in haiku/trunk/src/add-ons/kernel/file_systems: . googlefs googlefs/bin googlefs/config Message-ID: <200701200205.l0K253SL023327@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 03:04:51 +0100 (Sat, 20 Jan 2007) New Revision: 19873 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19873&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/googlefs/README.googlefs.txt haiku/trunk/src/add-ons/kernel/file_systems/googlefs/_APP_ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attr2c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.txt haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/google haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/imlucky haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bookmark.mime haiku/trunk/src/add-ons/kernel/file_systems/googlefs/config/ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/config/googlefs haiku/trunk/src/add-ons/kernel/file_systems/googlefs/fsproto.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google-ext-search.html haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google.src haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_icon.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.docs.txt haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs_res.rdef haiku/trunk/src/add-ons/kernel/file_systems/googlefs/http_cnx.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/http_cnx.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/ksocket.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/lists.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/lists.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/lists2.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/lists2.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/lock.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/makefile haiku/trunk/src/add-ons/kernel/file_systems/googlefs/makefile.ufs haiku/trunk/src/add-ons/kernel/file_systems/googlefs/makezip.sh haiku/trunk/src/add-ons/kernel/file_systems/googlefs/parse_google_html.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/query.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/query.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/ringbuff.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/ringbuff.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/settings.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/settings.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/string_utils.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/string_utils.h haiku/trunk/src/add-ons/kernel/file_systems/googlefs/vnidpool.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/vnidpool.h Log: \o/ \o/ This is the mighty GoogleFS for BeOS, now also for Haiku. \o/ \o/ Quick, before I loose googlefs.h again (bloody /bin/deres which overwrites foo.h for foo.rsrc !!!!) A makefile is provided for BeOS/Zeta, the Jamfile currently only builds for Haiku. The makefile.ufs is for UserlandFS. The source code is quite messy, beware. Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/Jamfile 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/Jamfile 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,20 @@ +SubDir HAIKU_TOP src add-ons kernel file_systems googlefs ; + +UsePrivateHeaders kernel ; + +#SubDirCcFlags -DTRACK_FILENAME ; +#SubDirCcFlags -DDEBUG_GOOGLEFS=1 ; + +KernelAddon googlefs : + attrs.c + google_icon.c + google_request.c + googlefs.c + http_cnx.c + lists2.c + parse_google_html.c + query.c + settings.c + string_utils.c + vnidpool.c +; Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/README.googlefs.txt =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/README.googlefs.txt 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/README.googlefs.txt 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,29 @@ +Welcome to the Google??? FileSystem for BeOS???, Zeta??? and Haiku???. +Copyright?? 2004, 2005, Fran??ois Revol. +Google is a trademark of Google,Inc. +BeOS is a trademark of PalmSource. +Zeta is a trademark of yellowTAB GmbH. +Haiku is a trademark of Haiku Inc. + + +REQUIRES BONE + +mkdir /google; ndmount googlefs /google + +Use "Search Google" query template in this folder to ask google anything. + +or: + +query -v /google '((name=="*QUESTION*")&&(BEOS:TYPE=="application/x-vnd.Be-bookmark"))' +where QUESTION is what you want to ask google. (googlefs currently filters queries to only answer those) +( you will want to pipe that to catattr: +query -v /google '((name=="*site:bebits.com bone*")&&(BEOS:TYPE=="application/x-vnd.Be-bookmark"))' | xargs catattr META:url +note that won't work with sync_unlink true in the settings) + +Included are 2 scripts, google and imlucky that runs such a query using the arguments given on the command line. + +An addon for Ingo Weinhold's UserlandFS is provided, compiled with debug printouts, so you can see it at work. +To use it, startUserlandFSServer and run: +ufs_mount googlefs /dev/zero /google + +Enjoy. \ No newline at end of file Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/_APP_ =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/_APP_ 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/_APP_ 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1 @@ +link /boot/home/config/bin/UserlandFSServer \ No newline at end of file Property changes on: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/_APP_ ___________________________________________________________________ Name: svn:special + * Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attr2c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attr2c 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attr2c 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ $# -lt 2 ]; then + echo "attr2c attrname file" + exit 1 +fi +#for R5 catattr +/bin/catattr "$1" "$2" | tail +2 | cut -c 10-57 | sed 's/,/, 0x/g;s/ / 0x/;s/ *//;s/$/,/' +#for zeta ?? +#catattr "$1" "$2" | tail +2 | cut -c 10-57 | sed 's/,/, 0x/g;s/ / 0x/;s/ *//;s/$/,/' Property changes on: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attr2c ___________________________________________________________________ Name: svn:executable + * Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,273 @@ +#include +#include "googlefs.h" + +#define SZSTR(s) sizeof(s), s +#define SZTAB(s) sizeof(s), s + +extern const char google_icon_M[]; +extern const char google_icon_L[]; + + +struct attr_entry root_folder_attrs[] = { +{ "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', SZSTR("application/x-vnd.Be-directory") }, +{ "BEOS:M:STD_ICON", 'MICN', 16*16, google_icon_M }, +{ "BEOS:L:STD_ICON", 'ICON', 32*32, google_icon_L }, +//{ "BEOS:EMBLEMS", 'CSTR', SZSTR("palm") }, +{ NULL, 0, 0, NULL } /* end of list */ +}; + +static uint8 folders_attrs_1[] = { + 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x54, 0x69, 0x74, 0x6c, + 0x65, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00, 0x00, 0x02, 0x43, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, + 0x00, 0x00, 0x4d, 0x45, 0x54, 0x41, 0x3a, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x00, 0x52, 0x7d, 0xfb, + 0x77, 0x52, 0x54, 0x53, 0x43, 0x00, 0x01, 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x55, 0x52, 0x4c, 0x00, 0x00, 0x00, 0x39, 0x43, 0x00, 0x00, 0x2a, 0x43, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4d, 0x45, 0x54, 0x41, 0x3a, 0x75, 0x72, 0x6c, 0x00, + 0x52, 0x54, 0x5b, 0xe3, 0x52, 0x54, 0x53, 0x43, 0x00, 0x01, 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x00, 0x00, + 0x00, 0xb9, 0x43, 0x00, 0x00, 0x02, 0x43, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4d, + 0x45, 0x54, 0x41, 0x3a, 0x6b, 0x65, 0x79, 0x77, 0x00, 0x52, 0xdc, 0xf3, 0xdb, 0x52, 0x54, 0x53, + 0x43, 0x00, 0x01, 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4d, + 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x00, 0x00, 0xc0, 0x00, 0x44, 0x00, 0x00, 0x16, 0x43, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x2f, 0x6d, 0x6f, + 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x00, 0x45, 0x6d, 0x4b, 0x5d, 0x45, 0x4d, 0x49, 0x54, 0x01, + 0x00, 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x47, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x00, 0x00, 0x00, 0x2a, 0x44, 0x00, 0x00, + 0xa0, 0x41, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, + 0x3a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x00, 0x47, 0xde, 0xef, 0xfc, 0x47, 0x4e, 0x4f, 0x4c, 0x00, + 0x01 }; +static uint8 folders_attrs_2[] = { + 0x52, 0xf5, 0x5e, 0x6f, 0x0a, 0x00, 0x00, 0x00, 0x74, 0x73, 0x6c, 0x54, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x47, 0xde, 0xef, 0xfc, 0x47, 0x4e, 0x4f, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01 }; +struct attr_entry folders_attrs[] = { +{ "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', SZSTR("application/x-vnd.Be-directory") }, +{ "_trk/columns_le", 'RAWT', SZTAB(folders_attrs_1) }, +{ "_trk/viewstate_le", 'RAWT', SZTAB(folders_attrs_2) }, +{ "", 'RAWT', SZTAB(folders_attrs_2) }, +{ NULL, 0, 0, NULL } /* end of list */ +}; + +struct attr_entry bookmark_attrs[] = { +{ "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', SZSTR("application/x-vnd.Be-bookmark") }, +{ NULL, 0, 0, NULL } /* end of list */ +}; + +/* for debugging */ +static int32 fake_bm_attr_1 = 1; +struct attr_entry fake_bookmark_attrs[] = { +{ "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', SZSTR("application/x-vnd.Be-bookmark") }, +{ "META:title", 'CSTR', SZSTR("Plop!") }, +{ "META:url", 'CSTR', SZSTR("http://127.0.0.1/") }, +{ "META:keyw", 'CSTR', SZSTR("plop") }, +//{ "GOOGLE:order", 'LONG', sizeof(int32), &fake_bm_attr_1 }, +{ NULL, 0, 0, NULL } /* end of list */ +}; + +static uint8 template_1_attrs_1 = 1; +static int32 template_1_attrs_2 = 1; +static uint8 template_1_attrs_3[] = { + 0x31, 0x42, 0x4F, 0x46, 0x01, 0x00, 0x00, 0x98, 0x98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x0F, 0x47, 0x4E, 0x4F, 0x4C, 0x04, 0x0C, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6F, 0x6E, + 0x44, 0x61, 0x74, 0x65, 0x51, 0xEA, 0xC7, 0x41, 0x0F, 0x47, 0x4E, 0x4C, 0x4C, 0x08, 0x08, 0x63, + 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, + 0x52, 0x54, 0x53, 0x43, 0x08, 0x0A, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4E, 0x61, 0x6D, 0x65, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x41, 0x0B, 0x52, 0x54, 0x53, 0x43, 0x10, 0x0A, 0x76, + 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x4E, 0x61, 0x6D, 0x65, 0x07, 0x00, 0x00, 0x00, 0x47, 0x6F, 0x6F, + 0x67, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x52, 0x54, 0x53, 0x43, 0x10, 0x07, + 0x66, 0x73, 0x68, 0x4E, 0x61, 0x6D, 0x65, 0x09, 0x00, 0x00, 0x00, 0x67, 0x6F, 0x6F, 0x67, 0x6C, + 0x65, 0x66, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00 }; +static int32 template_1_attrs_4 = 0x4662796E; +static uint8 template_1_attrs_5[] = { + 0x00, 0x00, 0x06, 0xEC, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 }; +static int32 template_1_attrs_6 = 0x00000027; +static int32 template_1_attrs_7 = 0x00000000; +static uint8 template_1_attrs_8[] = { + 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x82, 0x43, 0x00, 0x00, 0xA0, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xE0, 0x9F, 0x44, 0x00, 0xC0, 0x7F, 0x44, 0xFF, 0xFF, 0xFF, 0xFF }; +static uint8 template_1_attrs_9[] = { + 0x00, 0x00, 0x00, 0x00, 0x58, 0x10, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x44, + 0x00, 0x00, 0x0c, 0x44 }; +static uint8 template_1_attrs_10[] = { + 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x54, 0x69, 0x74, 0x6c, + 0x65, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00, 0x00, 0x50, 0x43, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, + 0x00, 0x00, 0x4d, 0x45, 0x54, 0x41, 0x3a, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x00, 0x52, 0x7d, 0xfb, + 0x77, 0x52, 0x54, 0x53, 0x43, 0x00, 0x01, 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x55, 0x52, 0x4c, 0x00, 0x00, 0x80, 0x83, 0x43, 0x00, 0x80, 0x85, 0x43, 0x00, + 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4d, 0x45, 0x54, 0x41, 0x3a, 0x75, 0x72, 0x6c, 0x00, + 0x52, 0x54, 0x5b, 0xe3, 0x52, 0x54, 0x53, 0x43, 0x00, 0x01, 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4b, 0x65, 0x79, 0x77, 0x6f, 0x72, 0x64, 0x73, 0x00, 0x00, + 0x40, 0x08, 0x44, 0x00, 0x00, 0x02, 0x43, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x4d, + 0x45, 0x54, 0x41, 0x3a, 0x6b, 0x65, 0x79, 0x77, 0x00, 0x52, 0xdc, 0xf3, 0xdb, 0x52, 0x54, 0x53, + 0x43, 0x00, 0x01, 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4d, + 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x00, 0x00, 0x80, 0x2c, 0x44, 0x00, 0x00, 0x16, 0x43, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x2f, 0x6d, 0x6f, + 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x00, 0x45, 0x6d, 0x4b, 0x5d, 0x45, 0x4d, 0x49, 0x54, 0x01, + 0x00, 0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x47, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x00, 0x00, 0xc0, 0x55, 0x44, 0x00, 0x00, + 0x70, 0x41, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x47, 0x4f, 0x4f, 0x47, 0x4c, 0x45, + 0x3a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x00, 0x47, 0xde, 0xef, 0xfc, 0x47, 0x4e, 0x4f, 0x4c, 0x00, + 0x00 }; +static uint8 template_1_attrs_11[] = { + 0x52, 0xf5, 0x5e, 0x6f, 0x0a, 0x00, 0x00, 0x00, 0x74, 0x73, 0x6c, 0x54, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x47, 0xde, 0xef, 0xfc, 0x47, 0x4e, 0x4f, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01 }; +struct attr_entry template_1_attrs[] = { +{ "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', SZSTR("application/x-vnd.Be-queryTemplate") }, +{ "_trk/qrystr", 'CSTR', SZSTR("((name==\"*[aA][nN][yY] [qQ][uU][eE][sS][tT][iI][oO][nN] [yY][oO][uU]\\'[dD] [lL][iI][kK][eE] [tT][oO] [aA][sS][kK] [gG][oO][oO][gG][lL][eE] ?*\")&&(BEOS:TYPE==\"application/x-vnd.Be-bookmark\"))") }, +{ "_trk/queryDynamicDate", 'BOOL', 1, &template_1_attrs_1 }, +{ "_trk/recentQuery", 'LONG', sizeof(int32), &template_1_attrs_2 }, +{ "_trk/qryvol1", 'MSGG', SZTAB(template_1_attrs_3) }, +{ "_trk/qryinitmime", 'CSTR', SZSTR("Bookmark") }, +{ "_trk/qryinitmode", 'LONG', sizeof(int32), &template_1_attrs_4 }, +{ "_trk/qrymoreoptions_le", 'RAWT', SZTAB(template_1_attrs_5) }, +{ "_trk/qryinitstr", 'CSTR', SZSTR("Any question you'd like to ask google ?") }, +{ "_trk/focusedView", 'CSTR', SZSTR("TextControl") }, +{ "_trk/focusedSelEnd", 'LONG', sizeof(int32), &template_1_attrs_6 }, +{ "_trk/focusedSelStart", 'LONG', sizeof(int32), &template_1_attrs_7 }, +{ "_trk/xtpinfo_le", 'RAWT', SZTAB(template_1_attrs_8) }, +{ "_trk/pinfo_le", 'RAWT', SZTAB(template_1_attrs_9) }, +{ "_trk/columns_le", 'RAWT', SZTAB(folders_attrs_1)/*SZTAB(template_1_attrs_10)*/ }, +{ "_trk/viewstate_le", 'RAWT', SZTAB(template_1_attrs_11) }, +{ NULL, 0, 0, NULL } /* end of list */ +}; + +static int32 text_attrs_1 = 0x0000FFFF; +static int32 text_attrs_2 = 0x00000000; +static uint8 text_attrs_3 = 1; +static uint8 text_attrs_4[] = { + 0x41, 0x6c, 0x69, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x53, 0x77, 0x69, 0x73, 0x37, 0x32, 0x31, 0x20, 0x42, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x52, 0x6f, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x41, 0x60, 0x00, 0x00, 0x42, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x53, 0x77, 0x69, 0x73, 0x37, 0x32, 0x31, 0x20, 0x42, 0x54, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x52, 0x6f, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x42, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x53, 0x77, 0x69, 0x73, 0x37, 0x32, 0x31, 0x20, + 0x42, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x6f, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, 0x42, 0xb4, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x53, 0x77, 0x69, 0x73, + 0x37, 0x32, 0x31, 0x20, 0x42, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x6f, 0x6d, 0x61, + 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x60, 0x00, 0x00, + 0x42, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, + 0x53, 0x77, 0x69, 0x73, 0x37, 0x32, 0x31, 0x20, 0x42, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x52, 0x6f, 0x6d, 0x61, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x41, 0x20, 0x00, 0x00, 0x42, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00 }; +struct attr_entry text_attrs[] = { +{ "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', SZSTR("text/plain") }, +{ "be:encoding", 'LONG', sizeof(int32), &text_attrs_1 }, +{ "alignment", 'LONG', sizeof(int32), &text_attrs_2 }, +{ "wrap", 'BOOL', sizeof(uint8), &text_attrs_3 }, +{ "styles", 'RAWT', SZTAB(text_attrs_4) }, +{ NULL, 0, 0, NULL } /* end of list */ +}; + +char *readmestr = \ +"Welcome to the Google??? FileSystem for BeOS???, Zeta??? and Haiku???. +Copyright?? 2004, 2005, Fran??ois Revol. +Google is a trademark of Google,Inc. +BeOS is a trademark of PalmSource. +Zeta is a trademark of yellowTAB GmbH. +Haiku is a trademark of Haiku Inc. + +Use \"Search Google\" query template in this folder to ask google anything. +"; + +struct attr_entry mailto_me_bookmark_attrs[] = { +{ "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', SZSTR("application/x-person") }, +{ "META:email", 'CSTR', SZSTR("revol at free.fr") }, +{ "META:name", 'CSTR', SZSTR("Fran??ois Revol") }, +{ "META:country", 'CSTR', SZSTR("France") }, +{ "META:nickname", 'CSTR', SZSTR("mmu_man") }, +{ "META:company", 'CSTR', SZSTR("yellowTAB GmbH") }, +{ "META:url", 'CSTR', SZSTR("") }, +{ "META:group", 'CSTR', SZSTR("") }, +{ "IM:connections", 'CSTR', SZSTR("icq:77792625") }, +#if 0 +{ "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', SZSTR("application/x-vnd.Be-bookmark") }, +{ "META:title", 'CSTR', SZSTR("Report googlefs bugs") }, +{ "META:url", 'CSTR', SZSTR("mailto:revol at free.fr"/*"&subject=googlefs bug report""&body=Hi, I found a bug in GoogleFS."*/) }, +{ "META:keyw", 'CSTR', SZSTR("googlefs") }, +//{ "GOOGLE:order", 'LONG', sizeof(int32), &fake_bm_attr_1 }, +#endif +{ NULL, 0, 0, NULL } /* end of list */ +}; + +#if 0 +File: Search Google a +Type Size Name Value +---------- ---------- ---------------------------------- ----------------------------------------------------------------- +'MIMS' 35 "BEOS:TYPE" "application/x-vnd.Be-queryTemplate" +STRING 191 "_trk/qrystr" "((name==\"*[aA][nN][yY] [qQ][uU][eE][sS][tT][iI][oO][nN] [yY][o" + "O][uU]\\'[dD] [lL][iI][kK][eE] [tT][oO] [aA][sS][kK] [gG][oO][o" + "O][gG][lL][eE] ?*\")&&(BEOS:TYPE==\"application/x-vnd.Be-bookma" + "rk\"))" +BOOL 1 "_trk/queryDynamicDate" TRUE +INT32 4 "_trk/recentQuery" 1 0x00000001 + 01 0F 47 4E 4F 4C 04 0C-63 72 65 61 74 69 6F 6E ..GNOL..creation + 44 61 74 65 51 EA C7 41-0F 47 4E 4C 4C 08 08 63 DateQ..A.GNLL..c + 61 70 61 63 69 74 79 00-00 00 00 00 00 00 00 0B apacity......... + 52 54 53 43 08 0A 64 65-76 69 63 65 4E 61 6D 65 RTSC..deviceName + 01 00 00 00 00 00 70 41-0B 52 54 53 43 10 0A 76 ......pA.RTSC..v + 6F 6C 75 6D 65 4E 61 6D-65 07 00 00 00 47 6F 6F olumeName....Goo + 67 6C 65 00 00 00 00 00-00 0B 52 54 53 43 10 07 gle.......RTSC.. + 66 73 68 4E 61 6D 65 09-00 00 00 67 6F 6F 67 6C fshName....googl + 65 66 73 00 00 00 00 00- efs..... +STRING 9 "_trk/qryinitmime" "Bookmark" +INT32 4 "_trk/qryinitmode" 1180858734 0x4662796E +RAW 36 "_trk/qrymoreoptions_le" 00 00 06 EC 00 00 00 00-01 00 00 00 00 00 00 00 ................ + 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + 00 00 00 00 - .... +STRING 40 "_trk/qryinitstr" "Any question you'd like to ask google ?" +STRING 12 "_trk/focusedView" "TextControl" +INT32 4 "_trk/focusedSelEnd" 39 0x00000027 +INT32 4 "_trk/focusedSelStart" 0 0x00000000 +RAW 60 "_trk/xtpinfo_le" FF FF FF FF 00 00 00 00-00 00 00 00 00 00 00 00 ................ + 00 00 00 00 00 00 00 00-00 00 00 00 01 00 00 00 ................ + 00 00 82 43 00 00 A0 42-00 00 00 00 00 00 00 00 ...C...B........ + 00 E0 9F 44 00 C0 7F 44-FF FF FF FF ...D...D.... +#endif +#if 0 +, 0x41, 0x6E, 0x79, 0x20, 0x71, 0x75, 0x65, 0x73-74, 0x69, 0x6F, 0x6E, 0x20, 0x79, 0x6F, 0x75 +, 0x27, 0x64, 0x20, 0x6C, 0x69, 0x6B, 0x65, 0x20-74, 0x6F, 0x20, 0x61, 0x73, 0x6B, 0x20, 0x67 +, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x20, 0x3F, 0x00-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6F, 0x6E, 0x74-72, 0x6F, 0x6C, 0x00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x27, 0x00, 0x00, 0x00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x00, 0x00, 0x00, 0x00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +#endif Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.h 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.h 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,45 @@ + +, 0xValue, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x----------------------------------------------- +, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74-69, 0x6F, 0x6E, 0x2F, 0x78, 0x2D, 0x76, 0x6E +, 0x64, 0x2E, 0x42, 0x65, 0x2D, 0x71, 0x75, 0x65-72, 0x79, 0x54, 0x65, 0x6D, 0x70, 0x6C, 0x61 +, 0x74, 0x65, 0x00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x28, 0x28, 0x6E, 0x61, 0x6D, 0x65, 0x3D, 0x3D-22, 0x2A, 0x5B, 0x61, 0x41, 0x5D, 0x5B, 0x6E +, 0x4E, 0x5D, 0x5B, 0x79, 0x59, 0x5D, 0x20, 0x5B-71, 0x51, 0x5D, 0x5B, 0x75, 0x55, 0x5D, 0x5B +, 0x65, 0x45, 0x5D, 0x5B, 0x73, 0x53, 0x5D, 0x5B-74, 0x54, 0x5D, 0x5B, 0x69, 0x49, 0x5D, 0x5B +, 0x6F, 0x4F, 0x5D, 0x5B, 0x6E, 0x4E, 0x5D, 0x20-5B, 0x79, 0x59, 0x5D, 0x5B, 0x6F, 0x4F, 0x5D +, 0x5B, 0x75, 0x55, 0x5D, 0x5C, 0x27, 0x5B, 0x64-44, 0x5D, 0x20, 0x5B, 0x6C, 0x4C, 0x5D, 0x5B +, 0x69, 0x49, 0x5D, 0x5B, 0x6B, 0x4B, 0x5D, 0x5B-65, 0x45, 0x5D, 0x20, 0x5B, 0x74, 0x54, 0x5D +, 0x5B, 0x6F, 0x4F, 0x5D, 0x20, 0x5B, 0x61, 0x41-5D, 0x5B, 0x73, 0x53, 0x5D, 0x5B, 0x6B, 0x4B +, 0x5D, 0x20, 0x5B, 0x67, 0x47, 0x5D, 0x5B, 0x6F-4F, 0x5D, 0x5B, 0x6F, 0x4F, 0x5D, 0x5B, 0x67 +, 0x47, 0x5D, 0x5B, 0x6C, 0x4C, 0x5D, 0x5B, 0x65-45, 0x5D, 0x20, 0x3F, 0x2A, 0x22, 0x29, 0x26 +, 0x26, 0x28, 0x42, 0x45, 0x4F, 0x53, 0x3A, 0x54-59, 0x50, 0x45, 0x3D, 0x3D, 0x22, 0x61, 0x70 +, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F-6E, 0x2F, 0x78, 0x2D, 0x76, 0x6E, 0x64, 0x2E +, 0x42, 0x65, 0x2D, 0x62, 0x6F, 0x6F, 0x6B, 0x6D-61, 0x72, 0x6B, 0x22, 0x29, 0x29, 0x00, 0x, 0x, 0x +, 0xFD, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x01, 0x00, 0x00, 0x00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x31, 0x42, 0x4F, 0x46, 0x01, 0x00, 0x00, 0x98-98, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +, 0x01, 0x0F, 0x47, 0x4E, 0x4F, 0x4C, 0x04, 0x0C-63, 0x72, 0x65, 0x61, 0x74, 0x69, 0x6F, 0x6E +, 0x44, 0x61, 0x74, 0x65, 0x51, 0xEA, 0xC7, 0x41-0F, 0x47, 0x4E, 0x4C, 0x4C, 0x08, 0x08, 0x63 +, 0x61, 0x70, 0x61, 0x63, 0x69, 0x74, 0x79, 0x00-00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B +, 0x52, 0x54, 0x53, 0x43, 0x08, 0x0A, 0x64, 0x65-76, 0x69, 0x63, 0x65, 0x4E, 0x61, 0x6D, 0x65 +, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x41-0B, 0x52, 0x54, 0x53, 0x43, 0x10, 0x0A, 0x76 +, 0x6F, 0x6C, 0x75, 0x6D, 0x65, 0x4E, 0x61, 0x6D-65, 0x07, 0x00, 0x00, 0x00, 0x47, 0x6F, 0x6F +, 0x67, 0x6C, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00-00, 0x0B, 0x52, 0x54, 0x53, 0x43, 0x10, 0x07 +, 0x66, 0x73, 0x68, 0x4E, 0x61, 0x6D, 0x65, 0x09-00, 0x00, 0x00, 0x67, 0x6F, 0x6F, 0x67, 0x6C +, 0x65, 0x66, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x42, 0x6F, 0x6F, 0x6B, 0x6D, 0x61, 0x72, 0x6B-00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x6E, 0x79, 0x62, 0x46, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x00, 0x00, 0x06, 0xEC, 0x00, 0x00, 0x00, 0x00-01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00-00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +, 0x00, 0x00, 0x00, 0x00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x41, 0x6E, 0x79, 0x20, 0x71, 0x75, 0x65, 0x73-74, 0x69, 0x6F, 0x6E, 0x20, 0x79, 0x6F, 0x75 +, 0x27, 0x64, 0x20, 0x6C, 0x69, 0x6B, 0x65, 0x20-74, 0x6F, 0x20, 0x61, 0x73, 0x6B, 0x20, 0x67 +, 0x6F, 0x6F, 0x67, 0x6C, 0x65, 0x20, 0x3F, 0x00-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x54, 0x65, 0x78, 0x74, 0x43, 0x6F, 0x6E, 0x74-72, 0x6F, 0x6C, 0x00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x27, 0x00, 0x00, 0x00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0x00, 0x00, 0x00, 0x00, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x-, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x +, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00-00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00-00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 +, 0x00, 0x00, 0x82, 0x43, 0x00, 0x00, 0xA0, 0x42-00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +, 0x00, 0xE0, 0x9F, 0x44, 0x00, 0xC0, 0x7F, 0x44-FF, 0xFF, 0xFF, 0xFF, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x, 0x Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.txt =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.txt 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.txt 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,33 @@ +File: Search Google a +Type Size Name Value +---------- ---------- ---------------------------------- ----------------------------------------------------------------- +'MIMS' 35 "BEOS:TYPE" "application/x-vnd.Be-queryTemplate" +STRING 191 "_trk/qrystr" "((name==\"*[aA][nN][yY] [qQ][uU][eE][sS][tT][iI][oO][nN] [yY][o" + "O][uU]\\'[dD] [lL][iI][kK][eE] [tT][oO] [aA][sS][kK] [gG][oO][o" + "O][gG][lL][eE] ?*\")&&(BEOS:TYPE==\"application/x-vnd.Be-bookma" + "rk\"))" +BOOL 1 "_trk/queryDynamicDate" TRUE +INT32 4 "_trk/recentQuery" 1 0x00000001 +MESSAGE 152 "_trk/qryvol1" 31 42 4F 46 01 00 00 98-98 00 00 00 00 00 00 00 1BOF............ + 01 0F 47 4E 4F 4C 04 0C-63 72 65 61 74 69 6F 6E ..GNOL..creation + 44 61 74 65 51 EA C7 41-0F 47 4E 4C 4C 08 08 63 DateQ..A.GNLL..c + 61 70 61 63 69 74 79 00-00 00 00 00 00 00 00 0B apacity......... + 52 54 53 43 08 0A 64 65-76 69 63 65 4E 61 6D 65 RTSC..deviceName + 01 00 00 00 00 00 70 41-0B 52 54 53 43 10 0A 76 ......pA.RTSC..v + 6F 6C 75 6D 65 4E 61 6D-65 07 00 00 00 47 6F 6F olumeName....Goo + 67 6C 65 00 00 00 00 00-00 0B 52 54 53 43 10 07 gle.......RTSC.. + 66 73 68 4E 61 6D 65 09-00 00 00 67 6F 6F 67 6C fshName....googl + 65 66 73 00 00 00 00 00- efs..... +STRING 9 "_trk/qryinitmime" "Bookmark" +INT32 4 "_trk/qryinitmode" 1180858734 0x4662796E +RAW 36 "_trk/qrymoreoptions_le" 00 00 06 EC 00 00 00 00-01 00 00 00 00 00 00 00 ................ + 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ + 00 00 00 00 - .... +STRING 40 "_trk/qryinitstr" "Any question you'd like to ask google ?" +STRING 12 "_trk/focusedView" "TextControl" +INT32 4 "_trk/focusedSelEnd" 39 0x00000027 +INT32 4 "_trk/focusedSelStart" 0 0x00000000 +RAW 60 "_trk/xtpinfo_le" FF FF FF FF 00 00 00 00-00 00 00 00 00 00 00 00 ................ + 00 00 00 00 00 00 00 00-00 00 00 00 01 00 00 00 ................ + 00 00 82 43 00 00 A0 42-00 00 00 00 00 00 00 00 ...C...B........ + 00 E0 9F 44 00 C0 7F 44-FF FF FF FF ...D...D.... Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/google =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/google 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/google 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,2 @@ +#!/bin/sh +query -v /google/ '((name=="*'"$*"'*")&&(BEOS:TYPE=="application/x-vnd.Be-bookmark"))' | xargs catattr META:url Property changes on: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/google ___________________________________________________________________ Name: svn:executable + * Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/imlucky =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/imlucky 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/imlucky 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,2 @@ +#!/bin/sh +query -v /google/ '((name=="*'"$*"'*")&&(BEOS:TYPE=="application/x-vnd.Be-bookmark"))' | xargs catattr META:url | head -1 Property changes on: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bin/imlucky ___________________________________________________________________ Name: svn:executable + * Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bookmark.mime =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bookmark.mime 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/bookmark.mime 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,33 @@ +/bin/setmime -set application/x-vnd.Be-bookmark -short "Bookmark" -long "Bookmark for a web page." -preferredAppSig application/x-vnd.Be-NPOS \ + -attribute "META:url" -attrName "URL" \ + -attrType 'CSTR' -attrWidth 170 -attrAlignment left \ + -attrViewable 1 -attrEditable 1 -attrExtra 0 \ + -attribute "META:keyw" -attrName "Keywords" \ + -attrType 'CSTR' -attrWidth 130 -attrAlignment left \ + -attrViewable 1 -attrEditable 1 -attrExtra 0 \ + -attribute "META:title" -attrName "Title" \ + -attrType 'CSTR' -attrWidth 130 -attrAlignment left \ + -attrViewable 1 -attrEditable 1 -attrExtra 0 \ + -attribute "GOOGLE:order" -attrName "Google order" \ + -attrType 'LONG' -attrWidth 40 -attrAlignment right \ + -attrViewable 1 -attrEditable 1 -attrExtra 0 \ + -miniIcon ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffff00003f1b0000ffffffff\ +ffffffffff001b1c3f3f3f1b0000ffffffffffffff0000111b1c3f3f3f1b0000ffffff00002d2c0000111b1c3f000e5dffff003f00002d2c2d00001b000f5d00\ +ffff003f1b1c00002d2c2d000f5d00ffff001b3f3f3f1b1c00002d2c000011ffff001b1c3f3f3f3f1b00002c2d2d0000005d00001c1b3f3f000e5d00002d2c00\ +00005d1c00001c000f5d00ffff00003fffff00005d1b000f5d00ffffffffffffffffffff00005d5d00ffffffffffffffffffffffffff0000ffffffffffffffff \ + -largeIcon ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\ +ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\ +ffffffffffffffffffffffffffffffffff0000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff003f0000ffffffffffffffffffffff\ +ffffffffffffffffffffffffffffffff001b1c3f3f0000ffffffffffffffffffffffffffffffffffffffffffff0000003f191a1b1c3f3f0000ffffffffffffff\ +ffffffffffffffffffffffff003f3f3f3f3f3f191a1b1c3f3f0000ffffffffffffffffffffffffffffffff001b1c1b3f3f3f3f3f3f191a1b1c3f3f000000ffff\ +ffffffffffffffffffff000000151b1c1c3f3f3f3f3f3f191a1b1c3f3f0000ffffffffffffffffffffff002b2a0000151b1c1c3f3f3f3f3f3f191a1b1c0000ff\ +ffffffffffffffffff00302c2d2b2a0000151b1c1c3f3f3f3f1b1c00001b00ffffffffffffffff00000000302f2c2d2b2b0100151c1b1c3f1b00001c0f005d00\ +ffffffffffff001b1c0f0f0000302f2c2d2b2b0100151c1b001c0f0f005d00ffffffffffff001b1c1b1c1c0f0e00002f302c2d2b2a000016000f1b005d000fff\ +ffffffff003f3f3f3f1b1c1b1c0f0f00002f302c2d2b2a00001b005d000fffffffffffff003f3f3f3f3f3f1b1c1b1c0f0f00002f302b313132005d000fffffff\ +ffffff003f3f3f3f3f3f3f3f3f1b1c1b1c0f0f00002f32313200000fffffffffffffff001b3f3f3f3f3f3f3f3f3f3f1b1c1b1c1c00003231320000000f0fffff\ +ffff003f1b3f1b3f3f3f3f3f3f3f3f3f3f1b000000000031312d2b2a00000f0fff00003f3f3f1b3f3f3f3f3f3f3f3f3f3f000e0f1c000031312c2d2c2b2b0000\ +ff1b0000003f3f1b1c3f3f3f3f3f3f3f000e1c3f005d000000002d2c2d2d000fff00003f3f00003f3f1b1c3f3f3f3f3f001b3f005d00000effff00002d2c00ff\ +005d5d00003f3f00003f3f1b1c3f3f001b3f005d000effffffffffff000000ffff00005d5d00003f3f00003f3f1b3f001b005d000fffffffffffffffffffffff\ +ffffff00005d5d00003f3f00003f001b005d000fffffffffffffffffffffffffffffffffff00005d5d00003f3f001b005d000fffffffffffffffffffffffffff\ +ffffffffffffff00005d5d00003f005d000effffffffffffffffffffffffffffffffffffffffffffff00005d5d005d000effffffffffffffffffffffffffffff\ +ffffffffffffffffffffff00005d000effffffffffffffffffffffffffffffffffffffffffffffffffffffffff000effffffffffffffffffffffffffffffffff Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/config/googlefs =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/config/googlefs 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/config/googlefs 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,15 @@ +# googlefs configuration file +# + +# IP of the google server to query +server 66.102.11.99 + +# max number of vnodes allowed in the fs (to limit RAM usage) +# 10 <= allowed <= 1000000 +max_nodes 5000 + +# maximum number of results to ask google for +max_results 50 + +# delete result entries on last query close +sync_unlink 0 Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/fsproto.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/fsproto.h 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/fsproto.h 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,250 @@ +#ifndef _FSPROTO_H +#define _FSPROTO_H + +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef dev_t nspace_id; +typedef ino_t vnode_id; + +/* UGLY UGLY UGLY */ +#ifndef _DRIVERS_H +struct selectsync; +typedef struct selectsync selectsync; +#endif + + +/* + * PUBLIC PART OF THE FILE SYSTEM PROTOCOL + */ + +#define WSTAT_MODE 0x0001 +#define WSTAT_UID 0x0002 +#define WSTAT_GID 0x0004 +#define WSTAT_SIZE 0x0008 +#define WSTAT_ATIME 0x0010 +#define WSTAT_MTIME 0x0020 +#define WSTAT_CRTIME 0x0040 + +#define WFSSTAT_NAME 0x0001 + +#define B_ENTRY_CREATED 1 +#define B_ENTRY_REMOVED 2 +#define B_ENTRY_MOVED 3 +#define B_STAT_CHANGED 4 +#define B_ATTR_CHANGED 5 +#define B_DEVICE_MOUNTED 6 +#define B_DEVICE_UNMOUNTED 7 + +#define B_STOP_WATCHING 0x0000 +#define B_WATCH_NAME 0x0001 +#define B_WATCH_STAT 0x0002 +#define B_WATCH_ATTR 0x0004 +#define B_WATCH_DIRECTORY 0x0008 + +/* UGLY UGLY UGLY - that goes to Drivers.h too */ +#ifndef SELECT_READ +#define SELECT_READ 1 +#define SELECT_WRITE 2 +#define SELECT_EXCEPTION 3 +#endif + +#define B_CUR_FS_API_VERSION 2 + +struct attr_info; +struct index_info; + +typedef int op_read_vnode(void *ns, vnode_id vnid, char r, void **node); +typedef int op_write_vnode(void *ns, void *node, char r); +typedef int op_remove_vnode(void *ns, void *node, char r); +typedef int op_secure_vnode(void *ns, void *node); + +typedef int op_walk(void *ns, void *base, const char *file, char **newpath, + vnode_id *vnid); + +typedef int op_access(void *ns, void *node, int mode); + +typedef int op_create(void *ns, void *dir, const char *name, + int omode, int perms, vnode_id *vnid, void **cookie); +typedef int op_mkdir(void *ns, void *dir, const char *name, int perms); +typedef int op_symlink(void *ns, void *dir, const char *name, + const char *path); +typedef int op_link(void *ns, void *dir, const char *name, void *node); + +typedef int op_rename(void *ns, void *olddir, const char *oldname, + void *newdir, const char *newname); +typedef int op_unlink(void *ns, void *dir, const char *name); +typedef int op_rmdir(void *ns, void *dir, const char *name); + +typedef int op_readlink(void *ns, void *node, char *buf, size_t *bufsize); + +typedef int op_opendir(void *ns, void *node, void **cookie); +typedef int op_closedir(void *ns, void *node, void *cookie); +typedef int op_rewinddir(void *ns, void *node, void *cookie); +typedef int op_readdir(void *ns, void *node, void *cookie, long *num, + struct dirent *buf, size_t bufsize); + +typedef int op_open(void *ns, void *node, int omode, void **cookie); +typedef int op_close(void *ns, void *node, void *cookie); +typedef int op_free_cookie(void *ns, void *node, void *cookie); +typedef int op_read(void *ns, void *node, void *cookie, off_t pos, void *buf, + size_t *len); +typedef int op_write(void *ns, void *node, void *cookie, off_t pos, + const void *buf, size_t *len); +typedef int op_readv(void *ns, void *node, void *cookie, off_t pos, const iovec *vec, + size_t count, size_t *len); +typedef int op_writev(void *ns, void *node, void *cookie, off_t pos, const iovec *vec, + size_t count, size_t *len); +typedef int op_ioctl(void *ns, void *node, void *cookie, int cmd, void *buf, + size_t len); +typedef int op_setflags(void *ns, void *node, void *cookie, int flags); + +typedef int op_rstat(void *ns, void *node, struct stat *); +typedef int op_wstat(void *ns, void *node, struct stat *, long mask); +typedef int op_fsync(void *ns, void *node); + +typedef int op_select(void *ns, void *node, void *cookie, uint8 event, + uint32 ref, selectsync *sync); +typedef int op_deselect(void *ns, void *node, void *cookie, uint8 event, + selectsync *sync); + +typedef int op_initialize(const char *devname, void *parms, size_t len); +typedef int op_mount(nspace_id nsid, const char *devname, ulong flags, + void *parms, size_t len, void **data, vnode_id *vnid); +typedef int op_unmount(void *ns); +typedef int op_sync(void *ns); +typedef int op_rfsstat(void *ns, struct fs_info *); +typedef int op_wfsstat(void *ns, struct fs_info *, long mask); + + +typedef int op_open_attrdir(void *ns, void *node, void **cookie); +typedef int op_close_attrdir(void *ns, void *node, void *cookie); +typedef int op_rewind_attrdir(void *ns, void *node, void *cookie); +typedef int op_read_attrdir(void *ns, void *node, void *cookie, long *num, + struct dirent *buf, size_t bufsize); +typedef int op_remove_attr(void *ns, void *node, const char *name); +typedef int op_rename_attr(void *ns, void *node, const char *oldname, + const char *newname); +typedef int op_stat_attr(void *ns, void *node, const char *name, + struct attr_info *buf); + +typedef int op_write_attr(void *ns, void *node, const char *name, int type, + const void *buf, size_t *len, off_t pos); +typedef int op_read_attr(void *ns, void *node, const char *name, int type, + void *buf, size_t *len, off_t pos); + +typedef int op_open_indexdir(void *ns, void **cookie); +typedef int op_close_indexdir(void *ns, void *cookie); +typedef int op_rewind_indexdir(void *ns, void *cookie); +typedef int op_read_indexdir(void *ns, void *cookie, long *num, + struct dirent *buf, size_t bufsize); +typedef int op_create_index(void *ns, const char *name, int type, int flags); +typedef int op_remove_index(void *ns, const char *name); +typedef int op_rename_index(void *ns, const char *oldname, + const char *newname); +typedef int op_stat_index(void *ns, const char *name, struct index_info *buf); + +typedef int op_open_query(void *ns, const char *query, ulong flags, + port_id port, long token, void **cookie); +typedef int op_close_query(void *ns, void *cookie); +typedef int op_read_query(void *ns, void *cookie, long *num, + struct dirent *buf, size_t bufsize); + +typedef struct vnode_ops { + op_read_vnode (*read_vnode); + op_write_vnode (*write_vnode); + op_remove_vnode (*remove_vnode); + op_secure_vnode (*secure_vnode); + op_walk (*walk); + op_access (*access); + op_create (*create); + op_mkdir (*mkdir); + op_symlink (*symlink); + op_link (*link); + op_rename (*rename); + op_unlink (*unlink); + op_rmdir (*rmdir); + op_readlink (*readlink); + op_opendir (*opendir); + op_closedir (*closedir); + op_free_cookie (*free_dircookie); + op_rewinddir (*rewinddir); + op_readdir (*readdir); + op_open (*open); + op_close (*close); + op_free_cookie (*free_cookie); + op_read (*read); + op_write (*write); + op_readv (*readv); + op_writev (*writev); + op_ioctl (*ioctl); + op_setflags (*setflags); + op_rstat (*rstat); + op_wstat (*wstat); + op_fsync (*fsync); + op_initialize (*initialize); + op_mount (*mount); + op_unmount (*unmount); + op_sync (*sync); + op_rfsstat (*rfsstat); + op_wfsstat (*wfsstat); + op_select (*select); + op_deselect (*deselect); + op_open_indexdir (*open_indexdir); + op_close_indexdir (*close_indexdir); + op_free_cookie (*free_indexdircookie); + op_rewind_indexdir (*rewind_indexdir); + op_read_indexdir (*read_indexdir); + op_create_index (*create_index); + op_remove_index (*remove_index); + op_rename_index (*rename_index); + op_stat_index (*stat_index); + op_open_attrdir (*open_attrdir); + op_close_attrdir (*close_attrdir); + op_free_cookie (*free_attrdircookie); + op_rewind_attrdir (*rewind_attrdir); + op_read_attrdir (*read_attrdir); + op_write_attr (*write_attr); + op_read_attr (*read_attr); + op_remove_attr (*remove_attr); + op_rename_attr (*rename_attr); + op_stat_attr (*stat_attr); + op_open_query (*open_query); + op_close_query (*close_query); + op_free_cookie (*free_querycookie); + op_read_query (*read_query); +} vnode_ops; + +extern _IMPEXP_KERNEL int new_path(const char *path, char **copy); +extern _IMPEXP_KERNEL void free_path(char *p); + +extern _IMPEXP_KERNEL int notify_listener(int op, nspace_id nsid, + vnode_id vnida, vnode_id vnidb, + vnode_id vnidc, const char *name); +extern _IMPEXP_KERNEL void notify_select_event(selectsync *sync, uint32 ref); +extern _IMPEXP_KERNEL int send_notification(port_id port, long token, + ulong what, long op, nspace_id nsida, + nspace_id nsidb, vnode_id vnida, + vnode_id vnidb, vnode_id vnidc, + const char *name); +extern _IMPEXP_KERNEL int get_vnode(nspace_id nsid, vnode_id vnid, void **data); +extern _IMPEXP_KERNEL int put_vnode(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL int new_vnode(nspace_id nsid, vnode_id vnid, void *data); +extern _IMPEXP_KERNEL int remove_vnode(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL int unremove_vnode(nspace_id nsid, vnode_id vnid); +extern _IMPEXP_KERNEL int is_vnode_removed(nspace_id nsid, vnode_id vnid); + + +extern _EXPORT vnode_ops fs_entry; +extern _EXPORT int32 api_version; + +#endif Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google-ext-search.html =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google-ext-search.html 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google-ext-search.html 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,140 @@ +Google Search: google api help "frequently asked" -plop + +
Go to Google Home  
Web    Images    GroupsNew!    News    Froogle    more »
 
  Advanced Search
  Preferences    
+ +
 Web Results 1 - 50 of about 12,800 English pages over the past 3 months for google api help "frequently asked" -plop. (0.40 seconds) 
!
 
    Sponsored Links
Google Help
Better Understand Your Results &
Learn Fun Facts Too. Get More Info!
www.GoogleStore.com
See your message here...

Google Web APIs - FAQ
... a custom Java client library, documentation on how to use the ... You can find it ! at +http://api.google.com/GoogleSearch.wsdl ... need to get started is in googleapi.jar ... +
www.google.com/apis/api_faq.html - 29k - Cached - Similar pages

SEO Count - Keyword Ranking Tool - Frequently Asked Questions
Frequently Asked Questions. ... that Google only indexes the www version to help increase +Page ... Since the Google API provides results for UTF-8 Encoding we are able ... +
www.seocount.com/faq.php - 16k - Cached - Similar pages

eBay Hacks - Frequently Asked Questions
... If you need help getting started with eBay, you'd ... is concerned with programming and +the eBay API; that leaves ... 5.36934319 ? 10 41 Joules, as reported by Google ... +
www.ebayhacks.com/exec/show/book_faq - 8k - 5 Dec 2004 - Cached - Similar pages

Free SOAP Resources, freeprogrammingresources.com
... The Google API is used as an example. ... Tutorials, Links FAQs. ... This page explains how +to get started editing the home page of your Manila site using SOAP to make ... +
www.freeprogrammingresources.com/soap.html - Similar pages

FAQ: SEO Search Engine Optimization Frequently Asked Questions
... come from the Top25Web.com server, and it is using the Google API which was recently +made available by Google. ... Post a message in our forums for more help! ... +
www.top25web.com/faq.html - 15k - Cached - Similar pages

Among Other Things ? Google API Cocoa framework
... to be using the Google API for something ... NetBSD/dreamcast NetBSD/dreamcast: How to +use NetBSD/dreamcast NetBSD/dreamcast Frequently Asked Questions The ... +
interalia.org/archives/2003/ 03/24/google-api-cocoa-framework - 48k - Cached - Similar pages

Google Guide: Useful Links
... www.googleguide.com/searchLeader.html; Google's Online Help: Google Help Central - +www.google.com/help/; ... Google Web API - www.google.com/apis/ API stands ... +
www.googleguide.com/links.html - 12k - 6 Dec 2004 - Cached - Similar pages

FAQ: Very Frequently Asked Questions (with answers) v1.29
... some of the questions that are most frequently asked in comp ... Google search: +<URL:http://groups.google.com/groups ... URLs contain information on how to reinstate ... +
www.codecomments.com/Clipper/message320018.html - 23k - Cached - Similar pages

comp.lang.prolog Frequently Asked Questions
... For details on how to join or send in contributions, check ... readers who would be glad +to help people making a ... Yes, there are: Google Groups has archives of news ... +
www.codecomments.com/Prolog/message321541.html - 42k - Cached - Similar pages
[ More results from www.codecomments.com ]

Frequently Asked Questions
... Frequently Asked Questions. ... Since the API is entirely modular, we are looking for +people who can help fix bugs or add enhancements to the project. ... +
open.echomine.org/cowiki/20.html - 36k - Cached - Similar pages

Chat11.com: SEM - Paid Inclusion Doesn't Seem To Be Helping
... Google, ... I Thought Paid Inclusion Would Help, So Why Are My Pages Not Ranked Better? ... +Our Tutorial About How To Increase Visitors To Your Website. ... +
www.chat11.com/ SEM_-_Paid_Inclusion_Doesn't_Seem_To_Be_Helping - 17k - Cached - Similar pages

Data Transformation Services for SQL Server 2005: Frequently Asked ...
... Tuesday, November 23, 2004. .: Home Articles/Tutorials SQL_Server : Data Transformation +Services for SQL Server 2005: Frequently Asked Design Questions. ... +
www.wwwcoder.com/main/parentid/ 191/site/3373/68/default.aspx - 47k - Cached - Similar pages

Programming Articles on webservices.xml.com
... month's XML Endpoints column, Rich Salz explains how to process SOAP ... Google's Gaffe. +By Paul Prescod Paul Prescod explains why moving its API to use ... +
webservices.xml.com/programming/ - 38k - 5 Dec 2004 - Cached - Similar pages

HTML Help FAQs
... This is a nice site found using Google: ... Borland Delphi and HH. Free code examples +show you how to program the HTML Help API via Borland Delphi. ... +
www.helpware.net/FAR/far_faq.htm - 101k - 5 Dec 2004 - Cached - Similar pages

Ruminations
... Frequently Asked Questions, Getting Started with Radio UserLand, Tips, and Tutorials. ... +Using the Google API with Radio and Frontier - How to make requests ... +
ruminations.weblogger.com/ - 27k - 5 Dec 2004 - Cached - Similar pages

Google launches its Deskbar API
... a big difference in your rankings and our most popular ** How To ** section The ... Deskbar +API can be found here: http://deskbar.google.com/help/api/index.html ... +
news-01.rankforsales.com/news-bf/889-seo-nov-22-04.html - 18k - 6 Dec 2004 - Cached - Similar pages

Java FAQ - Frequently Asked Questions
... Search google. ... The JAI API is the subject of discussion in this Sun sponsored mailing ... +Java FAQ is written and maintained by Andrew Thompson, with help from the ... +
www.physci.org/codes/javafaq.jsp - 53k - Cached - Similar pages

Frequently Asked Questions - comp.lang.java.gui
... first document has requested a notice that he is not a help desk for ... 7.10 Java 3D +API. ... see news:comp.lang.java.3d http://groups.google.com/groups?group=comp.lang ... +
www.physci.org/guifaq.jsp - 44k - Cached - Similar pages

GoogleDuel - About
... Asked Questions (FAQ) An old Frequently Asked Questions list ... sample source code which +illustrates how to use the ... SOAP library to call the Google API from PHP. ... +
www.googleduel.com/about.php - 12k - Cached - Similar pages

Search engine articles, tools, links and resources
... Search Engine Help by Highrankings Search Engine Features Chart ... top Guide to frames +usage How to Optimize a ... Enumeration Google Count - uses Google API Go Rank ... +
www.bearcanyonseo.com/tips_links.html - 29k - Cached - Similar pages

OpenOffice.org FAQ
... Most Frequently Asked Questions On using OpenOffice.org software in ... printing with +the binaries, the help system, licensing ... API FAQ Questions and answers on the ... +
www.openoffice.org/faq.html - 10k - Cached - Similar pages

hey Google - don't auto-update my toolbar!
Google Toolbar, Desktop Search, and API Topics. ... Google, there is absolutely no need +for this. ... Asked Questions section of the toolbar help: http://toolbar.google ... +
www.webmasterworld.com/forum80/457-9-10.htm - Similar pages

hey Google - don't auto-update my toolbar!
Google Toolbar, Desktop Search, and API Topics. ... then the very first link is to the +toolbar help page. ... If Google is willing to support use of the toolbar without ... +
www.webmasterworld.com/forum80/457-10-10.htm - Similar pages
[ More results from www.webmasterworld.com ]

Michel Olagnon's Fortran 90 List
... programs and Microsoft Windows Open Database Connectivity (ODBC) API. ... 3.7 - Other +places for Help on Fortran 90. ... ftp.cs.unm.edu; Free Software; How to get Fortran ... +
www.kcl.ac.uk/kis/support/cc/fortran/engfaq.html - 56k - Cached - Similar pages

Frequently Asked Questions - Confluence
... exporting, searchable attachments, a comprehensive remote API, easy installation ... +starting up to tell it how to use its ... If you need help with a particular server ... +
confluence.atlassian.com/ display/DOC/Frequently+Asked+Questions - 35k - 5 Dec 2004 - Cached - Similar pages

Frequently Asked Questions - Confluence
... I figured-out how to add an inline image. ... page hierachies, page subscription, online +help, WebDAV file storage, a more comprehensive remote API... ... +
confluence.atlassian.com/display/DOC/ Frequently+Asked+Questions?focusedCommentId=11067 - 72k - Cached - Similar pages
[ More results from confluence.atlassian.com ]

Bookmarks for bradg at videotron.ca
... The Mother of All Search Engines Google SEARCH.COM ... J2EE API Java(TM) SE Platform +Documentation Servlets ... Franck Allimant - Accueil (Win JDK Help Files) Getting ... +
pages.videotron.com/gbradet/home_bm.htm - 30k - Cached - Similar pages

Resources for Java server-side developers: CLDC - Bluetooth API ...
... Applications by Qusay H. Mahmoud This two-part series of articles will show you +how to use J2ME ... Home > J2ME Technologies > CLDC - Bluetooth API (JSR-82). Google, ... +
www.java201.com/resources/browse/126-all.html - 13k - Cached - Similar pages

Viv?simo // Frequently Asked Questions
... just a small sampling of who we can help: Researchers; Support ... well we work on top +of the Google Appliance ... delivered as aC software library with an API; they run ... +
vivisimo.com/html/faq - 31k - Cached - Similar pages

DataPower: Technical Resources
... Headers DataPower chief security architect Rich Salz explains how to process SOAP ... +of WSDL, with particular reference to the new Google web services API. ... +
www.datapower.com/xmldev/tech_resources.html - 19k - 5 Dec 2004 - Cached - Similar pages

Search Results | MySmartChannels
... Search Google, ... MySmartChannels I agree that actually trying out the different SQL +functions on a computer will help with the ... Is there an API to MySmartChannels? ... +
myst-technology.com/mysmartchannels/ public/search?q=mysmartchannels&scheme=standalone - 101k - Cached - Similar pages

Macromedia -UltraDevTechNotes:UltraDev Technical FAQ (Frequently ...
... Printable instructions on how to create objects and server behaviors using UltraDev's +JavaScript API are available ... Search powered by Powered by Google. +
www.macromedia.com/support/ ultradev/ts/documents/ultradev_faq.htm - 28k - Cached - Similar pages

Mensniche.com Forum - Main Forum
... SG Forum - Great Resource; need help; PPC Results; 404 Traffic; www.volume ... Meta Tags +Optimization; Pre-Sell; Google PageRank, & How to Get It; Nice Google API tool ... +
mensniche.com/forum/archive/index.php/f-2.html - 15k - Cached - Similar pages

Bookshare.org - Book Information
... new Google API, including how to build and modify scripts that can become custom +business applications based on Google. Google Hacks contains 100 tips, tricks ... +
www.bookshare.org/web/SingleTitle. html?submittitleid=19778 - 18k - Cached - Similar pages

Bookshare.org - Books by Author
... advanced search interface and the new Google API, including how ... Google Hacks contains +100 tips, tricks and scripts ... tips, tricks, and tools to help serious Mac ... +
www.bookshare.org/web/ BooksByAuthor.html?author_id=10726 - 29k - Cached - Similar pages

page87 - links
... PHP Implementation of the Google Web API System 26 ... Promotion Google ranking tips +Google's AdWords Advertising Program How to Advertise Responsibly ... +
www.page87.net/links/ - 70k - Cached - Similar pages

April 2002 | iWalt.com
... It?s an AppleScript which calls the Google API and gets the top result for your +query. ... Frequently Asked Questions. ... Help define the site. =-). ... +
www.iwalt.com/weblog/2002/04/ - 39k - Cached - Similar pages

Java Programming FAQs and Tutorials: Learning Java
... Search the Web: Google. ... Tutorials, online courses and more, to help you pass your +Java certification ... Learning how to generate high-quality printouts of components ... +
www.apl.jhu.edu/~hall/java/FAQs-and-Tutorials.html - 21k - Cached - Similar pages

Keyword density research report - Best Practices Search Engine ...
... everything come from the Google API? Did Google have to approve this? If so, +do you have any tips on getting API applications approved? ... +
www.ihelpyouservices.com/forums/ showthread.php?s=&threadid=13023 - 63k - Cached - Similar pages

Recommended Reading List / Answers to Frequently Asked Questions
... Guide Clark Connect Help Downloadable User Guides Webconfig API (For those ... relay +host(I can't send email) Help, I can ... Also, don't forget to google Note: All the ... +
www.clarkconnect.org/forums/showflat. php?Cat=&Board=howtos&Number=40192 - 31k - Cached - Similar pages

XMLhub.com Web Directory: Computers: Programming: Languages ...
... Microsoft: Visual FoxPro v3.0+ - Technical support forums and mutual help system +for ... Usenet microsoft.public.fox.vfp.lck-api - news: - Google Groups; Usenet ... +
www.xmlhub.com/dir/index/Computers/ Programming/Languages/Visual_FoxPro/ - 18k - Cached - Similar pages

Forum FAQ - GameDev.Net Discussion Forums
... If you're looking for API specific tutorials, here are some of the most common to +help get you ... could easily answer yourself with a quick Google search or a ... +
www.gamedev.net/community/ forums/showfaq.asp?forum_id=31 - 32k - 5 Dec 2004 - Cached - Similar pages

NDIS Frequently Asked Questions
... The Microsoft DDK help file and DDK samples, as well as ... On the other hand, the +user-mode WMI API is fairly ... useful information is to perform a Google Search on ... +
www.ndis.com/faq/QA10290101.htm - 35k - Cached - Similar pages

Managing CruiseControl With JMX - Confluence
... It is ridiculously easy to enable controling CC using the JMX (Java Mananagement +eXtensions) api. Here's what you get : ... How to enable the JMX server. ... +
confluence.public.thoughtworks.org/ display/CC/Managing+CruiseControl+With+JMX - 26k - 6 Dec 2004 - Cached - Similar pages

Post Comment
... Gone Wild General RSS Stuff Hardware Help HijackThis Logs ... And why has the Google +API stagnated for 2.5 years ... So what should Google, MSNbot and Yahoo search (to ... +
chris.pirillo.com/blog/cmd=post_comment/ article_id=119543/parent_id=165843 - 57k - Cached - Similar pages

FWE - National Headquarters - Job Search - View Job
... Northwest-Software Engineering GOOGLE - C++, Win32 API, and Linux Kernel Engineering +Opportunities POSTED: 9/30/2004 JOB TITLE: Software Engineer Google is ... +
www.fwe.org/p/p.asp?mlid=354&jid=1018 - 43k - Cached - Similar pages

Firefox Help: Firefox FAQ
... be able to find packages using Google. ... EWH32.api , printme.api and search.api from +plug_ins_disabled ... can convert the bookmarks with the help from BookmarkPriest ... +
www.mozilla.org/support/firefox/faq - 35k - 5 Dec 2004 - Cached - Similar pages

The Star Online Directory - FAQs, Help, and Tutorials
... Active Server Pages, and the Internet Server API. ... public.inetserver.iis.activeserverpages +- news: - Google Groups. Help build the largest human-edited directory ... +
directory.thestar.com.my/cat.asp?/Computers/ Programming/Internet/ASP/FAQs,_Help,_and_Tutorials/ - 15k - Cached - Similar pages

eMarketing Resources @ Spherica
... Rank Checker SEO Count Advanced API Rank Checker ... Google AdWords Keyword Suggestion +Tool Additional eTools Spider ... Index: Simple formula to help determine the ... +
www.spheri.ca/resources.html - 18k - 5 Dec 2004 - Cached - Similar pages

Building XML Web Services with .NET: Hands-On - Course FAQ
... Web services currently available include the Google API, Microsoft?s ... You learn how +to use the .NET System.Xml class ... Does this course help me prepare for the ... +
www.learningtree.com/courses/508qa.htm - 29k - Cached - Similar pages


Result Page: 

1

2

3

4

5

6

7

8

9

10

Next
+

 
+

Search within results | Language Tools | Search Tips | Dissatisfied? Help us improve


Google Home - Advertising Programs - Business Solutions - About Google

©2004 Google
Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google.src =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google.src 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google.src 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,29 @@ +# Mozilla/Google plug-in by amitp+mozilla at google.com + + + + + + + + + + + + Added: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_icon.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_icon.c 2007-01-20 00:35:17 UTC (rev 19872) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_icon.c 2007-01-20 02:04:51 UTC (rev 19873) @@ -0,0 +1,175 @@ +#if 0 +/* old one */ +const char google_icon_M[] = { [... truncated: 4558 lines follow ...] From mmu_man at mail.berlios.de Sat Jan 20 03:11:18 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 03:11:18 +0100 Subject: [Haiku-commits] r19874 - haiku/trunk/src/add-ons/kernel/file_systems/googlefs Message-ID: <200701200211.l0K2BIKA023731@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 03:11:17 +0100 (Sat, 20 Jan 2007) New Revision: 19874 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19874&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c Log: Disable the quite verbose debug, as I'm sure everyoen will want to test it :D Btw, to try: mkdir /google mount -t googlefs /google (in BeOS you must give a dev to mount, use /dev/zero to test) Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c 2007-01-20 02:04:51 UTC (rev 19873) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c 2007-01-20 02:11:17 UTC (rev 19874) @@ -23,7 +23,7 @@ /* just publish fake entries; for debugging */ //#define NO_SEARCH -#define DEBUG_GOOGLEFS 1 +//#define DEBUG_GOOGLEFS 1 #if DEBUG_GOOGLEFS #define PRINT(a) /*snooze(5000);*/ dprintf a From mmu_man at mail.berlios.de Sat Jan 20 03:12:48 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 03:12:48 +0100 Subject: [Haiku-commits] r19875 - haiku/trunk/src/add-ons/kernel/file_systems Message-ID: <200701200212.l0K2CmjF023818@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 03:12:47 +0100 (Sat, 20 Jan 2007) New Revision: 19875 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19875&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile Log: Get googlefs in the build; and nfs (but disable it for now). Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-01-20 02:11:17 UTC (rev 19874) +++ haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-01-20 02:12:47 UTC (rev 19875) @@ -2,5 +2,7 @@ SubInclude HAIKU_TOP src add-ons kernel file_systems dos ; SubInclude HAIKU_TOP src add-ons kernel file_systems bfs ; +SubInclude HAIKU_TOP src add-ons kernel file_systems googlefs ; SubInclude HAIKU_TOP src add-ons kernel file_systems iso9660 ; +#SubInclude HAIKU_TOP src add-ons kernel file_systems nfs ; SubInclude HAIKU_TOP src add-ons kernel file_systems udf ; From mmu_man at mail.berlios.de Sat Jan 20 03:22:58 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 03:22:58 +0100 Subject: [Haiku-commits] r19876 - haiku/trunk/build/jam Message-ID: <200701200222.l0K2MwKf024302@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 03:22:57 +0100 (Sat, 20 Jan 2007) New Revision: 19876 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19876&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: Add googlefs to the image, and the needed socket module. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-20 02:12:47 UTC (rev 19875) +++ haiku/trunk/build/jam/HaikuImage 2007-01-20 02:22:57 UTC (rev 19876) @@ -103,7 +103,7 @@ BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi config_manager $(X86_ONLY)agp usb ; -BEOS_ADD_ONS_FILESYSTEMS = bfs dos iso9660 ; +BEOS_ADD_ONS_FILESYSTEMS = bfs dos iso9660 googlefs ; # modules @@ -271,7 +271,7 @@ : keyboard mouse ; AddFilesToHaikuImage beos system add-ons input_server filters : screen_saver ; AddFilesToHaikuImage beos system add-ons kernel network - : stack ; + : stack socket ; AddFilesToHaikuImage beos system add-ons kernel network devices : $(BEOS_NETWORK_DEVICES) ; AddFilesToHaikuImage beos system add-ons kernel network datalink_protocols From darkwyrm at mail.berlios.de Sat Jan 20 04:18:12 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Sat, 20 Jan 2007 04:18:12 +0100 Subject: [Haiku-commits] r19877 - haiku/trunk/src/apps/showimage Message-ID: <200701200318.l0K3IC4D028538@sheep.berlios.de> Author: darkwyrm Date: 2007-01-20 04:18:10 +0100 (Sat, 20 Jan 2007) New Revision: 19877 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19877&view=rev Modified: haiku/trunk/src/apps/showimage/ResizerWindow.cpp haiku/trunk/src/apps/showimage/ShowImageView.cpp haiku/trunk/src/apps/showimage/ShowImageWindow.cpp haiku/trunk/src/apps/showimage/ShowImageWindow.h Log: Removed "Stippled Zooming" item and made dithering automatic in 8-bit screen mode "Keep Proportions" in resizing window became "Keep Original Proportions", which was suggested by korli and is the best suggestion IMO Bilinear scaling is on by default I like ShowImage's menus now. :^) Modified: haiku/trunk/src/apps/showimage/ResizerWindow.cpp =================================================================== --- haiku/trunk/src/apps/showimage/ResizerWindow.cpp 2007-01-20 02:22:57 UTC (rev 19876) +++ haiku/trunk/src/apps/showimage/ResizerWindow.cpp 2007-01-20 03:18:10 UTC (rev 19877) @@ -43,7 +43,7 @@ static const char* kWidthLabel = "Width:"; static const char* kHeightLabel = "Height:"; -static const char* kKeepAspectRatioLabel = "Keep Proportions"; +static const char* kKeepAspectRatioLabel = "Keep Original Proportions"; static const char* kApplyLabel = "Apply"; static const float kLineDistance = 5; @@ -65,7 +65,7 @@ const float column2 = max_c(widthLabelWidth, heightLabelWidth); const float textControlWidth = column2 + back_view->StringWidth("999999"); - const float keepAspectRatioLabelWidth = 15 + back_view->StringWidth(kKeepAspectRatioLabel); + const float keepAspectRatioLabelWidth = 20 + back_view->StringWidth(kKeepAspectRatioLabel); const float width2 = 2 * kHorizontalIndent + max_c(textControlWidth, keepAspectRatioLabelWidth); ResizeTo(width2+1, Bounds().Height()+1); Modified: haiku/trunk/src/apps/showimage/ShowImageView.cpp =================================================================== --- haiku/trunk/src/apps/showimage/ShowImageView.cpp 2007-01-20 02:22:57 UTC (rev 19876) +++ haiku/trunk/src/apps/showimage/ShowImageView.cpp 2007-01-20 03:18:10 UTC (rev 19877) @@ -181,7 +181,7 @@ settings = my_app->Settings(); InitPatterns(); - fDither = false; + fDither = BScreen().ColorSpace() == B_CMAP8; fBitmap = NULL; fDisplayBitmap = NULL; fSelBitmap = NULL; @@ -197,7 +197,7 @@ fShowCaption = false; fZoom = 1.0; fMovesImage = false; - fScaleBilinear = false; + fScaleBilinear = true; fScaler = NULL; #if DELAYED_SCALING fScalingCountDown = SCALING_DELAY_TIME; Modified: haiku/trunk/src/apps/showimage/ShowImageWindow.cpp =================================================================== --- haiku/trunk/src/apps/showimage/ShowImageWindow.cpp 2007-01-20 02:22:57 UTC (rev 19876) +++ haiku/trunk/src/apps/showimage/ShowImageWindow.cpp 2007-01-20 03:18:10 UTC (rev 19877) @@ -246,7 +246,6 @@ menu->AddSeparatorItem(); AddItemMenu(menu, "High-Quality Zooming", MSG_SCALE_BILINEAR, 0, 0, 'W', true); - AddItemMenu(menu, "Stippled Zooming", MSG_DITHER_IMAGE, 0, 0, 'W', true); menu->AddSeparatorItem(); @@ -1197,4 +1196,9 @@ } +void +ShowImageWindow::ScreenChanged(BRect frame, color_space mode) +{ + fImageView->SetDither(mode == B_CMAP8); +} Modified: haiku/trunk/src/apps/showimage/ShowImageWindow.h =================================================================== --- haiku/trunk/src/apps/showimage/ShowImageWindow.h 2007-01-20 02:22:57 UTC (rev 19876) +++ haiku/trunk/src/apps/showimage/ShowImageWindow.h 2007-01-20 03:18:10 UTC (rev 19877) @@ -43,6 +43,7 @@ virtual void FrameResized(float width, float height); virtual void MessageReceived(BMessage *message); virtual bool QuitRequested(); + virtual void ScreenChanged(BRect frame, color_space mode); // virtual void Zoom(BPoint origin, float width, float height); status_t InitCheck(); From axeld at mail.berlios.de Sat Jan 20 13:49:44 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sat, 20 Jan 2007 13:49:44 +0100 Subject: [Haiku-commits] r19878 - in haiku/trunk: headers/private/kernel src/system/kernel/vm Message-ID: <200701201249.l0KCniBO027358@sheep.berlios.de> Author: axeld Date: 2007-01-20 13:49:44 +0100 (Sat, 20 Jan 2007) New Revision: 19878 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19878&view=rev Modified: haiku/trunk/headers/private/kernel/vm_types.h haiku/trunk/src/system/kernel/vm/vm_cache.c Log: * Mixed consumer with consumerRef to identify the cache in the consumer list; this fixes bug #227 again (which I recently opened again accidently). * We actually switched the last consumer's source without having acquired its lock! This fixes some rare random app crashes as well as potential kernel crash ("cache to be deleted still has consumers"). * Some more comments to explain why things are done and can be done the way they are done :-) Modified: haiku/trunk/headers/private/kernel/vm_types.h =================================================================== --- haiku/trunk/headers/private/kernel/vm_types.h 2007-01-20 03:18:10 UTC (rev 19877) +++ haiku/trunk/headers/private/kernel/vm_types.h 2007-01-20 12:49:44 UTC (rev 19878) @@ -92,7 +92,7 @@ uint32 protection; uint16 wiring; uint16 memory_type; - int32 ref_count; + vint32 ref_count; struct vm_cache_ref *cache_ref; off_t cache_offset; Modified: haiku/trunk/src/system/kernel/vm/vm_cache.c =================================================================== --- haiku/trunk/src/system/kernel/vm/vm_cache.c 2007-01-20 03:18:10 UTC (rev 19877) +++ haiku/trunk/src/system/kernel/vm/vm_cache.c 2007-01-20 12:49:44 UTC (rev 19878) @@ -407,12 +407,12 @@ void vm_cache_remove_consumer(vm_cache_ref *cacheRef, vm_cache *consumer) { - vm_cache *newSource = NULL; vm_cache *cache; TRACE(("remove consumer vm cache %p from cache %p\n", consumer, cacheRef->cache)); ASSERT_LOCKED_MUTEX(&consumer->ref->lock); + // remove the consumer from the cache, but keep its reference until later mutex_lock(&cacheRef->lock); cache = cacheRef->cache; list_remove_item(&cache->consumers, consumer); @@ -427,17 +427,22 @@ bool merge = false; consumer = list_get_first_item(&cache->consumers); - consumerRef = consumer->ref; // Our cache doesn't have a ref to its consumer (only the other way around), // so we cannot just acquire it here; it might be deleted right now while (true) { - int32 count = consumerRef->ref_count; + int32 count; + consumerRef = consumer->ref; + + count = consumerRef->ref_count; if (count == 0) break; if (atomic_test_and_set(&consumerRef->ref_count, count + 1, count) == count) { - // we managed to grab a reference to the consumer + // We managed to grab a reference to the consumerRef. + // Since this doesn't guarantee that we get the cache we wanted + // to, we need to check if this cache is really the last + // consumer of the cache we want to merge it with. merge = true; break; } @@ -453,10 +458,12 @@ // the cache and the situation might have changed cache = cacheRef->cache; + consumer = consumerRef->cache; + if (cacheRef->areas != NULL || cache->source == NULL || list_is_empty(&cache->consumers) || cache->consumers.link.next != cache->consumers.link.prev - || consumerRef != list_get_first_item(&cache->consumers)) { + || consumer != list_get_first_item(&cache->consumers)) { merge = false; mutex_unlock(&consumerRef->lock); } @@ -464,6 +471,7 @@ if (merge) { vm_page *page, *nextPage; + vm_cache *newSource; consumer = list_remove_head_item(&cache->consumers); @@ -488,27 +496,28 @@ } newSource = cache->source; + if (newSource != NULL) { + // The remaining consumer has gotten a new source + mutex_lock(&newSource->ref->lock); + + list_remove_item(&newSource->consumers, cache); + list_add_item(&newSource->consumers, consumer); + consumer->source = newSource; + cache->source = NULL; + + mutex_unlock(&newSource->ref->lock); + + // Release the other reference to the cache - we take over + // its reference of its source cache; we can do this here + // (with the cacheRef locked) since we own another reference + // from the first consumer we removed + vm_cache_release_ref(cacheRef); + } mutex_unlock(&consumerRef->lock); } vm_cache_release_ref(consumerRef); } - if (newSource != NULL) { - // The remaining consumer has gotten a new source - mutex_lock(&newSource->ref->lock); - - list_remove_item(&newSource->consumers, cache); - list_add_item(&newSource->consumers, consumer); - consumer->source = newSource; - cache->source = NULL; - - mutex_unlock(&newSource->ref->lock); - - // Release the other reference to the cache - we take over - // its reference of its source cache - vm_cache_release_ref(cacheRef); - } - mutex_unlock(&cacheRef->lock); vm_cache_release_ref(cacheRef); } From mmu_man at mail.berlios.de Sat Jan 20 15:12:55 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 15:12:55 +0100 Subject: [Haiku-commits] r19879 - haiku/trunk/src/add-ons/kernel/file_systems/nfs Message-ID: <200701201412.l0KECtTi031955@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 15:12:54 +0100 (Sat, 20 Jan 2007) New Revision: 19879 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19879&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/XDRInPacket.c haiku/trunk/src/add-ons/kernel/file_systems/nfs/XDROutPacket.c haiku/trunk/src/add-ons/kernel/file_systems/nfs/fsproto.h haiku/trunk/src/add-ons/kernel/file_systems/nfs/makefile haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.h Log: NFS now builds for Haiku. Still needs fixes to be able to mount. Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/XDRInPacket.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/XDRInPacket.c 2007-01-20 12:49:44 UTC (rev 19878) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/XDRInPacket.c 2007-01-20 14:12:54 UTC (rev 19879) @@ -1,7 +1,7 @@ #include "XDRInPacket.h" #include #include -#include +#include extern void XDRInPacketInit(struct XDRInPacket *packet) Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/XDROutPacket.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/XDROutPacket.c 2007-01-20 12:49:44 UTC (rev 19878) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/XDROutPacket.c 2007-01-20 14:12:54 UTC (rev 19879) @@ -2,7 +2,7 @@ #include #include -#include +#include extern const uint8 * XDROutPacketBuffer(struct XDROutPacket *packet) Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/fsproto.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/fsproto.h 2007-01-20 12:49:44 UTC (rev 19878) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/fsproto.h 2007-01-20 14:12:54 UTC (rev 19879) @@ -1,7 +1,8 @@ #ifndef _FSPROTO_H #define _FSPROTO_H -#include +//#include +#include #include #include #include Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/makefile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/makefile 2007-01-20 12:49:44 UTC (rev 19878) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/makefile 2007-01-20 14:12:54 UTC (rev 19879) @@ -215,5 +215,5 @@ LANG_FILES_DIR := -## include $(BUILD_SCRIPT_DIR)/the makefile-engine -include $(BUILD_SCRIPT_DIR)/makefile-engine.zeta +##include $(BUILD_SCRIPT_DIR)/the makefile-engine +include $(BUILDHOME)/etc/makefile-engine Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-01-20 12:49:44 UTC (rev 19878) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-01-20 14:12:54 UTC (rev 19879) @@ -14,8 +14,12 @@ #include #include #include +#include #include +#ifndef UDP_SIZE_MAX +#define UDP_SIZE_MAX 65515 +#endif #define B_UDP_MAX_SIZE UDP_SIZE_MAX /* declare gSocket and others */ @@ -51,74 +55,6 @@ //#define my_notify_listener(p_a, p_b, p_c, p_d, p_e, p_f) ({dprintf("nfs: notify_listener(%08lx)\n", p_a); notify_listener(p_a, p_b, p_c, p_d, p_e, p_f); }) #define my_notify_listener notify_listener -_EXPORT vnode_ops fs_entry = -{ - (op_read_vnode *)&fs_read_vnode, - (op_write_vnode *)&fs_write_vnode, - (op_remove_vnode *)&fs_remove_vnode, - (op_secure_vnode *)&fs_secure_vnode, - (op_walk *)&fs_walk, - (op_access *)&fs_access, - (op_create *)&fs_create, - (op_mkdir *)&fs_mkdir, - (op_symlink *)&fs_symlink, - NULL, // &fs_link, - (op_rename *)&fs_rename, - (op_unlink *)&fs_unlink, - (op_rmdir *)&fs_rmdir, - (op_readlink *)&fs_readlink, - (op_opendir *)&fs_opendir, - (op_closedir *)&fs_closedir, - (op_free_cookie *)&fs_free_dircookie, - (op_rewinddir *)&fs_rewinddir, - (op_readdir *)&fs_readdir, - (op_open *)&fs_open, - (op_close *)&fs_close, - (op_free_cookie *)&fs_free_cookie, - (op_read *)&fs_read, - (op_write *)&fs_write, - NULL, // &fs_readv, - NULL, // &fs_writev, - NULL, // &fs_ioctl, - NULL, // &fs_setflags, - (op_rstat *)&fs_rstat, - (op_wstat *)&fs_wstat, - NULL, // &fs_fsync, - NULL, // &fs_initialize, - (op_mount *)&fs_mount, - (op_unmount *)&fs_unmount, - NULL, // &fs_sync, - (op_rfsstat *)&fs_rfsstat, - (op_wfsstat *)&fs_wfsstat, - NULL, // &fs_select, - NULL, // &fs_deselect, - NULL, // &fs_open_indexdir, - NULL, // &fs_close_indexdir, - NULL, // &fs_free_indexdircookie, - NULL, // &fs_rewind_indexdir, - NULL, // &fs_read_indexdir, - NULL, // &fs_create_index, - NULL, // &fs_remove_index, - NULL, // &fs_rename_index, - NULL, // &fs_stat_index, - NULL, // &fs_open_attrdir, - NULL, // &fs_close_attrdir, - NULL, // &fs_free_attrdircookie, - NULL, // &fs_rewind_attrdir, - NULL, // &fs_read_attrdir, - NULL, // &fs_write_attr, - NULL, // &fs_read_attr, - NULL, // &fs_remove_attr, - NULL, // &fs_rename_attr, - NULL, // &fs_stat_attr, - NULL, // &fs_open_query, - NULL, // &fs_close_query, - NULL, // &fs_free_querycookie, - NULL, // &fs_read_query -}; - -_EXPORT int32 api_version=B_CUR_FS_API_VERSION; - static vint32 refcount = 0; /* we only want to read the config once ? */ static status_t read_config(void) @@ -236,7 +172,7 @@ { status_t result; - ns->tid=spawn_kernel_thread ((thread_func)postoffice_func,"Postoffice",B_NORMAL_PRIORITY,ns); + ns->tid=spawn_kernel_thread ((thread_func)postoffice_func,"NFSv2 Postoffice",B_NORMAL_PRIORITY,ns); if (ns->tidtid; @@ -876,7 +812,11 @@ } extern int +#ifdef __HAIKU__ +fs_read_vnode(fs_nspace *ns, vnode_id vnid, fs_node **node, char r) +#else fs_read_vnode(fs_nspace *ns, vnode_id vnid, char r, fs_node **node) +#endif { fs_node *current; @@ -904,13 +844,29 @@ } extern int +#ifdef __HAIKU__ +fs_release_vnode(fs_nspace *ns, fs_node *node, char r) +#else fs_write_vnode(fs_nspace *ns, fs_node *node, char r) +#endif { return B_OK; } +#ifdef __HAIKU__ +extern int +fs_get_vnode_name(fs_nspace *ns, fs_node *node, char *buffer, size_t len) +{ + return ENOSYS; +} +#endif + extern int +#ifdef __HAIKU__ +fs_walk(fs_nspace *ns, fs_node *base, const char *file, vnode_id *vnid, int *type) +#else fs_walk(fs_nspace *ns, fs_node *base, const char *file, char **newpath, vnode_id *vnid) +#endif { bool isLink; fs_node *dummy; @@ -920,6 +876,9 @@ if (!strcmp(".",file)) { *vnid=base->vnid; +#ifdef __HAIKU__ + *type = S_IFDIR; +#endif isLink=false; } else @@ -936,6 +895,9 @@ newNode->vnid=st.st_ino; *vnid=newNode->vnid; +#ifdef __HAIKU__ + *type = st.st_mode & S_IFMT; +#endif insert_node (ns,newNode); @@ -945,6 +907,7 @@ if ((result=get_vnode (ns->nsid,*vnid,(void **)&dummy))nsid,*vnid); } +#endif return B_OK; } @@ -1005,8 +969,12 @@ return B_OK; } -extern int +extern int +#ifdef __HAIKU__ +fs_readdir(fs_nspace *ns, fs_node *node, nfs_cookie *cookie, struct dirent *buf, size_t bufsize, uint32 *num) +#else fs_readdir(fs_nspace *ns, fs_node *node, nfs_cookie *cookie, long *num, struct dirent *buf, size_t bufsize) +#endif { int32 max=*num; int32 eof; @@ -1171,12 +1139,20 @@ extern int -fs_mount(nspace_id nsid, const char *devname, ulong flags, struct mount_nfs_params *parms, size_t len, fs_nspace **data, vnode_id *vnid) +#ifdef __HAIKU__ +fs_mount(nspace_id nsid, const char *devname, uint32 flags, const char *_parms, fs_nspace **data, vnode_id *vnid) +#else +fs_mount(nspace_id nsid, const char *devname, ulong flags, const char *_parms, size_t len, fs_nspace **data, vnode_id *vnid) +#endif { + struct mount_nfs_params *parms = (struct mount_nfs_params *)_parms; // XXX: FIXME status_t result; fs_nspace *ns; fs_node *rootNode; struct stat st; +#ifndef __HAIKU__ + (void) len; +#endif if (parms==NULL) return EINVAL; @@ -1213,6 +1189,7 @@ ns->mountAddr.sin_addr.s_addr=htonl(parms->serverIP); memset (ns->mountAddr.sin_zero,0,sizeof(ns->mountAddr.sin_zero)); + // XXX: cleanup error handling if ((result=create_socket(ns))rootid; - if ((result=new_vnode(nsid,*vnid,rootNode))sem); free(rootNode); @@ -1373,6 +1350,11 @@ ns->first=next; } + // Unlike in BeOS, we need to put the reference to our root node ourselves +#ifdef __HAIKU__ + put_vnode(ns->nsid, ns->rootid); +#endif + delete_sem (ns->sem); shutdown_postoffice(ns); fs_nspaceDestroy (ns); @@ -1699,8 +1681,11 @@ } extern int -fs_create(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, vnode_id *vnid, - fs_file_cookie **cookie) +#ifdef __HAIKU__ +fs_create(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, fs_file_cookie **cookie, vnode_id *vnid) +#else +fs_create(fs_nspace *ns, fs_node *dir, const char *name, int omode, int perms, vnode_id *vnid, fs_file_cookie **cookie) +#endif { nfs_fhandle fhandle; struct stat st; @@ -1931,11 +1916,13 @@ return B_OK; } +#ifndef __HAIKU__ extern int fs_secure_vnode(fs_nspace *ns, fs_node *node) { return B_OK; } +#endif extern int fs_mkdir(fs_nspace *ns, fs_node *dir, const char *name, int perms) @@ -1959,11 +1946,12 @@ if (result==B_OK) { void *dummy; - if ((result=get_vnode(ns->nsid,st.st_ino,&dummy))nsid,st.st_ino,&dummy)) +# include +# include +typedef dev_t nspace_id; +# define WSTAT_MODE FS_WRITE_STAT_MODE +# define WSTAT_UID FS_WRITE_STAT_UID +# define WSTAT_GID FS_WRITE_STAT_GID +# define WSTAT_SIZE FS_WRITE_STAT_SIZE +# define WSTAT_ATIME FS_WRITE_STAT_ATIME +# define WSTAT_MTIME FS_WRITE_STAT_MTIME +# define WSTAT_CRTIME FS_WRITE_STAT_CRTIME + +#else +# include "fsproto.h" +# define publish_vnode new_vnode +#endif + + #include "RPCPendingCalls.h" #include "XDROutPacket.h" #include "XDRInPacket.h" @@ -69,6 +88,7 @@ typedef struct fs_file_cookie fs_file_cookie; typedef struct nfs_fhandle nfs_fhandle; +#if 0 int fs_read_vnode(fs_nspace *ns, vnode_id vnid, char r, fs_node **node); int fs_write_vnode(fs_nspace *ns, fs_node *node, char r); @@ -116,6 +136,7 @@ int fs_symlink(fs_nspace *ns, fs_node *dir, const char *name, const char *path); +#endif status_t create_socket (fs_nspace *ns); status_t init_postoffice (fs_nspace *ns); From mmu_man at mail.berlios.de Sat Jan 20 15:13:45 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 15:13:45 +0100 Subject: [Haiku-commits] r19880 - haiku/trunk/src/add-ons/kernel/file_systems Message-ID: <200701201413.l0KEDjwk032043@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 15:13:45 +0100 (Sat, 20 Jan 2007) New Revision: 19880 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19880&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile Log: iAdd nfs to the build Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-01-20 14:12:54 UTC (rev 19879) +++ haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-01-20 14:13:45 UTC (rev 19880) @@ -4,5 +4,5 @@ SubInclude HAIKU_TOP src add-ons kernel file_systems bfs ; SubInclude HAIKU_TOP src add-ons kernel file_systems googlefs ; SubInclude HAIKU_TOP src add-ons kernel file_systems iso9660 ; -#SubInclude HAIKU_TOP src add-ons kernel file_systems nfs ; +SubInclude HAIKU_TOP src add-ons kernel file_systems nfs ; SubInclude HAIKU_TOP src add-ons kernel file_systems udf ; From mmu_man at mail.berlios.de Sat Jan 20 15:15:40 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 15:15:40 +0100 Subject: [Haiku-commits] r19881 - haiku/trunk/build/jam Message-ID: <200701201415.l0KEFeXN032239@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 15:15:40 +0100 (Sat, 20 Jan 2007) New Revision: 19881 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19881&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: Add nfs to the image Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-20 14:13:45 UTC (rev 19880) +++ haiku/trunk/build/jam/HaikuImage 2007-01-20 14:15:40 UTC (rev 19881) @@ -103,7 +103,7 @@ BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi config_manager $(X86_ONLY)agp usb ; -BEOS_ADD_ONS_FILESYSTEMS = bfs dos iso9660 googlefs ; +BEOS_ADD_ONS_FILESYSTEMS = bfs dos googlefs iso9660 nfs ; # modules From laplace at mail.berlios.de Sat Jan 20 16:52:59 2007 From: laplace at mail.berlios.de (laplace at BerliOS) Date: Sat, 20 Jan 2007 16:52:59 +0100 Subject: [Haiku-commits] r19882 - in haiku/trunk: headers/private/print headers/private/print/libprint headers/private/print/utils src/add-ons/print/drivers/canon_lips/lips3 src/add-ons/print/drivers/canon_lips/lips4 src/add-ons/print/drivers/pcl5 src/add-ons/print/drivers/pcl6 src/add-ons/print/drivers/pdf/source src/add-ons/print/drivers/postscript src/add-ons/print/drivers/preview src/add-ons/print/drivers/shared src/add-ons/print/drivers/shared/libprint src/add-ons/print/drivers/shared/utils src/add-ons/print/shared src/add-ons/print/transports/lpr src/servers/print src/servers/print/shared Message-ID: <200701201552.l0KFqxlX004857@sheep.berlios.de> Author: laplace Date: 2007-01-20 16:52:37 +0100 (Sat, 20 Jan 2007) New Revision: 19882 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19882&view=rev Added: haiku/trunk/headers/private/print/libprint/StatusWindow.h haiku/trunk/headers/private/print/utils/ haiku/trunk/headers/private/print/utils/InterfaceUtils.h haiku/trunk/headers/private/print/utils/MarginView.h haiku/trunk/headers/private/print/utils/Utils.h haiku/trunk/src/add-ons/print/drivers/pdf/source/AboutText.cpp haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFSystem.h haiku/trunk/src/add-ons/print/drivers/shared/libprint/StatusWindow.cpp haiku/trunk/src/add-ons/print/drivers/shared/utils/ haiku/trunk/src/add-ons/print/drivers/shared/utils/InterfaceUtils.cpp haiku/trunk/src/add-ons/print/drivers/shared/utils/Jamfile haiku/trunk/src/add-ons/print/drivers/shared/utils/MarginView.cpp haiku/trunk/src/add-ons/print/drivers/shared/utils/Utils.cpp Removed: haiku/trunk/headers/private/print/libprint/MarginView.h haiku/trunk/src/add-ons/print/drivers/pdf/source/InterfaceUtils.cpp haiku/trunk/src/add-ons/print/drivers/pdf/source/InterfaceUtils.h haiku/trunk/src/add-ons/print/drivers/pdf/source/Utils.cpp haiku/trunk/src/add-ons/print/drivers/pdf/source/Utils.h haiku/trunk/src/add-ons/print/drivers/preview/InterfaceUtils.cpp haiku/trunk/src/add-ons/print/drivers/preview/InterfaceUtils.h haiku/trunk/src/add-ons/print/drivers/preview/MarginView.cpp haiku/trunk/src/add-ons/print/drivers/preview/MarginView.h haiku/trunk/src/add-ons/print/drivers/preview/Utils.cpp haiku/trunk/src/add-ons/print/drivers/preview/Utils.h haiku/trunk/src/add-ons/print/drivers/shared/libprint/MarginView.cpp Modified: haiku/trunk/headers/private/print/BeUtils.h haiku/trunk/headers/private/print/PrintJobReader.h haiku/trunk/headers/private/print/PrintTransport.h haiku/trunk/headers/private/print/PrintTransportAddOn.h haiku/trunk/headers/private/print/Template.h haiku/trunk/headers/private/print/libprint/GraphicsDriver.h haiku/trunk/headers/private/print/libprint/JobData.h haiku/trunk/headers/private/print/libprint/JobSetupDlg.h haiku/trunk/headers/private/print/libprint/Preview.h haiku/trunk/src/add-ons/print/drivers/canon_lips/lips3/Jamfile haiku/trunk/src/add-ons/print/drivers/canon_lips/lips4/Jamfile haiku/trunk/src/add-ons/print/drivers/pcl5/Jamfile haiku/trunk/src/add-ons/print/drivers/pcl6/Jamfile haiku/trunk/src/add-ons/print/drivers/pcl6/PCL6.cpp haiku/trunk/src/add-ons/print/drivers/pcl6/PCL6.h haiku/trunk/src/add-ons/print/drivers/pcl6/PCL6Cap.cpp haiku/trunk/src/add-ons/print/drivers/pcl6/PCL6Config.h haiku/trunk/src/add-ons/print/drivers/pcl6/PCL6Entry.cpp haiku/trunk/src/add-ons/print/drivers/pdf/source/Jamfile haiku/trunk/src/add-ons/print/drivers/pdf/source/JobSetupWindow.cpp haiku/trunk/src/add-ons/print/drivers/pdf/source/Link.cpp haiku/trunk/src/add-ons/print/drivers/pdf/source/Link.h haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFWriter.h haiku/trunk/src/add-ons/print/drivers/pdf/source/PrinterDriver.cpp haiku/trunk/src/add-ons/print/drivers/pdf/source/PrinterDriver.h haiku/trunk/src/add-ons/print/drivers/pdf/source/PrinterSettings.cpp haiku/trunk/src/add-ons/print/drivers/pdf/source/StatusWindow.cpp haiku/trunk/src/add-ons/print/drivers/pdf/source/StatusWindow.h haiku/trunk/src/add-ons/print/drivers/postscript/Jamfile haiku/trunk/src/add-ons/print/drivers/preview/Driver.cpp haiku/trunk/src/add-ons/print/drivers/preview/Driver.h haiku/trunk/src/add-ons/print/drivers/preview/Jamfile haiku/trunk/src/add-ons/print/drivers/preview/JobSetupWindow.cpp haiku/trunk/src/add-ons/print/drivers/preview/JobSetupWindow.h haiku/trunk/src/add-ons/print/drivers/preview/PageSetupWindow.cpp haiku/trunk/src/add-ons/print/drivers/preview/PageSetupWindow.h haiku/trunk/src/add-ons/print/drivers/preview/Preview.cpp haiku/trunk/src/add-ons/print/drivers/preview/Preview.h haiku/trunk/src/add-ons/print/drivers/preview/PreviewDriver.cpp haiku/trunk/src/add-ons/print/drivers/preview/PreviewDriver.h haiku/trunk/src/add-ons/print/drivers/preview/PrinterDriver.cpp haiku/trunk/src/add-ons/print/drivers/preview/PrinterDriver.h haiku/trunk/src/add-ons/print/drivers/preview/PrinterSetupWindow.cpp haiku/trunk/src/add-ons/print/drivers/preview/PrinterSetupWindow.h haiku/trunk/src/add-ons/print/drivers/shared/Jamfile haiku/trunk/src/add-ons/print/drivers/shared/libprint/GraphicsDriver.cpp haiku/trunk/src/add-ons/print/drivers/shared/libprint/Jamfile haiku/trunk/src/add-ons/print/drivers/shared/libprint/JobData.cpp haiku/trunk/src/add-ons/print/drivers/shared/libprint/JobSetupDlg.cpp haiku/trunk/src/add-ons/print/drivers/shared/libprint/PageSetupDlg.cpp haiku/trunk/src/add-ons/print/drivers/shared/libprint/Preview.cpp haiku/trunk/src/add-ons/print/drivers/shared/libprint/PrinterData.cpp haiku/trunk/src/add-ons/print/drivers/shared/libprint/PrinterDriver.cpp haiku/trunk/src/add-ons/print/shared/Jamfile haiku/trunk/src/add-ons/print/transports/lpr/LprSetupDlg.cpp haiku/trunk/src/servers/print/Jamfile haiku/trunk/src/servers/print/shared/BeUtils.cpp haiku/trunk/src/servers/print/shared/Jamfile Log: Some printing related improvements: * libprint based drivers can now show a preview window and show progress window while printing contributed in part by Hartmut Reh. * Libprint and PCL6 driver bug fixes. * Code clean-up (removed code duplications, coding style, copyright text) Builds under Linux. Not tested under BeOS. Modified: haiku/trunk/headers/private/print/BeUtils.h =================================================================== --- haiku/trunk/headers/private/print/BeUtils.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/BeUtils.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -36,8 +36,8 @@ // DEALINGS IN THE SOFTWARE. /*****************************************************************************/ -#ifndef BEUTILS_H -#define BEUTILS_H +#ifndef _BE_UTILS_H +#define _BE_UTILS_H #include #include @@ -91,7 +91,7 @@ // mimetype from sender bool MimeTypeForSender(BMessage* sender, BString& mime); // adds fields to message or replaces existing fields -void AddFields(BMessage* to, const BMessage* from, const char* excludeList[] = NULL, const char* includeList[] = NULL); +void AddFields(BMessage* to, const BMessage* from, const char* excludeList[] = NULL, const char* includeList[] = NULL, bool overwrite = true); // load bitmap from application resources BBitmap* LoadBitmap(const char* name, uint32 type_code = B_TRANSLATOR_BITMAP); // convert bitmap to picture; view must be attached to a window! Modified: haiku/trunk/headers/private/print/PrintJobReader.h =================================================================== --- haiku/trunk/headers/private/print/PrintJobReader.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/PrintJobReader.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -27,6 +27,9 @@ */ +#ifndef _PRINT_JOB_READER_H +#define _PRINT_JOB_READER_H + #include #include @@ -80,3 +83,5 @@ status_t GetPage(int no, PrintJobPage& pjp); }; +#endif + Modified: haiku/trunk/headers/private/print/PrintTransport.h =================================================================== --- haiku/trunk/headers/private/print/PrintTransport.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/PrintTransport.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -28,8 +28,8 @@ */ -#ifndef PRINT_TRANSPORT_H -#define PRINT_TRANSPORT_H +#ifndef _PRINT_TRANSPORT_H +#define _PRINT_TRANSPORT_H #include #include Modified: haiku/trunk/headers/private/print/PrintTransportAddOn.h =================================================================== --- haiku/trunk/headers/private/print/PrintTransportAddOn.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/PrintTransportAddOn.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -27,8 +27,8 @@ */ -#ifndef PRINT_TRANSPORT_ADD_ON_H -#define PRINT_TRANSPORT_ADD_ON_H +#ifndef _PRINT_TRANSPORT_ADD_ON_H +#define _PRINT_TRANSPORT_ADD_ON_H #include #include @@ -38,4 +38,5 @@ // to be implemented by the transport add-on extern "C" BDataIO* instantiate_transport(BDirectory* printer, BMessage* msg); -#endif PRINT_TRANSPORT_ADD_ON_H +#endif + Modified: haiku/trunk/headers/private/print/Template.h =================================================================== --- haiku/trunk/headers/private/print/Template.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/Template.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -82,4 +82,4 @@ virtual void SetFontFace(int32 flags); }; -#endif _TEMPLATE_H +#endif // _TEMPLATE_H Modified: haiku/trunk/headers/private/print/libprint/GraphicsDriver.h =================================================================== --- haiku/trunk/headers/private/print/libprint/GraphicsDriver.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/libprint/GraphicsDriver.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -11,6 +11,7 @@ #include "PrintProcess.h" #include "SpoolMetaData.h" #include "Transport.h" +#include "StatusWindow.h" class BView; class BBitmap; @@ -26,7 +27,11 @@ public: GraphicsDriver(BMessage *, PrinterData *, const PrinterCap *); virtual ~GraphicsDriver(); + const JobData *getJobData(BFile *spoolFile); BMessage *takeJob(BFile *spool, uint32 flags = 0); + static BPoint getScale(int32 nup, BRect physicalRect, float scaling); + static BPoint getOffset(int32 nup, int index, JobData::Orientation orientation, const BPoint *scale, + BRect scaledPhysicalRect, BRect scaledPrintableRect, BRect physicalRect); protected: virtual bool startDoc(); @@ -58,7 +63,7 @@ GraphicsDriver &operator = (const GraphicsDriver &); private: - void setupData(BFile *file, long page_count); + bool setupData(BFile *file); void setupBitmap(); void cleanupData(); void cleanupBitmap(); @@ -91,6 +96,9 @@ int fPixelDepth; int fBandCount; int fInternalCopies; + + uint32 fPageCount; + StatusWindow *fStatusWindow; }; inline const JobData *GraphicsDriver::getJobData() const Modified: haiku/trunk/headers/private/print/libprint/JobData.h =================================================================== --- haiku/trunk/headers/private/print/libprint/JobData.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/libprint/JobData.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -206,7 +206,10 @@ */ enum Color { kMonochrome = 1, - kColor + kColor, + // Some PCL6 printers do not support compressed data + // in color mode. + kColorCompressionDisabled }; enum Settings { @@ -221,6 +224,7 @@ }; private: + bool fShowPreview; Paper fPaper; int32 fXRes; int32 fYRes; @@ -261,6 +265,9 @@ void load(BMessage *msg, const PrinterCap *cap, Settings settings); void save(BMessage *msg = NULL); + bool getShowPreview() const { return fShowPreview; } + void setShowPreview(bool showPreview) { fShowPreview = showPreview; } + Paper getPaper() const { return fPaper; } void setPaper(Paper paper) { fPaper = paper; } Modified: haiku/trunk/headers/private/print/libprint/JobSetupDlg.h =================================================================== --- haiku/trunk/headers/private/print/libprint/JobSetupDlg.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/libprint/JobSetupDlg.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -29,7 +29,7 @@ JobSetupView(BRect frame, JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap); virtual void AttachedToWindow(); virtual void MessageReceived(BMessage *msg); - bool UpdateJobData(); + bool UpdateJobData(bool showPreview); private: void UpdateButtonEnabledState(); Deleted: haiku/trunk/headers/private/print/libprint/MarginView.h Modified: haiku/trunk/headers/private/print/libprint/Preview.h =================================================================== --- haiku/trunk/headers/private/print/libprint/Preview.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/libprint/Preview.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -1,29 +1,139 @@ /* - * Preview.h - * Copyright 1999-2000 Y.Takagi. All Rights Reserved. - */ -//#define USE_PREVIEW_FOR_DEBUG +Preview -#ifdef USE_PREVIEW_FOR_DEBUG -#ifndef __PREVIEW_H -#define __PREVIEW_H +Copyright (c) 2002, 2003 OpenBeOS. +Copyright (c) 2005 Haiku. -#include +Author: + Michael Pfeiffer + Hartmut Reh + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: -class PreviewWindow : public BWindow { +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ + +#include +#include "PrintJobReader.h" +#include "InterfaceUtils.h" + +class PreviewPage { + int32 fPage; + int32 fNumberOfPictures; + BPicture* fPictures; + BPoint* fPoints; + BRect* fRects; + status_t fStatus; + public: - PreviewWindow(BRect, const char *, BBitmap *); - virtual bool QuitRequested(); - int Go(); + PreviewPage(int32 page, PrintJobPage* pjp); + ~PreviewPage(); + status_t InitCheck() const; + + int32 Page() const { return fPage; } + void Draw(BView* view); +}; -protected: - PreviewWindow(const PreviewWindow &); - PreviewWindow &operator = (const PreviewWindow &); +class PreviewView : public BView { + int32 fPage; + int32 fZoom; + PrintJobReader fReader; + int32 fNumberOfPagesPerPage; + int32 fNumberOfPages; // physical pages + bool fReverse; + BRect fPageRect; + JobData::Orientation fOrientation; + JobData::PageSelection fPageSelection; + PreviewPage* fCachedPage; + + float ZoomFactor() const; + BRect PageRect() const; + BRect PrintableRect() const; + int32 GetPageNumber(int32 index) const; + +public: + PreviewView(BFile* jobFile, BRect rect); + ~PreviewView(); + status_t InitCheck() const; + + BRect ViewRect() const; -private: - long fSemaphore; + bool IsPageLoaded(int32 page) const; + bool IsPageValid() const; + void LoadPage(int32 page); + void DrawPageFrame(BRect r); + void DrawPage(BRect r); + void Draw(BRect r); + void FrameResized(float width, float height); + + void FixScrollbars(); + + bool ShowsFirstPage() const; + bool ShowsLastPage() const; + int CurrentPage() const { return fPage + 1; } + int NumberOfPages() const; + void ShowNextPage(); + void ShowPrevPage(); + void ShowFirstPage(); + void ShowLastPage(); + void ShowFindPage(int page); + + bool CanZoomIn() const; + bool CanZoomOut() const; + void ZoomIn(); + void ZoomOut(); }; -#endif /* __PREVIEW_H */ -#endif /* USE_PREVIEW_FOR_DEBUG */ +class PreviewWindow : public BlockingWindow { + BButton *fFirst; + BButton *fNext; + BButton *fPrev; + BButton *fLast; + BButton *fZoomIn; + BButton *fZoomOut; + BTextControl *fPageNumber; + BStringView *fPageText; + PreviewView *fPreview; + BScrollView *fPreviewScroller; + float fButtonBarHeight; + + enum { + MSG_FIRST_PAGE = 'pwfp', + MSG_NEXT_PAGE = 'pwnp', + MSG_PREV_PAGE = 'pwpp', + MSG_LAST_PAGE = 'pwlp', + MSG_FIND_PAGE = 'pwsp', + MSG_ZOOM_IN = 'pwzi', + MSG_ZOOM_OUT = 'pwzo', + MSG_PRINT_JOB = 'pwpj', + MSG_CANCEL_JOB = 'pwcj', + }; + + void ResizeToPage(bool allowShrinking = false); + void UpdateControls(); + + typedef BlockingWindow inherited; + +public: + PreviewWindow(BFile* jobFile, bool showOkAndCancelButtons = false); + status_t InitCheck() const { return fPreview->InitCheck(); } + void MessageReceived(BMessage* m); + status_t Go(); +}; + Added: haiku/trunk/headers/private/print/libprint/StatusWindow.h =================================================================== --- haiku/trunk/headers/private/print/libprint/StatusWindow.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/libprint/StatusWindow.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -0,0 +1,47 @@ +/* + StatusWindow.h + Copyright 2005 Dr.H.Reh. All Rights Reserved. +*/ + + +#ifndef STATUS_WINDOW_H +#define STATUS_WINDOW_H + +#ifndef _WINDOW_H +#include +#endif + +#include + + +class StatusWindow : public BWindow +{ + public: + StatusWindow(bool oddPages, bool evenPages, + uint32 firstPage, uint32 numPages, + uint32 docCopies, uint32 nup); + ~StatusWindow(void); + + virtual void MessageReceived(BMessage *message); + + void ResetStatusBar(void); + bool UpdateStatusBar(uint32 page, uint32 copy); + void SetPageCopies(uint32 copies); + + private: + BView *fStatusView; + BStatusBar *fStatusBar; + BButton *fCancelButton; + BButton *fHideButton; + bool fCancelBar; + bool fDocumentCopy; + uint32 fNops; + uint32 fFirstPage; + uint32 fCopies; + uint32 fDocCopies; + float fStatusDelta; + float fDelta; +}; + +#endif + Added: haiku/trunk/headers/private/print/utils/InterfaceUtils.h =================================================================== --- haiku/trunk/headers/private/print/utils/InterfaceUtils.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/utils/InterfaceUtils.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -0,0 +1,148 @@ +/* + +InterfaceUtils.cpp + +Copyright (c) 2002 OpenBeOS. + +Author: + Michael Pfeiffer + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ + +#ifndef _INTERFACE_UTILS_H +#define _INTERFACE_UTILS_H + +#include + +// -------------------------------------------------- +class HWindow : public BWindow +{ +protected: + void Init(uint32 escape_msg); + +public: + typedef BWindow inherited; + + HWindow(BRect frame, const char *title, window_type type, uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE, uint32 escape_msg = B_QUIT_REQUESTED); + HWindow(BRect frame, const char *title, window_look look, window_feel feel, uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE, uint32 escape_msg = B_QUIT_REQUESTED); + + virtual void MessageReceived(BMessage* m); + virtual void AboutRequested(); + virtual const char* AboutText() const { return NULL; } +}; + +// -------------------------------------------------- +class BlockingWindow : public HWindow +{ +public: + BlockingWindow(BRect frame, const char *title, window_type type, uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE, uint32 escape_msg = B_QUIT_REQUESTED); + BlockingWindow(BRect frame, const char *title, window_look look, window_feel feel, uint32 flags, uint32 workspace = B_CURRENT_WORKSPACE, uint32 escape_msg = B_QUIT_REQUESTED); + ~BlockingWindow(); + + bool QuitRequested(); + // Quit() is called by child class with result code + void Quit(status_t result); + // Show window and wait for it to quit, returns result code + virtual status_t Go(); + // Or quit window e.g. something went wrong in constructor + void Quit(); + // Sets the result that is returned when the user closes the window. + // Default is B_OK. + void SetUserQuitResult(status_t result); + + typedef HWindow inherited; + +private: + void Init(const char* title); + + status_t fUserQuitResult; + bool fReadyToQuit; + sem_id fExitSem; + status_t* fResult; +}; + +// -------------------------------------------------- +class TextView : public BTextView +{ +public: + typedef BTextView inherited; + + TextView(BRect frame, + const char *name, + BRect textRect, + uint32 rmask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + + TextView(BRect frame, + const char *name, + BRect textRect, + const BFont *font, const rgb_color *color, + uint32 rmask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + + void KeyDown(const char *bytes, int32 numBytes); + void MakeFocus(bool focus = true); + void Draw(BRect r); +}; + + +// -------------------------------------------------- +class TextControl : public BView +{ + BStringView *fLabel; + TextView *fText; +public: + TextControl(BRect frame, + const char *name, + const char *label, + const char *initial_text, + BMessage *message, + uint32 rmask = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE); + const char *Label() { return fLabel->Text(); } + const char *Text() { return fText->Text(); } + void MakeFocus(bool focus = true) { fText->MakeFocus(focus); } + void ConvertToParent(BView* parent, BView* child, BRect &rect); + void FocusSetTo(BView* child); +}; + + +// -------------------------------------------------- +class Table : public BView +{ +public: + typedef BView inherited; + + Table(BRect frame, const char *name, uint32 rmode, uint32 flags); + void ScrollTo(BPoint p); +}; + +class DragListView : public BListView +{ +public: + DragListView(BRect frame, const char *name, + list_view_type type = B_SINGLE_SELECTION_LIST, + uint32 resizingMode = B_FOLLOW_LEFT | B_FOLLOW_TOP, + uint32 flags = B_WILL_DRAW | B_NAVIGABLE | B_FRAME_EVENTS); + bool InitiateDrag(BPoint point, int32 index, bool wasSelected); +}; + +#endif Added: haiku/trunk/headers/private/print/utils/MarginView.h =================================================================== --- haiku/trunk/headers/private/print/utils/MarginView.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/utils/MarginView.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -0,0 +1,225 @@ +/* + +MarginView.h + +Copyright (c) 2002 OpenBeOS. + +Authors: + Philippe Houdoin + Simon Gauvin + Michael Pfeiffer + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + Documentation: + + The MarginView is designed to be a self contained component that manages + the display of a BBox control that shows a graphic of a page and its' + margings. The component also includes text fields that are used to mofify + the margin values and a popup to change the units used for the margins. + + There are two interfaces for the MarginView component: + + 1) Set methods: + - page size + - orientation + + Get methods to retrieve: + - margins + - page size + + The method interface is available for the parent Component to call on + the MarginView in response to the Window receiveing messages from + other BControls that it contains, such as a Page Size popup. The + Get methods are used to extract the page size and margins so that + the printer driver may put these values into a BMessage for printing. + + 2) 'Optional' Message interface: + - Set Page Size + - Flip Orientation + + The message interface is available for GUI Controls, BPopupMenu to send + messages to the MarginView if the parent Window is not used to handle + the messages. + + General Use of MarginView component: + + 1) Simply construct a new MarginView object with the margins + you want as defaults and add this view to the parent view + of the dialog. + + MarginView *mv; + mv = new MarginView(viewSizeRect, pageWidth, pageHeight); + parentView->AddChild(mv); + + * you can also set the margins in the constructor, and the units: + + mv = new MarginView(viewSizeRect, pageWidth, pageHeight + marginRect, kUnitPointS); + + ! but remeber to have the marginRect values match the UNITS :-) + + 2) Set Page Size with methods: + + mv-SetPageSize( pageWidth, pageHeight ); + mv->UpdateView(); + + 3) Set Page Size with BMessage: + + BMessage* msg = new BMessage(CHANGE_PAGE_SIZE); + msg->AddFloat("width", pageWidth); + msg->AddFloat("height", pageHeight); + mv->PostMessage(msg); + + 4) Flip Page with methods: + + mv-SetPageSize( pageHeight, pageWidth ); + mv->UpdateView(); + + 5) Flip Page with BMessage: + + BMessage* msg = new BMessage(FLIP_PAGE); + mv->Looper()->PostMessage(msg); + + Note: the MarginView DOES NOT keep track of the orientation. This + should be done by the code for the Page setup dialog. + + 6) Get Page Size + + BPoint pageSize = mv->GetPageSize(); + + 7) Get Margins + + BRect margins = mv->GetMargins(); + + 8) Get Units + + uint32 units = mv->GetUnits(); + + where units is one of: + kUnitInch, 72 points/in + kUnitCM, 28.346 points/cm + kUnitPoint, 1 point/point +*/ + +#ifndef _MARGIN_VIEW_H +#define _MARGIN_VIEW_H + +#include +#include + +class MarginManager; + +// Messages that the MarginManager accepts +const uint32 TOP_MARGIN_CHANGED = 'tchg'; +const uint32 RIGHT_MARGIN_CHANGED = 'rchg'; +const uint32 LEFT_MARGIN_CHANGED = 'lchg'; +const uint32 BOTTOM_MARGIN_CHANGED = 'bchg'; +const uint32 MARGIN_CHANGED = 'mchg'; +const uint32 CHANGE_PAGE_SIZE = 'chps'; +const uint32 FLIP_PAGE = 'flip'; +const uint32 MARGIN_UNIT_CHANGED = 'mucg'; + +enum MarginUnit { + kUnitInch = 0, + kUnitCM, + kUnitPoint +}; + +/** + * Class MarginView + */ +class MarginView : public BBox +{ +friend class MarginManager; + +private: + + // GUI components + BTextControl *fTop, *fBottom, *fLeft, *fRight; + + // rect that holds the margins for the page as a set of point offsets + BRect fMargins; + + // the maximum size of the page view calculated from the view size + float fMaxPageWidth; + float fMaxPageHeight; + + // the actual size of the page in points + float fPageHeight; + float fPageWidth; + + // the units used to calculate the page size + MarginUnit fMarginUnit; + float fUnitValue; + + // the size of the drawing area we have to draw the view in pixels + float fViewHeight; + float fViewWidth; + + // Calculate the view size for the margins + void CalculateViewSize(uint32 msg); + + // performed internally using the supplied popup + void SetMarginUnit(MarginUnit unit); + + // performed internally using text fields + void SetMargin(BRect margin); + + // utility method + void AllowOnlyNumbers(BTextControl *textControl, int maxNum); + +public: + MarginView(BRect rect, + int32 pageWidth = 0, + int32 pageHeight = 0, + BRect margins = BRect(1, 1, 1, 1), // default to 1 inch + MarginUnit unit = kUnitInch); + + ~MarginView(); + + /// all the GUI construction code + void ConstructGUI(); + + // page size + void SetPageSize(float pageWidth, float pageHeight); + // point.x = width, point.y = height + BPoint GetPageSize(void); + + // margin + BRect GetMargin(void); + + // orientation + // None, this state should be saved elsewhere in the page setup code + // and not here. See the FLIP_PAGE message to perform this function. + + // units + MarginUnit GetMarginUnit(void); + + // will cause a recalc and redraw + void UpdateView(uint32 msg); + + // BeOS Hook methods + virtual void AttachedToWindow(void); + void Draw(BRect rect); + void FrameResized(float width, float height); + void MessageReceived(BMessage *msg); +}; + +#endif // _MARGIN_VIEW_H Added: haiku/trunk/headers/private/print/utils/Utils.h =================================================================== --- haiku/trunk/headers/private/print/utils/Utils.h 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/headers/private/print/utils/Utils.h 2007-01-20 15:52:37 UTC (rev 19882) @@ -0,0 +1,132 @@ +/* + +PDF Writer printer driver. + +Copyright (c) 2001, 2002 OpenBeOS. +Copyright (c) 2005 Haiku. + +Authors: + Philippe Houdoin + Simon Gauvin + Michael Pfeiffer + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +*/ + +#ifndef _UTILS_H +#define _UTILS_H + +#include +#include +#include + + +void AddString(BMessage* m, const char* name, const char* value); + +// set or replace a value in a BMessage +void SetRect(BMessage* msg, const char* name, BRect rect); +void SetFloat(BMessage* msg, const char* name, float value); +void SetInt32(BMessage* msg, const char* name, int32 value); + +class EscapeMessageFilter : public BMessageFilter +{ +private: + BWindow *fWindow; + int32 fWhat; + +public: + EscapeMessageFilter(BWindow *window, int32 what); + filter_result Filter(BMessage *msg, BHandler **target); +}; + + +#define BEGINS_CHAR(byte) ((byte & 0xc0) != 0x80) + + +template +class TList { +private: + BList fList; + typedef int (*sort_func)(const void*, const void*); + +public: + virtual ~TList(); + void MakeEmpty(); + int32 CountItems() const; + T* ItemAt(int32 index) const; + void AddItem(T* p); + T* RemoveItem(int i); + T* Items(); + void SortItems(int (*comp)(const T**, const T**)); +}; + +// TList +template +TList::~TList() { + MakeEmpty(); +} + + +template +void TList::MakeEmpty() { + const int32 n = CountItems(); + for (int i = 0; i < n; i++) { + delete ItemAt(i); + } + fList.MakeEmpty(); +} + + +template +int32 TList::CountItems() const { + return fList.CountItems(); +} + + +template +T* TList::ItemAt(int32 index) const { + return (T*)fList.ItemAt(index); +} + + +template +void TList::AddItem(T* p) { + fList.AddItem(p); +} + +template +T* TList::RemoveItem(int i) { + return (T*)fList.RemoveItem(i); +} + + +template +T* TList::Items() { + return (T*)fList.Items(); +} + + +template +void TList::SortItems(int (*comp)(const T**, const T**)) { + sort_func sort = (sort_func)comp; + fList.SortItems(sort); +} + +#endif Modified: haiku/trunk/src/add-ons/print/drivers/canon_lips/lips3/Jamfile =================================================================== --- haiku/trunk/src/add-ons/print/drivers/canon_lips/lips3/Jamfile 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/src/add-ons/print/drivers/canon_lips/lips3/Jamfile 2007-01-20 15:52:37 UTC (rev 19882) @@ -3,6 +3,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers private print libprint ] ; +SubDirHdrs [ FDirName $(HAIKU_TOP) headers private print utils ] ; AddResources Canon\ LIPS3\ Compatible : Lips3.rdef ; @@ -13,7 +14,11 @@ Compress3.cpp ; -LinkAgainst Canon\ LIPS3\ Compatible : be libprint.a $(TARGET_LIBSTDC++) ; +LinkAgainst Canon\ LIPS3\ Compatible : + be + libprint.a + libprintutils.a + $(TARGET_LIBSTDC++) ; Package haiku-printingkit-cvs : Canon\ LIPS3\ Compatible : Modified: haiku/trunk/src/add-ons/print/drivers/canon_lips/lips4/Jamfile =================================================================== --- haiku/trunk/src/add-ons/print/drivers/canon_lips/lips4/Jamfile 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/src/add-ons/print/drivers/canon_lips/lips4/Jamfile 2007-01-20 15:52:37 UTC (rev 19882) @@ -3,6 +3,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers private print libprint ] ; +SubDirHdrs [ FDirName $(HAIKU_TOP) headers private print utils ] ; AddResources Canon\ LIPS4\ Compatible : Lips4.rdef ; @@ -12,7 +13,11 @@ Lips4Cap.cpp ; -LinkAgainst Canon\ LIPS4\ Compatible : be libprint.a $(TARGET_LIBSTDC++) ; +LinkAgainst Canon\ LIPS4\ Compatible : + be + libprint.a + libprintutils.a + $(TARGET_LIBSTDC++) ; Package haiku-printingkit-cvs : Canon\ LIPS4\ Compatible : Modified: haiku/trunk/src/add-ons/print/drivers/pcl5/Jamfile =================================================================== --- haiku/trunk/src/add-ons/print/drivers/pcl5/Jamfile 2007-01-20 14:15:40 UTC (rev 19881) +++ haiku/trunk/src/add-ons/print/drivers/pcl5/Jamfile 2007-01-20 15:52:37 UTC (rev 19882) @@ -3,6 +3,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers private print libprint ] ; +SubDirHdrs [ FDirName $(HAIKU_TOP) headers private print utils ] ; AddResources PCL5\ Compatible : PCL5.rsrc ; @@ -12,7 +13,11 @@ PCL5Cap.cpp ; -LinkAgainst PCL5\ Compatible : be libprint.a $(TARGET_LIBSTDC++) ; [... truncated: 5015 lines follow ...] From mmu_man at mail.berlios.de Sat Jan 20 21:03:38 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 21:03:38 +0100 Subject: [Haiku-commits] r19883 - in haiku/trunk/src/bin: . network network/mount_nfs Message-ID: <200701202003.l0KK3ceY028328@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 21:03:38 +0100 (Sat, 20 Jan 2007) New Revision: 19883 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19883&view=rev Added: haiku/trunk/src/bin/network/mount_nfs/ haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp Removed: haiku/trunk/src/bin/mount_nfs.cpp Log: Move mount_nfs to network bins Deleted: haiku/trunk/src/bin/mount_nfs.cpp Copied: haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp (from rev 19882, haiku/trunk/src/bin/mount_nfs.cpp) From mmu_man at mail.berlios.de Sat Jan 20 21:14:58 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 21:14:58 +0100 Subject: [Haiku-commits] r19884 - haiku/trunk/src/add-ons/kernel/file_systems/nfs Message-ID: <200701202014.l0KKEwPK029273@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 21:14:58 +0100 (Sat, 20 Jan 2007) New Revision: 19884 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19884&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/nfs/Jamfile Log: It will probably build better with a jamfile :D Added: haiku/trunk/src/add-ons/kernel/file_systems/nfs/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/Jamfile 2007-01-20 20:03:38 UTC (rev 19883) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/Jamfile 2007-01-20 20:14:58 UTC (rev 19884) @@ -0,0 +1,12 @@ +SubDir HAIKU_TOP src add-ons kernel file_systems nfs ; + +UsePrivateHeaders kernel ; + +#SubDirCcFlags -DTRACK_FILENAME ; + +KernelAddon nfs : + RPCPendingCalls.c + XDRInPacket.c + XDROutPacket.c + nfs_add_on.c +; From mmu_man at mail.berlios.de Sat Jan 20 21:24:47 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sat, 20 Jan 2007 21:24:47 +0100 Subject: [Haiku-commits] r19885 - in haiku/trunk/src/bin/network: . mount_nfs Message-ID: <200701202024.l0KKOl4r030239@sheep.berlios.de> Author: mmu_man Date: 2007-01-20 21:24:46 +0100 (Sat, 20 Jan 2007) New Revision: 19885 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19885&view=rev Added: haiku/trunk/src/bin/network/mount_nfs/Jamfile Modified: haiku/trunk/src/bin/network/Jamfile haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp Log: Add mount_nfs to the build. this should probably go away, mount should be enough. Modified: haiku/trunk/src/bin/network/Jamfile =================================================================== --- haiku/trunk/src/bin/network/Jamfile 2007-01-20 20:14:58 UTC (rev 19884) +++ haiku/trunk/src/bin/network/Jamfile 2007-01-20 20:24:46 UTC (rev 19885) @@ -3,6 +3,7 @@ SubInclude HAIKU_TOP src bin network arp ; SubInclude HAIKU_TOP src bin network ftp ; SubInclude HAIKU_TOP src bin network ifconfig ; +SubInclude HAIKU_TOP src bin network mount_nfs ; SubInclude HAIKU_TOP src bin network netstat ; #SubInclude HAIKU_TOP src bin network pppconfig ; #SubInclude HAIKU_TOP src bin network ppp_up ; Added: haiku/trunk/src/bin/network/mount_nfs/Jamfile =================================================================== --- haiku/trunk/src/bin/network/mount_nfs/Jamfile 2007-01-20 20:14:58 UTC (rev 19884) +++ haiku/trunk/src/bin/network/mount_nfs/Jamfile 2007-01-20 20:24:46 UTC (rev 19885) @@ -0,0 +1,8 @@ +SubDir HAIKU_TOP src bin network mount_nfs ; + +UsePrivateHeaders net ; + +BinCommand mount_nfs : + mount_nfs.cpp + : libnetwork.so +; Modified: haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp =================================================================== --- haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp 2007-01-20 20:14:58 UTC (rev 19884) +++ haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp 2007-01-20 20:24:46 UTC (rev 19885) @@ -8,6 +8,14 @@ #include #include #include +#ifdef __HAIKU__ +#include +int mount(const char *filesystem, const char *where, const char *device, ulong flags, void *parameters, size_t len) +{ + (void) len; + return fs_mount_volume(where, device, filesystem, flags, (const char *)parameters); +} +#endif struct mount_nfs_params { @@ -31,7 +39,7 @@ signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); - BApplication theApp ("application/x-vnd.barecode-mount_nfs"); + //BApplication theApp ("application/x-vnd.barecode-mount_nfs"); if (argc!=5) { From axeld at pinc-software.de Sat Jan 20 21:43:49 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sat, 20 Jan 2007 21:43:49 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19883_-_in_haiku/trunk/src/bin?= =?iso-8859-15?q?=3A_=2E_network_network/mount=5Fnfs?= In-Reply-To: <200701202003.l0KK3ceY028328@sheep.berlios.de> Message-ID: <41097536727-BeMail@zon> mmu_man at BerliOS wrote: > Log: > Move mount_nfs to network bins Could we possibly get rid of mount_nfs and configure it using the flat driver_settings parameter of mount? BTW: nice to see you working on this! Bye, Axel. From laplace at mail.berlios.de Sat Jan 20 23:52:00 2007 From: laplace at mail.berlios.de (laplace at BerliOS) Date: Sat, 20 Jan 2007 23:52:00 +0100 Subject: [Haiku-commits] r19886 - haiku/trunk/src/add-ons/print/drivers/pdf/source Message-ID: <200701202252.l0KMq0J5009589@sheep.berlios.de> Author: laplace Date: 2007-01-20 23:51:56 +0100 (Sat, 20 Jan 2007) New Revision: 19886 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19886&view=rev Modified: haiku/trunk/src/add-ons/print/drivers/pdf/source/Jamfile Log: Fixed broken build. Modified: haiku/trunk/src/add-ons/print/drivers/pdf/source/Jamfile =================================================================== --- haiku/trunk/src/add-ons/print/drivers/pdf/source/Jamfile 2007-01-20 20:24:46 UTC (rev 19885) +++ haiku/trunk/src/add-ons/print/drivers/pdf/source/Jamfile 2007-01-20 22:51:56 UTC (rev 19886) @@ -2,6 +2,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ; +SubDirHdrs [ FDirName $(HAIKU_TOP) headers private print ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers private print utils ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) src libs pdflib libs pdflib ] ; From koki at haiku-os.org Sun Jan 21 00:00:11 2007 From: koki at haiku-os.org (Jorge G. Mare (a.k.a. Koki)) Date: Sat, 20 Jan 2007 15:00:11 -0800 Subject: [Haiku-commits] r19885 - in haiku/trunk/src/bin/network: . mount_nfs In-Reply-To: <200701202024.l0KKOl4r030239@sheep.berlios.de> References: <200701202024.l0KKOl4r030239@sheep.berlios.de> Message-ID: <45B29EFB.8040207@haiku-os.org> mmu_man at BerliOS wrote: > Author: mmu_man > Date: 2007-01-20 21:24:46 +0100 (Sat, 20 Jan 2007) > New Revision: 19885 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19885&view=rev > > Added: > haiku/trunk/src/bin/network/mount_nfs/Jamfile > Modified: > haiku/trunk/src/bin/network/Jamfile > haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp > Log: > Add mount_nfs to the build. this should probably go away, mount should be enough. Welcome back Fran?ois! Cheers, Koki From darkwyrm at mail.berlios.de Sun Jan 21 04:19:28 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Sun, 21 Jan 2007 04:19:28 +0100 Subject: [Haiku-commits] r19887 - haiku/trunk/headers/build Message-ID: <200701210319.l0L3JScA007319@sheep.berlios.de> Author: darkwyrm Date: 2007-01-21 04:19:27 +0100 (Sun, 21 Jan 2007) New Revision: 19887 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19887&view=rev Modified: haiku/trunk/headers/build/HaikuBuildCompatibility.h Log: Fixed non-Haiku build targets for libicon Modified: haiku/trunk/headers/build/HaikuBuildCompatibility.h =================================================================== --- haiku/trunk/headers/build/HaikuBuildCompatibility.h 2007-01-20 22:51:56 UTC (rev 19886) +++ haiku/trunk/headers/build/HaikuBuildCompatibility.h 2007-01-21 03:19:27 UTC (rev 19887) @@ -67,6 +67,12 @@ # define B_BAD_DATA (B_NOT_ALLOWED + 1) #endif +#ifndef HAIKU_TARGET_PLATFORM_HAIKU +#ifndef B_VECTOR_ICON_TYPE +#define B_VECTOR_ICON_TYPE 'VICN' +#endif +#endif + #ifndef INT64_MAX #include #define INT64_MAX LONGLONG_MAX From laplace at mail.berlios.de Sun Jan 21 10:34:01 2007 From: laplace at mail.berlios.de (laplace at BerliOS) Date: Sun, 21 Jan 2007 10:34:01 +0100 Subject: [Haiku-commits] r19888 - haiku/trunk/src/preferences/print Message-ID: <200701210934.l0L9Y1Eh031849@sheep.berlios.de> Author: laplace Date: 2007-01-21 10:33:54 +0100 (Sun, 21 Jan 2007) New Revision: 19888 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19888&view=rev Modified: haiku/trunk/src/preferences/print/Jamfile Log: Next attempt to fix the build. Of course forgot to check in the updated Jamfile. Modified: haiku/trunk/src/preferences/print/Jamfile =================================================================== --- haiku/trunk/src/preferences/print/Jamfile 2007-01-21 03:19:27 UTC (rev 19887) +++ haiku/trunk/src/preferences/print/Jamfile 2007-01-21 09:33:54 UTC (rev 19888) @@ -12,12 +12,14 @@ JobListView.cpp SpoolFolder.cpp Globals.cpp - : be translation libprint.a - : Printers.rdef + : + be + translation + libprintutils.a + : + Printers.rdef ; -# TODO remove dependency to libtranslation (BeUtils) - Package haiku-printingkit-cvs : Printers : # boot beos preferences ; From mmu_man at mail.berlios.de Sun Jan 21 12:06:26 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sun, 21 Jan 2007 12:06:26 +0100 Subject: [Haiku-commits] r19889 - haiku/trunk/src/bin/network/mount_nfs Message-ID: <200701211106.l0LB6QIE003801@sheep.berlios.de> Author: mmu_man Date: 2007-01-21 12:06:25 +0100 (Sun, 21 Jan 2007) New Revision: 19889 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19889&view=rev Modified: haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp Log: hack around to pass a string for now... Modified: haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp =================================================================== --- haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp 2007-01-21 09:33:54 UTC (rev 19888) +++ haiku/trunk/src/bin/network/mount_nfs/mount_nfs.cpp 2007-01-21 11:06:25 UTC (rev 19889) @@ -8,6 +8,7 @@ #include #include #include +#include #ifdef __HAIKU__ #include int mount(const char *filesystem, const char *where, const char *device, ulong flags, void *parameters, size_t len) @@ -17,6 +18,8 @@ } #endif +#define BUFSZ 1024 + struct mount_nfs_params { unsigned int serverIP; @@ -36,6 +39,7 @@ int main (int argc, char **argv) { + char buf[BUFSZ]; signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); @@ -93,8 +97,16 @@ gethostname (hostname,256); params.hostname=hostname; + + sprintf(buf, "nfs:%s:%s,uid=%u,gid=%u,hostname=%s", + inet_ntoa(*((struct in_addr *)ent->h_addr)), + params._export, + params.uid, + params.gid, + params.hostname); - int result=mount ("nfs",argv[2],NULL,0,¶ms,sizeof(params)); + int result=mount ("nfs",argv[2],NULL,0,buf,sizeof(params)); + //int result=mount ("nfs",argv[2],NULL,0,¶ms,sizeof(params)); delete[] server; From mmu_man at mail.berlios.de Sun Jan 21 12:07:14 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sun, 21 Jan 2007 12:07:14 +0100 Subject: [Haiku-commits] r19890 - haiku/trunk/src/add-ons/kernel/file_systems/nfs Message-ID: <200701211107.l0LB7Epd003871@sheep.berlios.de> Author: mmu_man Date: 2007-01-21 12:07:14 +0100 (Sun, 21 Jan 2007) New Revision: 19890 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19890&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c Log: hack around to get a string from params for now. Cleaned up error handling in fs_mount. Don't have time to test but it should now work under Haiku. Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-01-21 11:06:25 UTC (rev 19889) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-01-21 11:07:14 UTC (rev 19890) @@ -17,6 +17,9 @@ #include #include +/* Haiku requires a string for mount params... */ +#define PARAMS_AS_STRING 1 + #ifndef UDP_SIZE_MAX #define UDP_SIZE_MAX 65515 #endif @@ -1137,6 +1140,84 @@ RPCPendingCallsDestroy (&nspace->pendingCalls); } +#ifdef PARAMS_AS_STRING +int parse_nfs_params(const char *str, struct mount_nfs_params *params) +{ + char *p, *e; + long v; + int i; + // sprintf(buf, "nfs:%s:%s,uid=%u,gid=%u,hostname=%s", + if (!str || !params) + return EINVAL; + if (strncmp(str, "nfs:", 4)) + return EINVAL; +dprintf("nfs:ip!\n"); + p = str + 4; + e = strchr(p, ':'); + if (!e) + return EINVAL; + params->server = malloc(e - p); + strncpy(params->server, p, e - p); + // hack + v = strtol(p, &p, 10); + if (!p) + return EINVAL; + p++; + params->serverIP |= (v << 24); + v = strtol(p, &p, 10); + if (!p) + return EINVAL; + p++; + params->serverIP |= (v << 16); + v = strtol(p, &p, 10); + if (!p) + return EINVAL; + p++; + params->serverIP |= (v << 8); + v = strtol(p, &p, 10); + if (!p) + return EINVAL; + params->serverIP |= (v); + if (*p++ != ':') + return EINVAL; + + e = strchr(p, ','); + i = (e) ? (e - p) : (strlen(p)); + + params->_export = malloc(i); + strncpy(params->_export, p, i); + + p = strstr(str, "hostname="); + if (!p) + return EINVAL; +dprintf("nfs:hn!\n"); + p += 9; + e = strchr(p, ','); + i = (e) ? (e - p) : (strlen(p)); + + params->hostname = malloc(i); + strncpy(params->hostname, p, i); + + p = strstr(str, "uid="); +dprintf("nfs:uid!\n"); + if (p) { + p += 4; + v = strtol(p, &p, 10); + params->uid = v; + } +dprintf("nfs:gid!\n"); + p = strstr(str, "gid="); + if (p) { + p += 4; + v = strtol(p, &p, 10); + params->gid = v; + } + dprintf("nfs: ip:%08lx server:'%s' export:'%s' hostname:'%s' uid=%d gid=%d \n", + params->serverIP, params->server, params->_export, + params->hostname, params->uid, params->gid); + return B_OK; +} +#endif extern int #ifdef __HAIKU__ @@ -1158,6 +1239,7 @@ return EINVAL; dprintf("nfs: mount(%d, %s, %08lx)\n", nsid, devname, flags); +#ifndef PARAMS_AS_STRING dprintf("nfs: nfs_params(ip:%lu, server:%s, export:%s, uid:%d, gid:%d, hostname:%s)\n", parms->serverIP, parms->server, @@ -1165,7 +1247,11 @@ parms->uid, parms->gid, parms->hostname); +#else +dprintf("nfs: nfs_params: %s\n", _parms); +#endif + // HAIKU: this should go to std_ops if (!refcount) read_config(); @@ -1173,11 +1259,21 @@ if (result < B_OK) return result; + result = ENOMEM; ns=(fs_nspace *)malloc(sizeof(fs_nspace)); + if (!ns) + goto err_nspace; fs_nspaceInit (ns); ns->nsid=nsid; + ns->params.server=NULL; + ns->params._export=NULL; + ns->params.hostname=NULL; +#ifdef PARAMS_AS_STRING + if ((result = parse_nfs_params(_parms, &ns->params)) < 0) + goto err_params; +#else ns->params.serverIP=parms->serverIP; ns->params.server=strdup(parms->server); ns->params._export=strdup(parms->_export); @@ -1188,152 +1284,89 @@ ns->mountAddr.sin_family=AF_INET; ns->mountAddr.sin_addr.s_addr=htonl(parms->serverIP); memset (ns->mountAddr.sin_zero,0,sizeof(ns->mountAddr.sin_zero)); +#endif // XXX: cleanup error handling if ((result=create_socket(ns))params.hostname); - free (ns->params._export); - free (ns->params.server); + goto err_socket; - fs_nspaceDestroy (ns); - free(ns); - - ksocket_cleanup(); - return result; - } - if ((result=init_postoffice(ns))s); - free (ns->params.hostname); - free (ns->params._export); - free (ns->params.server); + goto err_postoffice; - fs_nspaceDestroy (ns); - free(ns); - - ksocket_cleanup(); - return result; - } - if ((result=get_remote_address(ns,MOUNT_PROGRAM,MOUNT_VERSION,PMAP_IPPROTO_UDP,&ns->mountAddr))params.hostname); - free (ns->params._export); - free (ns->params.server); + goto err_sem; - fs_nspaceDestroy (ns); - free(ns); - - ksocket_cleanup(); - dprintf("nfs: error getting mountd address from portmapper: %s\n", strerror(result)); - return result; - } - memcpy (&ns->nfsAddr,&ns->mountAddr,sizeof(ns->mountAddr)); dprintf("nfs: mountd at %08lx:%d\n", ns->mountAddr.sin_addr.s_addr, ntohs(ns->mountAddr.sin_port)); if ((result=get_remote_address(ns,NFS_PROGRAM,NFS_VERSION,PMAP_IPPROTO_UDP,&ns->nfsAddr))params.hostname); - free (ns->params._export); - free (ns->params.server); - - fs_nspaceDestroy (ns); - free(ns); - - ksocket_cleanup(); - dprintf("nfs: error getting nfsd address from portmapper: %s\n", strerror(result)); - return result; - } + goto err_sem; dprintf("nfs: nfsd at %08lx:%d\n", ns->nfsAddr.sin_addr.s_addr, ntohs(ns->nfsAddr.sin_port)); // result = connect_socket(ns); //dprintf("nfs: connect: %s\n", strerror(result)); if ((result=create_sem(1,"nfs_sem"))params.hostname); - free (ns->params._export); - free (ns->params.server); + goto err_sem; - fs_nspaceDestroy (ns); - free(ns); - - ksocket_cleanup(); - return result; - } - ns->sem=result; set_sem_owner (ns->sem,B_SYSTEM_TEAM); + result = ENOMEM; rootNode=(fs_node *)malloc(sizeof(fs_node)); + if (!rootNode) + goto err_rootvn; rootNode->next=NULL; if ((result=nfs_mount(ns,ns->params._export,&rootNode->fhandle))sem); - free(rootNode); - shutdown_postoffice(ns); - free (ns->params.hostname); - free (ns->params._export); - free (ns->params.server); + goto err_mount; - fs_nspaceDestroy (ns); - free(ns); - - ksocket_cleanup(); - dprintf("nfs: error in nfs_mount: %s\n", strerror(result)); - return result; - } - if ((result=nfs_getattr(ns,&rootNode->fhandle,&st))sem); - free(rootNode); - shutdown_postoffice(ns); - free (ns->params.hostname); - free (ns->params._export); - free (ns->params.server); + goto err_publish; - fs_nspaceDestroy (ns); - free(ns); - - ksocket_cleanup(); - return result; - } - ns->rootid=st.st_ino; rootNode->vnid=ns->rootid; *vnid=ns->rootid; if ((result=publish_vnode(nsid,*vnid,rootNode))sem); - free(rootNode); - shutdown_postoffice(ns); - free (ns->params.hostname); - free (ns->params._export); - free (ns->params.server); - - fs_nspaceDestroy (ns); - free(ns); - - ksocket_cleanup(); - return result; - } - + goto err_publish; + *data=ns; ns->first=rootNode; - return B_OK; + return B_OK; + +err_publish: + // XXX: unmount ?? +err_mount: + free(rootNode); +err_rootvn: + delete_sem (ns->sem); +err_sem: + shutdown_postoffice(ns); + goto err_socket; +err_postoffice: + kclosesocket(ns->s); +err_socket: +err_params: + free (ns->params.hostname); + free (ns->params._export); + free (ns->params.server); + + fs_nspaceDestroy (ns); + free(ns); +err_nspace: + + ksocket_cleanup(); + if (result >= 0) { + dprintf("nfs:bad error from mount!\n"); + result = EINVAL; + } + dprintf("nfs: error in nfs_mount: %s\n", strerror(result)); + return result; } extern int From axeld at pinc-software.de Sun Jan 21 13:01:46 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 21 Jan 2007 13:01:46 +0100 (MET) Subject: [Haiku-commits] r19887 - haiku/trunk/headers/build In-Reply-To: <200701210319.l0L3JScA007319@sheep.berlios.de> Message-ID: <388474928-BeMail@zon> darkwyrm at BerliOS wrote: > +#ifndef HAIKU_TARGET_PLATFORM_HAIKU > +#ifndef B_VECTOR_ICON_TYPE #ifndef? Do you know of any non-Haiku target that would define this? ;- ) Bye, Axel. From axeld at pinc-software.de Sun Jan 21 13:04:49 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 21 Jan 2007 13:04:49 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19890_-_haiku/trunk/src/add-ons/?= =?iso-8859-15?q?kernel/file=5Fsystems/nfs?= In-Reply-To: <200701211107.l0LB7Epd003871@sheep.berlios.de> Message-ID: <570522237-BeMail@zon> mmu_man at BerliOS wrote: > Log: > hack around to get a string from params for now. All file systems should use flat driver settings for the parameter string, at least in the (near) future. That will also make parsing the settings easier and less error prone. Bye, Axel. From darkwyrm at earthlink.net Sun Jan 21 13:15:31 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Sun, 21 Jan 2007 07:15:31 -0500 EST Subject: [Haiku-commits] r19887 - haiku/trunk/headers/build In-Reply-To: <388474928-BeMail@zon> Message-ID: <1642091358-BeMail@sapphire> > darkwyrm at BerliOS wrote: > > +#ifndef HAIKU_TARGET_PLATFORM_HAIKU > > +#ifndef B_VECTOR_ICON_TYPE > > #ifndef? Do you know of any non-Haiku target that would define this? > ;- > ) I just did this for protection against inclusion from 2 different files. I take it this isn't necessary? --DW From axeld at pinc-software.de Sun Jan 21 13:36:40 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 21 Jan 2007 13:36:40 +0100 (MET) Subject: [Haiku-commits] r19887 - haiku/trunk/headers/build In-Reply-To: <1642091358-BeMail@sapphire> Message-ID: <2479183603-BeMail@zon> "DarkWyrm" wrote: > > darkwyrm at BerliOS wrote: > > > +#ifndef HAIKU_TARGET_PLATFORM_HAIKU > > > +#ifndef B_VECTOR_ICON_TYPE > > #ifndef? Do you know of any non-Haiku target that would define > > this? > > ;-) > I just did this for protection against inclusion from 2 different > files. I take it this isn't necessary? It has absolutely no effect; B_VECTOR_ICON_TYPE is a symbol in an enum, #ifndef will always be true, even if you include the Haiku version of TypeConstants.h first. Bye, Axel. From axeld at mail.berlios.de Sun Jan 21 14:20:21 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 21 Jan 2007 14:20:21 +0100 Subject: [Haiku-commits] r19891 - haiku/trunk/src/preferences/screensaver Message-ID: <200701211320.l0LDKLG0021635@sheep.berlios.de> Author: axeld Date: 2007-01-21 14:20:20 +0100 (Sun, 21 Jan 2007) New Revision: 19891 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19891&view=rev Modified: haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp Log: The screen saver is now stopped before deleting its view... Thanks to John Drinkwater and Fredrik Ekdahl for the hint! Modified: haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp 2007-01-21 11:07:14 UTC (rev 19890) +++ haiku/trunk/src/preferences/screensaver/ScreenSaverWindow.cpp 2007-01-21 13:20:20 UTC (rev 19891) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Haiku. + * Copyright 2003-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -465,6 +465,8 @@ if (fSettingsView != NULL) fSettingsBox->RemoveChild(fSettingsView); + if (fSaverRunner != NULL) + fSaverRunner->Quit(); if (saver != NULL) saver->StopConfig(); @@ -473,6 +475,8 @@ delete view; delete fSettingsView; delete fSaverRunner; + // the saver runner also unloads the add-on, so it must + // be deleted last fSettingsView = NULL; fSaverRunner = NULL; From axeld at pinc-software.de Sun Jan 21 14:21:36 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Sun, 21 Jan 2007 14:21:36 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19860_-_haiku/trunk/src/add-ons/?= =?iso-8859-15?q?kernel/bus=5Fmanagers/usb?= In-Reply-To: <200701182225.l0IMP5su009611@sheep.berlios.de> Message-ID: <5178367438-BeMail@zon> mmlr at BerliOS wrote: > Overall the USB stack should now be much more reliable. It should not > crash > on disconnects anymore and repluging of a device should be noticed by > all drivers. Very cool! Unfortunately, my keyboard is still not working. Is there any debug output that I could send you? Bye, Axel. From mmu_man at mail.berlios.de Sun Jan 21 17:41:14 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Sun, 21 Jan 2007 17:41:14 +0100 Subject: [Haiku-commits] r19892 - haiku/trunk/src/add-ons/kernel/file_systems/nfs Message-ID: <200701211641.l0LGfEii004595@sheep.berlios.de> Author: mmu_man Date: 2007-01-21 17:41:14 +0100 (Sun, 21 Jan 2007) New Revision: 19892 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19892&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c Log: Fixed parsing of param string. It now starts mounting, but blocks waiting for a reply. Is udp working already ?? Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-01-21 13:20:20 UTC (rev 19891) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-01-21 16:41:14 UTC (rev 19892) @@ -1159,22 +1159,27 @@ params->server = malloc(e - p); strncpy(params->server, p, e - p); // hack + params->serverIP = 0; v = strtol(p, &p, 10); +dprintf("IP:%ld.", v); if (!p) return EINVAL; + params->serverIP |= (v << 24); p++; - params->serverIP |= (v << 24); v = strtol(p, &p, 10); +dprintf("%ld.", v); if (!p) return EINVAL; + params->serverIP |= (v << 16); p++; - params->serverIP |= (v << 16); v = strtol(p, &p, 10); +dprintf("%ld.", v); if (!p) return EINVAL; + params->serverIP |= (v << 8); p++; - params->serverIP |= (v << 8); v = strtol(p, &p, 10); +dprintf("%ld\n", v); if (!p) return EINVAL; params->serverIP |= (v); @@ -1226,7 +1231,9 @@ fs_mount(nspace_id nsid, const char *devname, ulong flags, const char *_parms, size_t len, fs_nspace **data, vnode_id *vnid) #endif { +#ifndef PARAMS_AS_STRING struct mount_nfs_params *parms = (struct mount_nfs_params *)_parms; // XXX: FIXME +#endif status_t result; fs_nspace *ns; fs_node *rootNode; @@ -1235,7 +1242,7 @@ (void) len; #endif - if (parms==NULL) + if (_parms==NULL) return EINVAL; dprintf("nfs: mount(%d, %s, %08lx)\n", nsid, devname, flags); @@ -1280,14 +1287,12 @@ ns->params.uid=parms->uid; ns->params.gid=parms->gid; ns->params.hostname=strdup(parms->hostname); +#endif ns->xid=0; ns->mountAddr.sin_family=AF_INET; - ns->mountAddr.sin_addr.s_addr=htonl(parms->serverIP); + ns->mountAddr.sin_addr.s_addr=htonl(ns->params.serverIP); memset (ns->mountAddr.sin_zero,0,sizeof(ns->mountAddr.sin_zero)); -#endif - // XXX: cleanup error handling - if ((result=create_socket(ns)) Message-ID: <21141340499-BeMail@zon> mmu_man at BerliOS wrote: > Log: > Fixed parsing of param string. It now starts mounting, but blocks > waiting for a reply. > Is udp working already ?? It should; but feel free to investigate :-) Error reporting/retrieving via ICMP is not yet supported at all, though. Bye, Axel. From axeld at mail.berlios.de Sun Jan 21 19:03:49 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 21 Jan 2007 19:03:49 +0100 Subject: [Haiku-commits] r19893 - haiku/trunk/src/kits/tracker Message-ID: <200701211803.l0LI3nks030091@sheep.berlios.de> Author: axeld Date: 2007-01-21 19:03:47 +0100 (Sun, 21 Jan 2007) New Revision: 19893 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19893&view=rev Modified: haiku/trunk/src/kits/tracker/AutoMounter.cpp haiku/trunk/src/kits/tracker/AutoMounter.h Log: * Implemented the AutoMounter for Haiku - it's barely tested at this point, but at least mounting/unmounting seems to work. This fixes bug #191. * Also changed the way how Tracker automatically mounts/unmounts volumes: it now only differentiates between removable and fixed storage, not between initial scan at boot, and periodical scans during runtime. Also removed all HFS stuff. * Got rid of _INCLUDES_CLASS_DEVICE_MAP for the BeOS build. Modified: haiku/trunk/src/kits/tracker/AutoMounter.cpp =================================================================== --- haiku/trunk/src/kits/tracker/AutoMounter.cpp 2007-01-21 16:41:14 UTC (rev 19892) +++ haiku/trunk/src/kits/tracker/AutoMounter.cpp 2007-01-21 18:03:47 UTC (rev 19893) @@ -41,6 +41,13 @@ #include "Tracker.h" #include "TrackerSettings.h" +#ifdef __HAIKU__ +# include +# include +# include +# include +#endif + #include #include #include @@ -52,42 +59,555 @@ #include -static const uint32 kStartPolling = 'strp'; -#if _INCLUDES_CLASS_DEVICE_MAP static const char *kAutoMounterSettings = "automounter_settings"; + + +#ifdef __HAIKU__ +// #pragma mark - Haiku Disk Device API + +static const uint32 kMsgInitialScan = 'insc'; + + +AutoMounter::AutoMounter() + : BLooper("AutoMounter", B_LOW_PRIORITY), + fNormalMode(kRestorePreviousVolumes), + fRemovableMode(kAllVolumes) +{ + if (!BootedInSafeMode()) { + _ReadSettings(); + } else { + // defeat automounter in safe mode, don't even care about the settings + fNormalMode = kNoVolumes; + fRemovableMode = kNoVolumes; + } + + if (PostMessage(kMsgInitialScan) != B_OK) + debug_printf("AutoMounter: OH NO!\n"); +} + + +AutoMounter::~AutoMounter() +{ +} + + +void +AutoMounter::_MountVolumes(mount_mode normal, mount_mode removable) +{ + if (normal == kNoVolumes && removable == kNoVolumes) + return; + + class InitialMountVisitor : public BDiskDeviceVisitor { + public: + InitialMountVisitor(mount_mode normalMode, mount_mode removableMode, + BMessage& previous) + : + fNormalMode(normalMode), + fRemovableMode(removableMode), + fPrevious(previous) + { + } + + virtual + ~InitialMountVisitor() + { + } + + virtual bool + Visit(BDiskDevice* device) + { + return Visit(device, 0); + } + + virtual bool + Visit(BPartition* partition, int32 level) + { + mount_mode mode = partition->Device()->IsRemovableMedia() + ? fRemovableMode : fNormalMode; + if (mode == kNoVolumes + || partition->IsMounted() + || !partition->ContainsFileSystem()) + return false; + + if (mode == kRestorePreviousVolumes) { + // mount all volumes that were stored in the settings file + const char *volumeName; + BPath path; + if (partition->GetPath(&path) != B_OK + || partition->ContentName() == NULL + || fPrevious.FindString(path.Path(), &volumeName) != B_OK + || strcmp(volumeName, partition->ContentName())) + return false; + } else if (mode == kOnlyBFSVolumes) { + if (partition->ContentType() == NULL + || strcmp(partition->ContentType(), "BFS")) + return false; + } + + partition->Mount(); + return false; + } + + private: + mount_mode fNormalMode; + mount_mode fRemovableMode; + BMessage& fPrevious; + } visitor(normal, removable, fSettings); + + BDiskDeviceList devices; + status_t status = devices.Fetch(); + if (status == B_OK) + devices.VisitEachPartition(&visitor); +} + + +void +AutoMounter::_MountVolume(BMessage *message) +{ + int32 id; + if (message->FindInt32("id", &id) != B_OK) + return; + + BDiskDeviceRoster roster; + BPartition *partition; + BDiskDevice device; + if (roster.GetPartitionWithID(id, &device, &partition) != B_OK) + return; + + status_t status = partition->Mount(); + if (status < B_OK) { + BString string; + string << "Error mounting volume. (" << strerror(status) << ")"; + (new BAlert("", string.String(), "OK"))->Go(0); + } +} + + +bool +AutoMounter::_ForceUnmount(const char* name, status_t error) +{ + BString text; + text << "Could not unmount disk \"" << name << "\":\n\t" << strerror(error); + text << "\n\nShould I force unmounting the disk?\n\n" + "Note: if an application is currently writing to the volume, unmounting" + " it now might result in loss of data.\n"; + + int32 choice = (new BAlert("", text.String(), "Cancel", "Force Unmount", NULL, + B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); + + return choice == 1; +} + + +void +AutoMounter::_ReportUnmountError(const char* name, status_t error) +{ + BString text; + text << "Could not unmount disk \"" << name << "\":\n\t" << strerror(error); + + (new BAlert("", text.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL, + B_WARNING_ALERT))->Go(NULL); +} + + +void +AutoMounter::_UnmountAndEjectVolume(BMessage *message) +{ + int32 id; + if (message->FindInt32("id", &id) == B_OK) { + BDiskDeviceRoster roster; + BPartition *partition; + BDiskDevice device; + if (roster.GetPartitionWithID(id, &device, &partition) != B_OK) + return; + + status_t status = partition->Unmount(); + if (status < B_OK) { + if (!_ForceUnmount(partition->ContentName(), status)) + return; + + status = partition->Unmount(B_FORCE_UNMOUNT); + } + + if (status < B_OK) + _ReportUnmountError(partition->ContentName(), status); + + return; + } + + // see if we got a dev_t + + dev_t device; + if (message->FindInt32("device_id", &device) != B_OK) + return; + + BVolume volume(device); + status_t status = volume.InitCheck(); + + char name[B_FILE_NAME_LENGTH]; + if (status == B_OK) + status = volume.GetName(name); + if (status < B_OK) + snprintf(name, sizeof(name), "device:%ld", device); + + BDirectory mountPoint; + if (status == B_OK) + status = volume.GetRootDirectory(&mountPoint); + + BPath path; + if (status == B_OK) + status = path.SetTo(&mountPoint, "."); + + if (status == B_OK) { + status = fs_unmount_volume(path.Path(), 0); + if (status < B_OK) { + if (!_ForceUnmount(name, status)) + return; + + status = fs_unmount_volume(path.Path(), B_FORCE_UNMOUNT); + } + } + + if (status == B_OK) + rmdir(path.Path()); + + if (status < B_OK) + _ReportUnmountError(name, status); +} + + +void +AutoMounter::_FromMode(mount_mode mode, bool& all, bool& bfs, bool& restore) +{ + all = bfs = restore = false; + + switch (mode) { + case kAllVolumes: + all = true; + break; + case kOnlyBFSVolumes: + bfs = true; + break; + case kRestorePreviousVolumes: + restore = true; + break; + + default: + break; + } +} + + +AutoMounter::mount_mode +AutoMounter::_ToMode(bool all, bool bfs, bool restore) +{ + if (all) + return kAllVolumes; + if (bfs) + return kOnlyBFSVolumes; + if (restore) + return kRestorePreviousVolumes; + + return kNoVolumes; +} + + +void +AutoMounter::_ReadSettings() +{ + BPath directoryPath; + if (FSFindTrackerSettingsDir(&directoryPath) != B_OK) + return; + + BPath path(directoryPath); + path.Append(kAutoMounterSettings); + fPrefsFile.SetTo(path.Path(), O_RDWR); + + if (fPrefsFile.InitCheck() != B_OK) { + // no prefs file yet, create a new one + + BDirectory dir(directoryPath.Path()); + dir.CreateFile(kAutoMounterSettings, &fPrefsFile); + return; + } + + ssize_t settingsSize = (ssize_t)fPrefsFile.Seek(0, SEEK_END); + if (settingsSize == 0) + return; + + ASSERT(settingsSize != 0); + char *buffer = new char[settingsSize]; + + fPrefsFile.Seek(0, 0); + if (fPrefsFile.Read(buffer, (size_t)settingsSize) != settingsSize) { + PRINT(("error reading automounter settings\n")); + delete [] buffer; + return; + } + + BMessage message('stng'); + status_t result = message.Unflatten(buffer); + if (result != B_OK) { + PRINT(("error %s unflattening settings, size %d\n", strerror(result), + settingsSize)); + delete [] buffer; + return; + } + + delete [] buffer; + + _UpdateSettingsFromMessage(&message); + GetSettings(&fSettings); +} + + +void +AutoMounter::_WriteSettings() +{ + if (fPrefsFile.InitCheck() != B_OK) + return; + + BMessage message('stng'); + GetSettings(&message); + + ssize_t settingsSize = message.FlattenedSize(); + + char *buffer = new char[settingsSize]; + status_t result = message.Flatten(buffer, settingsSize); + + fPrefsFile.Seek(0, 0); + result = fPrefsFile.Write(buffer, (size_t)settingsSize); + if (result != settingsSize) + PRINT(("error writing settings, %s\n", strerror(result))); + + delete [] buffer; +} + + +void +AutoMounter::_UpdateSettingsFromMessage(BMessage* message) +{ + // auto mounter settings + + bool all, bfs, restore; + if (message->FindBool("autoMountAll", &all) != B_OK) + all = true; + if (message->FindBool("autoMountAllBFS", &bfs) != B_OK) + bfs = false; + + fRemovableMode = _ToMode(all, bfs, false); + + // initial mount settings + + if (message->FindBool("initialMountAll", &all) != B_OK) + all = false; + if (message->FindBool("initialMountAllBFS", &bfs) != B_OK) + bfs = false; + if (message->FindBool("initialMountRestore", &restore) != B_OK) + restore = true; + + fNormalMode = _ToMode(all, bfs, restore); +} + + +void +AutoMounter::GetSettings(BMessage *message) +{ + message->MakeEmpty(); + + bool all, bfs, restore; + + _FromMode(fNormalMode, all, bfs, restore); + message->AddBool("initialMountAll", all); + message->AddBool("initialMountAllBFS", bfs); + message->AddBool("initialMountRestore", restore); + + _FromMode(fRemovableMode, all, bfs, restore); + message->AddBool("autoMountAll", all); + message->AddBool("autoMountAllBFS", bfs); + + // Save mounted volumes so we can optionally mount them on next + // startup + BVolumeRoster volumeRoster; + BVolume volume; + while (volumeRoster.GetNextVolume(&volume) == B_OK) { + fs_info info; + if (fs_stat_dev(volume.Device(), &info) == 0 + && info.flags & (B_FS_IS_REMOVABLE | B_FS_IS_PERSISTENT)) + message->AddString(info.device_name, info.volume_name); + } +} + + +void +AutoMounter::MessageReceived(BMessage *message) +{ + switch (message->what) { + case kMsgInitialScan: + _MountVolumes(fNormalMode, fRemovableMode); + break; + + case kMountVolume: + _MountVolume(message); + break; + + case kUnmountVolume: + _UnmountAndEjectVolume(message); + break; + + case kSetAutomounterParams: + { + bool rescanNow = false; + message->FindBool("rescanNow", &rescanNow); + + _UpdateSettingsFromMessage(message); + GetSettings(&fSettings); + _WriteSettings(); + + if (rescanNow) + _MountVolumes(fNormalMode, fRemovableMode); + break; + } + + case kMountAllNow: + _MountVolumes(kAllVolumes, kAllVolumes); + break; + +#if 0 + case B_NODE_MONITOR: + { + int32 opcode; + if (message->FindInt32("opcode", &opcode) != B_OK) + break; + + switch (opcode) { + // The name of a mount point has changed + case B_ENTRY_MOVED: { + WRITELOG(("*** Received Mount Point Renamed Notification")); + + const char *newName; + if (message->FindString("name", &newName) != B_OK) { + WRITELOG(("ERROR: Couldn't find name field in update message")); + PRINT_OBJECT(*message); + break ; + } + + // + // When the node monitor reports a move, it gives the + // parent device and inode that moved. The problem is + // that the inode is the inode of root *in* the filesystem, + // which is generally always the same number for every + // filesystem of a type. + // + // What we'd really like is the device that the moved + // volume is mounted on. Find this by using the + // *new* name and directory, and then stat()ing that to + // find the device. + // + dev_t parentDevice; + if (message->FindInt32("device", &parentDevice) != B_OK) { + WRITELOG(("ERROR: Couldn't find 'device' field in update" + " message")); + PRINT_OBJECT(*message); + break; + } + + ino_t toDirectory; + if (message->FindInt64("to directory", &toDirectory)!=B_OK){ + WRITELOG(("ERROR: Couldn't find 'to directory' field in update" + "message")); + PRINT_OBJECT(*message); + break; + } + + entry_ref root_entry(parentDevice, toDirectory, newName); + + BNode entryNode(&root_entry); + if (entryNode.InitCheck() != B_OK) { + WRITELOG(("ERROR: Couldn't create mount point entry node: %s/n", + strerror(entryNode.InitCheck()))); + break; + } + + node_ref mountPointNode; + if (entryNode.GetNodeRef(&mountPointNode) != B_OK) { + WRITELOG(("ERROR: Couldn't get node ref for new mount point")); + break; + } + + WRITELOG(("Attempt to rename device %li to %s", mountPointNode.device, + newName)); + + Partition *partition = FindPartition(mountPointNode.device); + if (partition != NULL) { + WRITELOG(("Found device, changing name.")); + + BVolume mountVolume(partition->VolumeDeviceID()); + BDirectory mountDir; + mountVolume.GetRootDirectory(&mountDir); + BPath dirPath(&mountDir, 0); + + partition->SetMountedAt(dirPath.Path()); + partition->SetVolumeName(newName); + break; + } else { + WRITELOG(("ERROR: Device %li does not appear to be present", + mountPointNode.device)); + } + } + } + break; + } #endif + default: + BLooper::MessageReceived(message); + break; + } +} + + +bool +AutoMounter::QuitRequested() +{ + if (!BootedInSafeMode()) { + // don't write out settings in safe mode - this would overwrite the + // normal, non-safe mode settings + _WriteSettings(); + } + + return true; +} + + +#else // !__HAIKU__ +// #pragma mark - R5 DeviceMap API + +static const uint32 kStartPolling = 'strp'; + +static BMessage gSettingsMessage; +static bool gSilentAutoMounter; + struct OneMountFloppyParams { status_t result; }; -#if _INCLUDES_CLASS_DEVICE_MAP -static bool gSilentAutoMounter; -#endif -static BMessage gSettingsMessage; +struct MountPartitionParams { + int32 uniqueID; + status_t result; +}; #if xDEBUG static Partition * -DumpPartition(Partition *_DEVICE_MAP_ONLY(partition), void*) +DumpPartition(Partition *partition, void*) { -#if _INCLUDES_CLASS_DEVICE_MAP partition->Dump(); -#endif return 0; } #endif -#if _INCLUDES_CLASS_DEVICE_MAP - - -struct MountPartitionParams { - int32 uniqueID; - status_t result; -}; - - /** Sets the Tracker Shell's AutoMounter to monitor a node. * n.b. Get's the one AutoMounter and uses Tracker's _special_ WatchNode. * @@ -302,7 +822,65 @@ } +struct UnmountDeviceParams { + dev_t device; + status_t result; +}; + + static Partition * +UnmountIfMatchingID(Partition *partition, void *castToParams) +{ + UnmountDeviceParams *params = (UnmountDeviceParams *)castToParams; + + if (partition->VolumeDeviceID() == params->device) { + TTracker *tracker = dynamic_cast(be_app); + if (tracker && tracker->QueryActiveForDevice(params->device)) { + BString text; + text << "To unmount " << partition->VolumeName() << " some query " + "windows have to be closed. Would you like to close the query " + "windows?"; + if ((new BAlert("", text.String(), "Cancel", "Close and unmount", NULL, + B_WIDTH_FROM_LABEL))->Go() == 0) + return partition; + tracker->CloseActiveQueryWindows(params->device); + } + + params->result = partition->Unmount(); + Device *device = partition->GetDevice(); + bool deviceHasMountedPartitions = false; + + if (params->result == B_OK && device->Removable()) { + for (int32 sessionIndex = 0; ; sessionIndex++) { + Session *session = device->SessionAt(sessionIndex); + if (!session) + break; + + for (int32 partitionIndex = 0; ; partitionIndex++) { + Partition *partition = session->PartitionAt(partitionIndex); + if (!partition) + break; + + if (partition->Mounted() == kMounted) { + deviceHasMountedPartitions = true; + break; + } + } + } + + if (!deviceHasMountedPartitions + && TrackerSettings().EjectWhenUnmounting()) + params->result = partition->GetDevice()->Eject(); + } + + return partition; + } + + return NULL; +} + + +static Partition * NotifyFloppyNotMountable(Partition *partition, void *) { if (partition->Mounted() != kMounted @@ -316,9 +894,16 @@ } -#endif // #if _INCLUDES_CLASS_DEVICE_MAP +static Device * +FindFloppyDevice(Device *device, void *) +{ + if (device->IsFloppy()) + return device; + return 0; +} + #ifdef MOUNT_MENU_IN_DESKBAR // just for testing @@ -351,35 +936,32 @@ #endif // #ifdef MOUNT_MENU_IN_DESKBAR -AutoMounter::AutoMounter(bool _DEVICE_MAP_ONLY(checkRemovableOnly), - bool _DEVICE_MAP_ONLY(checkCDs), bool _DEVICE_MAP_ONLY(checkFloppies), - bool _DEVICE_MAP_ONLY(checkOtherRemovable), bool _DEVICE_MAP_ONLY(autoMountRemovablesOnly), - bool _DEVICE_MAP_ONLY(autoMountAll), bool _DEVICE_MAP_ONLY(autoMountAllBFS), - bool _DEVICE_MAP_ONLY(autoMountAllHFS), - bool initialMountAll, bool initialMountAllBFS, bool initialMountRestore, - bool initialMountAllHFS) - : BLooper("DirPoller", B_LOW_PRIORITY), - fInitialMountAll(initialMountAll), - fInitialMountAllBFS(initialMountAllBFS), - fInitialMountRestore(initialMountRestore), - fInitialMountAllHFS(initialMountAllHFS), - fSuspended(false), - fQuitting(false) +AutoMounter::AutoMounter(bool checkRemovableOnly, bool checkCDs, + bool checkFloppies, bool checkOtherRemovable, bool autoMountRemovablesOnly, + bool autoMountAll, bool autoMountAllBFS, bool autoMountAllHFS, + bool initialMountAll, bool initialMountAllBFS, bool initialMountRestore, + bool initialMountAllHFS) + : BLooper("AutoMounter", B_LOW_PRIORITY), + fInitialMountAll(initialMountAll), + fInitialMountAllBFS(initialMountAllBFS), + fInitialMountRestore(initialMountRestore), + fInitialMountAllHFS(initialMountAllHFS), + fSuspended(false), + fQuitting(false) { -#if _INCLUDES_CLASS_DEVICE_MAP fScanParams.shortestRescanHartbeat = 5000000; fScanParams.checkFloppies = checkFloppies; fScanParams.checkCDROMs = checkCDs; fScanParams.checkOtherRemovable = checkOtherRemovable; fScanParams.removableOrUnknownOnly = checkRemovableOnly; - + fAutomountParams.mountAllFS = autoMountAll; fAutomountParams.mountBFS = autoMountAllBFS; fAutomountParams.mountHFS = autoMountAllHFS; fAutomountParams.mountRemovableDisksOnly = autoMountRemovablesOnly; gSilentAutoMounter = true; - + if (!BootedInSafeMode()) { ReadSettings(); thread_id rescan = spawn_thread(AutoMounter::InitialRescanBinder, @@ -398,7 +980,6 @@ // Watch mount/unmount TTracker::WatchNode(0, B_WATCH_MOUNT, this); -#endif } @@ -407,29 +988,23 @@ } -Partition* AutoMounter::FindPartition(dev_t _DEVICE_MAP_ONLY(dev)) +Partition* AutoMounter::FindPartition(dev_t dev) { -#if _INCLUDES_CLASS_DEVICE_MAP FindPartitionByDeviceIDParams params; params.dev = dev; return fList.EachMountedPartition(FindPartitionByDeviceID, ¶ms); -#else - return NULL; -#endif } void AutoMounter::RescanDevices() { -#if _INCLUDES_CLASS_DEVICE_MAP stop_watching(this); fList.RescanDevices(true); fList.UpdateMountingInfo(); fList.EachMountedPartition(TryWatchMountPoint, 0); TTracker::WatchNode(0, B_WATCH_MOUNT, this); fList.EachMountedPartition(TryWatchMountPoint, 0); -#endif } @@ -437,21 +1012,15 @@ AutoMounter::MessageReceived(BMessage *message) { switch (message->what) { -#if _INCLUDES_CLASS_DEVICE_MAP case kAutomounterRescan: RescanDevices(); break; case kStartPolling: // PRINT(("starting the automounter\n")); - + fScanThread = spawn_thread(AutoMounter::WatchVolumeBinder, -#if DEBUG - "HiroshiLikesAtomountScan", // long story -#else - "AutomountScan", -#endif - B_LOW_PRIORITY, this); + "AutomountScan", B_LOW_PRIORITY, this); resume_thread(fScanThread); break; @@ -464,13 +1033,13 @@ break; case kSetAutomounterParams: - { - bool rescanNow = false; - message->FindBool("rescanNow", &rescanNow); - SetParams(message, rescanNow); - WriteSettings(); - break; - } + { + bool rescanNow = false; + message->FindBool("rescanNow", &rescanNow); + SetParams(message, rescanNow); + WriteSettings(); + break; + } case kMountAllNow: RescanDevices(); @@ -490,142 +1059,137 @@ break; case B_NODE_MONITOR: - { - int32 opcode; - if (message->FindInt32("opcode", &opcode) != B_OK) + { + int32 opcode; + if (message->FindInt32("opcode", &opcode) != B_OK) + break; + + switch (opcode) { + case B_DEVICE_MOUNTED: { + WRITELOG(("** Received Device Mounted Notification")); + dev_t device; + if (message->FindInt32("new device", &device) == B_OK) { + Partition *partition = FindPartition(device); + if (partition == NULL || partition->Mounted() != kMounted) { + WRITELOG(("Device %i not in device list. Someone mounted it outside " + "of Tracker", device)); + + // + // This is the worst case. Someone has mounted + // something from outside of tracker. + // Unfortunately, there's no easy way to tell which + // partition was just mounted (or if we even know about the device), + // so stop watching all nodes, rescan to see what is now mounted, + // and start watching again. + // + RescanDevices(); + } else + WRITELOG(("Found partition\n")); + } else { + WRITELOG(("ERROR: Could not find mounted device ID in message")); + PRINT_OBJECT(*message); + } + break; - - switch (opcode) { - case B_DEVICE_MOUNTED: { - WRITELOG(("** Received Device Mounted Notification")); - dev_t device; - if (message->FindInt32("new device", &device) == B_OK) { - Partition *partition = FindPartition(device); - if (partition == NULL || partition->Mounted() != kMounted) { - WRITELOG(("Device %i not in device list. Someone mounted it outside " - "of Tracker", device)); - - // - // This is the worst case. Someone has mounted - // something from outside of tracker. - // Unfortunately, there's no easy way to tell which - // partition was just mounted (or if we even know about the device), - // so stop watching all nodes, rescan to see what is now mounted, - // and start watching again. - // - RescanDevices(); - } else - WRITELOG(("Found partition\n")); - } else { - WRITELOG(("ERROR: Could not find mounted device ID in message")); - PRINT_OBJECT(*message); - } - + } + + case B_DEVICE_UNMOUNTED: { + WRITELOG(("*** Received Device Unmounted Notification")); + dev_t device; + if (message->FindInt32("device", &device) == B_OK) { + Partition *partition = FindPartition(device); + + if (partition != 0) { + WRITELOG(("Found device in device list. Updating state to unmounted.")); + partition->SetMountState(kNotMounted); + } else + WRITELOG(("Unmounted device %i was not in device list", device)); + } else { + WRITELOG(("ERROR: Could not find unmounted device ID in message")); + PRINT_OBJECT(*message); + } + + break; + } + + // The name of a mount point has changed + case B_ENTRY_MOVED: { + WRITELOG(("*** Received Mount Point Renamed Notification")); + + const char *newName; + if (message->FindString("name", &newName) != B_OK) { + WRITELOG(("ERROR: Couldn't find name field in update message")); + PRINT_OBJECT(*message); + break ; + } + + // + // When the node monitor reports a move, it gives the + // parent device and inode that moved. The problem is + // that the inode is the inode of root *in* the filesystem, + // which is generally always the same number for every + // filesystem of a type. + // + // What we'd really like is the device that the moved + // volume is mounted on. Find this by using the + // *new* name and directory, and then stat()ing that to + // find the device. + // + dev_t parentDevice; + if (message->FindInt32("device", &parentDevice) != B_OK) { + WRITELOG(("ERROR: Couldn't find 'device' field in update" + " message")); + PRINT_OBJECT(*message); break; } - - - case B_DEVICE_UNMOUNTED: { - WRITELOG(("*** Received Device Unmounted Notification")); - dev_t device; - if (message->FindInt32("device", &device) == B_OK) { - Partition *partition = FindPartition(device); - - if (partition != 0) { - WRITELOG(("Found device in device list. Updating state to unmounted.")); - partition->SetMountState(kNotMounted); - } else - WRITELOG(("Unmounted device %i was not in device list", device)); - } else { - WRITELOG(("ERROR: Could not find unmounted device ID in message")); - PRINT_OBJECT(*message); - } - + + ino_t toDirectory; + if (message->FindInt64("to directory", &toDirectory)!=B_OK){ + WRITELOG(("ERROR: Couldn't find 'to directory' field in update" + "message")); + PRINT_OBJECT(*message); break; + } + + entry_ref root_entry(parentDevice, toDirectory, newName); + + BNode entryNode(&root_entry); + if (entryNode.InitCheck() != B_OK) { + WRITELOG(("ERROR: Couldn't create mount point entry node: %s/n", + strerror(entryNode.InitCheck()))); + break; } - - - // The name of a mount point has changed - case B_ENTRY_MOVED: { - WRITELOG(("*** Received Mount Point Renamed Notification")); - - const char *newName; - if (message->FindString("name", &newName) != B_OK) { - WRITELOG(("ERROR: Couldn't find name field in update message")); - PRINT_OBJECT(*message); - break ; - } - - // - // When the node monitor reports a move, it gives the - // parent device and inode that moved. The problem is - // that the inode is the inode of root *in* the filesystem, - // which is generally always the same number for every - // filesystem of a type. - // - // What we'd really like is the device that the moved - // volume is mounted on. Find this by using the - // *new* name and directory, and then stat()ing that to - // find the device. - // - dev_t parentDevice; - if (message->FindInt32("device", &parentDevice) != B_OK) { - WRITELOG(("ERROR: Couldn't find 'device' field in update" - " message")); - PRINT_OBJECT(*message); - break; - } - - ino_t toDirectory; - if (message->FindInt64("to directory", &toDirectory)!=B_OK){ - WRITELOG(("ERROR: Couldn't find 'to directory' field in update" - "message")); - PRINT_OBJECT(*message); [... truncated: 789 lines follow ...] From axeld at mail.berlios.de Sun Jan 21 19:44:21 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 21 Jan 2007 19:44:21 +0100 Subject: [Haiku-commits] r19894 - haiku/trunk/src/kits/storage Message-ID: <200701211844.l0LIiLO5022069@sheep.berlios.de> Author: axeld Date: 2007-01-21 19:44:20 +0100 (Sun, 21 Jan 2007) New Revision: 19894 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19894&view=rev Modified: haiku/trunk/src/kits/storage/Partition.cpp Log: fs_unmount_volume() gets a path to the mount point, not the (eventual) device behind the mount point; BPartition::Unmount() would never unmount a volume. Modified: haiku/trunk/src/kits/storage/Partition.cpp =================================================================== --- haiku/trunk/src/kits/storage/Partition.cpp 2007-01-21 18:03:47 UTC (rev 19893) +++ haiku/trunk/src/kits/storage/Partition.cpp 2007-01-21 18:44:20 UTC (rev 19894) @@ -1,13 +1,15 @@ -//---------------------------------------------------------------------- -// This software is part of the Haiku distribution and is covered -// by the MIT license. -//--------------------------------------------------------------------- +/* + * Copyright 2003-2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Ingo Weinhold, bonefish at cs.tu-berlin.de + */ -#include -#include -#include -#include +#include +#include + #include #include #include @@ -21,9 +23,12 @@ #include #include -#include -#include +#include +#include +#include +#include + using std::nothrow; /*! \class BPartition @@ -537,23 +542,23 @@ status_t BPartition::Unmount(uint32 unmountFlags) { - if (!fPartitionData || !IsMounted()) + if (fPartitionData == NULL || !IsMounted()) return B_BAD_VALUE; // get the partition path - BPath partitionPath; - status_t error = GetPath(&partitionPath); - if (error != B_OK) - return error; + BPath path; + status_t status = GetMountPoint(&path); + if (status != B_OK) + return status; // unmount - error = fs_unmount_volume(partitionPath.Path(), unmountFlags); + status = fs_unmount_volume(path.Path(), unmountFlags); // update object, if successful - if (error == B_OK) - error = Device()->Update(); + if (status == B_OK) + status = Device()->Update(); - return error; + return status; } // Device From darkwyrm at earthlink.net Sun Jan 21 21:16:33 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Sun, 21 Jan 2007 15:16:33 -0500 EST Subject: [Haiku-commits] r19887 - haiku/trunk/headers/build In-Reply-To: <2479183603-BeMail@zon> Message-ID: <1197740211-BeMail@sapphire> > > I just did this for protection against inclusion from 2 different > > files. I take it this isn't necessary? > > It has absolutely no effect; B_VECTOR_ICON_TYPE is a symbol in an > enum, > #ifndef will always be true, even if you include the Haiku version of > TypeConstants.h first. Well, then, I guess I have a bit more tweaking to do. Thanks! --DW From darkwyrm at mail.berlios.de Sun Jan 21 21:50:14 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Sun, 21 Jan 2007 21:50:14 +0100 Subject: [Haiku-commits] r19895 - haiku/trunk/src/kits/tracker Message-ID: <200701212050.l0LKoEs1031576@sheep.berlios.de> Author: darkwyrm Date: 2007-01-21 21:50:14 +0100 (Sun, 21 Jan 2007) New Revision: 19895 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19895&view=rev Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp haiku/trunk/src/kits/tracker/SettingsViews.cpp haiku/trunk/src/kits/tracker/TrackerSettings.cpp haiku/trunk/src/kits/tracker/TrackerSettingsWindow.cpp Log: Label tweaks as agreed upon on list "List folders first" and "Show Full Path" default to on now Modified: haiku/trunk/src/kits/tracker/ContainerWindow.cpp =================================================================== --- haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2007-01-21 18:44:20 UTC (rev 19894) +++ haiku/trunk/src/kits/tracker/ContainerWindow.cpp 2007-01-21 20:50:14 UTC (rev 19895) @@ -1953,7 +1953,7 @@ menu->AddSeparatorItem(); - item = new BMenuItem("Settings"B_UTF8_ELLIPSIS, new BMessage(kShowSettingsWindow)); + item = new BMenuItem("Preferences"B_UTF8_ELLIPSIS, new BMessage(kShowSettingsWindow)); item->SetTarget(be_app); menu->AddItem(item); } Modified: haiku/trunk/src/kits/tracker/SettingsViews.cpp =================================================================== --- haiku/trunk/src/kits/tracker/SettingsViews.cpp 2007-01-21 18:44:20 UTC (rev 19894) +++ haiku/trunk/src/kits/tracker/SettingsViews.cpp 2007-01-21 20:50:14 UTC (rev 19895) @@ -152,7 +152,7 @@ rect.OffsetBy(0, itemSpacing); fMountVolumesOntoDesktopRadioButton = new BRadioButton(rect, "", - "Show Volumes On Desktop", new BMessage(kVolumesOnDesktopChanged)); + "Show Volumes on Desktop", new BMessage(kVolumesOnDesktopChanged)); AddChild(fMountVolumesOntoDesktopRadioButton); fMountVolumesOntoDesktopRadioButton->ResizeToPreferred(); @@ -443,7 +443,7 @@ : SettingsView(rect, "WindowsSettingsView") { rect.OffsetTo(B_ORIGIN); - fShowFullPathInTitleBarCheckBox = new BCheckBox(rect, "", "Show Full Path In Title Bar", + fShowFullPathInTitleBarCheckBox = new BCheckBox(rect, "", "Show Folder Location in Title Bar", new BMessage(kWindowsShowFullPathChanged)); fShowFullPathInTitleBarCheckBox->ResizeToPreferred(); AddChild(fShowFullPathInTitleBarCheckBox); @@ -451,7 +451,7 @@ const float itemSpacing = fShowFullPathInTitleBarCheckBox->Bounds().Height() + kItemExtraSpacing; rect.OffsetBy(0, itemSpacing); - fSingleWindowBrowseCheckBox = new BCheckBox(rect, "", "Single Window Browse", + fSingleWindowBrowseCheckBox = new BCheckBox(rect, "", "Single Window Navigation", new BMessage(kSingleWindowBrowseChanged)); fSingleWindowBrowseCheckBox->ResizeToPreferred(); AddChild(fSingleWindowBrowseCheckBox); @@ -472,7 +472,7 @@ rect.OffsetBy(0, itemSpacing); - fSortFolderNamesFirstCheckBox = new BCheckBox(rect, "", "Sort Folder Names First", + fSortFolderNamesFirstCheckBox = new BCheckBox(rect, "", "List Folders First", new BMessage(kSortFolderNamesFirstChanged)); fSortFolderNamesFirstCheckBox->ResizeToPreferred(); AddChild(fSortFolderNamesFirstCheckBox); @@ -1029,7 +1029,7 @@ : SettingsView(rect, "SpaceBarSettingsView") { rect.OffsetTo(B_ORIGIN); - fSpaceBarShowCheckBox = new BCheckBox(rect, "", "Show Space Bars On Volumes", + fSpaceBarShowCheckBox = new BCheckBox(rect, "", "Show Space Bars on Volumes", new BMessage(kUpdateVolumeSpaceBar)); fSpaceBarShowCheckBox->ResizeToPreferred(); AddChild(fSpaceBarShowCheckBox); @@ -1265,7 +1265,7 @@ : SettingsView(rect, "TrashSettingsView") { rect.OffsetTo(B_ORIGIN); - fDontMoveFilesToTrashCheckBox = new BCheckBox(rect, "", "Don't Move Files To Trash", + fDontMoveFilesToTrashCheckBox = new BCheckBox(rect, "", "Don't Move Files to Trash", new BMessage(kDontMoveFilesToTrashChanged)); fDontMoveFilesToTrashCheckBox->ResizeToPreferred(); AddChild(fDontMoveFilesToTrashCheckBox); Modified: haiku/trunk/src/kits/tracker/TrackerSettings.cpp =================================================================== --- haiku/trunk/src/kits/tracker/TrackerSettings.cpp 2007-01-21 18:44:20 UTC (rev 19894) +++ haiku/trunk/src/kits/tracker/TrackerSettings.cpp 2007-01-21 20:50:14 UTC (rev 19895) @@ -178,10 +178,10 @@ Add(fEjectWhenUnmounting = new BooleanValueSetting("EjectWhenUnmounting", true)); Add(fDesktopFilePanelRoot = new BooleanValueSetting("DesktopFilePanelRoot", true)); - Add(fShowFullPathInTitleBar = new BooleanValueSetting("ShowFullPathInTitleBar", false)); + Add(fShowFullPathInTitleBar = new BooleanValueSetting("ShowFullPathInTitleBar", true)); Add(fShowSelectionWhenInactive = new BooleanValueSetting("ShowSelectionWhenInactive", true)); Add(fTransparentSelection = new BooleanValueSetting("TransparentSelection", true)); - Add(fSortFolderNamesFirst = new BooleanValueSetting("SortFolderNamesFirst", false)); + Add(fSortFolderNamesFirst = new BooleanValueSetting("SortFolderNamesFirst", true)); Add(fHideDotFiles = new BooleanValueSetting("HideDotFiles", false)); Add(fSingleWindowBrowse = new BooleanValueSetting("SingleWindowBrowse", false)); Add(fShowNavigator = new BooleanValueSetting("ShowNavigator", false)); Modified: haiku/trunk/src/kits/tracker/TrackerSettingsWindow.cpp =================================================================== --- haiku/trunk/src/kits/tracker/TrackerSettingsWindow.cpp 2007-01-21 18:44:20 UTC (rev 19894) +++ haiku/trunk/src/kits/tracker/TrackerSettingsWindow.cpp 2007-01-21 20:50:14 UTC (rev 19895) @@ -64,7 +64,7 @@ TrackerSettingsWindow::TrackerSettingsWindow() - : BWindow(BRect(80, 80, 450, 350), "Tracker Settings", B_TITLED_WINDOW, + : BWindow(BRect(80, 80, 450, 350), "Tracker Preferences", B_TITLED_WINDOW, B_NOT_MINIMIZABLE | B_NOT_RESIZABLE | B_NO_WORKSPACE_ACTIVATION | B_NOT_ANCHORED_ON_ACTIVATE | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE) { @@ -112,7 +112,7 @@ new DesktopSettingsView(rect))); fSettingsTypeListView->AddItem(new SettingsItem("Windows", new WindowsSettingsView(rect))); - fSettingsTypeListView->AddItem(new SettingsItem("Time Format", + fSettingsTypeListView->AddItem(new SettingsItem("Date and Time", new TimeFormatSettingsView(rect))); fSettingsTypeListView->AddItem(new SettingsItem("Trash", new TrashSettingsView(rect))); From axeld at mail.berlios.de Sun Jan 21 22:02:46 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Sun, 21 Jan 2007 22:02:46 +0100 Subject: [Haiku-commits] r19896 - haiku/trunk/src/kits/tracker Message-ID: <200701212102.l0LL2keG032410@sheep.berlios.de> Author: axeld Date: 2007-01-21 22:02:45 +0100 (Sun, 21 Jan 2007) New Revision: 19896 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19896&view=rev Modified: haiku/trunk/src/kits/tracker/SettingsViews.cpp Log: Fixed a bug introduced by DarkWyrm: he obviously missed that there are two locations where you have to set the default value of a setting. Modified: haiku/trunk/src/kits/tracker/SettingsViews.cpp =================================================================== --- haiku/trunk/src/kits/tracker/SettingsViews.cpp 2007-01-21 20:50:14 UTC (rev 19895) +++ haiku/trunk/src/kits/tracker/SettingsViews.cpp 2007-01-21 21:02:45 UTC (rev 19896) @@ -599,9 +599,9 @@ } if (settings.SortFolderNamesFirst()) { - settings.SetSortFolderNamesFirst(false); + settings.SetSortFolderNamesFirst(true); send_bool_notices(kSortFolderNamesFirstChanged, - "SortFolderNamesFirst", false); + "SortFolderNamesFirst", true); } ShowCurrentSettings(); From axeld at mail.berlios.de Mon Jan 22 09:13:17 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 22 Jan 2007 09:13:17 +0100 Subject: [Haiku-commits] r19897 - in haiku/trunk/src/add-ons/kernel/file_systems: . ntfs ntfs/libntfs Message-ID: <200701220813.l0M8DHPE021239@sheep.berlios.de> Author: axeld Date: 2007-01-22 09:13:07 +0100 (Mon, 22 Jan 2007) New Revision: 19897 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19897&view=rev Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/kernel_interface.cpp haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/attrib.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/attrib.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/attrlist.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/attrlist.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/bitmap.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/bitmap.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/bootsect.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/bootsect.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/collate.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/collate.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/compat.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/compat.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/compress.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/compress.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/config.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/debug.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/debug.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/device.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/device.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/device_io.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/device_io.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/dir.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/endians.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/index.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/index.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/inode.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/inode.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/layout.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/lcnalloc.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/lcnalloc.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/list.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logfile.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logfile.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logging.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/logging.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/mft.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/mft.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/misc.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/mst.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/mst.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/ntfstime.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/runlist.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/runlist.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/security.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/security.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/support.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/types.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unistr.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unistr.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/unix_io.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/version.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/version.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/volume.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/libntfs/win32_io.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/lock.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/mime_table.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/mime_table.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfs.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/ntfsdir.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/utils.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/utils.h haiku/trunk/src/add-ons/kernel/file_systems/ntfs/volume_util.c haiku/trunk/src/add-ons/kernel/file_systems/ntfs/volume_util.h Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile Log: Added NTFS file system add-on written by Troeglazov Gerasim (a.k.a. 3dEyes**). It's based on ntfs-3g-0.20070102-BETA, and therefore under the GPL license. Writing is currently disabled for safety reasons, and you'll have to mount it manually, as the identify hooks are not yet implemented. Thanks a lot for your work! Modified: haiku/trunk/src/add-ons/kernel/file_systems/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-01-21 21:02:45 UTC (rev 19896) +++ haiku/trunk/src/add-ons/kernel/file_systems/Jamfile 2007-01-22 08:13:07 UTC (rev 19897) @@ -6,3 +6,5 @@ SubInclude HAIKU_TOP src add-ons kernel file_systems iso9660 ; SubInclude HAIKU_TOP src add-ons kernel file_systems nfs ; SubInclude HAIKU_TOP src add-ons kernel file_systems udf ; + +SubIncludeGPL HAIKU_TOP src add-ons kernel file_systems ntfs ; Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/Jamfile 2007-01-21 21:02:45 UTC (rev 19896) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/Jamfile 2007-01-22 08:13:07 UTC (rev 19897) @@ -0,0 +1,28 @@ +SubDir HAIKU_TOP src add-ons kernel file_systems ntfs ; + +SubDirHdrs [ FDirName $(SUBDIR) libntfs ] ; + +SubDirCcFlags -DHAVE_CONFIG_H=1 -D_READ_ONLY_=1 ; +SubDirC++Flags -DHAVE_CONFIG_H=1 -D_READ_ONLY_=1 ; + +UsePrivateHeaders kernel ; + +KernelAddon ntfs : + attributes.c + mime_table.c + utils.c + ntfsdir.c + volume_util.c + fs_func.c + kernel_interface.cpp + kernel_cpp.cpp + : + libntfs.a + ; + +SEARCH on [ FGristFiles + kernel_cpp.cpp + ] = [ FDirName $(HAIKU_TOP) src system kernel util ] ; + +SubIncludeGPL HAIKU_TOP src add-ons kernel file_systems ntfs libntfs ; + Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c 2007-01-21 21:02:45 UTC (rev 19896) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.c 2007-01-22 08:13:07 UTC (rev 19897) @@ -0,0 +1,336 @@ +/* + Copyright 1999-2001, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ +/* attributes.c + * handles mime type information for ntfs + * gets/sets mime information in vnode + */ + + +#define MIME_STRING_TYPE 'MIMS' + +#include +#include + +#include +#include +#include +#include + +#include "ntfs.h" +#include "attributes.h" +#include "mime_table.h" + +int32 kBeOSTypeCookie = 0x1234; + +status_t set_mime(vnode *node, const char *filename) +{ + struct ext_mime *p; + int32 namelen, ext_len; + + ERRPRINT("set_mime - for [%s]\n", filename); + + node->mime = NULL; + + namelen = strlen(filename); + + for (p=mimes;p->extension;p++) { + ext_len = strlen(p->extension); + + if (namelen <= ext_len) + continue; + + if (filename[namelen-ext_len-1] != '.') + continue; + + if (!strcasecmp(filename + namelen - ext_len, p->extension)) + break; + } + + node->mime = p->mime; + + return B_NO_ERROR; +} + + +status_t +fs_open_attrib_dir(void *_ns, void *_node, void **_cookie) +{ + nspace *ns = (nspace *)_ns; + int result = B_NO_ERROR; + + ERRPRINT("fs_open_attrdir - ENTER\n"); + + LOCK_VOL(ns); + + if ((*_cookie = malloc(sizeof(uint32))) == NULL) { + result = ENOMEM; + goto exit; + } + + *(int32 *)(*_cookie) = 0; + +exit: + + ERRPRINT("fs_open_attrdir - EXIT, result is %s\n", strerror(result)); + + UNLOCK_VOL(ns); + + return result; +} + +status_t +fs_close_attrib_dir(void *_ns, void *_node, void *_cookie) +{ + nspace *ns = (nspace *)_ns; + + ERRPRINT("fs_close_attrdir - ENTER\n"); + + LOCK_VOL(ns); + + *(int32 *)_cookie = 1; + + ERRPRINT("fs_close_attrdir - EXIT\n"); + + UNLOCK_VOL(ns); + + return B_NO_ERROR; +} + + +status_t +fs_free_attrib_dir_cookie(void *_ns, void *_node, void *_cookie) +{ + nspace *ns = (nspace *)_ns; + int result = B_NO_ERROR; + + LOCK_VOL(ns); + + ERRPRINT("fs_free_attrib_dir_cookie - ENTER\n"); + + if (_cookie == NULL) { + ERRPRINT("fs_free_attrib_dir_cookie - error: called with null cookie\n"); + result = EINVAL; + goto exit; + } + + *(int32 *)_cookie = 0x87654321; + free(_cookie); + +exit: + + ERRPRINT("fs_free_attrib_dir_cookie - EXIT, result is %s\n", strerror(result)); + + UNLOCK_VOL(ns); + + return result; +} + + +status_t +fs_rewind_attrib_dir(void *_ns, void *_node, void *_cookie) +{ + nspace *ns = (nspace *)_ns; + int result = B_NO_ERROR; + + LOCK_VOL(ns); + + ERRPRINT("fs_rewind_attrcookie - ENTER\n"); + + if (_cookie == NULL) { + ERRPRINT("fs_rewind_attrcookie - error: fs_rewind_attrcookie called with null cookie\n"); + result = EINVAL; + goto exit; + } + + *(uint32 *)_cookie = 0; + +exit: + + ERRPRINT("fs_rewind_attrcookie - EXIT, result is %s\n", strerror(result)); + + UNLOCK_VOL(ns); + + return result; +} + + +status_t +fs_read_attrib_dir(void *_ns, void *_node, void *_cookie, struct dirent *entry, size_t bufsize, uint32 *num) +{ + nspace *ns = (nspace *)_ns; + vnode *node = (vnode *)_node; + int32 *cookie = (int32 *)_cookie; + + LOCK_VOL(ns); + + ERRPRINT("fs_read_attrdir - ENTER\n"); + + *num = 0; + + if ((*cookie == 0) && (node->mime)) { + *num = 1; + + entry->d_ino = node->vnid; + entry->d_dev = ns->id; + entry->d_reclen = 10; + strcpy(entry->d_name, "BEOS:TYPE"); + } + + *cookie = 1; + + ERRPRINT("fs_read_attrdir - EXIT\n"); + + UNLOCK_VOL(ns); + + return B_NO_ERROR; +} + + +status_t +fs_open_attrib(void *_ns, void *_node, const char *name, int openMode, fs_cookie *_cookie) +{ + nspace *ns = (nspace *)_ns; + vnode *node = (vnode *)_node; + int result = B_NO_ERROR; + + LOCK_VOL(ns); + + ERRPRINT("fs_open_attrib - ENTER\n"); + + if (strcmp(name, "BEOS:TYPE")) { + result = ENOENT; + goto exit; + } + + if (node->mime == NULL) { + result = ENOENT; + goto exit; + } + + *_cookie = &kBeOSTypeCookie; + +exit: + + ERRPRINT("fs_open_attrib - EXIT, result is %s\n", strerror(result)); + + UNLOCK_VOL(ns); + + return result; +} + + +status_t +fs_close_attrib(void *_ns, void *_node, fs_cookie cookie) +{ + return B_NO_ERROR; +} + + +status_t +fs_free_attrib_cookie(void *_ns, void *_node, fs_cookie cookie) +{ + return B_NO_ERROR; +} + + +status_t +fs_read_attrib_stat(void *_ns, void *_node, fs_cookie _cookie, struct stat *stat) +{ + nspace *ns = (nspace *)_ns; + vnode *node = (vnode *)_node; + int result = B_NO_ERROR; + + LOCK_VOL(ns); + + ERRPRINT("fs_read_attr_stat - ENTER\n"); + + if (_cookie != &kBeOSTypeCookie) { + result = ENOENT; + goto exit; + } + + if (node->mime == NULL) { + result = ENOENT; + goto exit; + } + + stat->st_type = MIME_STRING_TYPE; + stat->st_size = strlen(node->mime) + 1; + +exit: + + ERRPRINT("fs_read_attrib_stat - EXIT, result is %s\n", strerror(result)); + + UNLOCK_VOL(ns); + + return B_NO_ERROR; +} + + +status_t +fs_read_attrib(void *_ns, void *_node, fs_cookie _cookie, off_t pos, void *buffer, size_t *_length) +{ + nspace *ns = (nspace *)_ns; + vnode *node = (vnode *)_node; + int result = B_NO_ERROR; + + LOCK_VOL(ns); + + ERRPRINT("fs_read_attr - ENTER\n"); + + if (_cookie != &kBeOSTypeCookie) { + result = ENOENT; + goto exit; + } + + if (node->mime == NULL) { + result = ENOENT; + goto exit; + } + + if ((pos < 0) || (pos > strlen(node->mime))) { + result = EINVAL; + goto exit; + } + + strncpy(buffer, node->mime + pos, *_length - 1); + ((char *)buffer)[*_length - 1] = 0; + *_length = strlen(buffer) + 1; + +exit: + + ERRPRINT("fs_read_attr - EXIT, result is %s\n", strerror(result)); + + UNLOCK_VOL(ns); + + return result; +} + + +status_t +fs_write_attrib(void *_ns, void *_node, fs_cookie _cookie, off_t pos, + const void *buffer, size_t *_length) +{ + nspace *ns = (nspace *)_ns; + int result = B_NO_ERROR; + + LOCK_VOL(ns); + + ERRPRINT("fs_write_attr - ENTER\n"); + + *_length = 0; + + if (_cookie != &kBeOSTypeCookie) { + result = ENOSYS; + goto exit; + } +exit: + + ERRPRINT("fs_write_attrib - EXIT, result is %s\n", strerror(result)); + + UNLOCK_VOL(ns); + + return result; +} Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.h 2007-01-21 21:02:45 UTC (rev 19896) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/attributes.h 2007-01-22 08:13:07 UTC (rev 19897) @@ -0,0 +1,29 @@ +/* + Copyright 1999-2001, Be Incorporated. All Rights Reserved. + This file may be used under the terms of the Be Sample Code License. +*/ +/* attributes.h + * handles mime type information for ntfs + * gets/sets mime information in vnode + */ + +#ifndef _fs_ATTR_H_ +#define _fs_ATTR_H_ + +#include + +status_t set_mime(vnode *node, const char *filename); + +status_t fs_open_attrib_dir(void *_vol, void *_node, void **_cookie); +status_t fs_close_attrib_dir(void *_vol, void *_node, void *_cookie); +status_t fs_free_attrib_dir_cookie(void *_vol, void *_node, void *_cookie); +status_t fs_rewind_attrib_dir(void *_vol, void *_node, void *_cookie); +status_t fs_read_attrib_dir(void *_vol, void *_node, void *_cookie, struct dirent *buf, size_t bufsize, uint32 *num); +status_t fs_open_attrib(void *_vol, void *_node, const char *name, int openMode,fs_cookie *_cookie); +status_t fs_close_attrib(void *_vol, void *_node, fs_cookie cookie); +status_t fs_free_attrib_cookie(void *_vol, void *_node, fs_cookie cookie); +status_t fs_read_attrib_stat(void *_vol, void *_node, fs_cookie _cookie, struct stat *stat); +status_t fs_read_attrib(void *_vol, void *_node, fs_cookie _cookie, off_t pos,void *buffer, size_t *_length); +status_t fs_write_attrib(void *_vol, void *_node, fs_cookie _cookie, off_t pos, const void *buffer, size_t *_length); + +#endif Added: haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-01-21 21:02:45 UTC (rev 19896) +++ haiku/trunk/src/add-ons/kernel/file_systems/ntfs/fs_func.c 2007-01-22 08:13:07 UTC (rev 19897) @@ -0,0 +1,1701 @@ +/* + * Copyright (c) 2000-2004 Anton Altaparmakov + * Copyright (c) 2002-2006 Szabolcs Szakacsits + * + * Copyright (c) 2006 Troeglazov Gerasim (3dEyes**) + * + * This program/include file is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program/include file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details. + * + * You should have received a copy of the GNU General Public License along with + * this program (in the main directory of the Linux-NTFS distribution in the + * file COPYING); if not, write to the Free Software Foundation,Inc., 59 Temple + * Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ntfs.h" +#include "attributes.h" +#include "lock.h" +#include "volume_util.h" + +status_t fs_mount( mount_id nsid, const char *device, ulong flags, const char *args, void **data, vnode_id *vnid ); +status_t fs_unmount(void *_ns); +status_t fs_rfsstat(void *_ns, struct fs_info *); +status_t fs_wfsstat(void *_vol, const struct fs_info *fss, uint32 mask); +status_t fs_sync(void *_ns); +status_t fs_walk(void *_ns, void *_base, const char *file, vnode_id *vnid,int *_type); +status_t fs_get_vnode_name(void *_ns, void *_node, char *buffer, size_t bufferSize); +status_t fs_read_vnode(void *_ns, vnode_id vnid, void **_node, bool reenter); +status_t fs_write_vnode(void *_ns, void *_node, bool reenter); +status_t fs_remove_vnode( void *_ns, void *_node, bool reenter ); +status_t fs_access( void *ns, void *node, int mode ); +status_t fs_rstat(void *_ns, void *_node, struct stat *st); +status_t fs_wstat(void *_vol, void *_node, const struct stat *st, uint32 mask); +status_t fs_create(void *_ns, void *_dir, const char *name, int omode, int perms, void **_cookie, vnode_id *_vnid); +status_t fs_open(void *_ns, void *_node, int omode, void **cookie); +status_t fs_close(void *ns, void *node, void *cookie); +status_t fs_free_cookie(void *ns, void *node, void *cookie); +status_t fs_read(void *_ns, void *_node, void *cookie, off_t pos, void *buf, size_t *len); +status_t fs_write(void *ns, void *node, void *cookie, off_t pos, const void *buf, size_t *len); +status_t fs_mkdir(void *_ns, void *_node, const char *name, int perms, vnode_id *_vnid); +status_t fs_rmdir(void *_ns, void *dir, const char *name); +status_t fs_opendir(void* _ns, void* _node, void** cookie); +status_t fs_readdir( void *_ns, void *_node, void *_cookie, struct dirent *buf, size_t bufsize, uint32 *num ); +status_t fs_rewinddir(void *_ns, void *_node, void *cookie); +status_t fs_closedir(void *_ns, void *_node, void *cookie); +status_t fs_free_dircookie(void *_ns, void *_node, void *cookie); +status_t fs_readlink(void *_ns, void *_node, char *buf, size_t *bufsize); +status_t fs_fsync(void *_ns, void *_node); +status_t fs_rename(void *_ns, void *_odir, const char *oldname, void *_ndir, const char *newname); +status_t fs_unlink(void *_ns, void *_node, const char *name); +status_t fs_create_symlink(void *_ns, void *_dir, const char *name, const char *target, int mode); + +void fs_free_identify_partition_cookie(partition_data *partition, void *_cookie); +status_t fs_scan_partition(int fd, partition_data *partition, void *_cookie); +float fs_identify_partition(int fd, partition_data *partition, void **_cookie); + +#ifndef _READ_ONLY_ +static status_t do_unlink(nspace *vol, vnode *dir, const char *name, bool isdir); +#endif + +//not emplemented now +float +fs_identify_partition(int fd, partition_data *partition, void **_cookie) +{ + return 0.0f; +} + +//not emplemented now +status_t +fs_scan_partition(int fd, partition_data *partition, void *_cookie) +{ + return B_OK; +} + +//not emplemented now +void +fs_free_identify_partition_cookie(partition_data *partition, void *_cookie) +{ +} + + +status_t +fs_mount( mount_id nsid, const char *device, ulong flags, const char *args, void **data, vnode_id *vnid ) +{ + nspace *ns; + vnode *newNode = NULL; + char lockname[32]; + status_t result = B_NO_ERROR; + + ERRPRINT("fs_mount - ENTER\n"); + + ns = ntfs_malloc(sizeof(nspace)); + if (!ns) { + result = ENOMEM; + goto exit; + } + + *ns = (nspace) { + .state = NF_FreeClustersOutdate | NF_FreeMFTOutdate, + .uid = 0, + .gid = 0, + .fmask = 0177, + .dmask = 0777, + .show_sys_files = false, + }; + + strcpy(ns->devicePath,device); + + sprintf(lockname, "ntfs_lock %lx", ns->id); + if ((result = recursive_lock_init(&(ns->vlock), lockname)) != 0) { + ERRPRINT("fs_mount - error creating lock (%s)\n", strerror(result)); + goto exit; + } + + ns->ntvol=utils_mount_volume(device,0,true); + if(ns->ntvol!=NULL) + result = B_NO_ERROR; + else + result = errno; + + if (result == B_NO_ERROR) { + *vnid = FILE_root; + *data = (void*)ns; + ns->id = nsid; + + newNode = (vnode*)ntfs_calloc( sizeof(vnode) ); + if ( newNode == NULL ) + result = ENOMEM; + else { + + newNode->vnid = *vnid; + newNode->parent_vnid = -1; + + result = publish_vnode( nsid, *vnid, (void*)newNode ); + if ( result != B_NO_ERROR ) { + free( ns ); + result = EINVAL; + goto exit; + } + else { + result = B_NO_ERROR; + ntfs_mark_free_space_outdated(ns); + ntfs_calc_free_space(ns); + } + } + } + +exit: + + ERRPRINT("fs_mount - EXIT, result code is %s\n", strerror(result)); + + return result; +} + +status_t +fs_unmount(void *_ns) +{ + nspace *ns = (nspace*)_ns; + status_t result = B_NO_ERROR; + + ERRPRINT("fs_unmount - ENTER\n"); + + ntfs_device_umount( ns->ntvol, true ); + + recursive_lock_destroy(&(ns->vlock)); + + free( ns ); + + ERRPRINT("fs_unmount - EXIT, result is %s\n", strerror(result)); + + return result; +} + +status_t +fs_rfsstat( void *_ns, struct fs_info * fss ) +{ + nspace *ns = (nspace*)_ns; + int i; + + LOCK_VOL(ns); + + ERRPRINT("fs_rfsstat - ENTER\n"); + + ntfs_calc_free_space(ns); + + fss->dev = ns->id; + fss->root = FILE_root; + fss->flags = B_FS_IS_PERSISTENT|B_FS_HAS_MIME|B_FS_HAS_ATTR; + fss->block_size = ns->ntvol->cluster_size; + fss->io_size = 65536; + fss->total_blocks = ns->ntvol->nr_clusters; + fss->free_blocks = ns->free_clusters; + strncpy( fss->device_name, ns->devicePath, sizeof(fss->device_name)); + strncpy( fss->volume_name, ns->ntvol->vol_name, sizeof(fss->volume_name) ); + + for (i = strlen(fss->volume_name)-1; i >=0 ; i--) + if (fss->volume_name[i] != ' ') + break; + if (i < 0) + strcpy(fss->volume_name, "NTFS Untitled"); + else + fss->volume_name[i + 1] = 0; + + strcpy( fss->fsh_name, "NTFS" ); + + ERRPRINT("fs_rfsstat - EXIT\n"); + + UNLOCK_VOL(ns); + + return B_NO_ERROR; +} + +#ifndef _READ_ONLY_ +status_t +fs_wfsstat(void *_vol, const struct fs_info * fss, uint32 mask) +{ + nspace* ns = (nspace*)_vol; + status_t result = B_NO_ERROR; + + LOCK_VOL(ns); + + if (mask & FS_WRITE_FSINFO_NAME) { + result = ntfs_change_label( ns->ntvol, (char*)fss->volume_name ); + goto exit; + } + +exit: + + UNLOCK_VOL(ns); + + return result; +} +#endif + +status_t +fs_walk(void *_ns, void *_base, const char *file, vnode_id *vnid,int *_type) +{ + nspace *ns = (nspace*)_ns; + vnode *baseNode = (vnode*)_base; + vnode *newNode = NULL; + ntfschar *unicode = NULL; + ntfs_inode *bi = NULL; + status_t result = B_NO_ERROR; + int len; + + LOCK_VOL(ns); + + ERRPRINT("fs_walk - ENTER : find for \"%s\"\n",file); + + if(ns == NULL || _base == NULL || file == NULL || vnid == NULL) { + result = EINVAL; + goto exit; + } + + if ( !strcmp( file, "." ) ) { + *vnid = baseNode->vnid; + if ( get_vnode( ns->id, *vnid, (void**)&newNode ) != 0 ) + result = ENOENT; + } else if ( !strcmp( file, ".." ) && baseNode->vnid != FILE_root ) { + *vnid = baseNode->parent_vnid; + if ( get_vnode( ns->id, *vnid, (void**)&newNode ) != 0 ) + result = ENOENT; + } else { + unicode = ntfs_calloc(MAX_PATH); + len = ntfs_mbstoucs(file, &unicode, MAX_PATH); + if (len < 0) { + result = EILSEQ; + goto exit; + } + + bi = ntfs_inode_open(ns->ntvol, baseNode->vnid); + if(!bi) { + result = ENOENT; + goto exit; + } + + *vnid = MREF( ntfs_inode_lookup_by_name(bi, unicode, len) ); + + ntfs_inode_close(bi); + free(unicode); + + if ( *vnid == (u64) -1 ) { + result = EINVAL; + goto exit; + } + + if( get_vnode( ns->id, *vnid, (void**)&newNode ) !=0 ) + result = ENOENT; + } + +exit: + + ERRPRINT("fs_walk - EXIT, result is %s\n", strerror(result)); + + UNLOCK_VOL(ns); + + return result; +} + + +status_t +fs_get_vnode_name(void *_ns, void *_node, char *buffer, size_t bufferSize) +{ + nspace *ns = (nspace*)_ns; + vnode *node = (vnode*)_node; + ntfs_inode *ni=NULL; + status_t result = B_NO_ERROR; + + char path[MAX_PATH]; + char *name; + + LOCK_VOL(ns); + + ni = ntfs_inode_open(ns->ntvol, node->vnid); + if(ni==NULL) { + result = ENOENT; + goto exit; + } + + if(utils_inode_get_name(ni, path, MAX_PATH)==0) { + result = EINVAL; + goto exit; + } + name = strrchr(path, '/'); + name++; + + strlcpy(buffer, name, bufferSize); + +exit: + + if(ni) + ntfs_inode_close(ni); + + UNLOCK_VOL(ns); + + return result; +} + + + + +status_t +fs_read_vnode(void *_ns, vnode_id vnid, void **node, bool reenter) +{ + nspace *ns = (nspace*)_ns; + vnode *newNode = NULL; + ntfs_inode *ni=NULL; + status_t result = B_NO_ERROR; + + if ( !reenter ) + LOCK_VOL(ns); + + ERRPRINT("fs_read_vnode - ENTER\n"); + + newNode = (vnode*)ntfs_calloc( sizeof(vnode) ); + if ( newNode != NULL ) { + char *name = NULL; + + ni = ntfs_inode_open(ns->ntvol, vnid); + if(ni==NULL) { + result = ENOENT; + goto exit; + } + + newNode->vnid = vnid; + newNode->parent_vnid = ntfs_get_parent_ref(ni); + + if( ni->mrec->flags & MFT_RECORD_IS_DIRECTORY ) + set_mime(newNode, ".***"); + else { + name = (char*)malloc(MAX_PATH); + if(name!=NULL) { + if(utils_inode_get_name(ni, name,MAX_PATH)==1) + set_mime(newNode, name); + free(name); + } + } + + *node = (void*)newNode; + } + else + result = ENOMEM; +exit: + + if(ni) + ntfs_inode_close(ni); + + ERRPRINT("fs_read_vnode - EXIT, result is %s\n", strerror(result)); + + if ( !reenter ) + UNLOCK_VOL(ns); + + return result; +} + +status_t +fs_write_vnode( void *_ns, void *_node, bool reenter ) +{ + nspace *ns = (nspace*)_ns; + vnode *node = (vnode*)_node; + status_t result = B_NO_ERROR; + + if ( !reenter ) + LOCK_VOL(ns); + + ERRPRINT("fs_write_vnode - ENTER (%Ld)\n", node->vnid); + + if (node) + free( node ); + + ERRPRINT("fs_write_vnode - EXIT\n"); + + if ( !reenter ) + UNLOCK_VOL(ns); + + return result; +} + +#ifndef _READ_ONLY_ +status_t +fs_remove_vnode( void *_ns, void *_node, bool reenter ) +{ + nspace *ns = (nspace*)_ns; + vnode *node = (vnode*)_node; + status_t result = B_NO_ERROR; + + if ( !reenter ) + LOCK_VOL(ns); + + ERRPRINT("fs_remove_vnode - ENTER (%Ld)\n", node->vnid); + + if(node) + free(node); + + ERRPRINT("fs_remove_vnode - EXIT, result is %s\n", strerror(result)); + + if ( !reenter ) + UNLOCK_VOL(ns); + + return result; +} +#endif + +status_t +fs_rstat( void *_ns, void *_node, struct stat *stbuf ) +{ + nspace *ns = (nspace*)_ns; + vnode *node = (vnode*)_node; + ntfs_inode *ni = NULL; + ntfs_attr *na; + status_t result = B_NO_ERROR; + + LOCK_VOL(ns); + + ERRPRINT("fs_rstat - ENTER:\n"); + + if(ns==NULL || node ==NULL ||stbuf==NULL) { + result = ENOENT; + goto exit; + } + + ni = ntfs_inode_open(ns->ntvol, node->vnid); + if(ni==NULL) { + result = ENOENT; + goto exit; + } + + stbuf->st_dev = ns->id; + stbuf->st_ino = MREF(ni->mft_no); + + if ( ni->mrec->flags & MFT_RECORD_IS_DIRECTORY ) { + stbuf->st_mode = S_IFDIR | (0777 & ~ns->dmask); + na = ntfs_attr_open(ni, AT_INDEX_ALLOCATION, NTFS_INDEX_I30, 4); + if (na) { + stbuf->st_size = na->data_size; + ntfs_attr_close(na); + } else { + stbuf->st_size = 0; + } + stbuf->st_nlink = 1; // Needed for correct find work. + } else { + // Regular or Interix (INTX) file. + stbuf->st_mode = S_IFREG; + stbuf->st_size = ni->data_size; + stbuf->st_nlink = le16_to_cpu(ni->mrec->link_count); + + na = ntfs_attr_open(ni, AT_DATA, NULL,0); + if (!na) { + result = ENOENT; + goto exit; + } + + stbuf->st_size = na->data_size; + + if (!ni->flags & FILE_ATTR_HIDDEN) { + if (na->data_size == 0) + stbuf->st_mode = S_IFIFO; + } + + if (na->data_size <= sizeof(INTX_FILE_TYPES) + sizeof(ntfschar) * MAX_PATH && na->data_size >sizeof(INTX_FILE_TYPES)) { + INTX_FILE *intx_file; + + intx_file = ntfs_malloc(na->data_size); + if (!intx_file) { + result = EINVAL; + ntfs_attr_close(na); + goto exit; + } + if (ntfs_attr_pread(na, 0, na->data_size,intx_file) != na->data_size) { + result = EINVAL; + free(intx_file); + ntfs_attr_close(na); + goto exit; + } + if (intx_file->magic == INTX_SYMBOLIC_LINK) + stbuf->st_mode = S_IFLNK; + free(intx_file); + } + ntfs_attr_close(na); + stbuf->st_mode |= (0777 & ~ns->fmask); + } + stbuf->st_uid = ns->uid; + stbuf->st_gid = ns->gid; + stbuf->st_atime = ni->last_access_time; + stbuf->st_ctime = ni->last_mft_change_time; + stbuf->st_mtime = ni->last_data_change_time; + +exit: + + if(ni) + ntfs_inode_close(ni); + + ERRPRINT("fs_rstat - EXIT, result is %s\n", strerror(result)); + + UNLOCK_VOL(ns); + + return result; + +} + +#ifndef _READ_ONLY_ +status_t [... truncated: 33046 lines follow ...] From axeld at mail.berlios.de Mon Jan 22 15:12:13 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 22 Jan 2007 15:12:13 +0100 Subject: [Haiku-commits] r19898 - haiku/trunk/src/system/kernel/vm Message-ID: <200701221412.l0MECDpA029420@sheep.berlios.de> Author: axeld Date: 2007-01-22 15:12:11 +0100 (Mon, 22 Jan 2007) New Revision: 19898 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19898&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: Add a little hack to the "dw/db/ds/dl" commands that allows you to dump the contents of a physical memory location. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-22 08:13:07 UTC (rev 19897) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-22 14:12:11 UTC (rev 19898) @@ -1762,27 +1762,36 @@ static int display_mem(int argc, char **argv) { + bool physical = false; + addr_t copyAddress; int32 displayWidth; int32 itemSize; - int32 num = 1; + int32 num = -1; addr_t address; - int i, j; + int i = 1, j; - if (argc < 2) { - kprintf("usage: dl/dw/ds/db
[num]\n" + if (argc > 1 && argv[1][0] == '-') { + if (!strcmp(argv[1], "-p") || !strcmp(argv[1], "--physical")) { + physical = true; + i++; + } else + i = 99; + } + + if (argc < i + 1 || argc > i + 2) { + kprintf("usage: dl/dw/ds/db [-p|--physical]
[num]\n" "\tdl - 8 bytes\n" "\tdw - 4 bytes\n" "\tds - 2 bytes\n" - "\tdb - 1 byte\n"); + "\tdb - 1 byte\n" + " -p or --physical only allows memory from a single page to be displayed.\n"); return 0; } - address = strtoul(argv[1], NULL, 0); + address = strtoul(argv[i], NULL, 0); - if (argc >= 3) { - num = -1; - num = atoi(argv[2]); - } + if (argc > i + 1) + num = atoi(argv[i + 1]); // build the format string if (strcmp(argv[0], "db") == 0) { @@ -1802,6 +1811,33 @@ return 0; } + if (num <= 0) + num = displayWidth; + + if (physical) { + int32 offset = address & (B_PAGE_SIZE - 1); + if (num * itemSize + offset > B_PAGE_SIZE) { + num = (B_PAGE_SIZE - offset) / itemSize; + kprintf("NOTE: number of bytes has been cut to page size\n"); + } + + address = ROUNDOWN(address, B_PAGE_SIZE); + + kernel_startup = true; + // vm_get_physical_page() needs to lock... + + if (vm_get_physical_page(address, ©Address, PHYSICAL_PAGE_NO_WAIT) != B_OK) { + kprintf("getting the hardware page failed."); + kernel_startup = false; + return 0; + } + + kernel_startup = false; + address += offset; + copyAddress += offset; + } else + copyAddress = address; + for (i = 0; i < num; i++) { uint32 value; @@ -1814,7 +1850,7 @@ for (j = 0; j < displayed; j++) { char c; - if (user_memcpy(&c, (char *)address + i * itemSize + j, 1) != B_OK) { + if (user_memcpy(&c, (char *)copyAddress + i * itemSize + j, 1) != B_OK) { displayed = j; break; } @@ -1831,7 +1867,7 @@ kprintf(" "); } - if (user_memcpy(&value, (uint8 *)address + i * itemSize, itemSize) != B_OK) { + if (user_memcpy(&value, (uint8 *)copyAddress + i * itemSize, itemSize) != B_OK) { kprintf("read fault"); break; } @@ -1853,6 +1889,13 @@ } kprintf("\n"); + + if (physical) { + copyAddress = ROUNDOWN(copyAddress, B_PAGE_SIZE); + kernel_startup = true; + vm_put_physical_page(copyAddress); + kernel_startup = false; + } return 0; } From axeld at mail.berlios.de Mon Jan 22 15:45:51 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 22 Jan 2007 15:45:51 +0100 Subject: [Haiku-commits] r19899 - in haiku/trunk: headers/private/kernel/arch/x86 src/add-ons/kernel/cpu/x86 Message-ID: <200701221445.l0MEjpCU031976@sheep.berlios.de> Author: axeld Date: 2007-01-22 15:45:50 +0100 (Mon, 22 Jan 2007) New Revision: 19899 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19899&view=rev Modified: haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp Log: Applied patch by Vasilis Kaoutsis: now checks for the MSR feature as well; obviously some Pentium 200 MMX pretend to support MTRRs. This should fix bug #553. Modified: haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h =================================================================== --- haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h 2007-01-22 14:12:11 UTC (rev 19898) +++ haiku/trunk/headers/private/kernel/arch/x86/arch_cpu.h 2007-01-22 14:45:50 UTC (rev 19899) @@ -22,6 +22,7 @@ #define IA32_MSR_MTRR_PHYSICAL_MASK_0 0x201 // cpuid eax 1 features +#define IA32_FEATURE_MSR (1UL << 5) #define IA32_FEATURE_MTRR (1UL << 12) #define IA32_FEATURE_GLOBAL_PAGES (1UL << 13) #define IA32_FEATURE_SSE (1UL << 25) Modified: haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp 2007-01-22 14:12:11 UTC (rev 19898) +++ haiku/trunk/src/add-ons/kernel/cpu/x86/generic_x86.cpp 2007-01-22 14:45:50 UTC (rev 19899) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006, Haiku, Inc. + * Copyright 2005-2007, Haiku, Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -48,7 +48,8 @@ { cpuid_info cpuInfo; if (get_current_cpuid(&cpuInfo, 1) != B_OK - || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0) + || (cpuInfo.eax_1.features & IA32_FEATURE_MTRR) == 0 + || (cpuInfo.eax_1.features & IA32_FEATURE_MSR) == 0) return 0; mtrr_capabilities capabilities(x86_read_msr(IA32_MSR_MTRR_CAPABILITIES)); @@ -160,6 +161,9 @@ void generic_dump_mtrrs(uint32 count) { + if (count == 0) + return; + if (x86_read_msr(IA32_MSR_MTRR_DEFAULT_TYPE) & IA32_MTRR_ENABLE) { TRACE(("MTRR enabled\n")); } else { From mmlr at mail.berlios.de Mon Jan 22 16:19:01 2007 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Mon, 22 Jan 2007 16:19:01 +0100 Subject: [Haiku-commits] r19900 - haiku/trunk/src/add-ons/kernel/busses/usb Message-ID: <200701221519.l0MFJ1ng002098@sheep.berlios.de> Author: mmlr Date: 2007-01-22 16:19:01 +0100 (Mon, 22 Jan 2007) New Revision: 19900 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19900&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/usb/ohci.cpp Log: Fixed wrong usage of object types in OHCI. The types are bitmasks, not values. Modified: haiku/trunk/src/add-ons/kernel/busses/usb/ohci.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/usb/ohci.cpp 2007-01-22 14:45:50 UTC (rev 19899) +++ haiku/trunk/src/add-ons/kernel/busses/usb/ohci.cpp 2007-01-22 15:19:01 UTC (rev 19900) @@ -617,23 +617,19 @@ //Check which list we need to add the endpoint in Endpoint *listhead; - switch (p->Type()) { - case USB_OBJECT_CONTROL_PIPE: + if (p->Type() & USB_OBJECT_CONTROL_PIPE) listhead = fDummyControl; - break; - case USB_OBJECT_BULK_PIPE: + else if (p->Type() & USB_OBJECT_BULK_PIPE) listhead = fDummyBulk; - break; - case USB_OBJECT_ISO_PIPE: + else if (p->Type() & USB_OBJECT_ISO_PIPE) listhead = fDummyIsochronous; - break; - default: + else { FreeEndpoint(endpoint); return B_ERROR; } //Add the endpoint to the queues - if (p->Type() != USB_OBJECT_ISO_PIPE) { + if ((p->Type() & USB_OBJECT_ISO_PIPE) == 0) { //Link the endpoint into the head of the list endpoint->SetNext(listhead->next); listhead->SetNext(endpoint); From mmu_man at mail.berlios.de Mon Jan 22 16:59:45 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Mon, 22 Jan 2007 16:59:45 +0100 Subject: [Haiku-commits] r19901 - in haiku/trunk: headers/os headers/os/usb src/kits src/kits/usb Message-ID: <200701221559.l0MFxjuE004360@sheep.berlios.de> Author: mmu_man Date: 2007-01-22 16:59:44 +0100 (Mon, 22 Jan 2007) New Revision: 19901 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19901&view=rev Added: haiku/trunk/headers/os/usb/ haiku/trunk/headers/os/usb/USBKit.h haiku/trunk/src/kits/usb/ haiku/trunk/src/kits/usb/USBConfiguration.cpp haiku/trunk/src/kits/usb/USBDevice.cpp haiku/trunk/src/kits/usb/USBEndpoint.cpp haiku/trunk/src/kits/usb/USBInterface.cpp haiku/trunk/src/kits/usb/USBRoster.cpp Log: The original (sample code version) USB Kit from Be, as from ftp.be.com/samples/usb_kit/usbkit_99-03-23.tgz Some files renamed. Won't build yet with our usb_raw driver due to different namings. classes need to be B-prefixed anyway. USBKit.h needs to be split like in zeta as well. Added: haiku/trunk/headers/os/usb/USBKit.h =================================================================== --- haiku/trunk/headers/os/usb/USBKit.h 2007-01-22 15:19:01 UTC (rev 19900) +++ haiku/trunk/headers/os/usb/USBKit.h 2007-01-22 15:59:44 UTC (rev 19901) @@ -0,0 +1,211 @@ + +// USBKit.h +// +// Copyright 1999, Be Incorporated. +// +// Prototype USB Kit / Prerelease Sample Code +// Contents may change massively before official release. + +#ifndef _USBKIT_H +#define _USBKIT_H + +// Provides definitions for usb_xxx_descriptor structures. +#include + +#include + +class USBDevice; +class USBEndpoint; +class USBInterface; +class USBConfiguration; +class USBRosterLooper; + +class USBEndpoint +{ +public: +// Connectivity functions (this endpoint belongs to an Interface that +// belongs to a Configuration that belongs to a Device) + const USBInterface *Interface(void) const; + const USBConfiguration *Configuration(void) const; + const USBDevice *Device(void) const; + +// Raw descriptor data + const usb_endpoint_descriptor *Descriptor(void) const; + +// Descriptor Accessor Functions + bool IsBulk(void) const; + bool IsInterrupt(void) const; + bool IsIsochronous(void) const; + bool IsInput(void) const; + bool IsOutput(void) const; + uint16 MaxPacketSize(void) const; + uint8 Interval(void) const; + +// Initiate a USB Transaction + status_t InterruptTransfer(void *data, size_t length) const; + status_t BulkTransfer(void *data, size_t length) const; + +private: + friend USBDevice; // Only created by a USBDevice + friend USBInterface; // Only destroyed by a containing USBInterface + USBEndpoint(uint32 n, USBInterface *ifc); + ~USBEndpoint(); + + USBInterface *interface; + usb_endpoint_descriptor descriptor; + uint32 endpoint_num; +}; + +class USBInterface +{ +public: +// Connectivity functions (this Interface belongs to a Configuration which +// belongs to a Device) + const USBConfiguration *Configuration(void) const; + const USBDevice *Device(void) const; + +// Iterate over the Endpoints defined by this Interface + uint32 CountEndpoints(void) const; + const USBEndpoint *EndpointAt(uint32 n) const; + +// Access the raw descriptor + const usb_interface_descriptor *Descriptor(void) const; + +// Accessors for useful bits in the descriptor + uint8 Class(void) const; + uint8 Subclass(void) const; + uint8 Protocol(void) const; + const char *InterfaceString(void) const; + +private: + friend USBDevice; // only created by USBDevice + friend USBConfiguration; // only destroyed by the containing Configuration + USBInterface(uint32 n, USBConfiguration *cfc); + ~USBInterface(); + + USBConfiguration *configuration; + usb_interface_descriptor descriptor; + uint32 interface_num; + BList endpoints; +}; + +class USBConfiguration +{ +public: +// Connectivity functions (this Configuration belongs to a Device) + const USBDevice *Device(void) const; + +// Iterators for the Interfaces provided by this Configuration + uint32 CountInterfaces(void) const; + const USBInterface *InterfaceAt(uint32 n) const; + +// Access the raw descriptor + const usb_configuration_descriptor *Descriptor(void) const; + +private: + friend USBDevice; + USBConfiguration(uint n, USBDevice *dev); + ~USBConfiguration(); + + USBDevice *device; + uint configuration_num; + usb_configuration_descriptor descriptor; + BList interfaces; +}; + +class USBDevice +{ +public: + USBDevice(const char *path = NULL); + virtual ~USBDevice(); + virtual status_t InitCheck(void); + status_t SetTo(const char *path); + +// Bus Topology information methods: + +// Return the logical path (eg 0/0/1 of the device), or NULL if unconfigured + const char *Location(void) const; +// Return true if this device is a usb hub + bool IsHub(void) const; + +// Accessors for useful bits in the descriptor + uint16 USBVersion(void) const; + uint8 Class(void) const; + uint8 Subclass(void) const; + uint8 Protocol(void) const; + uint8 MaxEndpoint0PacketSize(void) const; + uint16 VendorID(void) const; + uint16 ProductID(void) const; + uint16 Version(void) const; + const char *ManufacturerString(void) const; + const char *ProductString(void) const; + const char *SerialNumberString(void) const; + +// Access the raw descriptor + const usb_device_descriptor *Descriptor(void) const; + +// Read a string descriptor from the Device into a buffer + size_t GetStringDescriptor(uint32 n, usb_string_descriptor *desc, size_t length) const; + +// Read a string descriptor, convert it from Unicode to UTF8, return a new char[] +// containing the string (must be delete'd by the caller) + char *DecodeStringDescriptor(uint32 n) const; + +// Iterate over the possible configurations + uint32 CountConfigurations(void) const; + const USBConfiguration *ConfigurationAt(uint32 n) const; + +// View and select the active configuration + const USBConfiguration *ActiveConfiguration(void) const; + status_t SetConfiguration(const USBConfiguration *conf); + +// Initiate a Control (endpoint 0) transaction + status_t ControlTransfer(uint8 request_type, uint8 request, uint16 value, + uint16 index, uint16 length, void *data) const; + +private: + status_t InterruptTransfer(const USBEndpoint *e, void *data, size_t length) const; + status_t BulkTransfer(const USBEndpoint *e, void *data, size_t length) const; + + void Release(void); + void PopulateInterface(USBInterface *ifc, usb_interface_descriptor *descr); + void PopulateConfig(USBConfiguration *conf, usb_configuration_descriptor *descr); + void PopulateDevice(void); + + mutable char *serial_string; // Cache the string descriptors + mutable char *manufacturer_string; + mutable char *product_string; + char *location; // Bus Topology info + bool ishub; + int fd; // Connection to /dev/bus/usb/... + usb_device_descriptor descriptor; // Cache the descriptor + USBConfiguration *active; // Current active configuration + BList configurations; // All possible configurations + +friend USBEndpoint; // USBEndpoint uses the XxxTransfer() methods +}; + + +class USBRoster +{ +public: + USBRoster(void); + virtual ~USBRoster(); + +// DeviceAdded() is called when a new device appears on the Bus. +// If the result is not B_OK, the USBDevice instance is deleted and +// there will be no DeviceRemoved notification. + virtual status_t DeviceAdded(USBDevice *dev) = 0; + +// DeviceRemoved() is called when a device is disconnected from the Bus. +// The USBDevice WILL BE deleted after this method returns. + virtual void DeviceRemoved(USBDevice *dev) = 0; + + void Start(void); + void Stop(void); +private: + USBRosterLooper *rlooper; + +}; + +#endif \ No newline at end of file Added: haiku/trunk/src/kits/usb/USBConfiguration.cpp =================================================================== --- haiku/trunk/src/kits/usb/USBConfiguration.cpp 2007-01-22 15:19:01 UTC (rev 19900) +++ haiku/trunk/src/kits/usb/USBConfiguration.cpp 2007-01-22 15:59:44 UTC (rev 19901) @@ -0,0 +1,46 @@ + +#include + +// USBConfiguration ------------------------------------------------------------------ + +uint32 +USBConfiguration::CountInterfaces(void) const +{ + return descriptor.number_interfaces; +} + +const USBInterface * +USBConfiguration::InterfaceAt(uint32 n) const +{ + return (USBInterface *) interfaces.ItemAt(n); +} + +const usb_configuration_descriptor * +USBConfiguration::Descriptor(void) const +{ + return &descriptor; +} + +const USBDevice * +USBConfiguration::Device(void) const +{ + return device; +} + +USBConfiguration::USBConfiguration(uint n, USBDevice *dev) +{ + configuration_num = n; + device = dev; +} + +USBConfiguration::~USBConfiguration() +{ + int i; + USBInterface *ifc; + + for(i=0;(ifc = (USBInterface *) interfaces.ItemAt(i)); i++){ + delete ifc; + } + interfaces.MakeEmpty(); +} + Added: haiku/trunk/src/kits/usb/USBDevice.cpp =================================================================== --- haiku/trunk/src/kits/usb/USBDevice.cpp 2007-01-22 15:19:01 UTC (rev 19900) +++ haiku/trunk/src/kits/usb/USBDevice.cpp 2007-01-22 15:59:44 UTC (rev 19901) @@ -0,0 +1,419 @@ + +#include +#include +#include +#include +#include +#include + +// USBDevice ------------------------------------------------------------------------- + +USBDevice::USBDevice(const char *path) +{ + fd = -1; + serial_string = NULL; + manufacturer_string = NULL; + product_string = NULL; + active = NULL; + ishub = false; + location = NULL; + + SetTo(path); +} + +USBDevice::~USBDevice() +{ + Release(); +} + +const char * +USBDevice::Location(void) const +{ + return (const char *) location; +} + +bool +USBDevice::IsHub(void) const +{ + return ishub; +} + +// Release allocated resources (for destructor or reinit) +void USBDevice::Release(void) +{ + int i; + USBConfiguration *cfg; + + ishub = false; + + if(fd != -1) { + close(fd); + fd = -1; + } + + if(location){ + free(location); + location = NULL; + } + + if(serial_string) { + delete[] serial_string; + serial_string = NULL; + } + + if(manufacturer_string) { + delete[] manufacturer_string; + manufacturer_string = NULL; + } + + if(product_string) { + delete[] product_string; + product_string = NULL; + } + + for(i=0;(cfg = (USBConfiguration *) configurations.ItemAt(i)); i++){ + delete cfg; + } + configurations.MakeEmpty(); +} + +void +USBDevice::PopulateInterface(USBInterface *ifc, usb_interface_descriptor *descr) +{ + uint i; + memcpy(&(ifc->descriptor),descr,sizeof(usb_interface_descriptor)); + for(i=0;iCountEndpoints();i++){ + usb_raw_command cmd; + usb_endpoint_descriptor descr; + cmd.endpoint.descr = &descr; + cmd.endpoint.config_num = ifc->configuration->configuration_num; + cmd.endpoint.interface_num = ifc->interface_num; + cmd.endpoint.endpoint_num = i; + ioctl(fd,get_endpoint_descriptor,&cmd,sizeof(cmd)); + if(!cmd.endpoint.status){ + USBEndpoint *ept = new USBEndpoint(i,ifc); + memcpy(&(ept->descriptor),&descr,sizeof(usb_endpoint_descriptor)); + ept->endpoint_num = i; + ifc->endpoints.AddItem(ept); + } + } +} + +void +USBDevice::PopulateConfig(USBConfiguration *conf, usb_configuration_descriptor *descr) +{ + uint i; + memcpy(&(conf->descriptor),descr,sizeof(usb_configuration_descriptor)); + for(i=0;iCountInterfaces();i++){ + usb_raw_command cmd; + usb_interface_descriptor descr; + cmd.interface.descr = &descr; + cmd.interface.config_num = conf->configuration_num; + cmd.interface.interface_num = i; + ioctl(fd,get_interface_descriptor,&cmd,sizeof(cmd)); + if(!cmd.interface.status){ + USBInterface *ifc = new USBInterface(i,conf); + ifc->interface_num = i; + PopulateInterface(ifc,&descr); + conf->interfaces.AddItem(ifc); + } + } +} + +void +USBDevice::PopulateDevice(void) +{ + uint i; + for(i=0;i 255)) return NULL; + l = (l-2)/2; + s = new char[l+1]; + for(i=0;iconfiguration_num; + if(ioctl(fd, set_configuration, &cmd, sizeof(cmd))){ + return B_ERROR; + } else { + if(!cmd.generic.status) active = (USBConfiguration *) conf; + return cmd.generic.status ? B_ERROR : B_OK; + } +} + +status_t +USBDevice::ControlTransfer(uint8 request_type, uint8 request, uint16 value, + uint16 index, uint16 length, void *data) const +{ + usb_raw_command cmd; + cmd.control.request_type = request_type; + cmd.control.request = request; + cmd.control.value = value; + cmd.control.index = index; + cmd.control.length = length; + cmd.control.data = data; + + if(ioctl(fd, do_control, &cmd, sizeof(cmd))){ + return B_ERROR; + } else { + return cmd.generic.status ? B_ERROR : B_OK; + } +} + +status_t +USBDevice::InterruptTransfer(const USBEndpoint *e, void *data, size_t length) const +{ + if(!e || (e->Device() != this)) return B_ERROR; + + usb_raw_command cmd; + cmd.interrupt.interface = e->interface->interface_num; + cmd.interrupt.endpoint = e->endpoint_num; + cmd.interrupt.data = data; + cmd.interrupt.length = length; + + if(ioctl(fd, do_interrupt, &cmd, sizeof(cmd))){ + return B_ERROR; + } else { + return cmd.generic.status ? B_ERROR : B_OK; + } +} + +status_t +USBDevice::BulkTransfer(const USBEndpoint *e, void *data, size_t length) const +{ + if(!e || (e->Device() != this)) return B_ERROR; + + usb_raw_command cmd; + cmd.bulk.interface = e->interface->interface_num; + cmd.bulk.endpoint = e->endpoint_num; + cmd.bulk.data = data; + cmd.bulk.length = length; + + if(ioctl(fd, do_bulk, &cmd, sizeof(cmd))){ + return B_ERROR; + } else { + return cmd.generic.status ? B_ERROR : B_OK; + } +} + Added: haiku/trunk/src/kits/usb/USBEndpoint.cpp =================================================================== --- haiku/trunk/src/kits/usb/USBEndpoint.cpp 2007-01-22 15:19:01 UTC (rev 19900) +++ haiku/trunk/src/kits/usb/USBEndpoint.cpp 2007-01-22 15:59:44 UTC (rev 19901) @@ -0,0 +1,94 @@ + +// USBEndpoint ------------------------------------------------------------------------ + +#include + +const USBInterface * +USBEndpoint::Interface(void) const +{ + return interface; +} + +const USBConfiguration * +USBEndpoint::Configuration(void) const +{ + return interface->Configuration(); +} + +const USBDevice * +USBEndpoint::Device(void) const +{ + return interface->Configuration()->Device(); +} + +const usb_endpoint_descriptor * +USBEndpoint::Descriptor(void) const +{ + return &descriptor; +} + +bool +USBEndpoint::IsBulk(void) const +{ + return (descriptor.attributes & 0x03) == 0x02; +} + +bool +USBEndpoint::IsInterrupt(void) const +{ + return (descriptor.attributes & 0x03) == 0x03; +} + +bool +USBEndpoint::IsIsochronous(void) const +{ + return (descriptor.attributes & 0x03) == 0x01; +} + +bool +USBEndpoint::IsInput(void) const +{ + return (descriptor.endpoint_address & 0x01) == 0x01; +} + +bool +USBEndpoint::IsOutput(void) const +{ + return (descriptor.endpoint_address & 0x01) == 0x00; +} + +uint16 +USBEndpoint::MaxPacketSize(void) const +{ + return descriptor.max_packet_size; +} + +uint8 +USBEndpoint::Interval(void) const +{ + return descriptor.interval; +} + +status_t +USBEndpoint::InterruptTransfer(void *data, size_t length) const +{ + return Device()->InterruptTransfer(this,data,length); +} + +status_t +USBEndpoint::BulkTransfer(void *data, size_t length) const +{ + return Device()->BulkTransfer(this,data,length); +} + +USBEndpoint::USBEndpoint(uint32 n, USBInterface *ifc) +{ + endpoint_num = n; + interface = ifc; +} + +USBEndpoint::~USBEndpoint() +{ + // nothing to do here really. +} + Added: haiku/trunk/src/kits/usb/USBInterface.cpp =================================================================== --- haiku/trunk/src/kits/usb/USBInterface.cpp 2007-01-22 15:19:01 UTC (rev 19900) +++ haiku/trunk/src/kits/usb/USBInterface.cpp 2007-01-22 15:59:44 UTC (rev 19901) @@ -0,0 +1,75 @@ + +#include + +// USBInterface ---------------------------------------------------------------------- + +uint32 +USBInterface::CountEndpoints(void) const +{ + return descriptor.num_endpoints; +} + +const USBEndpoint * +USBInterface::EndpointAt(uint32 n) const +{ + return (USBEndpoint *) endpoints.ItemAt(n); +} + +const usb_interface_descriptor * +USBInterface::Descriptor(void) const +{ + return &descriptor; +} + +uint8 +USBInterface::Class(void) const +{ + return descriptor.interface_class; +} + +uint8 +USBInterface::Subclass(void) const +{ + return descriptor.interface_subclass; +} + +uint8 +USBInterface::Protocol(void) const +{ + return descriptor.interface_protocol; +} + +const char * +USBInterface::InterfaceString(void) const +{ + return NULL; +} + +const USBConfiguration * +USBInterface::Configuration(void) const +{ + return configuration; +} + +const USBDevice * +USBInterface::Device(void) const +{ + return configuration->Device(); +} + +USBInterface::USBInterface(uint32 n, USBConfiguration *cfg) +{ + interface_num = n; + configuration = cfg; +} + +USBInterface::~USBInterface() +{ + int i; + USBEndpoint *ept; + + for(i=0;(ept = (USBEndpoint *) endpoints.ItemAt(i)); i++){ + delete ept; + } + endpoints.MakeEmpty(); +} Added: haiku/trunk/src/kits/usb/USBRoster.cpp =================================================================== --- haiku/trunk/src/kits/usb/USBRoster.cpp 2007-01-22 15:19:01 UTC (rev 19900) +++ haiku/trunk/src/kits/usb/USBRoster.cpp 2007-01-22 15:59:44 UTC (rev 19901) @@ -0,0 +1,344 @@ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int __directory = 0; +static void *DIRECTORY = (void *) &__directory; + +struct WatchItem +{ + ino_t inode; + + char *name; + void *data; + + WatchItem *children; + WatchItem *next; + WatchItem *parent; + + ~WatchItem(){ + free(name); + } + + char *LongName(void){ + WatchItem *w; + int sz; + char *n; + for(w=parent,sz=1+strlen(name);w;w=w->parent){ + sz += 1+strlen(w->name); + } + n = (char*) malloc(sz); + sz--; + n[sz] = 0; + for(w=this;w;w=w->parent){ + sz -= strlen(w->name); + memcpy(n + sz, w->name, strlen(w->name)); + if(sz){ + sz--; + n[sz]='/'; + } + } + return n; + } + + WatchItem(ino_t inode, const char *name, void *data = NULL){ + parent = NULL; + children = NULL; + next = NULL; + + this->inode = inode; + this->name = strdup(name); + this->data = data; + } + + WatchItem *Find(const char *name0){ + WatchItem *w; + for(w=children;w;w=w->next){ + if(!strcmp(name0,w->name)) return w; + } + return NULL; + } + + WatchItem *Find(ino_t inode0){ + WatchItem *w; + + if(inode == inode0) { + return this; + } + + for(w=children;w;w=w->next){ + WatchItem *r = w->Find(inode0); + if(r) { + return r; + } + } + return NULL; + } + + WatchItem *Remove(WatchItem *w){ + char *n = w->LongName(); + free(n); + + if(w->parent != this) return w; + w->parent = NULL; + + if(children == w){ + children = w->next; + w->next = NULL; + return w; + } + WatchItem *w0; + for(w0=children;w0;w0=w0->next){ + if(w0->next == w){ + w0->next = w->next; + w->next = NULL; + return w; + } + } + return w; + } + + void Add(WatchItem *w){ + w->parent = this; + w->next = children; + children = w; + + char *n = w->LongName(); + free(n); + } [... truncated: 226 lines follow ...] From mmu_man at mail.berlios.de Mon Jan 22 17:08:32 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Mon, 22 Jan 2007 17:08:32 +0100 Subject: [Haiku-commits] r19902 - haiku/trunk/src/bin Message-ID: <200701221608.l0MG8W19004942@sheep.berlios.de> Author: mmu_man Date: 2007-01-22 17:08:31 +0100 (Mon, 22 Jan 2007) New Revision: 19902 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19902&view=rev Added: haiku/trunk/src/bin/usb_dev_info.cpp Log: the info.cpp sample from usbkit-99-03-23.tgz Added: haiku/trunk/src/bin/usb_dev_info.cpp =================================================================== --- haiku/trunk/src/bin/usb_dev_info.cpp 2007-01-22 15:59:44 UTC (rev 19901) +++ haiku/trunk/src/bin/usb_dev_info.cpp 2007-01-22 16:08:31 UTC (rev 19902) @@ -0,0 +1,82 @@ + +#include +#include + +void DumpInterface(const USBInterface *ifc) +{ + int i; + const USBEndpoint *ept; + if(!ifc) return; + printf(" Class .............. %d\n",ifc->Class()); + printf(" Subclass ........... %d\n",ifc->Subclass()); + printf(" Protocol ........... %d\n",ifc->Protocol()); + for(i=0;iCountEndpoints();i++){ + if(ept = ifc->EndpointAt(i)){ + printf(" [Endpoint %d]\n",i); + printf(" MaxPacketSize .... %d\n",ept->MaxPacketSize()); + printf(" Interval ......... %d\n",ept->Interval()); + if(ept->IsBulk()){ + printf(" Type ............. Bulk\n"); + } + if(ept->IsIsochronous()){ + printf(" Type ............. Isochronous\n"); + } + if(ept->IsInterrupt()){ + printf(" Type ............. Interrupt\n"); + } + if(ept->IsInput()){ + printf(" Direction ........ Input\n"); + } else { + printf(" Direction ........ Output\n"); + } + } + } +} + +void DumpConfiguration(const USBConfiguration *conf) +{ + int i; + if(!conf) return; + for(i=0;iCountInterfaces();i++){ + printf(" [Interface %d]\n",i); + DumpInterface(conf->InterfaceAt(i)); + } +} + +void DumpInfo(USBDevice &dev) +{ + int i; + + printf("[Device]\n"); + printf("Class .................. %d\n",dev.Class()); + printf("Subclass ............... %d\n",dev.Subclass()); + printf("Protocol ............... %d\n",dev.Protocol()); + printf("Vendor ID .............. 0x%04x\n",dev.VendorID()); + printf("Product ID ............. 0x%04x\n",dev.ProductID()); + printf("Version ................ 0x%04x\n",dev.Version()); + printf("Manufacturer String .... \"%s\"\n",dev.ManufacturerString()); + printf("Product String ......... \"%s\"\n",dev.ProductString()); + printf("Serial Number .......... \"%s\"\n",dev.SerialNumberString()); + + for(i=0;i\n"); + return 1; + } +} From axeld at pinc-software.de Mon Jan 22 17:16:00 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Mon, 22 Jan 2007 17:16:00 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19901_-_in_haiku/trunk=3A_header?= =?iso-8859-15?q?s/os_headers/os/usb_src/kits_src/kits/usb?= In-Reply-To: <200701221559.l0MFxjuE004360@sheep.berlios.de> Message-ID: <31594928084-BeMail@zon> mmu_man at BerliOS wrote: > Log: > The original (sample code version) USB Kit from Be, as from > ftp.be.com/samples/usb_kit/usbkit_99-03-23.tgz > Some files renamed. Won't build yet with our usb_raw driver due to > different namings. > classes need to be B-prefixed anyway. USBKit.h needs to be split like > in zeta as well. Why should this be a public kit, anyway? It's not that long so why not just linking it as .a where needed (and move it into src/libs/ then)? Bye, Axel. From korli at users.berlios.de Mon Jan 22 17:23:21 2007 From: korli at users.berlios.de (=?ISO-8859-1?Q?J=E9r=F4me_Duval?=) Date: Mon, 22 Jan 2007 17:23:21 +0100 Subject: [Haiku-commits] r19902 - haiku/trunk/src/bin In-Reply-To: <200701221608.l0MG8W19004942@sheep.berlios.de> References: <200701221608.l0MG8W19004942@sheep.berlios.de> Message-ID: Hi Fran?ois, does the usual Be Sample license apply to this file ? This could be specified at the top of the source file. Bye, J?r?me 2007/1/22, mmu_man at BerliOS : > > Author: mmu_man > Date: 2007-01-22 17:08:31 +0100 (Mon, 22 Jan 2007) > New Revision: 19902 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19902&view=rev > > Added: > haiku/trunk/src/bin/usb_dev_info.cpp > Log: > the info.cpp sample from usbkit-99-03-23.tgz > > > Added: haiku/trunk/src/bin/usb_dev_info.cpp > =================================================================== > --- haiku/trunk/src/bin/usb_dev_info.cpp 2007-01-22 15:59:44 UTC > (rev 19901) > +++ haiku/trunk/src/bin/usb_dev_info.cpp 2007-01-22 16:08:31 UTC > (rev 19902) > @@ -0,0 +1,82 @@ > + > +#include > +#include > + > +void DumpInterface(const USBInterface *ifc) > +{ > + int i; > + const USBEndpoint *ept; > + if(!ifc) return; > + printf(" Class .............. %d\n",ifc->Class()); > + printf(" Subclass ........... %d\n",ifc->Subclass()); > + printf(" Protocol ........... %d\n",ifc->Protocol()); > + for(i=0;iCountEndpoints();i++){ > + if(ept = ifc->EndpointAt(i)){ > + printf(" [Endpoint %d]\n",i); > + printf(" MaxPacketSize .... > %d\n",ept->MaxPacketSize()); > + printf(" Interval ......... > %d\n",ept->Interval()); > + if(ept->IsBulk()){ > + printf(" Type ............. Bulk\n"); > + } > + if(ept->IsIsochronous()){ > + printf(" Type ............. > Isochronous\n"); > + } > + if(ept->IsInterrupt()){ > + printf(" Type ............. > Interrupt\n"); > + } > + if(ept->IsInput()){ > + printf(" Direction ........ > Input\n"); > + } else { > + printf(" Direction ........ > Output\n"); > + } > + } > + } > +} > + > +void DumpConfiguration(const USBConfiguration *conf) > +{ > + int i; > + if(!conf) return; > + for(i=0;iCountInterfaces();i++){ > + printf(" [Interface %d]\n",i); > + DumpInterface(conf->InterfaceAt(i)); > + } > +} > + > +void DumpInfo(USBDevice &dev) > +{ > + int i; > + > + printf("[Device]\n"); > + printf("Class .................. %d\n",dev.Class()); > + printf("Subclass ............... %d\n",dev.Subclass()); > + printf("Protocol ............... %d\n",dev.Protocol()); > + printf("Vendor ID .............. 0x%04x\n",dev.VendorID()); > + printf("Product ID ............. 0x%04x\n",dev.ProductID()); > + printf("Version ................ 0x%04x\n",dev.Version()); > + printf("Manufacturer String .... \"%s\"\n",dev.ManufacturerString > ()); > + printf("Product String ......... \"%s\"\n",dev.ProductString()); > + printf("Serial Number .......... \"%s\"\n",dev.SerialNumberString > ()); > + > + for(i=0;i + printf(" [Configuration %d]\n",i); > + DumpConfiguration(dev.ConfigurationAt(i)); > + } > +} > + > +int main(int argc, char *argv[]) > +{ > + if(argc == 2){ > + USBDevice dev(argv[1]); > + if(dev.InitCheck()){ > + printf("Cannot open USB device: %s\n",argv[1]); > + return 1; > + } else { > + DumpInfo(dev); > + return 0; > + } > + } else { > + printf("Usage: info \n"); > + return 1; > + } > +} > > _______________________________________________ > Haiku-commits mailing list > Haiku-commits at lists.berlios.de > https://lists.berlios.de/mailman/listinfo/haiku-commits > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mmu_man at mail.berlios.de Mon Jan 22 17:27:14 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Mon, 22 Jan 2007 17:27:14 +0100 Subject: [Haiku-commits] r19903 - haiku/trunk/src/bin Message-ID: <200701221627.l0MGREKB006509@sheep.berlios.de> Author: mmu_man Date: 2007-01-22 17:27:13 +0100 (Mon, 22 Jan 2007) New Revision: 19903 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19903&view=rev Modified: haiku/trunk/src/bin/usb_dev_info.cpp Log: we'll use B-prefixed classes there. make functions static. Modified: haiku/trunk/src/bin/usb_dev_info.cpp =================================================================== --- haiku/trunk/src/bin/usb_dev_info.cpp 2007-01-22 16:08:31 UTC (rev 19902) +++ haiku/trunk/src/bin/usb_dev_info.cpp 2007-01-22 16:27:13 UTC (rev 19903) @@ -1,11 +1,11 @@ -#include +#include #include -void DumpInterface(const USBInterface *ifc) +static void DumpInterface(const BUSBInterface *ifc) { int i; - const USBEndpoint *ept; + const BUSBEndpoint *ept; if(!ifc) return; printf(" Class .............. %d\n",ifc->Class()); printf(" Subclass ........... %d\n",ifc->Subclass()); @@ -33,7 +33,7 @@ } } -void DumpConfiguration(const USBConfiguration *conf) +static void DumpConfiguration(const BUSBConfiguration *conf) { int i; if(!conf) return; @@ -43,7 +43,7 @@ } } -void DumpInfo(USBDevice &dev) +static void DumpInfo(BUSBDevice &dev) { int i; @@ -67,7 +67,7 @@ int main(int argc, char *argv[]) { if(argc == 2){ - USBDevice dev(argv[1]); + BUSBDevice dev(argv[1]); if(dev.InitCheck()){ printf("Cannot open USB device: %s\n",argv[1]); return 1; From mmlr at mlotz.ch Mon Jan 22 17:17:59 2007 From: mmlr at mlotz.ch (Michael Lotz) Date: Mon, 22 Jan 2007 17:17:59 +0100 CET Subject: [Haiku-commits] =?windows-1252?q?r19901_-_in_haiku/trunk=3A_heade?= =?windows-1252?q?rs/os_headers/os/usb_src/kits_src/kits/usb?= In-Reply-To: <200701221559.l0MFxjuE004360@sheep.berlios.de> Message-ID: <4810022408-BeMail@Primary> > Author: mmu_man > The original (sample code version) USB Kit from Be, as from > ftp.be.com/samples/usb_kit/usbkit_99-03-23.tgz Please don't do anything with that: 1. There is a newer version of these sources available (usbkit.2000.01.15.tgz) 2. I've started rewriting some of that already... Regards Michael From mmu_man at mail.berlios.de Mon Jan 22 17:55:37 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Mon, 22 Jan 2007 17:55:37 +0100 Subject: [Haiku-commits] r19904 - haiku/trunk/headers/os/usb Message-ID: <200701221655.l0MGtbSH010285@sheep.berlios.de> Author: mmu_man Date: 2007-01-22 17:55:37 +0100 (Mon, 22 Jan 2007) New Revision: 19904 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19904&view=rev Modified: haiku/trunk/headers/os/usb/USBKit.h Log: Let it B, let it B... Modified: haiku/trunk/headers/os/usb/USBKit.h =================================================================== --- haiku/trunk/headers/os/usb/USBKit.h 2007-01-22 16:27:13 UTC (rev 19903) +++ haiku/trunk/headers/os/usb/USBKit.h 2007-01-22 16:55:37 UTC (rev 19904) @@ -14,20 +14,20 @@ #include -class USBDevice; -class USBEndpoint; -class USBInterface; -class USBConfiguration; -class USBRosterLooper; +class BUSBDevice; +class BUSBEndpoint; +class BUSBInterface; +class BUSBConfiguration; +class BUSBRosterLooper; -class USBEndpoint +class BUSBEndpoint { public: // Connectivity functions (this endpoint belongs to an Interface that // belongs to a Configuration that belongs to a Device) - const USBInterface *Interface(void) const; - const USBConfiguration *Configuration(void) const; - const USBDevice *Device(void) const; + const BUSBInterface *Interface(void) const; + const BUSBConfiguration *Configuration(void) const; + const BUSBDevice *Device(void) const; // Raw descriptor data const usb_endpoint_descriptor *Descriptor(void) const; @@ -46,27 +46,27 @@ status_t BulkTransfer(void *data, size_t length) const; private: - friend USBDevice; // Only created by a USBDevice - friend USBInterface; // Only destroyed by a containing USBInterface - USBEndpoint(uint32 n, USBInterface *ifc); - ~USBEndpoint(); + friend BUSBDevice; // Only created by a USBDevice + friend BUSBInterface; // Only destroyed by a containing USBInterface + BUSBEndpoint(uint32 n, BUSBInterface *ifc); + ~BUSBEndpoint(); - USBInterface *interface; + BUSBInterface *interface; usb_endpoint_descriptor descriptor; uint32 endpoint_num; }; -class USBInterface +class BUSBInterface { public: // Connectivity functions (this Interface belongs to a Configuration which // belongs to a Device) - const USBConfiguration *Configuration(void) const; - const USBDevice *Device(void) const; + const BUSBConfiguration *Configuration(void) const; + const BUSBDevice *Device(void) const; // Iterate over the Endpoints defined by this Interface uint32 CountEndpoints(void) const; - const USBEndpoint *EndpointAt(uint32 n) const; + const BUSBEndpoint *EndpointAt(uint32 n) const; // Access the raw descriptor const usb_interface_descriptor *Descriptor(void) const; @@ -78,46 +78,46 @@ const char *InterfaceString(void) const; private: - friend USBDevice; // only created by USBDevice - friend USBConfiguration; // only destroyed by the containing Configuration - USBInterface(uint32 n, USBConfiguration *cfc); - ~USBInterface(); + friend BUSBDevice; // only created by USBDevice + friend BUSBConfiguration; // only destroyed by the containing Configuration + BUSBInterface(uint32 n, BUSBConfiguration *cfc); + ~BUSBInterface(); - USBConfiguration *configuration; + BUSBConfiguration *configuration; usb_interface_descriptor descriptor; uint32 interface_num; BList endpoints; }; -class USBConfiguration +class BUSBConfiguration { public: // Connectivity functions (this Configuration belongs to a Device) - const USBDevice *Device(void) const; + const BUSBDevice *Device(void) const; // Iterators for the Interfaces provided by this Configuration uint32 CountInterfaces(void) const; - const USBInterface *InterfaceAt(uint32 n) const; + const BUSBInterface *InterfaceAt(uint32 n) const; // Access the raw descriptor const usb_configuration_descriptor *Descriptor(void) const; private: - friend USBDevice; - USBConfiguration(uint n, USBDevice *dev); - ~USBConfiguration(); + friend BUSBDevice; + BUSBConfiguration(uint n, BUSBDevice *dev); + ~BUSBConfiguration(); - USBDevice *device; + BUSBDevice *device; uint configuration_num; usb_configuration_descriptor descriptor; BList interfaces; }; -class USBDevice +class BUSBDevice { public: - USBDevice(const char *path = NULL); - virtual ~USBDevice(); + BUSBDevice(const char *path = NULL); + virtual ~BUSBDevice(); virtual status_t InitCheck(void); status_t SetTo(const char *path); @@ -153,23 +153,23 @@ // Iterate over the possible configurations uint32 CountConfigurations(void) const; - const USBConfiguration *ConfigurationAt(uint32 n) const; + const BUSBConfiguration *ConfigurationAt(uint32 n) const; // View and select the active configuration - const USBConfiguration *ActiveConfiguration(void) const; - status_t SetConfiguration(const USBConfiguration *conf); + const BUSBConfiguration *ActiveConfiguration(void) const; + status_t SetConfiguration(const BUSBConfiguration *conf); // Initiate a Control (endpoint 0) transaction status_t ControlTransfer(uint8 request_type, uint8 request, uint16 value, uint16 index, uint16 length, void *data) const; private: - status_t InterruptTransfer(const USBEndpoint *e, void *data, size_t length) const; - status_t BulkTransfer(const USBEndpoint *e, void *data, size_t length) const; + status_t InterruptTransfer(const BUSBEndpoint *e, void *data, size_t length) const; + status_t BulkTransfer(const BUSBEndpoint *e, void *data, size_t length) const; void Release(void); - void PopulateInterface(USBInterface *ifc, usb_interface_descriptor *descr); - void PopulateConfig(USBConfiguration *conf, usb_configuration_descriptor *descr); + void PopulateInterface(BUSBInterface *ifc, usb_interface_descriptor *descr); + void PopulateConfig(BUSBConfiguration *conf, usb_configuration_descriptor *descr); void PopulateDevice(void); mutable char *serial_string; // Cache the string descriptors @@ -179,27 +179,27 @@ bool ishub; int fd; // Connection to /dev/bus/usb/... usb_device_descriptor descriptor; // Cache the descriptor - USBConfiguration *active; // Current active configuration + BUSBConfiguration *active; // Current active configuration BList configurations; // All possible configurations -friend USBEndpoint; // USBEndpoint uses the XxxTransfer() methods +friend BUSBEndpoint; // USBEndpoint uses the XxxTransfer() methods }; -class USBRoster +class BUSBRoster { public: - USBRoster(void); - virtual ~USBRoster(); + BUSBRoster(void); + virtual ~BUSBRoster(); // DeviceAdded() is called when a new device appears on the Bus. // If the result is not B_OK, the USBDevice instance is deleted and // there will be no DeviceRemoved notification. - virtual status_t DeviceAdded(USBDevice *dev) = 0; + virtual status_t DeviceAdded(BUSBDevice *dev) = 0; // DeviceRemoved() is called when a device is disconnected from the Bus. // The USBDevice WILL BE deleted after this method returns. - virtual void DeviceRemoved(USBDevice *dev) = 0; + virtual void DeviceRemoved(BUSBDevice *dev) = 0; void Start(void); void Stop(void); @@ -208,4 +208,4 @@ }; -#endif \ No newline at end of file +#endif From axeld at mail.berlios.de Mon Jan 22 17:57:47 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 22 Jan 2007 17:57:47 +0100 Subject: [Haiku-commits] r19905 - haiku/trunk/src/system/kernel/arch/x86 Message-ID: <200701221657.l0MGvlbI010472@sheep.berlios.de> Author: axeld Date: 2007-01-22 17:57:47 +0100 (Mon, 22 Jan 2007) New Revision: 19905 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19905&view=rev Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug.c Log: Now checks if the address space pointer is NULL before dereferencing it. Modified: haiku/trunk/src/system/kernel/arch/x86/arch_debug.c =================================================================== --- haiku/trunk/src/system/kernel/arch/x86/arch_debug.c 2007-01-22 16:55:37 UTC (rev 19904) +++ haiku/trunk/src/system/kernel/arch/x86/arch_debug.c 2007-01-22 16:57:47 UTC (rev 19905) @@ -104,7 +104,9 @@ (void *)baseAddress, eip - baseAddress); } } else { - vm_area *area = vm_area_lookup(thread->team->address_space, eip); + vm_area *area = NULL; + if (thread->team->address_space != NULL) + area = vm_area_lookup(thread->team->address_space, eip); if (area != NULL) { kprintf(" %ld:%s@%p + %#lx\n", area->id, area->name, (void *)area->base, eip - area->base); From axeld at mail.berlios.de Mon Jan 22 18:52:08 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Mon, 22 Jan 2007 18:52:08 +0100 Subject: [Haiku-commits] r19906 - haiku/trunk/src/system/kernel/vm Message-ID: <200701221752.l0MHq8ao014744@sheep.berlios.de> Author: axeld Date: 2007-01-22 18:51:51 +0100 (Mon, 22 Jan 2007) New Revision: 19906 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19906&view=rev Modified: haiku/trunk/src/system/kernel/vm/vm.cpp Log: * "db/ds/dw/dl" now print all isprint() characters, not only isalnum(). * Also, the output no longer has the leading "0x" to ease reading. Modified: haiku/trunk/src/system/kernel/vm/vm.cpp =================================================================== --- haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-22 16:57:47 UTC (rev 19905) +++ haiku/trunk/src/system/kernel/vm/vm.cpp 2007-01-22 17:51:51 UTC (rev 19906) @@ -1854,7 +1854,7 @@ displayed = j; break; } - if (!isalnum(c)) + if (!isprint(c)) c = '.'; kprintf("%c", c); @@ -1874,16 +1874,16 @@ switch (itemSize) { case 1: - kprintf(" 0x%02x", *(uint8 *)&value); + kprintf(" %02x", *(uint8 *)&value); break; case 2: - kprintf(" 0x%04x", *(uint16 *)&value); + kprintf(" %04x", *(uint16 *)&value); break; case 4: - kprintf(" 0x%08lx", *(uint32 *)&value); + kprintf(" %08lx", *(uint32 *)&value); break; case 8: - kprintf(" 0x%016Lx", *(uint64 *)&value); + kprintf(" %016Lx", *(uint64 *)&value); break; } } From korli at mail.berlios.de Mon Jan 22 21:25:09 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 22 Jan 2007 21:25:09 +0100 Subject: [Haiku-commits] r19907 - haiku/trunk/src/add-ons/kernel/network/socket Message-ID: <200701222025.l0MKP9Pn001333@sheep.berlios.de> Author: korli Date: 2007-01-22 21:25:08 +0100 (Mon, 22 Jan 2007) New Revision: 19907 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19907&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/socket/socket.cpp Log: fix gcc4 build Modified: haiku/trunk/src/add-ons/kernel/network/socket/socket.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/socket/socket.cpp 2007-01-22 17:51:51 UTC (rev 19906) +++ haiku/trunk/src/add-ons/kernel/network/socket/socket.cpp 2007-01-22 20:25:08 UTC (rev 19907) @@ -19,7 +19,7 @@ #include -static int +int socket(int family, int type, int protocol) { int socket = open(NET_STACK_DRIVER_PATH, O_RDWR); @@ -40,7 +40,7 @@ } -static int +int bind(int socket, const struct sockaddr *address, socklen_t addressLength) { sockaddr_args args; @@ -51,14 +51,14 @@ } -static int +int shutdown(int socket, int how) { return ioctl(socket, NET_STACK_SHUTDOWN, (void *)how, 0); } -static int +int connect(int socket, const struct sockaddr *address, socklen_t addressLength) { sockaddr_args args; @@ -69,14 +69,14 @@ } -static int +int listen(int socket, int backlog) { return ioctl(socket, NET_STACK_LISTEN, (void *)backlog, 0); } -static int +int accept(int socket, struct sockaddr *address, socklen_t *_addressLength) { int acceptSocket = open(NET_STACK_DRIVER_PATH, O_RDWR); @@ -110,7 +110,7 @@ } -static ssize_t +ssize_t recv(int socket, void *data, size_t length, int flags) { transfer_args args; @@ -124,7 +124,7 @@ } -static ssize_t +ssize_t recvfrom(int socket, void *data, size_t length, int flags, struct sockaddr *address, socklen_t *_addressLength) { @@ -146,7 +146,7 @@ } -static ssize_t +ssize_t recvmsg(int socket, struct msghdr *message, int flags) { // TODO: implement me! @@ -154,7 +154,7 @@ } -static ssize_t +ssize_t send(int socket, const void *data, size_t length, int flags) { transfer_args args; @@ -168,7 +168,7 @@ } -static ssize_t +ssize_t sendto(int socket, const void *data, size_t length, int flags, const struct sockaddr *address, socklen_t addressLength) { @@ -183,7 +183,7 @@ } -static ssize_t +ssize_t sendmsg(int socket, const struct msghdr *message, int flags) { // TODO: implement me! @@ -191,7 +191,7 @@ } -static int +int getsockopt(int socket, int level, int option, void *value, size_t *_length) { sockopt_args args; @@ -210,7 +210,7 @@ } -static int +int setsockopt(int socket, int level, int option, const void *value, size_t length) { sockopt_args args; @@ -223,7 +223,7 @@ } -static int +int getpeername(int socket, struct sockaddr *address, socklen_t *_addressLength) { sockaddr_args args; @@ -240,7 +240,7 @@ } -static int +int getsockname(int socket, struct sockaddr *address, socklen_t *_addressLength) { sockaddr_args args; @@ -257,7 +257,7 @@ } -static int +int sockatmark(int socket) { // TODO: implement me! @@ -265,7 +265,7 @@ } -static int +int socketpair(int family, int type, int protocol, int socketVector[2]) { socketVector[0] = socket(family, type, protocol); From korli at mail.berlios.de Mon Jan 22 21:39:19 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Mon, 22 Jan 2007 21:39:19 +0100 Subject: [Haiku-commits] r19908 - in haiku/trunk/src/add-ons/print/drivers: pdf/source shared/libprint Message-ID: <200701222039.l0MKdJ15002795@sheep.berlios.de> Author: korli Date: 2007-01-22 21:39:18 +0100 (Mon, 22 Jan 2007) New Revision: 19908 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19908&view=rev Modified: haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFText.cpp haiku/trunk/src/add-ons/print/drivers/shared/libprint/StatusWindow.cpp Log: fix warning Modified: haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFText.cpp =================================================================== --- haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFText.cpp 2007-01-22 20:25:08 UTC (rev 19907) +++ haiku/trunk/src/add-ons/print/drivers/pdf/source/PDFText.cpp 2007-01-22 20:39:18 UTC (rev 19908) @@ -386,7 +386,7 @@ if (convert_from_utf8(B_MAC_ROMAN_CONVERSION, utf8, &srcLen, dest, &destLen, &state, 0) != B_OK || dest[0] == 0 ) { // could not convert to MacRoman uint8 enc; - uint16 index; + uint16 index = 0; font_encoding fenc; GetFontName(&fState->beFont, fontName); Modified: haiku/trunk/src/add-ons/print/drivers/shared/libprint/StatusWindow.cpp =================================================================== --- haiku/trunk/src/add-ons/print/drivers/shared/libprint/StatusWindow.cpp 2007-01-22 20:25:08 UTC (rev 19907) +++ haiku/trunk/src/add-ons/print/drivers/shared/libprint/StatusWindow.cpp 2007-01-22 20:39:18 UTC (rev 19908) @@ -175,7 +175,7 @@ break; default: - inherited::MessageReceived(message); + BWindow::MessageReceived(message); break; } From wkornewald at mail.berlios.de Tue Jan 23 09:34:21 2007 From: wkornewald at mail.berlios.de (wkornewald at BerliOS) Date: Tue, 23 Jan 2007 09:34:21 +0100 Subject: [Haiku-commits] r19909 - haiku/trunk/src/add-ons/kernel/network/ppp Message-ID: <200701230834.l0N8YLQY006491@sheep.berlios.de> Author: wkornewald Date: 2007-01-23 09:34:20 +0100 (Tue, 23 Jan 2007) New Revision: 19909 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19909&view=rev Removed: haiku/trunk/src/add-ons/kernel/network/ppp/TODO Log: Little test commit. Deleted: haiku/trunk/src/add-ons/kernel/network/ppp/TODO From jackburton at mail.berlios.de Tue Jan 23 12:22:12 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Tue, 23 Jan 2007 12:22:12 +0100 Subject: [Haiku-commits] r19910 - haiku/trunk/src/apps/deskbar Message-ID: <200701231122.l0NBMCqY020807@sheep.berlios.de> Author: jackburton Date: 2007-01-23 12:22:12 +0100 (Tue, 23 Jan 2007) New Revision: 19910 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19910&view=rev Modified: haiku/trunk/src/apps/deskbar/BarWindow.cpp haiku/trunk/src/apps/deskbar/BeMenu.cpp haiku/trunk/src/apps/deskbar/ExpandoMenuBar.cpp haiku/trunk/src/apps/deskbar/TeamMenu.cpp Log: Use BMenu::RemoveItems() instead of looping... I hope I caught all occurrences. Modified: haiku/trunk/src/apps/deskbar/BarWindow.cpp =================================================================== --- haiku/trunk/src/apps/deskbar/BarWindow.cpp 2007-01-23 08:34:20 UTC (rev 19909) +++ haiku/trunk/src/apps/deskbar/BarWindow.cpp 2007-01-23 11:22:12 UTC (rev 19910) @@ -144,16 +144,11 @@ { BWindow::MenusEnded(); - if (!sBeMenu->LockLooper()) { + if (sBeMenu->LockLooper()) { // TODO: is this ok? - return; + sBeMenu->RemoveItems(0, sBeMenu->CountItems(), true); + sBeMenu->UnlockLooper(); } - - BMenuItem *item = NULL; - while ((item = sBeMenu->RemoveItem((int32)0)) != NULL) - delete item; - - sBeMenu->UnlockLooper(); } Modified: haiku/trunk/src/apps/deskbar/BeMenu.cpp =================================================================== --- haiku/trunk/src/apps/deskbar/BeMenu.cpp 2007-01-23 08:34:20 UTC (rev 19909) +++ haiku/trunk/src/apps/deskbar/BeMenu.cpp 2007-01-23 11:22:12 UTC (rev 19910) @@ -138,14 +138,7 @@ bool TBeMenu::StartBuildingItemList() { - int32 count = CountItems()-1; - for (int32 index = count; index >= 0; index--) { - BMenuItem *item = ItemAt(index); - ASSERT(item); - - RemoveItem(index); - delete item; - } + RemoveItems(0, CountItems(), true); fAddState = kStart; return BNavMenu::StartBuildingItemList(); } @@ -555,15 +548,8 @@ bool TRecentsMenu::StartBuildingItemList() { - int32 count = CountItems()-1; - for (int32 index = count; index >= 0; index--) { - BMenuItem *item = ItemAt(index); - ASSERT(item); + RemoveItems(0, CountItems(), true); - RemoveItem(index); - delete item; - } - // !! note: don't call inherited from here // the navref is not set for this menu // but it still needs to be a draggable navmenu @@ -732,9 +718,7 @@ bool MountMenu::AddDynamicItem(add_state s) { - BMenuItem *item; - while ((item = RemoveItem(0L)) != NULL) - delete item; + RemoveItems(0, CountItems(), true); // Send message to tracker to get items. BMessage request('gmtv'); Modified: haiku/trunk/src/apps/deskbar/ExpandoMenuBar.cpp =================================================================== --- haiku/trunk/src/apps/deskbar/ExpandoMenuBar.cpp 2007-01-23 08:34:20 UTC (rev 19909) +++ haiku/trunk/src/apps/deskbar/ExpandoMenuBar.cpp 2007-01-23 11:22:12 UTC (rev 19910) @@ -191,9 +191,7 @@ message.AddMessenger("messenger", self); be_app->PostMessage(&message); - BMenuItem *item = NULL; - while ((item = RemoveItem(0L)) != NULL) - delete item; + RemoveItems(0, CountItems(), true); } Modified: haiku/trunk/src/apps/deskbar/TeamMenu.cpp =================================================================== --- haiku/trunk/src/apps/deskbar/TeamMenu.cpp 2007-01-23 08:34:20 UTC (rev 19909) +++ haiku/trunk/src/apps/deskbar/TeamMenu.cpp 2007-01-23 11:22:12 UTC (rev 19910) @@ -63,9 +63,7 @@ void TTeamMenu::AttachedToWindow() { - BMenuItem *item = NULL; - while ((item = RemoveItem((int32)0)) != NULL) - delete item; + RemoveItems(0, CountItems(), true); BMessenger self(this); BList teamList; From fekdahl at gmail.com Tue Jan 23 13:59:52 2007 From: fekdahl at gmail.com (Fredrik Ekdahl) Date: Tue, 23 Jan 2007 13:59:52 +0100 Subject: [Haiku-commits] r19873 - in haiku/trunk/src/add-ons/kernel/file_systems: . googlefs googlefs/bin googlefs/config In-Reply-To: <200701200205.l0K253SL023327@sheep.berlios.de> References: <200701200205.l0K253SL023327@sheep.berlios.de> Message-ID: <45B606C8.7070509@gmail.com> mmu_man at BerliOS skrev: > Author: mmu_man > Date: 2007-01-20 03:04:51 +0100 (Sat, 20 Jan 2007) > New Revision: 19873 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19873&view=rev > > Log: > \o/ \o/ This is the mighty GoogleFS for BeOS, now also for Haiku. \o/ \o/ > Quick, before I loose googlefs.h again (bloody /bin/deres which overwrites foo.h for foo.rsrc !!!!) > A makefile is provided for BeOS/Zeta, the Jamfile currently only builds for Haiku. The makefile.ufs is for UserlandFS. > The source code is quite messy, beware. > Hi there! Compilation fails with gcc4 under Linux. Here are the error messages: Cc generated/objects/haiku/x86/release/add-ons/kernel/file_systems/googlefs/attrs.o In file included from src/add-ons/kernel/file_systems/googlefs/attrs.c:2: src/add-ons/kernel/file_systems/googlefs/googlefs.h:51:1: warning: "ASSERT" redefined In file included from headers/private/./kernel/lock.h:13, from src/add-ons/kernel/file_systems/googlefs/googlefs.h:8, from src/add-ons/kernel/file_systems/googlefs/attrs.c:2: headers/private/kernel/debug.h:21:1: warning: this is the location of the previous definition src/add-ons/kernel/file_systems/googlefs/attrs.c:13: warning: initialization discards qualifiers from pointer target type src/add-ons/kernel/file_systems/googlefs/attrs.c:14: warning: initialization discards qualifiers from pointer target type src/add-ons/kernel/file_systems/googlefs/attrs.c:201: error: missing terminating " character src/add-ons/kernel/file_systems/googlefs/attrs.c:203: error: stray '\194' in program src/add-ons/kernel/file_systems/googlefs/attrs.c:203: error: stray '\169' in program src/add-ons/kernel/file_systems/googlefs/attrs.c:203: error: 'Copyright' undeclared here (not in a function) src/add-ons/kernel/file_systems/googlefs/attrs.c:203: error: syntax error before numeric constant src/add-ons/kernel/file_systems/googlefs/attrs.c:203: error: stray '\195' in program src/add-ons/kernel/file_systems/googlefs/attrs.c:203: error: stray '\167' in program src/add-ons/kernel/file_systems/googlefs/attrs.c:209: error: stray '\' in program src/add-ons/kernel/file_systems/googlefs/attrs.c:209: error: missing terminating " character src/add-ons/kernel/file_systems/googlefs/attrs.c:210: error: missing terminating " character /media/data/develop/haiku/trunk/generated/cross-tools/bin/i586-pc-haiku-gcc -O -Wall -Wmissing-prototypes -nostdinc -Wno-multichar -finline -fno-builtin -Wno-multichar -DBOCHS_DEBUG_HACK=0 -D_KERNEL_MODE -c "src/add-ons/kernel/file_systems/googlefs/attrs.c" -D__HAIKU__ -D__INTEL__ -DARCH_x86 -DHAIKU_TARGET_PLATFORM_HAIKU -iquote src/add-ons/kernel/file_systems/googlefs -iquote generated/objects/common/add-ons/kernel/file_systems/googlefs -iquote generated/objects/linux/x86/common/add-ons/kernel/file_systems/googlefs -iquote generated/objects/haiku/x86/common/add-ons/kernel/file_systems/googlefs -idirafter headers/private/kernel -idirafter headers -idirafter headers/posix -idirafter headers/gnu -idirafter headers/glibc -idirafter headers/os -idirafter headers/os/add-ons -idirafter headers/os/add-ons/file_system -idirafter headers/os/add-ons/graphics -idirafter headers/os/add-ons/input_server -idirafter headers/os/add-ons/registrar -idirafter headers/os/add-ons/screen_saver -idirafter headers/os/add-ons/tracker -idirafter headers/os/app -idirafter headers/os/device -idirafter headers/os/drivers -idirafter headers/os/game -idirafter headers/os/interface -idirafter headers/os/kernel -idirafter headers/os/media -idirafter headers/os/mail -idirafter headers/os/midi -idirafter headers/os/midi2 -idirafter headers/os/net -idirafter headers/os/opengl -idirafter headers/os/storage -idirafter headers/os/support -idirafter headers/os/translation -idirafter headers/private/. -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2 -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2/i586-pc-haiku -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2/backward -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2/ext -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/include -o "generated/objects/haiku/x86/release/add-ons/kernel/file_systems/googlefs/attrs.o" ; ...failed Cc generated/objects/haiku/x86/release/add-ons/kernel/file_systems/googlefs/attrs.o ... Cc generated/objects/haiku/x86/release/add-ons/kernel/file_systems/googlefs/parse_google_html.o src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:36: warning: no previous prototype for 'google_parse_results' src/add-ons/kernel/file_systems/googlefs/parse_google_html.c: In function 'google_parse_results': src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:50: warning: implicit declaration of function 'dprintf' src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:61: warning: passing argument 2 of 'strtol' from incompatible pointer type src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:66: warning: passing argument 2 of 'strtol' from incompatible pointer type src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:97: warning: assignment discards qualifiers from pointer target type src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:109: warning: assignment discards qualifiers from pointer target type src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:120: warning: passing argument 1 of 'strncpy' discards qualifiers from pointer target type src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:121: error: assignment of read-only location src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:129: warning: passing argument 1 of 'free' discards qualifiers from pointer target type src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:187: warning: assignment discards qualifiers from pointer target type src/add-ons/kernel/file_systems/googlefs/parse_google_html.c:183: warning: unused variable 'iscache' /media/data/develop/haiku/trunk/generated/cross-tools/bin/i586-pc-haiku-gcc -O -Wall -Wmissing-prototypes -nostdinc -Wno-multichar -finline -fno-builtin -Wno-multichar -DBOCHS_DEBUG_HACK=0 -D_KERNEL_MODE -c "src/add-ons/kernel/file_systems/googlefs/parse_google_html.c" -D__HAIKU__ -D__INTEL__ -DARCH_x86 -DHAIKU_TARGET_PLATFORM_HAIKU -iquote src/add-ons/kernel/file_systems/googlefs -iquote generated/objects/common/add-ons/kernel/file_systems/googlefs -iquote generated/objects/linux/x86/common/add-ons/kernel/file_systems/googlefs -iquote generated/objects/haiku/x86/common/add-ons/kernel/file_systems/googlefs -idirafter headers/private/kernel -idirafter headers -idirafter headers/posix -idirafter headers/gnu -idirafter headers/glibc -idirafter headers/os -idirafter headers/os/add-ons -idirafter headers/os/add-ons/file_system -idirafter headers/os/add-ons/graphics -idirafter headers/os/add-ons/input_server -idirafter headers/os/add-ons/registrar -idirafter headers/os/add-ons/screen_saver -idirafter headers/os/add-ons/tracker -idirafter headers/os/app -idirafter headers/os/device -idirafter headers/os/drivers -idirafter headers/os/game -idirafter headers/os/interface -idirafter headers/os/kernel -idirafter headers/os/media -idirafter headers/os/mail -idirafter headers/os/midi -idirafter headers/os/midi2 -idirafter headers/os/net -idirafter headers/os/opengl -idirafter headers/os/storage -idirafter headers/os/support -idirafter headers/os/translation -idirafter headers/private/. -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2 -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2/i586-pc-haiku -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2/backward -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/../../../../include/c++/4.0.2/ext -idirafter /media/data/develop/haiku/trunk/generated/cross-tools/lib/gcc/i586-pc-haiku/4.0.2/include -o "generated/objects/haiku/x86/release/add-ons/kernel/file_systems/googlefs/parse_google_html.o" ; ...failed Cc generated/objects/haiku/x86/release/add-ons/kernel/file_systems/googlefs/parse_google_html.o ... ...skipped googlefs for lack of attrs.o... ...skipped haiku.image-copy-files-dummy-beos/system/add-ons/kernel/file_systems for lack of googlefs... /Fredrik Ekdahl From mmu_man at mail.berlios.de Tue Jan 23 15:27:14 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 15:27:14 +0100 Subject: [Haiku-commits] r19911 - haiku/trunk/src/add-ons/kernel/file_systems/googlefs Message-ID: <200701231427.l0NEREP2013093@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 15:27:14 +0100 (Tue, 23 Jan 2007) New Revision: 19911 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19911&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c Log: Cosmetic. As gcc4 doesn't seem to get multi-line strings, use multiple one-line-strings. Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c 2007-01-23 11:22:12 UTC (rev 19910) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c 2007-01-23 14:27:14 UTC (rev 19911) @@ -199,16 +199,16 @@ }; char *readmestr = \ -"Welcome to the Google? FileSystem for BeOS?, Zeta? and Haiku?. -Copyright? 2004, 2005, Fran?ois Revol. -Google is a trademark of Google,Inc. -BeOS is a trademark of PalmSource. -Zeta is a trademark of yellowTAB GmbH. -Haiku is a trademark of Haiku Inc. +"Welcome to the Google? FileSystem for BeOS?, Zeta? and Haiku?.\n" +"Copyright? 2004, 2005, Fran?ois Revol.\n" +"Google is a trademark of Google,Inc.\n" +"BeOS is a trademark of PalmSource.\n" +"Zeta is a trademark of yellowTAB GmbH.\n" +"Haiku is a trademark of Haiku Inc.\n" +"\n" +"Use \"Search Google\" query template in this folder to ask google anything.\n" +"\n"; -Use \"Search Google\" query template in this folder to ask google anything. -"; - struct attr_entry mailto_me_bookmark_attrs[] = { { "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', SZSTR("application/x-person") }, { "META:email", 'CSTR', SZSTR("revol at free.fr") }, Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c 2007-01-23 11:22:12 UTC (rev 19910) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.c 2007-01-23 14:27:14 UTC (rev 19911) @@ -1726,7 +1726,6 @@ NULL, }; - #else /* BeOS fsil api */ _EXPORT vnode_ops fs_entry = From mmu_man at mail.berlios.de Tue Jan 23 15:38:45 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 15:38:45 +0100 Subject: [Haiku-commits] r19912 - haiku/trunk/src/add-ons/kernel/file_systems/googlefs Message-ID: <200701231438.l0NEcj4O013875@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 15:38:42 +0100 (Tue, 23 Jan 2007) New Revision: 19912 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19912&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/parse_google_html.c Log: gcc4 is also picky about writing to const variables... grr Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/parse_google_html.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/parse_google_html.c 2007-01-23 14:27:14 UTC (rev 19911) +++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/parse_google_html.c 2007-01-23 14:38:42 UTC (rev 19912) @@ -35,7 +35,7 @@ int google_parse_results(const char *html, size_t htmlsize, struct google_result **results) { struct google_result *res = NULL, *nres = NULL, *prev = NULL; - const char *p, *q; + char *p, *q; char *nextresult = NULL; long numres = 0; long maxres = 0; From revol at free.fr Tue Jan 23 15:56:20 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Tue, 23 Jan 2007 15:56:20 +0100 CET Subject: [Haiku-commits] =?windows-1252?q?r19873_-_in_haiku/trunk/src/add-?= =?windows-1252?q?ons/kernel/file=5Fsystems=3A_=2E_googlefs_googlefs/bin_g?= =?windows-1252?q?ooglefs/config?= In-Reply-To: <45B606C8.7070509@gmail.com> Message-ID: <831377196-BeMail@laptop> > > Author: mmu_man > > Date: 2007-01-20 03:04:51 +0100 (Sat, 20 Jan 2007) > > New Revision: 19873 > > > > Hi there! > Compilation fails with gcc4 under Linux. Here are the error messages: Fixed by r19911 and r19912. Thx. Fran?ois. From axeld at pinc-software.de Tue Jan 23 16:27:01 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Tue, 23 Jan 2007 16:27:01 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19912_-_haiku/trunk/src/add-ons/?= =?iso-8859-15?q?kernel/file=5Fsystems/googlefs?= In-Reply-To: <200701231438.l0NEcj4O013875@sheep.berlios.de> Message-ID: <12734961978-BeMail@zon> mmu_man at BerliOS wrote: > Log: > gcc4 is also picky about writing to const variables... grr What do you think const variables are for? ;-) Bye, Axel. From mmlr at mail.berlios.de Tue Jan 23 16:55:35 2007 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Tue, 23 Jan 2007 16:55:35 +0100 Subject: [Haiku-commits] r19913 - in haiku/trunk: headers/libs headers/libs/usb src/libs src/libs/usb Message-ID: <200701231555.l0NFtZiL020787@sheep.berlios.de> Author: mmlr Date: 2007-01-23 16:55:34 +0100 (Tue, 23 Jan 2007) New Revision: 19913 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19913&view=rev Added: haiku/trunk/headers/libs/usb/ haiku/trunk/headers/libs/usb/USBKit.h haiku/trunk/src/libs/usb/ haiku/trunk/src/libs/usb/Jamfile haiku/trunk/src/libs/usb/USBConfiguration.cpp haiku/trunk/src/libs/usb/USBDevice.cpp haiku/trunk/src/libs/usb/USBEndpoint.cpp haiku/trunk/src/libs/usb/USBInterface.cpp haiku/trunk/src/libs/usb/USBRoster.cpp Modified: haiku/trunk/src/libs/Jamfile Log: Commiting reimplemented USBKit that is compatible with the old Be sample code version. It is supposed to be cleaner and more object oriented. It also adds some features (like a string getter for the interface) that were appearantly left out in the Be implementation. It is currently built as a small static library from src/libs. Added: haiku/trunk/headers/libs/usb/USBKit.h =================================================================== --- haiku/trunk/headers/libs/usb/USBKit.h 2007-01-23 14:38:42 UTC (rev 19912) +++ haiku/trunk/headers/libs/usb/USBKit.h 2007-01-23 15:55:34 UTC (rev 19913) @@ -0,0 +1,316 @@ +/* + * Copyright 2007, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Michael Lotz + */ + +#ifndef _USBKIT_H +#define _USBKIT_H + +#include +#include + + +// Keep compatibility with original USBKit classes +#define USBRoster BUSBRoster +#define USBDevice BUSBDevice +#define USBConfiguration BUSBConfiguration +#define USBInterface BUSBInterface +#define USBEndpoint BUSBEndpoint + + +class BUSBRoster; +class BUSBDevice; +class BUSBConfiguration; +class BUSBInterface; +class BUSBEndpoint; + + +/* The BUSBRoster class can be used to watch for devices that get attached or + removed from the USB bus. + You subclass the roster and implement the pure virtual DeviceAdded() and + DeviceRemoved() hooks. */ +class BUSBRoster { +public: + BUSBRoster(); +virtual ~BUSBRoster(); + + // The DeviceAdded() hook will be called when a new device gets + // attached to the USB bus. The hook is called with an initialized + // BUSBDevice object. If you return B_OK from your hook the object + // will stay valid and the DeviceRemoved() hook will be called with + // for it. Otherwise the object is deleted and DeviceRemoved() + // is not called. +virtual status_t DeviceAdded(BUSBDevice *device) = 0; + + // When a device gets detached from the bus that you hold a + // BUSBDevice object for (gotten through DeviceAdded()) the + // DeviceRemoved() hook will be called. The device object gets + // invalid and will be deleted as soon as you return from the hook + // so be sure to remove all references to it. +virtual void DeviceRemoved(BUSBDevice *device) = 0; + + void Start(); + void Stop(); + +private: + void *fLooper; +}; + + +/* The BUSBDevice presents an interface to USB device. You can either get + it through the BUSBRoster or by creating one yourself and setting it to + a valid raw usb device (with a path of "/dev/bus/usb/x"). + The device class provides direct accessors for descriptor fields as well + as convenience functions to directly get string representations of fields. + The BUSBDevice also provides access for the BUSBConfiguration objects of + a device. These objects and all of their child objects depend on the + parent device and will be deleted as soon as the device object is + destroyed */ +class BUSBDevice { +public: + BUSBDevice(const char *path = NULL); +virtual ~BUSBDevice(); + +virtual status_t InitCheck(); + + status_t SetTo(const char *path); + void Unset(); + + // Returns the location on the bus represented as hub/device sequence + const char *Location() const; + bool IsHub() const; + + // These are direct accessors to descriptor fields + uint16 USBVersion() const; + uint8 Class() const; + uint8 Subclass() const; + uint8 Protocol() const; + uint8 MaxEndpoint0PacketSize() const; + uint16 VendorID() const; + uint16 ProductID() const; + uint16 Version() const; + + // The string functions return the string representation of the + // descriptor data. The strings are decoded to normal 0 terminated + // c strings and are cached and owned by the object. + // If a string is not available an empty string is returned. + const char *ManufacturerString() const; + const char *ProductString() const; + const char *SerialNumberString() const; + + const usb_device_descriptor *Descriptor() const; + + // GetStringDescriptor() can be used to retrieve the raw + // usb_string_descriptor with a given index. The strings contained + // in these descriptors are usually two-byte unicode encoded. + size_t GetStringDescriptor(uint32 index, + usb_string_descriptor *descriptor, + size_t length) const; + + // Use the DecodeStringDescriptor() convenience function to get a + // 0-terminated c string for a given string index. Note that this + // will allocate the string as "new char[];" and needs to be deleted + // like "delete[] string;" by the caller. + char *DecodeStringDescriptor(uint32 index) const; + + size_t GetDescriptor(uint8 type, uint8 index, + uint16 languageID, void *data, + size_t length) const; + + // With ConfigurationAt() or ActiveConfiguration() you can get an + // object that represents the configuration at a certain index or at + // the index that is currently configured. Note that the index does not + // necessarily correspond with the configuration value. + // Use the returned object as an argument to SetConfiguration() to + // change the active configuration of a device. + uint32 CountConfigurations() const; + const BUSBConfiguration *ConfigurationAt(uint32 index) const; + + const BUSBConfiguration *ActiveConfiguration() const; + status_t SetConfiguration( + const BUSBConfiguration *configuration); + + // ControlTransfer() sends requests using the default pipe + ssize_t ControlTransfer(uint8 requestType, + uint8 request, uint16 value, + uint16 index, uint16 length, + void *data) const; + +private: + char *fPath; + int fRawFD; + + usb_device_descriptor fDescriptor; + BUSBConfiguration **fConfigurations; + uint32 fActiveConfiguration; + +mutable char *fManufacturerString; +mutable char *fProductString; +mutable char *fSerialNumberString; +}; + + +/* A BUSBConfiguration object represents one of possibly multiple + configurations a device might have. A valid object can only be gotten + through the ConfigurationAt() and ActiveConfiguration() methods of a + BUSBDevice. + The BUSBConfiguration provides further access into the configuration by + providing CountInterfaces() and InterfaceAt() to retrieve BUSBInterface + objects. */ +class BUSBConfiguration { +public: + // Device() returns the parent device of this configuration. This + // configuration is located at the index returned by Index() within + // that parent device. + uint32 Index() const; + const BUSBDevice *Device() const; + + // Gets a describing string of this configuration if available. + // Otherwise an empty string is returned. + const char *ConfigurationString() const; + + const usb_configuration_descriptor + *Descriptor() const; + + // With CountInterfaces() and InterfaceAt() you can iterate through + // the child interfaces of this configuration. It is the only valid + // way to get a BUSBInterface object. + // Note that the interface objects retrieved using InterfaceAt() will + // be invalid and deleted as soon as this configuration gets deleted. + uint32 CountInterfaces() const; + const BUSBInterface *InterfaceAt(uint32 index) const; + +private: +friend class BUSBDevice; + BUSBConfiguration(BUSBDevice *device, + uint32 index, int rawFD); + ~BUSBConfiguration(); + + BUSBDevice *fDevice; + uint32 fIndex; + int fRawFD; + + usb_configuration_descriptor fDescriptor; + BUSBInterface **fInterfaces; + +mutable char *fConfigurationString; +}; + + +/* The BUSBInterface class can be used to access the descriptor fields of + an underleying USB interface. Most importantly though it can be used to + iterate over and retrieve BUSBEndpoint objects that can be used to + transfer data over the bus. */ +class BUSBInterface { +public: + // Configuration() returns the parent configuration of this interface. + // This interface is located at the index returned by Index() in that + // parent configuration. + // Device() is a convenience function to directly reach the parent + // device of this interface instead of going through the configuration. + uint32 Index() const; + const BUSBConfiguration *Configuration() const; + const BUSBDevice *Device() const; + + // These are accessors to descriptor fields. InterfaceString() tries + // to return a describing string of this interface. If no string is + // available an empty string will be returned. + uint8 Class() const; + uint8 Subclass() const; + uint8 Protocol() const; + const char *InterfaceString() const; + + const usb_interface_descriptor + *Descriptor() const; + + // Use OtherDescriptorAt() to get generic descriptors of an interface. + // These are usually vendor or device specific extensions. + status_t OtherDescriptorAt(uint32 index, + usb_descriptor *descriptor, + size_t length) const; + + // CountEndpoints() and EndpointAt() can be used to iterate over the + // available endpoints within an interface. EndpointAt() is the only + // valid way to get BUSBEndpoint object. Note that these objects will + // get invalid and deleted as soon as the parent interface is deleted. + uint32 CountEndpoints() const; + const BUSBEndpoint *EndpointAt(uint32 index) const; + +private: +friend class BUSBConfiguration; + BUSBInterface(BUSBConfiguration *config, + uint32 index, int rawFD); + ~BUSBInterface(); + + BUSBConfiguration *fConfiguration; + uint32 fIndex; + int fRawFD; + + usb_interface_descriptor fDescriptor; + BUSBEndpoint **fEndpoints; + +mutable char *fInterfaceString; +}; + + +/* The BUSBEndpoint represent a device endpoint that can be used to send or + receive data. It also alows to query endpoint characteristics like + endpoint type or direction. */ +class BUSBEndpoint { +public: + // Interface() returns the parent interface of this endpoint. + // This endpoint is located at the index returned by Index() in the + // parent interface. + // Configuration() and Device() are convenience functions to directly + // reach the parent configuration or device of this endpoint instead + // of going through the parent objects. + uint32 Index() const; + const BUSBInterface *Interface() const; + const BUSBConfiguration *Configuration() const; + const BUSBDevice *Device() const; + + // These methods can be used to check for endpoint characteristics. + bool IsBulk() const; + bool IsInterrupt() const; + bool IsIsochronous() const; + bool IsControl() const; + + bool IsInput() const; + bool IsOutput() const; + + uint16 MaxPacketSize() const; + uint8 Interval() const; + + const usb_endpoint_descriptor + *Descriptor() const; + + // These methods initiate transfers to or from the endpoint. All + // transfers are synchronous and the actually transfered amount of + // data is returned as a result. A negative value indicates an error. + // Which transfer type to use depends on the endpoint type. + ssize_t ControlTransfer(uint8 requestType, + uint8 request, uint16 value, + uint16 index, uint16 length, + void *data) const; + ssize_t InterruptTransfer(void *data, + size_t length) const; + ssize_t BulkTransfer(void *data, + size_t length) const; + +private: +friend class BUSBInterface; + BUSBEndpoint(BUSBInterface *interface, + uint32 index, int rawFD); + ~BUSBEndpoint(); + + BUSBInterface *fInterface; + uint32 fIndex; + int fRawFD; + + usb_endpoint_descriptor fDescriptor; +}; + +#endif Modified: haiku/trunk/src/libs/Jamfile =================================================================== --- haiku/trunk/src/libs/Jamfile 2007-01-23 14:38:42 UTC (rev 19912) +++ haiku/trunk/src/libs/Jamfile 2007-01-23 15:55:34 UTC (rev 19913) @@ -14,5 +14,6 @@ SubInclude HAIKU_TOP src libs png ; SubInclude HAIKU_TOP src libs stdc++ ; SubInclude HAIKU_TOP src libs termcap ; +SubInclude HAIKU_TOP src libs usb ; SubInclude HAIKU_TOP src libs util ; SubInclude HAIKU_TOP src libs zlib ; Added: haiku/trunk/src/libs/usb/Jamfile =================================================================== --- haiku/trunk/src/libs/usb/Jamfile 2007-01-23 14:38:42 UTC (rev 19912) +++ haiku/trunk/src/libs/usb/Jamfile 2007-01-23 15:55:34 UTC (rev 19913) @@ -0,0 +1,16 @@ +SubDir HAIKU_TOP src libs usb ; + +SetSubDirSupportedPlatformsBeOSCompatible ; + +# for USBKit.h, usb_raw.h and lock.h +UseLibraryHeaders usb ; +UseHeaders [ FDirName $(HAIKU_TOP) src add-ons kernel drivers bus usb ] : true ; +UsePrivateHeaders kernel ; + +StaticLibrary USBKit.a : + USBRoster.cpp + USBDevice.cpp + USBConfiguration.cpp + USBInterface.cpp + USBEndpoint.cpp +; Added: haiku/trunk/src/libs/usb/USBConfiguration.cpp =================================================================== --- haiku/trunk/src/libs/usb/USBConfiguration.cpp 2007-01-23 14:38:42 UTC (rev 19912) +++ haiku/trunk/src/libs/usb/USBConfiguration.cpp 2007-01-23 15:55:34 UTC (rev 19913) @@ -0,0 +1,99 @@ +/* + * Copyright 2007, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Michael Lotz + */ + +#include +#include +#include +#include + + +BUSBConfiguration::BUSBConfiguration(BUSBDevice *device, uint32 index, int rawFD) + : fDevice(device), + fIndex(index), + fRawFD(rawFD), + fInterfaces(NULL), + fConfigurationString(NULL) +{ + raw_command command; + command.config.descriptor = &fDescriptor; + command.config.config_index = fIndex; + if (ioctl(fRawFD, RAW_COMMAND_GET_CONFIGURATION_DESCRIPTOR, &command, sizeof(command)) + || command.config.status != RAW_STATUS_SUCCESS) { + memset(&fDescriptor, 0, sizeof(fDescriptor)); + } + + fInterfaces = new BUSBInterface *[fDescriptor.number_interfaces]; + for (uint32 i = 0; i < fDescriptor.number_interfaces; i++) + fInterfaces[i] = new BUSBInterface(this, i, fRawFD); +} + + +BUSBConfiguration::~BUSBConfiguration() +{ + delete[] fConfigurationString; + for (int32 i = 0; i < fDescriptor.number_interfaces; i++) + delete fInterfaces[i]; + delete[] fInterfaces; +} + + +uint32 +BUSBConfiguration::Index() const +{ + return fIndex; +} + + +const BUSBDevice * +BUSBConfiguration::Device() const +{ + return fDevice; +} + + +const char * +BUSBConfiguration::ConfigurationString() const +{ + if (fDescriptor.configuration == 0) + return ""; + + if (fConfigurationString) + return fConfigurationString; + + fConfigurationString = Device()->DecodeStringDescriptor(fDescriptor.configuration); + if (!fConfigurationString) { + fConfigurationString = new char[1]; + fConfigurationString[0] = 0; + } + + return fConfigurationString; +} + + +const usb_configuration_descriptor * +BUSBConfiguration::Descriptor() const +{ + return &fDescriptor; +} + + +uint32 +BUSBConfiguration::CountInterfaces() const +{ + return fDescriptor.number_interfaces; +} + + +const BUSBInterface * +BUSBConfiguration::InterfaceAt(uint32 index) const +{ + if (index >= fDescriptor.number_interfaces) + return NULL; + + return fInterfaces[index]; +} Added: haiku/trunk/src/libs/usb/USBDevice.cpp =================================================================== --- haiku/trunk/src/libs/usb/USBDevice.cpp 2007-01-23 14:38:42 UTC (rev 19912) +++ haiku/trunk/src/libs/usb/USBDevice.cpp 2007-01-23 15:55:34 UTC (rev 19913) @@ -0,0 +1,371 @@ +/* + * Copyright 2007, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Michael Lotz + */ + +#include +#include +#include +#include +#include + + +BUSBDevice::BUSBDevice(const char *path) + : fPath(NULL), + fRawFD(-1), + fConfigurations(NULL), + fActiveConfiguration(0), + fManufacturerString(NULL), + fProductString(NULL), + fSerialNumberString(NULL) +{ + memset(&fDescriptor, 0, sizeof(fDescriptor)); + + if (path) + SetTo(path); +} + + +BUSBDevice::~BUSBDevice() +{ + Unset(); +} + + +status_t +BUSBDevice::InitCheck() +{ + return (fRawFD >= 0 ? B_OK : B_ERROR); +} + + +status_t +BUSBDevice::SetTo(const char *path) +{ + if (!path) + return B_BAD_VALUE; + + fPath = strdup(path); + fRawFD = open(path, O_RDWR); + if (fRawFD < 0) { + Unset(); + return B_ERROR; + } + + raw_command command; + if (ioctl(fRawFD, RAW_COMMAND_GET_VERSION, &command, sizeof(command)) + || command.version.status != 0x0015) { + Unset(); + return B_ERROR; + } + + command.device.descriptor = &fDescriptor; + if (ioctl(fRawFD, RAW_COMMAND_GET_DEVICE_DESCRIPTOR, &command, sizeof(command)) + || command.device.status != RAW_STATUS_SUCCESS) { + Unset(); + return B_ERROR; + } + + fConfigurations = new BUSBConfiguration *[fDescriptor.num_configurations]; + for (uint32 i = 0; i < fDescriptor.num_configurations; i++) + fConfigurations[i] = new BUSBConfiguration(this, i, fRawFD); + + return B_OK; +} + + +void +BUSBDevice::Unset() +{ + if (fRawFD >= 0) + close(fRawFD); + fRawFD = -1; + + free(fPath); + fPath = NULL; + + delete[] fManufacturerString; + delete[] fProductString; + delete[] fSerialNumberString; + fManufacturerString = fProductString = fSerialNumberString = NULL; + + for (int32 i = 0; i < fDescriptor.num_configurations; i++) + delete fConfigurations[i]; + + delete[] fConfigurations; + memset(&fDescriptor, 0, sizeof(fDescriptor)); +} + + +const char * +BUSBDevice::Location() const +{ + if (!fPath || strlen(fPath) < 12) + return NULL; + + return &fPath[12]; +} + + +bool +BUSBDevice::IsHub() const +{ + return fDescriptor.device_class == 0x09; +} + + +uint16 +BUSBDevice::USBVersion() const +{ + return fDescriptor.usb_version; +} + + +uint8 +BUSBDevice::Class() const +{ + return fDescriptor.device_class; +} + + +uint8 +BUSBDevice::Subclass() const +{ + return fDescriptor.device_subclass; +} + + +uint8 +BUSBDevice::Protocol() const +{ + return fDescriptor.device_protocol; +} + + +uint8 +BUSBDevice::MaxEndpoint0PacketSize() const +{ + return fDescriptor.max_packet_size_0; +} + + +uint16 +BUSBDevice::VendorID() const +{ + return fDescriptor.vendor_id; +} + + +uint16 +BUSBDevice::ProductID() const +{ + return fDescriptor.product_id; +} + + +uint16 +BUSBDevice::Version() const +{ + return fDescriptor.device_version; +} + + +const char * +BUSBDevice::ManufacturerString() const +{ + if (fDescriptor.manufacturer == 0) + return ""; + + if (fManufacturerString) + return fManufacturerString; + + fManufacturerString = DecodeStringDescriptor(fDescriptor.manufacturer); + if (!fManufacturerString) { + fManufacturerString = new char[1]; + fManufacturerString[0] = 0; + } + + return fManufacturerString; +} + + +const char * +BUSBDevice::ProductString() const +{ + if (fDescriptor.product == 0) + return ""; + + if (fProductString) + return fProductString; + + fProductString = DecodeStringDescriptor(fDescriptor.product); + if (!fProductString) { + fProductString = new char[1]; + fProductString[0] = 0; + } + + return fProductString; +} + + +const char * +BUSBDevice::SerialNumberString() const +{ + if (fDescriptor.serial_number == 0) + return ""; + + if (fSerialNumberString) + return fSerialNumberString; + + fSerialNumberString = DecodeStringDescriptor(fDescriptor.serial_number); + if (!fSerialNumberString) { + fSerialNumberString = new char[1]; + fSerialNumberString[0] = 0; + } + + return fSerialNumberString; +} + + +const usb_device_descriptor * +BUSBDevice::Descriptor() const +{ + return &fDescriptor; +} + + +size_t +BUSBDevice::GetStringDescriptor(uint32 index, + usb_string_descriptor *descriptor, size_t length) const +{ + if (!descriptor) + return B_BAD_VALUE; + + raw_command command; + command.string.descriptor = descriptor; + command.string.string_index = index; + command.string.length = length; + + if (ioctl(fRawFD, RAW_COMMAND_GET_STRING_DESCRIPTOR, &command, sizeof(command)) + || command.string.status != RAW_STATUS_SUCCESS) { + return 0; + } + + return command.string.length; +} + + +char * +BUSBDevice::DecodeStringDescriptor(uint32 index) const +{ + char buffer[300]; + usb_string_descriptor *stringDescriptor; + stringDescriptor = (usb_string_descriptor *)&buffer; + + size_t stringLength = GetStringDescriptor(index, stringDescriptor, + sizeof(buffer) - sizeof(usb_string_descriptor)); + + if (stringLength < 3) + return NULL; + + // pseudo convert unicode string + stringLength = (stringLength - 2) / 2; + char *result = new char[stringLength + 1]; + for (size_t i = 0; i < stringLength; i++) + result[i] = stringDescriptor->string[i * 2]; + result[stringLength] = 0; + return result; +} + + +size_t +BUSBDevice::GetDescriptor(uint8 type, uint8 index, uint16 languageID, + void *data, size_t length) const +{ + if (length > 0 && data == NULL) + return B_BAD_VALUE; + + raw_command command; + command.descriptor.type = type; + command.descriptor.index = index; + command.descriptor.language_id = languageID; + command.descriptor.data = data; + command.descriptor.length = length; + + if (ioctl(fRawFD, RAW_COMMAND_GET_DESCRIPTOR, &command, sizeof(command)) + || command.descriptor.status != RAW_STATUS_SUCCESS) { + return 0; + } + + return command.descriptor.length; +} + + +uint32 +BUSBDevice::CountConfigurations() const +{ + return fDescriptor.num_configurations; +} + + +const BUSBConfiguration * +BUSBDevice::ConfigurationAt(uint32 index) const +{ + if (index >= fDescriptor.num_configurations) + return NULL; + + return fConfigurations[index]; +} + + +const BUSBConfiguration * +BUSBDevice::ActiveConfiguration() const +{ + return fConfigurations[fActiveConfiguration]; +} + + +status_t +BUSBDevice::SetConfiguration(const BUSBConfiguration *configuration) +{ + if (!configuration || configuration->Index() >= fDescriptor.num_configurations) + return B_BAD_VALUE; + + raw_command command; + command.config.config_index = configuration->Index(); + + if (ioctl(fRawFD, RAW_COMMAND_SET_CONFIGURATION, &command, sizeof(command)) + || command.config.status != RAW_STATUS_SUCCESS) { + return B_ERROR; + } + + fActiveConfiguration = configuration->Index(); + return B_OK; +} + + +ssize_t +BUSBDevice::ControlTransfer(uint8 requestType, uint8 request, uint16 value, + uint16 index, uint16 length, void *data) const +{ + if (length > 0 && data == NULL) + return B_BAD_VALUE; + + raw_command command; + command.control.request_type = requestType; + command.control.request = request; + command.control.value = value; + command.control.index = index; + command.control.length = length; + command.control.data = data; + + if (ioctl(fRawFD, RAW_COMMAND_CONTROL_TRANSFER, &command, sizeof(command)) + || command.control.status != RAW_STATUS_SUCCESS) { + return B_ERROR; + } + + return command.control.length; +} Added: haiku/trunk/src/libs/usb/USBEndpoint.cpp =================================================================== --- haiku/trunk/src/libs/usb/USBEndpoint.cpp 2007-01-23 14:38:42 UTC (rev 19912) +++ haiku/trunk/src/libs/usb/USBEndpoint.cpp 2007-01-23 15:55:34 UTC (rev 19913) @@ -0,0 +1,191 @@ +/* + * Copyright 2007, Haiku Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Michael Lotz + */ + +#include +#include +#include +#include + + +BUSBEndpoint::BUSBEndpoint(BUSBInterface *interface, uint32 index, int rawFD) + : fInterface(interface), + fIndex(index), + fRawFD(rawFD) +{ + raw_command command; + command.endpoint.descriptor = &fDescriptor; + command.endpoint.config_index = fInterface->Configuration()->Index(); + command.endpoint.interface_index = fInterface->Index(); + command.endpoint.endpoint_index = fIndex; + if (ioctl(fRawFD, RAW_COMMAND_GET_ENDPOINT_DESCRIPTOR, &command, sizeof(command)) + || command.config.status != RAW_STATUS_SUCCESS) { + memset(&fDescriptor, 0, sizeof(fDescriptor)); + } +} + + +BUSBEndpoint::~BUSBEndpoint() +{ +} + + +uint32 +BUSBEndpoint::Index() const +{ + return fIndex; +} + + +const BUSBInterface * +BUSBEndpoint::Interface() const +{ + return fInterface; +} + + +const BUSBConfiguration * +BUSBEndpoint::Configuration() const +{ + return fInterface->Configuration(); +} + + +const BUSBDevice * +BUSBEndpoint::Device() const +{ + return fInterface->Device(); +} + + +bool +BUSBEndpoint::IsBulk() const +{ + return (fDescriptor.attributes & USB_ENDPOINT_ATTR_MASK) == USB_ENDPOINT_ATTR_BULK; +} + + +bool +BUSBEndpoint::IsInterrupt() const +{ + return (fDescriptor.attributes & USB_ENDPOINT_ATTR_MASK) == USB_ENDPOINT_ATTR_INTERRUPT; +} + + +bool +BUSBEndpoint::IsIsochronous() const +{ + return (fDescriptor.attributes & USB_ENDPOINT_ATTR_MASK) == USB_ENDPOINT_ATTR_ISOCHRONOUS; +} + + +bool +BUSBEndpoint::IsControl() const +{ + return (fDescriptor.attributes & USB_ENDPOINT_ATTR_MASK) == USB_ENDPOINT_ATTR_CONTROL; +} + + +bool +BUSBEndpoint::IsInput() const +{ + return (fDescriptor.endpoint_address & USB_ENDPOINT_ADDR_DIR_IN) == USB_ENDPOINT_ADDR_DIR_IN; +} + + +bool +BUSBEndpoint::IsOutput() const +{ + return (fDescriptor.endpoint_address & USB_ENDPOINT_ADDR_DIR_IN) == USB_ENDPOINT_ADDR_DIR_OUT; +} + + +uint16 +BUSBEndpoint::MaxPacketSize() const +{ + return fDescriptor.max_packet_size; +} + + +uint8 +BUSBEndpoint::Interval() const +{ + return fDescriptor.interval; +} + + +const usb_endpoint_descriptor * +BUSBEndpoint::Descriptor() const +{ + return &fDescriptor; +} + + +ssize_t +BUSBEndpoint::ControlTransfer(uint8 requestType, uint8 request, uint16 value, + uint16 index, uint16 length, void *data) const +{ + if (length > 0 && data == NULL) + return B_BAD_VALUE; + + raw_command command; + command.control.request_type = requestType; + command.control.request = request; + command.control.value = value; + command.control.index = index; + command.control.length = length; + command.control.data = data; + + if (ioctl(fRawFD, RAW_COMMAND_CONTROL_TRANSFER, &command, sizeof(command)) + || command.control.status != RAW_STATUS_SUCCESS) { + return B_ERROR; + } + + return command.control.length; +} + + +ssize_t +BUSBEndpoint::InterruptTransfer(void *data, size_t length) const +{ + if (length > 0 && data == NULL) + return B_BAD_VALUE; + [... truncated: 465 lines follow ...] From mmlr at mlotz.ch Tue Jan 23 17:01:11 2007 From: mmlr at mlotz.ch (Michael Lotz) Date: Tue, 23 Jan 2007 17:01:11 +0100 CET Subject: [Haiku-commits] =?windows-1252?q?r19913_-_in_haiku/trunk=3A_heade?= =?windows-1252?q?rs/libs_headers/libs/usb_src/libs_src/libs/usb?= In-Reply-To: <200701231555.l0NFtZiL020787@sheep.berlios.de> Message-ID: <34772321774-BeMail@Primary> > Log: > Commiting reimplemented USBKit that is compatible with the old Be > sample code version. Fran?ois could you please remove the sample code version again? We'll have to decide whether we're going to restructure the library to a public and shared one later on though. Regards Michael From mmlr at mail.berlios.de Tue Jan 23 17:40:36 2007 From: mmlr at mail.berlios.de (mmlr at BerliOS) Date: Tue, 23 Jan 2007 17:40:36 +0100 Subject: [Haiku-commits] r19914 - haiku/trunk/src/bin Message-ID: <200701231640.l0NGeaBp023883@sheep.berlios.de> Author: mmlr Date: 2007-01-23 17:40:36 +0100 (Tue, 23 Jan 2007) New Revision: 19914 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19914&view=rev Modified: haiku/trunk/src/bin/usb_dev_info.cpp Log: * Added configuration and interface strings to the output * Added printing generic descriptors from 2000 sample code archive * Added license header * Adjusted style Modified: haiku/trunk/src/bin/usb_dev_info.cpp =================================================================== --- haiku/trunk/src/bin/usb_dev_info.cpp 2007-01-23 15:55:34 UTC (rev 19913) +++ haiku/trunk/src/bin/usb_dev_info.cpp 2007-01-23 16:40:36 UTC (rev 19914) @@ -1,78 +1,110 @@ +/* + * Originally released under the Be Sample Code License. + * Copyright 2000, Be Incorporated. All rights reserved. + * + * Modified for Haiku by Fran?ois Revol and Michael Lotz. + * Copyright 2007, Haiku Inc. All rights reserved. + */ -#include +#include #include -static void DumpInterface(const BUSBInterface *ifc) + +static void +DumpInterface(const BUSBInterface *interface) { - int i; - const BUSBEndpoint *ept; - if(!ifc) return; - printf(" Class .............. %d\n",ifc->Class()); - printf(" Subclass ........... %d\n",ifc->Subclass()); - printf(" Protocol ........... %d\n",ifc->Protocol()); - for(i=0;iCountEndpoints();i++){ - if(ept = ifc->EndpointAt(i)){ - printf(" [Endpoint %d]\n",i); - printf(" MaxPacketSize .... %d\n",ept->MaxPacketSize()); - printf(" Interval ......... %d\n",ept->Interval()); - if(ept->IsBulk()){ - printf(" Type ............. Bulk\n"); - } - if(ept->IsIsochronous()){ - printf(" Type ............. Isochronous\n"); - } - if(ept->IsInterrupt()){ - printf(" Type ............. Interrupt\n"); - } - if(ept->IsInput()){ - printf(" Direction ........ Input\n"); - } else { - printf(" Direction ........ Output\n"); - } - } + if (!interface) + return; + + printf(" Class .............. %d\n", interface->Class()); + printf(" Subclass ........... %d\n", interface->Subclass()); + printf(" Protocol ........... %d\n", interface->Protocol()); + printf(" Interface String ... \"%s\"\n", interface->InterfaceString()); + + for (int32 i = 0; i < interface->CountEndpoints(); i++) { + const BUSBEndpoint *endpoint = interface->EndpointAt(i); + if (!endpoint) + continue; + + printf(" [Endpoint %d]\n", i); + printf(" MaxPacketSize .... %d\n", endpoint->MaxPacketSize()); + printf(" Interval ......... %d\n", endpoint->Interval()); + + if (endpoint->IsControl()) + printf(" Type ............. Control\n"); + else if (endpoint->IsBulk()) + printf(" Type ............. Bulk\n"); + else if (endpoint->IsIsochronous()) + printf(" Type ............. Isochronous\n"); + else if (endpoint->IsInterrupt()) + printf(" Type ............. Interrupt\n"); + + if(endpoint->IsInput()) + printf(" Direction ........ Input\n"); + else + printf(" Direction ........ Output\n"); } + + char buffer[256]; + usb_descriptor *generic = (usb_descriptor *)buffer; + for (int32 i = 0; interface->OtherDescriptorAt(i, generic, 256) == B_OK; i++) { + printf(" [Descriptor %d]\n", i); + printf(" Type ............. 0x%02x\n", generic->generic.descriptor_type); + + printf(" Data ............. "); + for(int32 j = 0; j < generic->generic.length; j++) + printf("%02x ", generic->generic.data[j]); + printf("\n"); + } } -static void DumpConfiguration(const BUSBConfiguration *conf) + +static void +DumpConfiguration(const BUSBConfiguration *configuration) { - int i; - if(!conf) return; - for(i=0;iCountInterfaces();i++){ - printf(" [Interface %d]\n",i); - DumpInterface(conf->InterfaceAt(i)); + if (!configuration) + return; + + printf(" Configuration String . \"%s\"\n", configuration->ConfigurationString()); + for (int32 i = 0; i < configuration->CountInterfaces(); i++) { + printf(" [Interface %d]\n", i); + DumpInterface(configuration->InterfaceAt(i)); } } -static void DumpInfo(BUSBDevice &dev) + +static void +DumpInfo(BUSBDevice &device) { - int i; - printf("[Device]\n"); - printf("Class .................. %d\n",dev.Class()); - printf("Subclass ............... %d\n",dev.Subclass()); - printf("Protocol ............... %d\n",dev.Protocol()); - printf("Vendor ID .............. 0x%04x\n",dev.VendorID()); - printf("Product ID ............. 0x%04x\n",dev.ProductID()); - printf("Version ................ 0x%04x\n",dev.Version()); - printf("Manufacturer String .... \"%s\"\n",dev.ManufacturerString()); - printf("Product String ......... \"%s\"\n",dev.ProductString()); - printf("Serial Number .......... \"%s\"\n",dev.SerialNumberString()); - - for(i=0;i Author: mmlr Date: 2007-01-23 17:44:37 +0100 (Tue, 23 Jan 2007) New Revision: 19915 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19915&view=rev Modified: haiku/trunk/headers/os/drivers/USB3.h haiku/trunk/headers/os/drivers/USB_spec.h Log: * Minor cleanup * Fixed wrong wording in comment Modified: haiku/trunk/headers/os/drivers/USB3.h =================================================================== --- haiku/trunk/headers/os/drivers/USB3.h 2007-01-23 16:40:36 UTC (rev 19914) +++ haiku/trunk/headers/os/drivers/USB3.h 2007-01-23 16:44:37 UTC (rev 19915) @@ -94,7 +94,7 @@ * A value of 0 can be used as a wildcard for all fields. * * Would you like to be notified about all added hubs (class 0x09) you - * would a support descriptor like this to register_driver: + * would use a support descriptor like this for register_driver: * usb_support_descriptor hub_devs = { 9, 0, 0, 0, 0 }; * * If you intend to support just any device, or you at least want to be Modified: haiku/trunk/headers/os/drivers/USB_spec.h =================================================================== --- haiku/trunk/headers/os/drivers/USB_spec.h 2007-01-23 16:40:36 UTC (rev 19914) +++ haiku/trunk/headers/os/drivers/USB_spec.h 2007-01-23 16:44:37 UTC (rev 19915) @@ -62,9 +62,9 @@ #define USB_ENDPOINT_ATTR_CONTROL 0x00 #define USB_ENDPOINT_ATTR_ISOCHRONOUS 0x01 -#define USB_ENDPOINT_ATTR_BULK 0x02 -#define USB_ENDPOINT_ATTR_INTERRUPT 0x03 -#define USB_ENDPOINT_ATTR_MASK 0x03 +#define USB_ENDPOINT_ATTR_BULK 0x02 +#define USB_ENDPOINT_ATTR_INTERRUPT 0x03 +#define USB_ENDPOINT_ATTR_MASK 0x03 #define USB_ENDPOINT_ADDR_DIR_IN 0x80 #define USB_ENDPOINT_ADDR_DIR_OUT 0x00 From revol at free.fr Tue Jan 23 17:58:06 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Tue, 23 Jan 2007 17:58:06 +0100 CET Subject: [Haiku-commits] =?windows-1252?q?r19912_-_haiku/trunk/src/add-ons?= =?windows-1252?q?/kernel/file=5Fsystems/googlefs?= In-Reply-To: <12734961978-BeMail@zon> Message-ID: <8137410820-BeMail@laptop> > > Log: > > gcc4 is also picky about writing to const variables... grr > > What do you think const variables are for? ;-) > A const-ernation ? :D Fran?ois. From revol at free.fr Tue Jan 23 18:01:05 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Tue, 23 Jan 2007 18:01:05 +0100 CET Subject: [Haiku-commits] r19913 - in haiku/trunk: headers/libs headers/libs/usb src/libs src/libs/usb In-Reply-To: <34772321774-BeMail@Primary> Message-ID: <8316962243-BeMail@laptop> > > Log: > > Commiting reimplemented USBKit that is compatible with the old Be > > sample code version. > > Fran?ois could you please remove the sample code version again? > We'll have to decide whether we're going to restructure the library > to > a public and shared one later on though. > Ok. At least it had you make your mind :D I was eager to try my webcam addon... plus I wanted to see if usb was working at all. I was also wondering about an usb_cdce (ethernet) driver, my Freebox DSL modem implements that. Fran?ois. From axeld at mail.berlios.de Tue Jan 23 18:09:22 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 23 Jan 2007 18:09:22 +0100 Subject: [Haiku-commits] r19916 - haiku/trunk/src/add-ons/kernel/file_systems/bfs Message-ID: <200701231709.l0NH9M0H027890@sheep.berlios.de> Author: axeld Date: 2007-01-23 18:09:21 +0100 (Tue, 23 Jan 2007) New Revision: 19916 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19916&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h haiku/trunk/src/add-ons/kernel/file_systems/bfs/Jamfile haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp Log: Writing to attributes was deadlock prone; the BFS volume lock was acquired with the BFS Journal lock held. Since our get_vnode() is no longer unsafe (unlike Be's version of it), we can get rid of the UNSAFE_GET_VNODE stuff, which also solves this bug. Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp 2007-01-23 16:44:37 UTC (rev 19915) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/BlockAllocator.cpp 2007-01-23 17:09:21 UTC (rev 19916) @@ -1,6 +1,6 @@ /* BlockAllocator - block bitmap handling and allocation policies * - * Copyright 2001-2006, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2001-2007, Axel D?rfler, axeld at pinc-software.de. * This file may be used under the terms of the MIT License. */ @@ -935,9 +935,6 @@ // get iterator for the next directory -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(fVolume->Lock()); -#endif Vnode vnode(fVolume, cookie->current); Inode *inode; if (vnode.Get(&inode) < B_OK) { @@ -1039,9 +1036,6 @@ // if we are allowed to fix errors, we should remove the file if (control->flags & BFS_REMOVE_WRONG_TYPES && control->flags & BFS_FIX_BITMAP_ERRORS) { -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(fVolume->Lock()); -#endif // it's safe to start a transaction, because Inode::Remove() // won't touch the block bitmap (which we hold the lock for) // if we set the INODE_DONT_FREE_SPACE flag - since we fix Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2007-01-23 16:44:37 UTC (rev 19915) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Inode.h 2007-01-23 17:09:21 UTC (rev 19916) @@ -1,6 +1,6 @@ /* Inode - inode access functions * - * Copyright 2001-2006, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2001-2007, Axel D?rfler, axeld at pinc-software.de. * This file may be used under the terms of the MIT License. */ #ifndef INODE_H @@ -250,9 +250,6 @@ status_t Get(Inode **_inode) { // should we check inode against NULL here? it should not be necessary -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(fVolume->Lock()); -#endif return get_vnode(fVolume->ID(), fID, (void **)_inode); } Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/Jamfile =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/Jamfile 2007-01-23 16:44:37 UTC (rev 19915) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/Jamfile 2007-01-23 17:09:21 UTC (rev 19916) @@ -3,7 +3,7 @@ # save original optimization level oldOPTIM = $(OPTIM) ; -# R5 support is currently disabled! +# R5 support has been removed! # # Have a look in src/tests/add-ons/kernel/file_systems/bfs/r5/ # for an R5 compatible version. @@ -13,7 +13,6 @@ # set some additional defines { local defines = - UNSAFE_GET_VNODE #BFS_BIG_ENDIAN_ONLY ; Modified: haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2007-01-23 16:44:37 UTC (rev 19915) +++ haiku/trunk/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp 2007-01-23 17:09:21 UTC (rev 19916) @@ -1,6 +1,6 @@ /* kernel_interface - file system interface to Haiku's vnode layer * - * Copyright 2001-2006, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2001-2007, Axel D?rfler, axeld at pinc-software.de. * This file may be used under the terms of the MIT License. */ @@ -693,10 +693,6 @@ if (status < B_OK) RETURN_ERROR(status); -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(volume->Lock()); -#endif - WriteLocked locked(inode->Lock()); if (locked.IsLocked() < B_OK) RETURN_ERROR(B_ERROR); @@ -793,9 +789,6 @@ cookie->last_size = 0; cookie->last_notification = system_time(); -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(volume->Lock()); -#endif Transaction transaction(volume, directory->BlockNumber()); status_t status = Inode::Create(transaction, directory, name, S_FILE | (mode & S_IUMSK), @@ -834,9 +827,6 @@ if (status < B_OK) RETURN_ERROR(status); -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(volume->Lock()); -#endif Transaction transaction(volume, directory->BlockNumber()); Inode *link; @@ -904,9 +894,6 @@ if (status < B_OK) return status; -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(volume->Lock()); -#endif Transaction transaction(volume, directory->BlockNumber()); off_t id; @@ -1274,9 +1261,6 @@ && (needsTrimming || inode->OldLastModified() != inode->LastModified() || inode->OldSize() != inode->Size())) { -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(volume->Lock()); -#endif ReadLocked locked(inode->Lock()); // trim the preallocated blocks and update the size, @@ -1406,9 +1390,6 @@ if (status < B_OK) RETURN_ERROR(status); -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(volume->Lock()); -#endif Transaction transaction(volume, directory->BlockNumber()); // Inode::Create() locks the inode if we pass the "id" parameter, but we @@ -1438,9 +1419,6 @@ Volume *volume = (Volume *)_ns; Inode *directory = (Inode *)_directory; -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(volume->Lock()); -#endif Transaction transaction(volume, directory->BlockNumber()); off_t id; @@ -1882,9 +1860,6 @@ if (geteuid() != 0) return B_NOT_ALLOWED; -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(volume->Lock()); -#endif Transaction transaction(volume, volume->Indices()); Index index(volume); @@ -1917,9 +1892,6 @@ if ((indices = volume->IndicesNode()) == NULL) return B_ENTRY_NOT_FOUND; -#ifdef UNSAFE_GET_VNODE - RecursiveLocker locker(volume->Lock()); -#endif Transaction transaction(volume, volume->Indices()); status_t status = indices->Remove(transaction, name); From axeld at mail.berlios.de Tue Jan 23 18:14:32 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 23 Jan 2007 18:14:32 +0100 Subject: [Haiku-commits] r19917 - haiku/trunk/src/preferences/screen Message-ID: <200701231714.l0NHEWRe028243@sheep.berlios.de> Author: axeld Date: 2007-01-23 18:14:32 +0100 (Tue, 23 Jan 2007) New Revision: 19917 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19917&view=rev Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp haiku/trunk/src/preferences/screen/ScreenWindow.h Log: Added special VESA mode support to the Screen preferences: the "Refresh Rate:" menu field will be hidden, and on resolution change, you get a message that tells you that the change will take effect with the next reboot. The "vesa" mode file will be written on exit if any changes were made. This closes bug #547. Modified: haiku/trunk/src/preferences/screen/ScreenWindow.cpp =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2007-01-23 17:09:21 UTC (rev 19916) +++ haiku/trunk/src/preferences/screen/ScreenWindow.cpp 2007-01-23 17:14:32 UTC (rev 19917) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -12,25 +12,6 @@ */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - #include "AlertWindow.h" #include "Constants.h" #include "RefreshWindow.h" @@ -48,10 +29,32 @@ * It will be replaced as soon as we introduce an updated accelerant interface * which may even happen before R1 hits the streets. */ - #include "multimon.h" // the usual: DANGER WILL, ROBINSON! +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + const char* kBackgroundsSignature = "application/x-vnd.haiku-backgrounds"; // list of officially supported colour spaces @@ -208,11 +211,17 @@ ScreenWindow::ScreenWindow(ScreenSettings *settings) : BWindow(settings->WindowFrame(), "Screen", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE, B_ALL_WORKSPACES), + fIsVesa(false), + fVesaApplied(false), fScreenMode(this), fChangingAllWorkspaces(false) { BScreen screen(this); + accelerant_device_info info; + if (screen.GetDeviceInfo(&info) == B_OK && !strcasecmp(info.chipset, "VESA")) + fIsVesa = true; + fScreenMode.Get(fOriginal); fActive = fSelected = fOriginal; @@ -228,7 +237,11 @@ fAllWorkspacesItem = new BMenuItem("All Workspaces", new BMessage(WORKSPACE_CHECK_MSG)); popUpMenu->AddItem(fAllWorkspacesItem); BMenuItem *item = new BMenuItem("Current Workspace", new BMessage(WORKSPACE_CHECK_MSG)); - item->SetMarked(true); + if (_IsVesa()) { + fAllWorkspacesItem->SetMarked(true); + item->SetEnabled(false); + } else + item->SetMarked(true); popUpMenu->AddItem(item); BMenuField* workspaceMenuField = new BMenuField(BRect(0, 0, 100, 15), @@ -351,6 +364,8 @@ } fRefreshField = new BMenuField(rect, "RefreshMenu", "Refresh Rate:", fRefreshMenu, true); + if (_IsVesa()) + fRefreshField->Hide(); fControlsBox->AddChild(fRefreshField); view->AddChild(fControlsBox); @@ -497,6 +512,17 @@ ScreenWindow::QuitRequested() { fSettings->SetWindowFrame(Frame()); + if (fVesaApplied) { + status_t status = _WriteVesaModeFile(fSelected); + if (status < B_OK) { + BString warning = "Could not write VESA mode settings file:\n\t"; + warning << strerror(status); + (new BAlert("VesaAlert", warning.String(), "Okay", NULL, NULL, + B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); + + } + } + be_app->PostMessage(B_QUIT_REQUESTED); return BWindow::QuitRequested(); @@ -708,16 +734,16 @@ } -/** reflect active mode in chosen settings */ - +/*! Reflect active mode in chosen settings */ void ScreenWindow::UpdateActiveMode() { - // usually, this function gets called after a mode + // Usually, this function gets called after a mode // has been set manually; still, as the graphics driver // is free to fiddle with mode passed, we better ask // what kind of mode we actually got - fScreenMode.Get(fActive); + if (!fVesaApplied) + fScreenMode.Get(fActive); fSelected = fActive; UpdateControls(); @@ -945,6 +971,37 @@ } +status_t +ScreenWindow::_WriteVesaModeFile(const screen_mode& mode) const +{ + BPath path; + status_t status = find_directory(B_USER_SETTINGS_DIRECTORY, &path, true); + if (status < B_OK) + return status; + + path.Append("kernel/drivers"); + status = create_directory(path.Path(), 0755); + if (status < B_OK) + return status; + + path.Append("vesa"); + BFile file; + status = file.SetTo(path.Path(), B_CREATE_FILE | B_WRITE_ONLY | B_ERASE_FILE); + if (status < B_OK) + return status; + + char buffer[256]; + snprintf(buffer, sizeof(buffer), "mode %ld %ld %ld\n", + mode.width, mode.height, mode.BitsPerPixel()); + + ssize_t bytesWritten = file.Write(buffer, strlen(buffer)); + if (bytesWritten < B_OK) + return bytesWritten; + + return B_OK; +} + + bool ScreenWindow::CanApply() const { @@ -976,6 +1033,17 @@ void ScreenWindow::Apply() { + if (_IsVesa()) { + (new BAlert("VesaAlert", + "Your graphics card is not supported. Resolution changes will be " + "adopted on next system startup.\n", "Okay", NULL, NULL, B_WIDTH_AS_USUAL, + B_INFO_ALERT))->Go(NULL); + + fVesaApplied = true; + fActive = fSelected; + return; + } + if (fAllWorkspacesItem->IsMarked()) { BAlert *workspacesAlert = new BAlert("WorkspacesAlert", "Change all workspaces? This action cannot be reverted.", "Okay", "Cancel", Modified: haiku/trunk/src/preferences/screen/ScreenWindow.h =================================================================== --- haiku/trunk/src/preferences/screen/ScreenWindow.h 2007-01-23 17:09:21 UTC (rev 19916) +++ haiku/trunk/src/preferences/screen/ScreenWindow.h 2007-01-23 17:14:32 UTC (rev 19917) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -52,10 +52,15 @@ bool CanApply() const; bool CanRevert() const; + status_t _WriteVesaModeFile(const screen_mode& mode) const; + bool _IsVesa() const { return fIsVesa; } + void LayoutControls(uint32 flags); BRect LayoutMenuFields(uint32 flags, bool sideBySide = false); ScreenSettings* fSettings; + bool fIsVesa; + bool fVesaApplied; BBox* fScreenBox; BBox* fControlsBox; From mmu_man at mail.berlios.de Tue Jan 23 18:14:36 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 18:14:36 +0100 Subject: [Haiku-commits] r19918 - in haiku/trunk: headers/os src/kits Message-ID: <200701231714.l0NHEa16028276@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 18:14:35 +0100 (Tue, 23 Jan 2007) New Revision: 19918 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19918&view=rev Removed: haiku/trunk/headers/os/usb/ haiku/trunk/src/kits/usb/ Log: Remove old usb kit fro Be in favor of the new rewritten one. At least we have one now :D From axeld at mail.berlios.de Tue Jan 23 18:27:33 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 23 Jan 2007 18:27:33 +0100 Subject: [Haiku-commits] r19919 - haiku/trunk/src/kits/interface Message-ID: <200701231727.l0NHRXt4028834@sheep.berlios.de> Author: axeld Date: 2007-01-23 18:27:32 +0100 (Tue, 23 Jan 2007) New Revision: 19919 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19919&view=rev Modified: haiku/trunk/src/kits/interface/Box.cpp Log: Calling ResizeToPreferred() on a BBox now honours its current size, IOW it won't get any smaller due to this (before, a box without a label would resize itself to 0/0). Modified: haiku/trunk/src/kits/interface/Box.cpp =================================================================== --- haiku/trunk/src/kits/interface/Box.cpp 2007-01-23 17:14:35 UTC (rev 19918) +++ haiku/trunk/src/kits/interface/Box.cpp 2007-01-23 17:27:32 UTC (rev 19919) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2006, Haiku, Inc. + * Copyright (c) 2001-2007, Haiku, Inc. * Distributed under the terms of the MIT license. * * Authors: @@ -360,7 +360,16 @@ void BBox::ResizeToPreferred() { - BView::ResizeToPreferred(); + float width, height; + GetPreferredSize(&width, &height); + + // make sure the box don't get smaller than it already is + if (width < Bounds().Width()) + width = Bounds().Width(); + if (height < Bounds().Height()) + height = Bounds().Height(); + + BView::ResizeTo(width, height); } From axeld at mail.berlios.de Tue Jan 23 18:57:22 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 23 Jan 2007 18:57:22 +0100 Subject: [Haiku-commits] r19920 - haiku/trunk/src/preferences/backgrounds Message-ID: <200701231757.l0NHvMoa011288@sheep.berlios.de> Author: axeld Date: 2007-01-23 18:57:14 +0100 (Tue, 23 Jan 2007) New Revision: 19920 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19920&view=rev Modified: haiku/trunk/src/preferences/backgrounds/Backgrounds.cpp haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp haiku/trunk/src/preferences/backgrounds/BackgroundsView.h Log: * Made the whole thing a bit more font sensitive - looks more or less good with an 18pt font, now. * Added a few TODO items. Modified: haiku/trunk/src/preferences/backgrounds/Backgrounds.cpp =================================================================== --- haiku/trunk/src/preferences/backgrounds/Backgrounds.cpp 2007-01-23 17:27:32 UTC (rev 19919) +++ haiku/trunk/src/preferences/backgrounds/Backgrounds.cpp 2007-01-23 17:57:14 UTC (rev 19920) @@ -59,7 +59,13 @@ { fBackgroundsView = new BackgroundsView(Bounds(), "BackgroundsView", B_FOLLOW_ALL, B_WILL_DRAW); + fBackgroundsView->ResizeToPreferred(); + ResizeTo(fBackgroundsView->Bounds().Width(), fBackgroundsView->Bounds().Height()); + AddChild(fBackgroundsView); + + // TODO: center on screen + // TODO: save window position? } Modified: haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp =================================================================== --- haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp 2007-01-23 17:27:32 UTC (rev 19919) +++ haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp 2007-01-23 17:57:14 UTC (rev 19920) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -89,8 +89,7 @@ BackgroundsView::BackgroundsView(BRect frame, const char *name, int32 resize, int32 flags) - : BBox(frame, name, resize, - flags | B_WILL_DRAW | B_FRAME_EVENTS, B_NO_BORDER), + : BBox(frame, name, resize, flags | B_WILL_DRAW | B_FRAME_EVENTS, B_NO_BORDER), fCurrent(NULL), fCurrentInfo(NULL), fLastImageIndex(-1), @@ -168,31 +167,24 @@ rightbox->SetLabel(workspaceMenuField); AddChild(rightbox); - fPicker = new BColorControl(BPoint(10, 110), B_CELLS_32x8, 5.0, "Picker", - new BMessage(kMsgUpdateColor)); - rightbox->AddChild(fPicker); - - delta = fPicker->Frame().bottom + 10.0f - rightbox->Bounds().Height(); - rightbox->ResizeBy(0, delta); - fPreview->ResizeBy(0, delta); - - // we're not yet attached to a view, so we need to move them manually - fXPlacementText->MoveBy(0, delta); - fYPlacementText->MoveBy(0, delta); - float offset = be_plain_font->StringWidth("Placement:") + 5; - rect.Set(offset + 10, 76, 280, 96); + rect.Set(10, 10, rightbox->Bounds().right - 10, 30); +#ifdef __HAIKU__ + rect.top = 8 + rightbox->InnerFrame().top; +#endif - fIconLabelBackground = new BCheckBox(rect, "iconLabelBackground", - "Icon label background", new BMessage(kMsgIconLabelBackground)); - fIconLabelBackground->SetValue(B_CONTROL_ON); - rightbox->AddChild(fIconLabelBackground); - fImageMenu = new BPopUpMenu("pick one"); fImageMenu->AddItem(new BGImageMenuItem("None", -1, new BMessage(kMsgNoImage))); fImageMenu->AddSeparatorItem(); fImageMenu->AddItem(new BMenuItem("Other" B_UTF8_ELLIPSIS, new BMessage(kMsgOtherImage))); + BMenuField *imageMenuField = new BMenuField(rect, "imageMenuField", + "Image:", fImageMenu); + imageMenuField->SetDivider(offset); + imageMenuField->SetAlignment(B_ALIGN_RIGHT); + imageMenuField->ResizeToPreferred(); + rightbox->AddChild(imageMenuField); + fPlacementMenu = new BPopUpMenu("pick one"); fPlacementMenu->AddItem(new BMenuItem("Manual", new BMessage(kMsgManualPlacement))); @@ -203,34 +195,53 @@ fPlacementMenu->AddItem(new BMenuItem("Tile", new BMessage(kMsgTilePlacement))); - rect.OffsetBy(-offset, -25); + rect.OffsetBy(0, imageMenuField->Bounds().Height() + 5); BMenuField *placementMenuField = new BMenuField(rect, "placementMenuField", "Placement:", fPlacementMenu); placementMenuField->SetDivider(offset); placementMenuField->SetAlignment(B_ALIGN_RIGHT); + placementMenuField->ResizeToPreferred(); rightbox->AddChild(placementMenuField); - rect.OffsetBy(0, -25); - rect.right += 40; - BMenuField *imageMenuField = new BMenuField(rect, "imageMenuField", - "Image:", fImageMenu); - imageMenuField->SetDivider(offset); - imageMenuField->SetAlignment(B_ALIGN_RIGHT); - rightbox->AddChild(imageMenuField); + rect.OffsetBy(offset, placementMenuField->Bounds().Height() + 5); + fIconLabelBackground = new BCheckBox(rect, "iconLabelBackground", + "Icon label background", new BMessage(kMsgIconLabelBackground)); + fIconLabelBackground->SetValue(B_CONTROL_ON); + fIconLabelBackground->ResizeToPreferred(); + rightbox->AddChild(fIconLabelBackground); + rect.top += fIconLabelBackground->Bounds().Height() + 15; + fPicker = new BColorControl(BPoint(10, rect.top), B_CELLS_32x8, 5.0, "Picker", + new BMessage(kMsgUpdateColor)); + rightbox->AddChild(fPicker); + + float xDelta = max_c(fIconLabelBackground->Frame().right, fPicker->Frame().right) + + 10.0f - rightbox->Bounds().Width(); + delta = fPicker->Frame().bottom + 10.0f - rightbox->Bounds().Height(); + + rightbox->ResizeBy(xDelta, delta); + fPreview->ResizeBy(0, delta); + + // we're not yet attached to a view, so we need to move them manually + fXPlacementText->MoveBy(0, delta); + fYPlacementText->MoveBy(0, delta); + fRevert = new BButton(BRect(fPreview->Frame().left, fPreview->Frame().bottom + 10, fPreview->Frame().left + 80, Frame().bottom - 10), "RevertButton", - "Revert", new BMessage(kMsgRevertSettings), B_FOLLOW_LEFT | B_FOLLOW_TOP, + "Revert", new BMessage(kMsgRevertSettings), B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, B_WILL_DRAW | B_NAVIGABLE); + fRevert->ResizeToPreferred(); AddChild(fRevert); - fApply = new BButton(BRect(rightbox->Frame().right - 70, fPreview->Frame().bottom + fApply = new BButton(BRect(rightbox->Frame().right, fPreview->Frame().bottom + 10, rightbox->Frame().right, 110), "ApplyButton", "Apply", - new BMessage(kMsgApplySettings), B_FOLLOW_LEFT | B_FOLLOW_TOP, + new BMessage(kMsgApplySettings), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM, B_WILL_DRAW | B_NAVIGABLE); + fApply->ResizeToPreferred(); + fApply->MoveBy(-fApply->Bounds().Width(), 0); AddChild(fApply); - ResizeBy(0, delta); + ResizeTo(rightbox->Frame().right + 10, fApply->Frame().bottom + 10); } @@ -242,6 +253,16 @@ void +BackgroundsView::GetPreferredSize(float* _width, float* _height) +{ + if (_width) + *_width = fApply->Frame().right + 10; + if (_height) + *_height = fApply->Frame().bottom + 10; +} + + +void BackgroundsView::AllAttached() { fPlacementMenu->SetTargetForItems(this); @@ -1217,19 +1238,20 @@ void PreviewBox::Draw(BRect rect) { + // TODO: make view size dependent! rgb_color color = HighColor(); - BPoint points[] = { - BPoint(11,19), BPoint(139,19), BPoint(141,21), - BPoint(141,119), BPoint(139,121), BPoint(118,121), - BPoint(118,126), BPoint(117,127), BPoint(33,127), - BPoint(32,126), BPoint(32,121),BPoint(11,121), - BPoint(9,119),BPoint(9,21),BPoint(11,19) - }; SetHighColor(LowColor()); FillRect(BRect(9,19,141,127)); if (fIsDesktop) { + BPoint points[] = { + BPoint(11,19), BPoint(139,19), BPoint(141,21), + BPoint(141,119), BPoint(139,121), BPoint(118,121), + BPoint(118,126), BPoint(117,127), BPoint(33,127), + BPoint(32,126), BPoint(32,121),BPoint(11,121), + BPoint(9,119),BPoint(9,21),BPoint(11,19) + }; SetHighColor(184,184,184); FillPolygon(points, 15); SetHighColor(96,96,96); Modified: haiku/trunk/src/preferences/backgrounds/BackgroundsView.h =================================================================== --- haiku/trunk/src/preferences/backgrounds/BackgroundsView.h 2007-01-23 17:27:32 UTC (rev 19919) +++ haiku/trunk/src/preferences/backgrounds/BackgroundsView.h 2007-01-23 17:57:14 UTC (rev 19920) @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005, Haiku, Inc. All Rights Reserved. + * Copyright 2002-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -91,6 +91,8 @@ Image* GetImage(int32 imageIndex); void ProcessRefs(entry_ref dir_ref, BMessage* msg); + void GetPreferredSize(float* _width, float* _height); + protected: void Save(); void NotifyServer(); From mmu_man at mail.berlios.de Tue Jan 23 19:24:36 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 19:24:36 +0100 Subject: [Haiku-commits] r19921 - in haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors: . hdcs1000 hv7131e1 tas5110c1b Message-ID: <200701231824.l0NIOaeX009130@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 19:24:36 +0100 (Tue, 23 Jan 2007) New Revision: 19921 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19921&view=rev Added: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hdcs1000.cpp haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hv7131e1.cpp haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/tas5110c1b.cpp Removed: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hdcs1000/hdcs1000.cpp haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hv7131e1/hv7131e1.cpp haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/tas5110c1b/tas5110c1b.cpp Log: move those down a bit to simplify jamfile writing (where are my wildcards ??) Deleted: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hdcs1000/hdcs1000.cpp Copied: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hdcs1000.cpp (from rev 19920, haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hdcs1000/hdcs1000.cpp) Deleted: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hv7131e1/hv7131e1.cpp Copied: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hv7131e1.cpp (from rev 19920, haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hv7131e1/hv7131e1.cpp) Deleted: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/tas5110c1b/tas5110c1b.cpp Copied: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/tas5110c1b.cpp (from rev 19920, haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/tas5110c1b/tas5110c1b.cpp) From mmu_man at mail.berlios.de Tue Jan 23 19:28:25 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 19:28:25 +0100 Subject: [Haiku-commits] r19922 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors Message-ID: <200701231828.l0NISPe0009395@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 19:28:25 +0100 (Tue, 23 Jan 2007) New Revision: 19922 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19922&view=rev Removed: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hdcs1000/ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/hv7131e1/ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/sensors/tas5110c1b/ Log: empty now From mmu_man at mail.berlios.de Tue Jan 23 19:30:57 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 19:30:57 +0100 Subject: [Haiku-commits] r19923 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam Message-ID: <200701231830.l0NIUve5009716@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 19:30:56 +0100 (Tue, 23 Jan 2007) New Revision: 19923 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19923&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/makefile Log: update makefile to reflect tree change Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/makefile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/makefile 2007-01-23 18:28:25 UTC (rev 19922) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/makefile 2007-01-23 18:30:56 UTC (rev 19923) @@ -34,7 +34,7 @@ # in folder names do not work well with this makefile. SRCS := $(wildcard *.cpp) \ $(wildcard addons/*/*.cpp) \ -$(wildcard sensors/*/*.cpp) \ +$(wildcard sensors/*.cpp) \ $(wildcard cstransforms/*.cpp) # specify the resource files to use @@ -196,8 +196,8 @@ CamInternalAddons.h: $(wildcard addons/*/*CamDevice.cpp) grep -h B_WEBCAM_MKINTFUNC $(CURDIR)/addons/*/*CamDevice.cpp > $@ -CamInternalSensors.h: $(wildcard sensors/*/*.cpp) - grep -h B_WEBCAM_DECLARE_SENSOR $(CURDIR)/sensors/*/*.cpp > $@ +CamInternalSensors.h: $(wildcard sensors/*.cpp) + grep -h B_WEBCAM_DECLARE_SENSOR $(CURDIR)/sensors/*.cpp > $@ CamInternalColorSpaceTransforms.h: $(wildcard cstransforms/*.cpp) grep -h B_WEBCAM_DECLARE_CSTRANSFORM $(CURDIR)/cstransforms/*.cpp > $@ From axeld at pinc-software.de Tue Jan 23 19:33:58 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Tue, 23 Jan 2007 19:33:58 +0100 (MET) Subject: [Haiku-commits] r19913 - in haiku/trunk: headers/libs headers/libs/usb src/libs src/libs/usb In-Reply-To: <8316962243-BeMail@laptop> Message-ID: <23953775888-BeMail@zon> "Fran?ois Revol" wrote: > Ok. At least it had you make your mind :D > I was eager to try my webcam addon... > plus I wanted to see if usb was working at all. > I was also wondering about an usb_cdce (ethernet) driver, my Freebox > DSL modem implements that. Sounds like a good plan ;-) Bye, Axel. From mmu_man at mail.berlios.de Tue Jan 23 19:58:17 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 19:58:17 +0100 Subject: [Haiku-commits] r19924 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam Message-ID: <200701231858.l0NIwHgA012852@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 19:58:17 +0100 (Tue, 23 Jan 2007) New Revision: 19924 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19924&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.cpp haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.cpp haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h Log: remove zeta-specific stuff from the use of USB Kit, USBKit.h is all we need. Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.cpp 2007-01-23 18:30:56 UTC (rev 19923) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.cpp 2007-01-23 18:58:17 UTC (rev 19924) @@ -6,7 +6,6 @@ #include #include -#include //#define DEBUG_WRITE_DUMP //#define DEBUG_DISCARD_DATA Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h 2007-01-23 18:30:56 UTC (rev 19923) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h 2007-01-23 18:58:17 UTC (rev 19924) @@ -3,20 +3,12 @@ #include #include -#include -#include +#include #include #include #include -namespace Z { - namespace USB { - class BUSBDevice; - } -} -using Z::USB::BUSBDevice; - typedef struct { usb_support_descriptor desc; const char *vendor; Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.cpp 2007-01-23 18:30:56 UTC (rev 19923) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.cpp 2007-01-23 18:58:17 UTC (rev 19924) @@ -5,7 +5,6 @@ #include "CamDebug.h" #include "CamDefs.h" -#include #include #undef B_WEBCAM_MKINTFUNC Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h 2007-01-23 18:30:56 UTC (rev 19923) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h 2007-01-23 18:58:17 UTC (rev 19924) @@ -3,21 +3,13 @@ #include #include -#include +#include #include class WebCamMediaAddOn; class CamDevice; class CamDeviceAddon; -namespace Z { -namespace USB { - class BUSBDevice; -} -} - -using Z::USB::BUSBDevice; - class CamRoster : public BUSBRoster { public: From mmu_man at mail.berlios.de Tue Jan 23 20:06:18 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 20:06:18 +0100 Subject: [Haiku-commits] r19925 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam Message-ID: <200701231906.l0NJ6I4a014265@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 20:06:18 +0100 (Tue, 23 Jan 2007) New Revision: 19925 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19925&view=rev Added: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile Log: I *love* Jam :D still need to autogenerate some headers... (you still need to 'make' it first). Added: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 18:58:17 UTC (rev 19924) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 19:06:18 UTC (rev 19925) @@ -0,0 +1,58 @@ +SubDir HAIKU_TOP src add-ons media media-add-ons usb_webcam ; + +SetSubDirSupportedPlatformsBeOSCompatible ; + +# for USBKit.h +UseLibraryHeaders usb ; + +# HOW the F*** do I do that with Jam ? +#SRCS := $(wildcard *.cpp) \ +#$(wildcard addons/*/*.cpp) \ +#$(wildcard sensors/*/*.cpp) \ +#$(wildcard cstransforms/*.cpp) + + +# source directories +local sourceDirs = + addons/quickcam + addons/sonix + cstransforms + sensors +; + +local sourceDir ; +for sourceDir in $(sourceDirs) { + SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons media media-add-ons usb_webcam $(sourceDir) ] ; +} + +## addon sources +local addonSources ; +addonSources = QuickCamDevice.cpp SonixCamDevice.cpp ; + +## colorspace transforms sources +local csTransformsSources ; +csTransformsSources = Bayer.cpp ; + +## sensors sources +local sensorsSources ; +sensorsSources = hdcs1000.cpp hv7131e1.cpp tas5110c1b.cpp ; + +Addon usb_webcam.media_addon : media : + $(addonSources) + $(csTransformsSources) + $(sensorsSources) + AddOn.cpp + Producer.cpp + CamBufferedFilterInterface.cpp + CamBufferingDeframer.cpp + CamColorSpaceTransform.cpp + CamDeframer.cpp + CamDefs.cpp + CamDevice.cpp + CamFilterInterface.cpp + CamRoster.cpp + CamSensor.cpp + CamStreamingDeframer.cpp +; + +LinkAgainst usb_webcam.media_addon : be media usb ; From mmu_man at mail.berlios.de Tue Jan 23 20:41:31 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 20:41:31 +0100 Subject: [Haiku-commits] r19926 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam Message-ID: <200701231941.l0NJfVqr017060@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 20:41:31 +0100 (Tue, 23 Jan 2007) New Revision: 19926 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19926&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile Log: if the Jamfile in devices prefs is correct this is supposed to generate the 3 headers listing addons... But it doesn't work yet. Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 19:06:18 UTC (rev 19925) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 19:41:31 UTC (rev 19926) @@ -37,6 +37,27 @@ local sensorsSources ; sensorsSources = hdcs1000.cpp hv7131e1.cpp tas5110c1b.cpp ; +## how to build header files from sources to include teh list of built-in addons. + +rule USBWebcamHeaderGen +{ + SEARCH on $(3) = $(SEARCH_SOURCE) ; + + Depends $(1) : $(3) ; + MakeLocateArch $(<) ; + USBWebcamHeaderGen1 $(2) : $(3) : $(1) ; + LocalClean clean : $(<) ; +} + +actions USBWebcamHeaderGen1 +{ + alert 'grep -h $(1) $(2) > $(3) ' ; +} + +USBWebcamHeaderGen [ FGristFiles CamInternalAddons.h ] : B_WEBCAM_MKINTFUNC : $(addonSources) ; +USBWebcamHeaderGen [ FGristFiles CamInternalSensors.h ] : B_WEBCAM_DECLARE_SENSOR : $(sensorsSources) ; +USBWebcamHeaderGen [ FGristFiles CamInternalColorSpaceTransforms.h ] : B_WEBCAM_DECLARE_CSTRANSFORM : $(csTransformsSources) ; + Addon usb_webcam.media_addon : media : $(addonSources) $(csTransformsSources) @@ -56,3 +77,9 @@ ; LinkAgainst usb_webcam.media_addon : be media usb ; + +# force dependancies +Includes [ FGristFiles CamRoster.cpp ] : [ FGristFiles CamInternalAddons.h ] ; +Includes [ FGristFiles CamDevice.cpp ] : [ FGristFiles CamInternalSensors.h ] ; +Includes [ FGristFiles CamColorSpaceTransform.cpp ] : [ FGristFiles CamInternalColorSpaceTransforms.h ] ; + From mmu_man at mail.berlios.de Tue Jan 23 21:11:57 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 21:11:57 +0100 Subject: [Haiku-commits] r19927 - in haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam: . addons/quickcam addons/sonix Message-ID: <200701232011.l0NKBvJN019284@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 21:11:56 +0100 (Tue, 23 Jan 2007) New Revision: 19927 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19927&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/addons/quickcam/QuickCamDevice.cpp haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/addons/sonix/SonixCamDevice.cpp Log: more Zeta vs Haiku USB Kit cleanup Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h 2007-01-23 19:41:31 UTC (rev 19926) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h 2007-01-23 20:11:56 UTC (rev 19927) @@ -3,7 +3,13 @@ #include #include -#include +#ifdef __HAIKU__ +# include +# include +#else +# include +# include +#endif #include #include #include Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h 2007-01-23 19:41:31 UTC (rev 19926) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h 2007-01-23 20:11:56 UTC (rev 19927) @@ -3,11 +3,11 @@ #include #include -#include #include +#include "CamDevice.h" + class WebCamMediaAddOn; -class CamDevice; class CamDeviceAddon; class CamRoster : public BUSBRoster Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 19:41:31 UTC (rev 19926) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 20:11:56 UTC (rev 19927) @@ -37,7 +37,7 @@ local sensorsSources ; sensorsSources = hdcs1000.cpp hv7131e1.cpp tas5110c1b.cpp ; -## how to build header files from sources to include teh list of built-in addons. +## how to build header files from sources to include the list of built-in addons. rule USBWebcamHeaderGen { Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/addons/quickcam/QuickCamDevice.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/addons/quickcam/QuickCamDevice.cpp 2007-01-23 19:41:31 UTC (rev 19926) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/addons/quickcam/QuickCamDevice.cpp 2007-01-23 20:11:56 UTC (rev 19927) @@ -1,7 +1,5 @@ #include "QuickCamDevice.h" -#include - const usb_named_support_descriptor kSupportedDevices[] = { {{ 0, 0, 0, 0x046d, 0x0840 }, "Logitech", "QuickCam Express"}, {{ 0, 0, 0, 0x046d, 0x0850 }, "Logitech", "QuickCam Express LEGO"}, Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/addons/sonix/SonixCamDevice.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/addons/sonix/SonixCamDevice.cpp 2007-01-23 19:41:31 UTC (rev 19926) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/addons/sonix/SonixCamDevice.cpp 2007-01-23 20:11:56 UTC (rev 19927) @@ -4,10 +4,6 @@ #include "CamBufferingDeframer.h" #include "CamStreamingDeframer.h" -#include -#include -#include - #include #include From axeld at pinc-software.de Tue Jan 23 21:26:42 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Tue, 23 Jan 2007 21:26:42 +0100 (MET) Subject: [Haiku-commits] =?iso-8859-15?q?r19925_-_haiku/trunk/src/add-ons/?= =?iso-8859-15?q?media/media-add-ons/usb=5Fwebcam?= In-Reply-To: <200701231906.l0NJ6I4a014265@sheep.berlios.de> Message-ID: <30718615399-BeMail@zon> mmu_man at BerliOS wrote: > Log: > I *love* Jam :D > still need to autogenerate some headers... (you still need to 'make' > it first). Would it be that unfortunate to just check the headers in? Are they hard to maintain? Bye, Axel. From mmu_man at mail.berlios.de Tue Jan 23 21:45:26 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 21:45:26 +0100 Subject: [Haiku-commits] r19928 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam Message-ID: <200701232045.l0NKjQiH022585@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 21:45:25 +0100 (Tue, 23 Jan 2007) New Revision: 19928 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19928&view=rev Removed: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDefs.cpp haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDefs.h Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.cpp haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile Log: cleaned up includes; removed useless files; switched from Zeta's BVector to BList. Deleted: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDefs.cpp Deleted: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDefs.h Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h 2007-01-23 20:11:56 UTC (rev 19927) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamDevice.h 2007-01-23 20:45:25 UTC (rev 19928) @@ -11,8 +11,9 @@ # include #endif #include -#include -#include +#include +#include +#include typedef struct { Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.cpp =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.cpp 2007-01-23 20:11:56 UTC (rev 19927) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.cpp 2007-01-23 20:45:25 UTC (rev 19928) @@ -3,7 +3,6 @@ #include "AddOn.h" #include "CamDevice.h" #include "CamDebug.h" -#include "CamDefs.h" #include @@ -38,21 +37,21 @@ status_t err; for( int16 i = fCamerasAddons.CountItems()-1; i >= 0; --i ) { - PRINT((CH ": checking %s for support..." CT, fCamerasAddons[i]->BrandName())); - err = fCamerasAddons[i]->Sniff(_device); + CamDeviceAddon *ao = (CamDeviceAddon *)fCamerasAddons.ItemAt(i); + PRINT((CH ": checking %s for support..." CT, ao->BrandName())); + err = ao->Sniff(_device); + if (err < B_OK) + continue; + CamDevice *cam = ao->Instantiate(*this, _device); + PRINT((CH ": found camera %s:%s!" CT, cam->BrandName(), cam->ModelName())); + err = cam->InitCheck(); if (err >= B_OK) { - CamDevice *cam = fCamerasAddons[i]->Instantiate(*this, _device); - PRINT((CH ": found camera %s:%s!" CT, cam->BrandName(), cam->ModelName())); - err = cam->InitCheck(); - if (err >= B_OK) - { - fCameras.AddItem(cam); - fAddon->CameraAdded(cam); - return B_OK; - } - PRINT((CH " error 0x%08lx" CT, err)); - } + fCameras.AddItem(cam); + fAddon->CameraAdded(cam); + return B_OK; + } + PRINT((CH " error 0x%08lx" CT, err)); } return B_ERROR; } @@ -64,11 +63,11 @@ PRINT((CH "()" CT)); for(uint32 i = 0; i < fCameras.CountItems(); ++i) { - CamDevice* cam = fCameras[i]; + CamDevice* cam = (CamDevice *)fCameras.ItemAt(i); if( cam->Matches(_device) ) { PRINT((CH ": camera %s:%s removed" CT, cam->BrandName(), cam->ModelName())); - fCameras.RemoveItemsAt(i, 1); + fCameras.RemoveItem(i); fAddon->CameraRemoved(cam); // XXX: B_DONT_DO_THAT! //delete cam; @@ -83,8 +82,8 @@ CamRoster::CountCameras() { int32 count; - PRINT((CH "(): %d cameras" CT, fCameras.CountItems())); fLocker.Lock(); + PRINT((CH "(): %d cameras" CT, fCameras.CountItems())); count = fCameras.CountItems(); fLocker.Unlock(); return count; @@ -112,7 +111,7 @@ CamRoster::CameraAt(int32 index) { PRINT((CH "()" CT)); - return fCameras.ItemAt(index); + return (CamDevice *)fCameras.ItemAt(index); } // --------------------------------------------------------------------------- Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h 2007-01-23 20:11:56 UTC (rev 19927) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamRoster.h 2007-01-23 20:45:25 UTC (rev 19928) @@ -2,7 +2,7 @@ #define _CAM_ROSTER_H #include -#include +#include #include #include "CamDevice.h" @@ -32,10 +32,8 @@ BLocker fLocker; WebCamMediaAddOn* fAddon; - B::Support:: - BVector fCamerasAddons; - B::Support:: - BVector fCameras; + BList fCamerasAddons; + BList fCameras; }; #endif Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 20:11:56 UTC (rev 19927) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 20:45:25 UTC (rev 19928) @@ -68,7 +68,6 @@ CamBufferingDeframer.cpp CamColorSpaceTransform.cpp CamDeframer.cpp - CamDefs.cpp CamDevice.cpp CamFilterInterface.cpp CamRoster.cpp From axeld at mail.berlios.de Tue Jan 23 22:01:19 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 23 Jan 2007 22:01:19 +0100 Subject: [Haiku-commits] r19929 - haiku/trunk/src/system/libroot/os/arch/x86 Message-ID: <200701232101.l0NL1JIv023716@sheep.berlios.de> Author: axeld Date: 2007-01-23 22:01:18 +0100 (Tue, 23 Jan 2007) New Revision: 19929 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19929&view=rev Modified: haiku/trunk/src/system/libroot/os/arch/x86/compatibility.c Log: Added _kstatfs_() for binary compatibility with some BeOS apps (most notably, SoftwareValet). We might want to remove it again once we have a replacement for it. Modified: haiku/trunk/src/system/libroot/os/arch/x86/compatibility.c =================================================================== --- haiku/trunk/src/system/libroot/os/arch/x86/compatibility.c 2007-01-23 20:45:25 UTC (rev 19928) +++ haiku/trunk/src/system/libroot/os/arch/x86/compatibility.c 2007-01-23 21:01:18 UTC (rev 19929) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2005-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -12,10 +12,13 @@ // ToDo: maybe they should indeed do something... #include +#include -#include #include + #include +#include +#include int _kset_mon_limit_(int num); @@ -23,6 +26,7 @@ int _klock_node_(int fd); int _kget_cpu_state_(int cpuNum); int _kset_cpu_state_(int cpuNum, int state); +int _kstatfs_(dev_t device, void *whatever, int fd, const char *path, fs_info *info); int @@ -71,4 +75,25 @@ return _kern_set_cpu_enabled(cpuNum, state != 0); } + +int +_kstatfs_(dev_t device, void *whatever, int fd, const char *path, fs_info *info) +{ + if (device < 0) { + if (fd >= 0) { + struct stat stat; + if (fstat(fd, &stat) < 0) + return -1; + + device = stat.st_dev; + } else if (path != NULL) + device = dev_for_path(path); + } + if (device < 0) + return B_ERROR; + + return fs_stat_dev(device, info); +} + + #endif // __GNUC__ < 3 From mmu_man at mail.berlios.de Tue Jan 23 22:02:59 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 22:02:59 +0100 Subject: [Haiku-commits] r19930 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam Message-ID: <200701232102.l0NL2x3s023830@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 22:02:59 +0100 (Tue, 23 Jan 2007) New Revision: 19930 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19930&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile Log: Use a different usb lib name for Haiku only Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 21:01:18 UTC (rev 19929) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 21:02:59 UTC (rev 19930) @@ -5,6 +5,13 @@ # for USBKit.h UseLibraryHeaders usb ; +# Zeta has a libusb.so, we have a USBKit.a +if $(TARGET_PLATFORM) = haiku { +usbKitLibraryName = USBKit.a ; +} else { +usbKitLibraryName = usb ; +} + # HOW the F*** do I do that with Jam ? #SRCS := $(wildcard *.cpp) \ #$(wildcard addons/*/*.cpp) \ @@ -75,7 +82,7 @@ CamStreamingDeframer.cpp ; -LinkAgainst usb_webcam.media_addon : be media usb ; +LinkAgainst usb_webcam.media_addon : be media $(usbKitLibraryName) ; # force dependancies Includes [ FGristFiles CamRoster.cpp ] : [ FGristFiles CamInternalAddons.h ] ; From mmu_man at mail.berlios.de Tue Jan 23 22:05:23 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 22:05:23 +0100 Subject: [Haiku-commits] r19931 - haiku/trunk/src/add-ons/media/media-add-ons Message-ID: <200701232105.l0NL5N6h023987@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 22:05:23 +0100 (Tue, 23 Jan 2007) New Revision: 19931 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19931&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/Jamfile Log: Include webcam addon as it now builds in Haiku as well. Modified: haiku/trunk/src/add-ons/media/media-add-ons/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/Jamfile 2007-01-23 21:02:59 UTC (rev 19930) +++ haiku/trunk/src/add-ons/media/media-add-ons/Jamfile 2007-01-23 21:05:23 UTC (rev 19931) @@ -9,5 +9,6 @@ SubInclude HAIKU_TOP src add-ons media media-add-ons radeon ; SubInclude HAIKU_TOP src add-ons media media-add-ons tone_producer_demo ; SubInclude HAIKU_TOP src add-ons media media-add-ons usb_vision ; +SubInclude HAIKU_TOP src add-ons media media-add-ons usb_webcam ; SubInclude HAIKU_TOP src add-ons media media-add-ons video_producer_demo ; From axeld at mail.berlios.de Tue Jan 23 22:15:07 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Tue, 23 Jan 2007 22:15:07 +0100 Subject: [Haiku-commits] r19932 - haiku/trunk/src/add-ons/translators/stxt Message-ID: <200701232115.l0NLF7HX024454@sheep.berlios.de> Author: axeld Date: 2007-01-23 22:15:07 +0100 (Tue, 23 Jan 2007) New Revision: 19932 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19932&view=rev Modified: haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp Log: I accidently prevented the STXTTranslator from adding the styles section to the styled text output. Modified: haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp 2007-01-23 21:05:23 UTC (rev 19931) +++ haiku/trunk/src/add-ons/translators/stxt/STXTTranslator.cpp 2007-01-23 21:15:07 UTC (rev 19932) @@ -1233,9 +1233,10 @@ } } while (bytesRead > 0); - if (outType == B_STYLED_TEXT_FORMAT) { - if (encodingBuffer.Size() == 0 || size == outputSize) - return B_OK; + if (outType != B_STYLED_TEXT_FORMAT) + return B_OK; + + if (encodingBuffer.Size() != 0 && size != outputSize) { if (outputSize > UINT32_MAX) return B_NOT_SUPPORTED; @@ -1243,8 +1244,11 @@ status = destination->Seek(0, SEEK_SET); if (status == B_OK) status = output_headers(destination, (uint32)outputSize); + if (status == B_OK) + status = destination->Seek(0, SEEK_END); - return status; + if (status < B_OK) + return status; } // Read file attributes if outputting styled data From mmu_man at mail.berlios.de Tue Jan 23 22:20:16 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Tue, 23 Jan 2007 22:20:16 +0100 Subject: [Haiku-commits] r19933 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam Message-ID: <200701232120.l0NLKGY9024769@sheep.berlios.de> Author: mmu_man Date: 2007-01-23 22:20:15 +0100 (Tue, 23 Jan 2007) New Revision: 19933 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19933&view=rev Added: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalAddons.h haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalColorSpaceTransforms.h haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalSensors.h Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile Log: Those headers should be autogenerated but I can't get it to work, put them in for now. Added a note in Jamfile. Added: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalAddons.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalAddons.h 2007-01-23 21:15:07 UTC (rev 19932) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalAddons.h 2007-01-23 21:20:15 UTC (rev 19933) @@ -0,0 +1,2 @@ +B_WEBCAM_MKINTFUNC(quickcam) +B_WEBCAM_MKINTFUNC(sonix) Added: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalColorSpaceTransforms.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalColorSpaceTransforms.h 2007-01-23 21:15:07 UTC (rev 19932) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalColorSpaceTransforms.h 2007-01-23 21:20:15 UTC (rev 19933) @@ -0,0 +1 @@ +B_WEBCAM_DECLARE_CSTRANSFORM(BayerTransform, bayer) Added: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalSensors.h =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalSensors.h 2007-01-23 21:15:07 UTC (rev 19932) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalSensors.h 2007-01-23 21:20:15 UTC (rev 19933) @@ -0,0 +1,3 @@ +B_WEBCAM_DECLARE_SENSOR(HDCS1000Sensor, hdcs1000) +B_WEBCAM_DECLARE_SENSOR(HV7131E1Sensor, hv7131e1) +B_WEBCAM_DECLARE_SENSOR(TAS5110C1BSensor, tas5110c1b) Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 21:15:07 UTC (rev 19932) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-23 21:20:15 UTC (rev 19933) @@ -2,6 +2,10 @@ SetSubDirSupportedPlatformsBeOSCompatible ; +# note: when adding new addons, sensors +# or colorspace transforms, one should regenerate +# the *Internal*.h headers with the makefile. + # for USBKit.h UseLibraryHeaders usb ; @@ -45,6 +49,7 @@ sensorsSources = hdcs1000.cpp hv7131e1.cpp tas5110c1b.cpp ; ## how to build header files from sources to include the list of built-in addons. +# but it doesn't seem to work for some reason... rule USBWebcamHeaderGen { From darkwyrm at mail.berlios.de Wed Jan 24 00:49:04 2007 From: darkwyrm at mail.berlios.de (darkwyrm at BerliOS) Date: Wed, 24 Jan 2007 00:49:04 +0100 Subject: [Haiku-commits] r19934 - haiku/trunk/src/kits/tracker Message-ID: <200701232349.l0NNn4xE032462@sheep.berlios.de> Author: darkwyrm Date: 2007-01-24 00:48:54 +0100 (Wed, 24 Jan 2007) New Revision: 19934 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19934&view=rev Modified: haiku/trunk/src/kits/tracker/SettingsViews.cpp Log: Removed non-boot desktop integration checkbox. Modified: haiku/trunk/src/kits/tracker/SettingsViews.cpp =================================================================== --- haiku/trunk/src/kits/tracker/SettingsViews.cpp 2007-01-23 21:20:15 UTC (rev 19933) +++ haiku/trunk/src/kits/tracker/SettingsViews.cpp 2007-01-23 23:48:54 UTC (rev 19934) @@ -163,15 +163,8 @@ AddChild(fMountSharedVolumesOntoDesktopCheckBox); fMountSharedVolumesOntoDesktopCheckBox->ResizeToPreferred(); - rect.OffsetBy(-20, 2 * itemSpacing); + rect.OffsetBy(-20, itemSpacing); - fIntegrateNonBootBeOSDesktopsCheckBox = new BCheckBox(rect, "", - "Integrate Non-Boot BeOS Desktops", new BMessage(kDesktopIntegrationChanged)); - AddChild(fIntegrateNonBootBeOSDesktopsCheckBox); - fIntegrateNonBootBeOSDesktopsCheckBox->ResizeToPreferred(); - - rect.OffsetBy(0, itemSpacing); - fEjectWhenUnmountingCheckBox = new BCheckBox(rect, "", "Eject When Unmounting", new BMessage(kEjectWhenUnmountingChanged)); AddChild(fEjectWhenUnmountingCheckBox); @@ -193,8 +186,7 @@ DesktopSettingsView::GetPreferredSize(float *_width, float *_height) { if (_width != NULL) { - *_width = max_c(fIntegrateNonBootBeOSDesktopsCheckBox->Frame().right, - fMountSharedVolumesOntoDesktopCheckBox->Frame().right); + *_width = fMountSharedVolumesOntoDesktopCheckBox->Frame().right; } if (_height != NULL) { @@ -210,7 +202,6 @@ fShowDisksIconRadioButton->SetTarget(this); fMountVolumesOntoDesktopRadioButton->SetTarget(this); fMountSharedVolumesOntoDesktopCheckBox->SetTarget(this); - fIntegrateNonBootBeOSDesktopsCheckBox->SetTarget(this); fEjectWhenUnmountingCheckBox->SetTarget(this); } @@ -289,29 +280,6 @@ break; } - case kDesktopIntegrationChanged: - { - // Set the new settings in the tracker: - settings.SetIntegrateNonBootBeOSDesktops( - fIntegrateNonBootBeOSDesktopsCheckBox->Value() == 1); - - // Construct the notification message: - BMessage notificationMessage; - notificationMessage.AddBool("MountVolumesOntoDesktop", - fMountVolumesOntoDesktopRadioButton->Value() == 1); - notificationMessage.AddBool("MountSharedVolumesOntoDesktop", - fMountSharedVolumesOntoDesktopCheckBox->Value() == 1); - notificationMessage.AddBool("IntegrateNonBootBeOSDesktops", - fIntegrateNonBootBeOSDesktopsCheckBox->Value() == 1); - - // Send the notification message - tracker->SendNotices(kDesktopIntegrationChanged, ¬ificationMessage); - - // Tell the settings window the contents have changed - Window()->PostMessage(kSettingsContentsModified); - break; - } - case kEjectWhenUnmountingChanged: { settings.SetEjectWhenUnmounting( @@ -380,8 +348,6 @@ fMountVolumesOntoDesktopRadioButton->Value() == 1); notificationMessage.AddBool("MountSharedVolumesOntoDesktop", fMountSharedVolumesOntoDesktopCheckBox->Value() == 1); - notificationMessage.AddBool("IntegrateNonBootBeOSDesktops", - fIntegrateNonBootBeOSDesktopsCheckBox->Value() == 1); notificationMessage.AddBool("EjectWhenUnmounting", fEjectWhenUnmountingCheckBox->Value() == 1); @@ -402,8 +368,6 @@ fMountSharedVolumesOntoDesktopCheckBox->SetValue(settings.MountSharedVolumesOntoDesktop()); fMountSharedVolumesOntoDesktopCheckBox->SetEnabled(settings.MountVolumesOntoDesktop()); - fIntegrateNonBootBeOSDesktopsCheckBox->SetValue(settings.IntegrateNonBootBeOSDesktops()); - fEjectWhenUnmountingCheckBox->SetValue(settings.EjectWhenUnmounting()); } @@ -429,8 +393,6 @@ (fMountVolumesOntoDesktopRadioButton->Value() > 0) || fMountSharedVolumesOntoDesktop != (fMountSharedVolumesOntoDesktopCheckBox->Value() > 0) - || fIntegrateNonBootBeOSDesktops != - (fIntegrateNonBootBeOSDesktopsCheckBox->Value() > 0) || fEjectWhenUnmounting != (fEjectWhenUnmountingCheckBox->Value() > 0); } From darkwyrm at earthlink.net Wed Jan 24 01:00:44 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Tue, 23 Jan 2007 19:00:44 -0500 EST Subject: [Haiku-commits] r19920 - haiku/trunk/src/preferences/backgrounds In-Reply-To: <200701231757.l0NHvMoa011288@sheep.berlios.de> Message-ID: <5939830749-BeMail@sapphire> > Author: axeld > Date: 2007-01-23 18:57:14 +0100 (Tue, 23 Jan 2007) > New Revision: 19920 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19920&view=rev > > Modified: > haiku/trunk/src/preferences/backgrounds/Backgrounds.cpp > haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp > haiku/trunk/src/preferences/backgrounds/BackgroundsView.h > Log: > * Made the whole thing a bit more font sensitive - looks more or less > good with an > 18pt font, now. > * Added a few TODO items. Layout is broken under certain conditions. The R5 build with Swis721 BT Roman @ 12pt has problems -- the Image label and associated menu are not moved down enough. Screenshot attached. --DW -------------- next part -------------- A non-text attachment was scrubbed... Name: LayoutProblems.png Type: image/png Size: 486916 bytes Desc: not available URL: From myob87 at gmail.com Wed Jan 24 01:17:03 2007 From: myob87 at gmail.com (Cian Duffy) Date: Wed, 24 Jan 2007 00:17:03 +0000 Subject: [Haiku-commits] r19934 - haiku/trunk/src/kits/tracker In-Reply-To: <200701232349.l0NNn4xE032462@sheep.berlios.de> References: <200701232349.l0NNn4xE032462@sheep.berlios.de> Message-ID: <2658dc2f0701231617w3cbc4dbbmc16d4f4ff305dbf1@mail.gmail.com> On 23/01/07, darkwyrm at BerliOS wrote: > Author: darkwyrm > Date: 2007-01-24 00:48:54 +0100 (Wed, 24 Jan 2007) > New Revision: 19934 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19934&view=rev > > Modified: > haiku/trunk/src/kits/tracker/SettingsViews.cpp > Log: > Removed non-boot desktop integration checkbox. > Why? Unless this is just not functional in Haiku, there is a very real and legitimate reason this existed. Most 'normal' users - which is what you appear to be trying to warp the interface for - only have one BFS partition. This setting turned on means that if they put in a BFS CD, such as a disc for a commercial application, it can place an Installer icon on the desktop, or similar. Its far, far more likely to be a problem for developers than any hypothetical 'normal' users we'll be getting in the future, but anyone who's irritated -knows how to turn it off-. -- ------------------------- "We're busy running out of time" From mmu_man at mail.berlios.de Wed Jan 24 01:24:52 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Wed, 24 Jan 2007 01:24:52 +0100 Subject: [Haiku-commits] r19935 - haiku/trunk/headers/private/shared Message-ID: <200701240024.l0O0Oqse016608@sheep.berlios.de> Author: mmu_man Date: 2007-01-24 01:24:51 +0100 (Wed, 24 Jan 2007) New Revision: 19935 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19935&view=rev Modified: haiku/trunk/headers/private/shared/pci-utils.h Log: This should fix intermitent KDLs (at least with console debug output). Use the size of the struct instead of checking a pointer that is never NULL... Modified: haiku/trunk/headers/private/shared/pci-utils.h =================================================================== --- haiku/trunk/headers/private/shared/pci-utils.h 2007-01-23 23:48:54 UTC (rev 19934) +++ haiku/trunk/headers/private/shared/pci-utils.h 2007-01-24 00:24:51 UTC (rev 19935) @@ -14,23 +14,25 @@ if (pci_class_base_id == 0x80) snprintf(classInfo, size, " (Other)"); else { - PCI_CLASSCODETABLE *s = PciClassCodeTable, *foundItem = NULL; - while (s->BaseDesc) { - if ((pci_class_base_id == s->BaseClass) - && (pci_class_sub_id == s->SubClass)) { - foundItem = s; - if (pci_class_api_id == s->ProgIf) + PCI_CLASSCODETABLE *foundItem = NULL; + int i; + for (i = 0; i < (int)PCI_CLASSCODETABLE_LEN; i++) { + if ((pci_class_base_id == PciClassCodeTable[i].BaseClass) + && (pci_class_sub_id == PciClassCodeTable[i].SubClass)) { + foundItem = &PciClassCodeTable[i]; + if (pci_class_api_id == PciClassCodeTable[i].ProgIf) break; } - s++; } - if (!s->BaseDesc) - s = foundItem; - if (pci_class_sub_id != 0x80) - snprintf(classInfo, size, "%s (%s%s%s)", s->BaseDesc, s->SubDesc, - (s->ProgDesc && strcmp("", s->ProgDesc)) ? ", " : "", s->ProgDesc); - else - snprintf(classInfo, size, "%s", s->BaseDesc); + if (foundItem) { + if (pci_class_sub_id != 0x80) + snprintf(classInfo, size, "%s (%s%s%s)", foundItem->BaseDesc, foundItem->SubDesc, + (foundItem->ProgDesc && strcmp("", foundItem->ProgDesc)) ? ", " : "", foundItem->ProgDesc); + else + snprintf(classInfo, size, "%s", foundItem->BaseDesc); + } else + snprintf(classInfo, size, "%s (%u:%u:%u)", "(Unknown)", + pci_class_base_id, pci_class_sub_id, pci_class_api_id); } } From mmu_man at mail.berlios.de Wed Jan 24 01:28:44 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Wed, 24 Jan 2007 01:28:44 +0100 Subject: [Haiku-commits] r19936 - haiku/trunk/build/jam Message-ID: <200701240028.l0O0SiZx016755@sheep.berlios.de> Author: mmu_man Date: 2007-01-24 01:28:44 +0100 (Wed, 24 Jan 2007) New Revision: 19936 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19936&view=rev Modified: haiku/trunk/build/jam/HaikuImage Log: Add release, rescan, mount_nfs and the usb_webcam addon to the image. Modified: haiku/trunk/build/jam/HaikuImage =================================================================== --- haiku/trunk/build/jam/HaikuImage 2007-01-24 00:24:51 UTC (rev 19935) +++ haiku/trunk/build/jam/HaikuImage 2007-01-24 00:28:44 UTC (rev 19936) @@ -26,9 +26,9 @@ $(X86_ONLY)gdb grep groups gzip head hey id ideinfo idestatus ifconfig iroster isvolume join keymap kill less lessecho lesskey link listarea listattr listdev listimage listport listres listsem ln locate logger logname ls lsindex makebootable md5sum mimeset - mkdos mkdir mkindex modifiers mount mountvolume mv netstat open pathchk ping play playfile + mkdos mkdir mkindex modifiers mount mount_nfs mountvolume mv netstat open pathchk ping play playfile playsound playwav ps pwd - query quit renice rm rmattr rmindex rmdir roster route safemode screen_blanker sed settype + query quit release renice rescan rm rmattr rmindex rmdir roster route safemode screen_blanker sed settype setversion setvolume sh shutdown sleep sort split strace su sum sync sysinfo tail tar tcpdump tee telnet test top touch tput traceroute translate true tty uname unmount unrar unzip unzipsfx uptime version waitfor wc wget whoami xargs xres yes zdiff zforce zgrep zip @@ -71,6 +71,7 @@ BEOS_ADD_ONS_MEDIA = mixer.media_addon hmulti_audio.media_addon tone_producer_demo.media_addon video_producer_demo.media_addon + usb_webcam.media_addon #legacy.media_addon ; BEOS_ADD_ONS_MEDIA_PLUGINS = $(GPL_ONLY)ac3_decoder From leavengood at gmail.com Wed Jan 24 01:45:47 2007 From: leavengood at gmail.com (Ryan Leavengood) Date: Tue, 23 Jan 2007 19:45:47 -0500 Subject: [Haiku-commits] r19920 - haiku/trunk/src/preferences/backgrounds In-Reply-To: <5939830749-BeMail@sapphire> References: <200701231757.l0NHvMoa011288@sheep.berlios.de> <5939830749-BeMail@sapphire> Message-ID: On 1/23/07, DarkWyrm wrote: > > Author: axeld > > Date: 2007-01-23 18:57:14 +0100 (Tue, 23 Jan 2007) > > New Revision: 19920 > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19920&view=rev > > > > Modified: > > haiku/trunk/src/preferences/backgrounds/Backgrounds.cpp > > haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp > > haiku/trunk/src/preferences/backgrounds/BackgroundsView.h > > Log: > > * Made the whole thing a bit more font sensitive - looks more or less > > good with an > > 18pt font, now. > > * Added a few TODO items. > Layout is broken under certain conditions. The R5 build with Swis721 BT > Roman @ 12pt has problems -- the Image label and associated menu are > not moved down enough. Screenshot attached. When are we going to start using Ingo's new layout management system to solve these problems? I'm working on a web-site article to help get people up to speed on the layout system, so maybe after that we can start doing some converting. Actually I may convert something as part of my learning it. Of course to maintain R5 compatibility for certain things we would need some big #ifdef's. Ryan From darkwyrm at earthlink.net Wed Jan 24 02:18:08 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Tue, 23 Jan 2007 20:18:08 -0500 EST Subject: [Haiku-commits] r19934 - haiku/trunk/src/kits/tracker In-Reply-To: <2658dc2f0701231617w3cbc4dbbmc16d4f4ff305dbf1@mail.gmail.com> Message-ID: <10583719719-BeMail@sapphire> > Why? Unless this is just not functional in Haiku, there is a very > real > and legitimate reason this existed. Most 'normal' users - which is > what you appear to be trying to warp the interface for - only have > one > BFS partition. This setting turned on means that if they put in a BFS > CD, such as a disc for a commercial application, it can place an > Installer icon on the desktop, or similar. > > Its far, far more likely to be a problem for developers than any > hypothetical 'normal' users we'll be getting in the future, but > anyone > who's irritated -knows how to turn it off-. Please don't think that this was a rash decision, first of all. I discussed it with the other Haiku developers, and it was decided as a group that the checkbox could be removed. First of all, it is obscure and almost without exception not used. The only instances that I'm aware of it even being used are on the R5 Pro CD and (I think) the Gobe Productive 2.0 CD. There may be a few more, but these are the only ones I know of. To be honest, I was not able to figure out why it was there in the first place, so thank you for clearing that up for me. :-)It isn't even enabled by default, making it even less used -- the only people who will enable it are those who know what it's for. For these two reasons, it is an edge case function -- one which falls into the category "but the user might need to do *this*" Note that the actual functionality for this has not been removed, just the checkbox, and those irritated by not having it on can pretty safely be assumed to both know what the implications of having it on happen to be and to know how to turn it on. It's not like it's an option that you will commonly have to change, either. :-) --DarkWyrm From stefano.ceccherini at gmail.com Wed Jan 24 06:55:55 2007 From: stefano.ceccherini at gmail.com (Stefano Ceccherini) Date: Wed, 24 Jan 2007 06:55:55 +0100 Subject: [Haiku-commits] r19920 - haiku/trunk/src/preferences/backgrounds In-Reply-To: References: <200701231757.l0NHvMoa011288@sheep.berlios.de> <5939830749-BeMail@sapphire> Message-ID: <894b9700701232155l7e8a7df7g1f413bf2a4ef25d3@mail.gmail.com> 2007/1/24, Ryan Leavengood : > > Of course to maintain R5 compatibility for certain things we would > need some big #ifdef's. IMHO, if we start using Ingo's layout stuff, we shouldn't pollute the source files with big #ifdefs. I think we should just drop R5 compatibility for those apps/preflets, in that case. From jackburton at mail.berlios.de Wed Jan 24 07:03:01 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Wed, 24 Jan 2007 07:03:01 +0100 Subject: [Haiku-commits] r19937 - haiku/trunk/src/kits/interface Message-ID: <200701240603.l0O631db021974@sheep.berlios.de> Author: jackburton Date: 2007-01-24 07:02:58 +0100 (Wed, 24 Jan 2007) New Revision: 19937 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19937&view=rev Modified: haiku/trunk/src/kits/interface/TextView.cpp Log: BTextView::FreeRunArray() now accepts a NULL pointer too (like free()) Modified: haiku/trunk/src/kits/interface/TextView.cpp =================================================================== --- haiku/trunk/src/kits/interface/TextView.cpp 2007-01-24 00:28:44 UTC (rev 19936) +++ haiku/trunk/src/kits/interface/TextView.cpp 2007-01-24 06:02:58 UTC (rev 19937) @@ -2506,6 +2506,9 @@ void BTextView::FreeRunArray(text_run_array *array) { + if (array == NULL) + return; + // Call destructors explicitly for (int32 i = 0; i < array->count; i++) array->runs[i].font.~BFont(); From jackburton at mail.berlios.de Wed Jan 24 07:11:13 2007 From: jackburton at mail.berlios.de (jackburton at BerliOS) Date: Wed, 24 Jan 2007 07:11:13 +0100 Subject: [Haiku-commits] r19938 - haiku/trunk/src/kits/interface/textview_support Message-ID: <200701240611.l0O6BDUY029194@sheep.berlios.de> Author: jackburton Date: 2007-01-24 07:11:12 +0100 (Wed, 24 Jan 2007) New Revision: 19938 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19938&view=rev Modified: haiku/trunk/src/kits/interface/textview_support/UndoBuffer.cpp haiku/trunk/src/kits/interface/textview_support/UndoBuffer.h Log: Use BTextView::Copy/FreeRunArray() instead of memcpy() and free() Modified: haiku/trunk/src/kits/interface/textview_support/UndoBuffer.cpp =================================================================== --- haiku/trunk/src/kits/interface/textview_support/UndoBuffer.cpp 2007-01-24 06:02:58 UTC (rev 19937) +++ haiku/trunk/src/kits/interface/textview_support/UndoBuffer.cpp 2007-01-24 06:11:12 UTC (rev 19938) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Haiku, Inc. + * Copyright 2003-2007, Haiku, Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -41,14 +41,14 @@ memcpy(fTextData, fTextView->Text() + fStart, fTextLength); if (fTextView->IsStylable()) - fRunArray = fTextView->RunArray(fStart, fEnd, &fRunArrayLength); + fRunArray = fTextView->RunArray(fStart, fEnd, &fRunArrayLength); } _BUndoBuffer_::~_BUndoBuffer_() { free(fTextData); - free(fRunArray); + BTextView::FreeRunArray(fRunArray); } @@ -128,24 +128,20 @@ : _BUndoBuffer_(textView, B_UNDO_PASTE), fPasteText(NULL), fPasteTextLength(textLen), - fPasteRunArray(NULL), - fPasteRunArrayLength(0) + fPasteRunArray(NULL) { fPasteText = (char *)malloc(fPasteTextLength); memcpy(fPasteText, text, fPasteTextLength); - if (runArray) { - fPasteRunArray = (text_run_array *)malloc(runArrayLen); - fPasteRunArrayLength = runArrayLen; - memcpy(fPasteRunArray, runArray, runArrayLen); - } + if (runArray) + fPasteRunArray = BTextView::CopyRunArray(runArray); } _BPasteUndoBuffer_::~_BPasteUndoBuffer_() { free(fPasteText); - free(fPasteRunArray); + BTextView::FreeRunArray(fPasteRunArray); } @@ -208,11 +204,8 @@ fDropText = (char *)malloc(fDropTextLength); memcpy(fDropText, text, fDropTextLength); - if (runArray) { - fDropRunArray = (text_run_array *)malloc(runArrayLen); - fDropRunArrayLength = runArrayLen; - memcpy(fDropRunArray, runArray, runArrayLen); - } + if (runArray) + fDropRunArray = BTextView::CopyRunArray(runArray); if (fInternalDrop && fDropLocation >= fEnd) fDropLocation -= fDropTextLength; @@ -222,7 +215,7 @@ _BDropUndoBuffer_::~_BDropUndoBuffer_() { free(fDropText); - free(fDropRunArray); + BTextView::FreeRunArray(fDropRunArray); } Modified: haiku/trunk/src/kits/interface/textview_support/UndoBuffer.h =================================================================== --- haiku/trunk/src/kits/interface/textview_support/UndoBuffer.h 2007-01-24 06:02:58 UTC (rev 19937) +++ haiku/trunk/src/kits/interface/textview_support/UndoBuffer.h 2007-01-24 06:11:12 UTC (rev 19938) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2004, Haiku, Inc. All Rights Reserved. + * Copyright 2003-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -67,7 +67,6 @@ char *fPasteText; int32 fPasteTextLength; text_run_array *fPasteRunArray; - int32 fPasteRunArrayLength; }; @@ -96,7 +95,6 @@ char *fDropText; int32 fDropTextLength; text_run_array *fDropRunArray; - int32 fDropRunArrayLength; int32 fDropLocation; bool fInternalDrop; From revol at free.fr Wed Jan 24 09:43:17 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Wed, 24 Jan 2007 09:43:17 +0100 CET Subject: [Haiku-commits] =?windows-1252?q?r19925_-_haiku/trunk/src/add-ons?= =?windows-1252?q?/media/media-add-ons/usb=5Fwebcam?= In-Reply-To: <30718615399-BeMail@zon> Message-ID: <2580491006-BeMail@laptop> > mmu_man at BerliOS wrote: > > Log: > > I *love* Jam :D > > still need to autogenerate some headers... (you still need to > > 'make' > > it first). > > Would it be that unfortunate to just check the headers in? Are they > hard to maintain? Yes I did, I can always use the makefile to regen them, and I have to update the Jamfile to add addons anyway (where are wildcards ?? :p). Still, what works for the Devices prefs doesn't seem to work here. I probably skipped some obvious stuff. Btw, looking at the pci stuff I fixed a bug in the id stuff. And I was wondering why I KDLed in PCI enum... :D Fran?ois. From axeld at pinc-software.de Wed Jan 24 12:21:16 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 24 Jan 2007 12:21:16 +0100 (MET) Subject: [Haiku-commits] r19934 - haiku/trunk/src/kits/tracker In-Reply-To: <2658dc2f0701231617w3cbc4dbbmc16d4f4ff305dbf1@mail.gmail.com> Message-ID: <2274976891-BeMail@zon> "Cian Duffy" wrote: > Its far, far more likely to be a problem for developers than any > hypothetical 'normal' users we'll be getting in the future, but > anyone > who's irritated -knows how to turn it off-. I changed it to default to "false" for quite some time, and nobody complained yet :-) Also, I don't think it adds a lot to the user experience to have those icons appear on the desktop. Bye, Axel. From axeld at pinc-software.de Wed Jan 24 12:39:57 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 24 Jan 2007 12:39:57 +0100 (MET) Subject: [Haiku-commits] r19920 - haiku/trunk/src/preferences/backgrounds In-Reply-To: Message-ID: <3394517775-BeMail@zon> "Ryan Leavengood" wrote: > On 1/23/07, DarkWyrm wrote: > > > Author: axeld > > > Date: 2007-01-23 18:57:14 +0100 (Tue, 23 Jan 2007) > > > New Revision: 19920 > > > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19920&view=rev > > > > > > Modified: > > > haiku/trunk/src/preferences/backgrounds/Backgrounds.cpp > > > haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp > > > haiku/trunk/src/preferences/backgrounds/BackgroundsView.h > > > Log: > > > * Made the whole thing a bit more font sensitive - looks more or > > > less > > > good with an > > > 18pt font, now. > > > * Added a few TODO items. > > Layout is broken under certain conditions. The R5 build with > > Swis721 BT > > Roman @ 12pt has problems -- the Image label and associated menu > > are > > not moved down enough. Screenshot attached. > When are we going to start using Ingo's new layout management system > to solve these problems? I'm working on a web-site article to help > get > people up to speed on the layout system, so maybe after that we can I'd guess after you did the article, we'll start using it :-) > start doing some converting. Actually I may convert something as part > of my learning it. > > Of course to maintain R5 compatibility for certain things we would > need some big #ifdef's. I'd say there is little point in converting apps that already are font sensitive - there already went some effort into them for this, and it's just wasted time to convert them to use the layout system. Also, I agree with Stefano that we shouldn't maintain both versions then, that is, I'd only pick those apps that aren't font sensitive at all, and/or that have no use under R5, and not just to convert an app. And new apps of course may use it (like the SoftwareValet replacement, hint, hint) :-) Bye, Axel. From axeld at mail.berlios.de Wed Jan 24 12:44:33 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 24 Jan 2007 12:44:33 +0100 Subject: [Haiku-commits] r19939 - haiku/trunk/src/preferences/backgrounds Message-ID: <200701241144.l0OBiXiD031712@sheep.berlios.de> Author: axeld Date: 2007-01-24 12:44:32 +0100 (Wed, 24 Jan 2007) New Revision: 19939 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19939&view=rev Modified: haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp Log: Fixed wrong layout under R5. Modified: haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp =================================================================== --- haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp 2007-01-24 06:11:12 UTC (rev 19938) +++ haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp 2007-01-24 11:44:32 UTC (rev 19939) @@ -168,9 +168,11 @@ AddChild(rightbox); float offset = be_plain_font->StringWidth("Placement:") + 5; - rect.Set(10, 10, rightbox->Bounds().right - 10, 30); + rect.Set(10, 0, rightbox->Bounds().right - 10, 30); #ifdef __HAIKU__ rect.top = 8 + rightbox->InnerFrame().top; +#else + rect.top = 5 + workspaceMenuField->Bounds().Height(); #endif fImageMenu = new BPopUpMenu("pick one"); From axeld at pinc-software.de Wed Jan 24 12:45:42 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 24 Jan 2007 12:45:42 +0100 (MET) Subject: [Haiku-commits] r19920 - haiku/trunk/src/preferences/backgrounds In-Reply-To: <5939830749-BeMail@sapphire> Message-ID: <3739189566-BeMail@zon> "DarkWyrm" wrote: > Layout is broken under certain conditions. The R5 build with Swis721 > BT > Roman @ 12pt has problems -- the Image label and associated menu are > not moved down enough. Screenshot attached. It's not under "certain conditions" - it's for the whole R5 build; I forgot it (since R5's BBox doesn't have an InnerFrame() method). But thanks for mentioning it, it's fixed now :-) Bye, Axel. From myob87 at gmail.com Wed Jan 24 13:55:45 2007 From: myob87 at gmail.com (myob87 at gmail.com) Date: Wed, 24 Jan 2007 12:55:45 +0000 Subject: [Haiku-commits] r19934 - haiku/trunk/src/kits/tracker In-Reply-To: <10583719719-BeMail@sapphire> References: <10583719719-BeMail@sapphire> Message-ID: <20070124125545.1694.4@Jetstream.finance.gov.ie> On 2007-01-24 at 01:18:08 [+0000], DarkWyrm wrote: > > Why? Unless this is just not functional in Haiku, there is a very > > real > > and legitimate reason this existed. Most 'normal' users - which is > > what you appear to be trying to warp the interface for - only have > > one > > BFS partition. This setting turned on means that if they put in a BFS > > CD, such as a disc for a commercial application, it can place an > > Installer icon on the desktop, or similar. > > > > Its far, far more likely to be a problem for developers than any > > hypothetical 'normal' users we'll be getting in the future, but > > anyone > > who's irritated -knows how to turn it off-. > Please don't think that this was a rash decision, first of all. I > discussed it with the other Haiku developers, and it was decided as a > group that the checkbox could be removed. First of all, it is obscure > and almost without exception not used. The only instances that I'm > aware of it even being used are on the R5 Pro CD and (I think) the Gobe > Productive 2.0 CD. There may be a few more, but these are the only ones > I know of. To be honest, I was not able to figure out why it was there > in the first place, so thank you for clearing that up for me. :-)It > isn't even enabled by default, making it even less used -- the only > people who will enable it are those who know what it's for. For these > two reasons, it is an edge case function -- one which falls into the > category "but the user might need to do *this*" Note that the actual > functionality for this has not been removed, just the checkbox, and > those irritated by not having it on can pretty safely be assumed to > both know what the implications of having it on happen to be and to > know how to turn it on. It's not like it's an option that you will > commonly have to change, either. :-) This -is- turned on by default in R5. And having the functionality but no way to turn it on, or indeed off if your settings had that and you updated, is about as useful as a chocolate teapot. Changing the interface significantly from BeOS - which stripping options is - only serves to be counter-intuitive. Its also breaking years-old functionality which is relied on by applications that certainly aren't going to be recompilable/repackaged for Haiku - more than just GP2 uses this. Cian From axeld at pinc-software.de Wed Jan 24 14:40:23 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 24 Jan 2007 14:40:23 +0100 (MET) Subject: [Haiku-commits] r19934 - haiku/trunk/src/kits/tracker In-Reply-To: <20070124125545.1694.4@Jetstream.finance.gov.ie> Message-ID: <10620679738-BeMail@zon> myob87 at gmail.com wrote: > Changing the interface significantly from BeOS - which stripping > options is > - only serves to be counter-intuitive. Its also breaking years-old > functionality which is relied on by applications that certainly > aren't > going to be recompilable/repackaged for Haiku - more than just GP2 > uses > this. While I don't really see the big difference to double clicking the CD first and then "Install Gobe Productive", we could restrict the feature on removable read-only media. That would remove its annoying outcome when having more than one bootable volume mounted, and would still keep (the little) use it has. If someone wants to do it, I'd accept that patch. Bye, Axel. From darkwyrm at earthlink.net Wed Jan 24 14:59:27 2007 From: darkwyrm at earthlink.net (DarkWyrm) Date: Wed, 24 Jan 2007 08:59:27 -0500 Subject: [Haiku-commits] r19934 - haiku/trunk/src/kits/tracker In-Reply-To: <10620679738-BeMail@zon> References: <10620679738-BeMail@zon> Message-ID: <45B7663F.2010407@earthlink.net> > While I don't really see the big difference to double clicking the CD > first and then "Install Gobe Productive", we could restrict the feature > on removable read-only media. > That would remove its annoying outcome when having more than one > bootable volume mounted, and would still keep (the little) use it has. > If someone wants to do it, I'd accept that patch. Likewise, if someone does the patch, I would want the feature to default to on and still leave the checkbox out -- that would suddenly become a useful feature instead of the mixed blessing that it is now. --DarkWyrm From axeld at mail.berlios.de Wed Jan 24 15:03:21 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 24 Jan 2007 15:03:21 +0100 Subject: [Haiku-commits] r19940 - haiku/trunk/src/apps/diskprobe Message-ID: <200701241403.l0OE3LPD024474@sheep.berlios.de> Author: axeld Date: 2007-01-24 15:03:21 +0100 (Wed, 24 Jan 2007) New Revision: 19940 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19940&view=rev Modified: haiku/trunk/src/apps/diskprobe/DataEditor.cpp haiku/trunk/src/apps/diskprobe/DiskProbe.cpp haiku/trunk/src/apps/diskprobe/ProbeView.cpp Log: * DataEditor::SetTo() now checks if the reported block size is zero and then sets it to the 512 byte default - this fixes bug #960. * IconView::UpdateIcon() now uses 8-bit icon for get_device_icon(), as B_RGB32 cannot work in this case. * Also, in case it couldn't get an icon, it now tries to show the generic icon instead. Modified: haiku/trunk/src/apps/diskprobe/DataEditor.cpp =================================================================== --- haiku/trunk/src/apps/diskprobe/DataEditor.cpp 2007-01-24 11:44:32 UTC (rev 19939) +++ haiku/trunk/src/apps/diskprobe/DataEditor.cpp 2007-01-24 14:03:21 UTC (rev 19940) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -505,6 +505,9 @@ } } + if (fBlockSize == 0) + fBlockSize = 512; + fRealViewSize = fViewSize = fBlockSize; fNeedsUpdate = true; Modified: haiku/trunk/src/apps/diskprobe/DiskProbe.cpp =================================================================== --- haiku/trunk/src/apps/diskprobe/DiskProbe.cpp 2007-01-24 11:44:32 UTC (rev 19939) +++ haiku/trunk/src/apps/diskprobe/DiskProbe.cpp 2007-01-24 14:03:21 UTC (rev 19940) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -454,7 +454,7 @@ { BAlert *alert = new BAlert("about", "DiskProbe\n" "\twritten by Axel D?rfler\n" - "\tCopyright 2004-2006, Haiku.\n\n" + "\tCopyright 2004-2007, Haiku.\n\n" "original Be version by Robert Polic\n", "Ok"); BTextView *view = alert->TextView(); BFont font; Modified: haiku/trunk/src/apps/diskprobe/ProbeView.cpp =================================================================== --- haiku/trunk/src/apps/diskprobe/ProbeView.cpp 2007-01-24 11:44:32 UTC (rev 19939) +++ haiku/trunk/src/apps/diskprobe/ProbeView.cpp 2007-01-24 14:03:21 UTC (rev 19940) @@ -1,5 +1,5 @@ /* - * Copyright 2004-2006, Axel D?rfler, axeld at pinc-software.de. All rights reserved. + * Copyright 2004-2007, Axel D?rfler, axeld at pinc-software.de. All rights reserved. * Distributed under the terms of the MIT License. */ @@ -256,13 +256,26 @@ status_t status = B_ERROR; if (fIsDevice) { + BBitmap* icon = new BBitmap(BRect(0, 0, 31, 31), B_CMAP8); + // TODO: as long as we'll use get_device_icon() for this + BPath path(&fRef); - status = get_device_icon(path.Path(), fBitmap->Bits(), B_LARGE_ICON); + status = get_device_icon(path.Path(), icon->Bits(), B_LARGE_ICON); + if (status == B_OK) { + delete fBitmap; + fBitmap = icon; + } else + delete icon; } else status = BNodeInfo::GetTrackerIcon(&fRef, fBitmap); if (status != B_OK) { - // ToDo: get a standard generic icon here? + // Try to get generic icon + BMimeType type(B_FILE_MIME_TYPE); + status = type.GetIcon(fBitmap, B_LARGE_ICON); + } + + if (status != B_OK) { delete fBitmap; fBitmap = NULL; } From axeld at pinc-software.de Wed Jan 24 15:14:52 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 24 Jan 2007 15:14:52 +0100 (MET) Subject: [Haiku-commits] r19934 - haiku/trunk/src/kits/tracker In-Reply-To: <45B7663F.2010407@earthlink.net> Message-ID: <12690934262-BeMail@zon> DarkWyrm wrote: > > While I don't really see the big difference to double clicking the > > CD > > first and then "Install Gobe Productive", we could restrict the > > feature > > on removable read-only media. > > That would remove its annoying outcome when having more than one > > bootable volume mounted, and would still keep (the little) use it > > has. > > If someone wants to do it, I'd accept that patch. > Likewise, if someone does the patch, I would want the feature to > default > to on and still leave the checkbox out -- that would suddenly become > a > useful feature instead of the mixed blessing that it is now. Exactly, I didn't want to imply that the checkbox should go back in then. Bye, Axel. From axeld at mail.berlios.de Wed Jan 24 15:32:06 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 24 Jan 2007 15:32:06 +0100 Subject: [Haiku-commits] r19941 - haiku/trunk/src/system/runtime_loader Message-ID: <200701241432.l0OEW6s8027487@sheep.berlios.de> Author: axeld Date: 2007-01-24 15:32:05 +0100 (Wed, 24 Jan 2007) New Revision: 19941 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19941&view=rev Modified: haiku/trunk/src/system/runtime_loader/elf.c haiku/trunk/src/system/runtime_loader/runtime_loader.c Log: * Made all exported safe against NULL pointers, this fixes bug #485. * Slightly improved error codes. Modified: haiku/trunk/src/system/runtime_loader/elf.c =================================================================== --- haiku/trunk/src/system/runtime_loader/elf.c 2007-01-24 14:03:21 UTC (rev 19940) +++ haiku/trunk/src/system/runtime_loader/elf.c 2007-01-24 14:32:05 UTC (rev 19941) @@ -1,5 +1,5 @@ /* - * Copyright 2003-2006, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2003-2007, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2002, Manuel J. Petit. All rights reserved. @@ -1264,6 +1264,9 @@ image_type type = (addOn ? B_ADD_ON_IMAGE : B_LIBRARY_IMAGE); status_t status; + if (path == NULL) + return B_BAD_VALUE; + // ToDo: implement flags (void)flags; @@ -1319,6 +1322,9 @@ image_t *image; image_type type = addOn ? B_ADD_ON_IMAGE : B_LIBRARY_IMAGE; + if (imageID < B_OK) + return B_BAD_IMAGE_ID; + rld_lock(); // for now, just do stupid simple global locking @@ -1413,6 +1419,11 @@ status_t status = B_OK; image_t *image; + if (imageID < B_OK) + return B_BAD_IMAGE_ID; + if (symbolName == NULL) + return B_BAD_VALUE; + rld_lock(); // for now, just do stupid simple global locking @@ -1443,12 +1454,15 @@ struct Elf32_Dyn *dynamicSection; image_t *image; + if (_name == NULL) + return B_BAD_VALUE; + rld_lock(); image = find_loaded_image_by_id(id); if (image == NULL) { rld_unlock(); - return B_BAD_VALUE; + return B_BAD_IMAGE_ID; } dynamicSection = (struct Elf32_Dyn *)image->dynamic_ptr; Modified: haiku/trunk/src/system/runtime_loader/runtime_loader.c =================================================================== --- haiku/trunk/src/system/runtime_loader/runtime_loader.c 2007-01-24 14:03:21 UTC (rev 19940) +++ haiku/trunk/src/system/runtime_loader/runtime_loader.c 2007-01-24 14:32:05 UTC (rev 19941) @@ -1,5 +1,5 @@ /* - * Copyright 2005-2006, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2005-2007, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2002, Manuel J. Petit. All rights reserved. @@ -269,6 +269,9 @@ ssize_t length; int fd; + if (name == NULL) + return B_BAD_VALUE; + strlcpy(path, name, sizeof(path)); fd = open_executable(path, B_APP_IMAGE, NULL); From axeld at mail.berlios.de Wed Jan 24 15:49:32 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 24 Jan 2007 15:49:32 +0100 Subject: [Haiku-commits] r19942 - haiku/trunk/src/preferences/mail Message-ID: <200701241449.l0OEnWJ5028475@sheep.berlios.de> Author: axeld Date: 2007-01-24 15:49:32 +0100 (Wed, 24 Jan 2007) New Revision: 19942 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19942&view=rev Modified: haiku/trunk/src/preferences/mail/ConfigWindow.cpp Log: It now also centers the window on screen if the settings couldn't be found or at least one corner is not visible on screen. Modified: haiku/trunk/src/preferences/mail/ConfigWindow.cpp =================================================================== --- haiku/trunk/src/preferences/mail/ConfigWindow.cpp 2007-01-24 14:32:05 UTC (rev 19941) +++ haiku/trunk/src/preferences/mail/ConfigWindow.cpp 2007-01-24 14:49:32 UTC (rev 19942) @@ -1,8 +1,11 @@ -/* ConfigWindow - main eMail config window -** -** Copyright 2001-2003 Dr. Zoidberg Enterprises. All rights reserved. -*/ +/* + * Copyright 2001-2003 Dr. Zoidberg Enterprises. All rights reserved. + * Copyright 2007, Haiku Inc. All Rights Reserved. + * + * Distributed under the terms of the MIT License. + */ +//! main E-Mail config window #include "ConfigWindow.h" #include "CenterContainer.h" @@ -233,11 +236,10 @@ ConfigWindow::ConfigWindow() - : BWindow(BRect(100.0, 100.0, 580.0, 540.0), - "E-mail", B_TITLED_WINDOW, - B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE), - fLastSelectedAccount(NULL), - fSaveSettings(false) + : BWindow(BRect(100.0, 100.0, 580.0, 540.0), "E-mail", B_TITLED_WINDOW, + B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_RESIZABLE), + fLastSelectedAccount(NULL), + fSaveSettings(false) { // create controls @@ -423,6 +425,7 @@ top->AddChild(revertButton); LoadSettings(); + // this will also move our window to the stored position fAccountsListView->SetSelectionMessage(new BMessage(kMsgAccountSelected)); fAccountsListView->MakeFocus(true); @@ -438,19 +441,15 @@ ConfigWindow::MakeHowToView() { BResources *resources = BApplication::AppResources(); - if (resources) - { + if (resources) { size_t length; - char *buffer = (char *)resources->FindResource('ICON',101,&length); - if (buffer) - { - BBitmap *bitmap = new BBitmap(BRect(0,0,63,63),B_CMAP8); - if (bitmap && bitmap->InitCheck() == B_OK) - { + char *buffer = (char *)resources->FindResource('ICON', 101, &length); + if (buffer) { + BBitmap *bitmap = new BBitmap(BRect(0, 0, 63, 63), B_CMAP8); + if (bitmap && bitmap->InitCheck() == B_OK) { // copy and enlarge a 32x32 8-bit bitmap char *bits = (char *)bitmap->Bits(); - for (int32 i=0, j=-64; i<(int32)length; i++) - { + for (int32 i = 0, j = -64; i < (int32)length; i++) { if ((i % 32) == 0) j += 64; @@ -458,14 +457,13 @@ b[0] = b[1] = b[64] = b[65] = buffer[i]; } fConfigView->AddChild(new BitmapView(bitmap)); - } - else + } else delete bitmap; } } BRect rect = fConfigView->Bounds(); - BTextView *text = new BTextView(rect,NULL,rect,B_FOLLOW_NONE,B_WILL_DRAW); + BTextView *text = new BTextView(rect, NULL, rect, B_FOLLOW_NONE, B_WILL_DRAW); text->SetViewColor(fConfigView->Parent()->ViewColor()); text->SetAlignment(B_ALIGN_CENTER); text->SetText( @@ -476,7 +474,7 @@ "\n\n????????????????\n????????????\n???????\"??\"?????????" "\n\n????????????\n??????????????????")); rect = text->Bounds(); - text->ResizeTo(rect.Width(),text->TextHeight(0,42)); + text->ResizeTo(rect.Width(), text->TextHeight(0, 42)); text->SetTextRect(rect); text->MakeEditable(false); @@ -492,30 +490,30 @@ ConfigWindow::LoadSettings() { Accounts::Delete(); - Accounts::Create(fAccountsListView,fConfigView); + Accounts::Create(fAccountsListView, fConfigView); // load in general settings - BMailSettings *settings = new BMailSettings(); - status_t status = SetToGeneralSettings(settings); - if (status == B_OK) - { - // adjust own window frame - BScreen screen(this); - BRect screenFrame(screen.Frame().InsetByCopy(0,5)); - BRect frame(settings->ConfigWindowFrame()); - - if (screenFrame.Contains(frame.LeftTop())) - MoveTo(frame.LeftTop()); - else // center on screen - MoveTo((screenFrame.Width() - frame.Width()) / 2,(screenFrame.Height() - frame.Height()) / 2); + BMailSettings settings; + status_t status = SetToGeneralSettings(&settings); + if (status == B_OK) { + // move own window + MoveTo(settings.ConfigWindowFrame().LeftTop()); + } else { + fprintf(stderr, MDR_DIALECT_CHOICE("Error retrieving general settings: %s\n", + "??????????? %s\n"), strerror(status)); } - else - fprintf(stderr, MDR_DIALECT_CHOICE ( - "Error retrieving general settings: %s\n", - "??????????? %s\n"), - strerror(status)); - delete settings; + BScreen screen(this); + BRect screenFrame(screen.Frame().InsetByCopy(0, 5)); + if (!screenFrame.Contains(Frame().LeftTop()) + || !screenFrame.Contains(Frame().RightBottom())) + status = B_ERROR; + + if (status != B_OK) { + // center window on screen + MoveTo((screenFrame.Width() - Frame().Width()) / 2, + (screenFrame.Height() - Frame().Height()) / 2); + } } From mmu_man at mail.berlios.de Wed Jan 24 17:03:25 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Wed, 24 Jan 2007 17:03:25 +0100 Subject: [Haiku-commits] r19943 - haiku/trunk/src/add-ons/print/shared Message-ID: <200701241603.l0OG3P5b000711@sheep.berlios.de> Author: mmu_man Date: 2007-01-24 17:03:24 +0100 (Wed, 24 Jan 2007) New Revision: 19943 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19943&view=rev Modified: haiku/trunk/src/add-ons/print/shared/Template.cpp Log: Maybe your gcc doesn't caer, but otehr's do: error: virtual outside class declaration Fixed. Modified: haiku/trunk/src/add-ons/print/shared/Template.cpp =================================================================== --- haiku/trunk/src/add-ons/print/shared/Template.cpp 2007-01-24 14:49:32 UTC (rev 19942) +++ haiku/trunk/src/add-ons/print/shared/Template.cpp 2007-01-24 16:03:24 UTC (rev 19943) @@ -29,183 +29,183 @@ #include "Template.h" -virtual void Template::Op(int number) { +void Template::Op(int number) { } -virtual void Template::MovePenBy(BPoint delta) { +void Template::MovePenBy(BPoint delta) { } -virtual void Template::StrokeLine(BPoint start, BPoint end) { +void Template::StrokeLine(BPoint start, BPoint end) { } -virtual void Template::StrokeRect(BRect rect) { +void Template::StrokeRect(BRect rect) { } -virtual void Template::FillRect(BRect rect) { +void Template::FillRect(BRect rect) { } -virtual void Template::StrokeRoundRect(BRect rect, BPoint radii) { +void Template::StrokeRoundRect(BRect rect, BPoint radii) { } -virtual void Template::FillRoundRect(BRect rect, BPoint radii) { +void Template::FillRoundRect(BRect rect, BPoint radii) { } -virtual void Template::StrokeBezier(BPoint *control) { +void Template::StrokeBezier(BPoint *control) { } -virtual void Template::FillBezier(BPoint *control) { +void Template::FillBezier(BPoint *control) { } -virtual void Template::StrokeArc(BPoint center, BPoint radii, float startTheta, float arcTheta) { +void Template::StrokeArc(BPoint center, BPoint radii, float startTheta, float arcTheta) { } -virtual void Template::FillArc(BPoint center, BPoint radii, float startTheta, float arcTheta) { +void Template::FillArc(BPoint center, BPoint radii, float startTheta, float arcTheta) { } -virtual void Template::StrokeEllipse(BPoint center, BPoint radii) { +void Template::StrokeEllipse(BPoint center, BPoint radii) { } -virtual void Template::FillEllipse(BPoint center, BPoint radii) { +void Template::FillEllipse(BPoint center, BPoint radii) { } -virtual void Template::StrokePolygon(int32 numPoints, BPoint *points, bool isClosed) { +void Template::StrokePolygon(int32 numPoints, BPoint *points, bool isClosed) { } -virtual void Template::FillPolygon(int32 numPoints, BPoint *points, bool isClosed) { +void Template::FillPolygon(int32 numPoints, BPoint *points, bool isClosed) { } -virtual void Template::StrokeShape(BShape *shape) { +void Template::StrokeShape(BShape *shape) { } -virtual void Template::FillShape(BShape *shape) { +void Template::FillShape(BShape *shape) { } -virtual void Template::DrawString(char *string, float escapement_nospace, float escapement_space) { +void Template::DrawString(char *string, float escapement_nospace, float escapement_space) { } -virtual void Template::DrawPixels(BRect src, BRect dest, int32 width, int32 height, int32 bytesPerRow, int32 pixelFormat, int32 flags, void *data) { +void Template::DrawPixels(BRect src, BRect dest, int32 width, int32 height, int32 bytesPerRow, int32 pixelFormat, int32 flags, void *data) { } -virtual void Template::SetClippingRects(BRect *rects, uint32 numRects) { +void Template::SetClippingRects(BRect *rects, uint32 numRects) { } -virtual void Template::ClipToPicture(BPicture *picture, BPoint point, bool clip_to_inverse_picture) { +void Template::ClipToPicture(BPicture *picture, BPoint point, bool clip_to_inverse_picture) { } -virtual void Template::PushState() { +void Template::PushState() { } -virtual void Template::PopState() { +void Template::PopState() { } -virtual void Template::EnterStateChange() { +void Template::EnterStateChange() { } -virtual void Template::ExitStateChange() { +void Template::ExitStateChange() { } -virtual void Template::EnterFontState() { +void Template::EnterFontState() { } -virtual void Template::ExitFontState() { +void Template::ExitFontState() { } -virtual void Template::SetOrigin(BPoint pt) { +void Template::SetOrigin(BPoint pt) { } -virtual void Template::SetPenLocation(BPoint pt) { +void Template::SetPenLocation(BPoint pt) { } -virtual void Template::SetDrawingMode(drawing_mode mode) { +void Template::SetDrawingMode(drawing_mode mode) { } -virtual void Template::SetLineMode(cap_mode capMode, join_mode joinMode, float miterLimit) { +void Template::SetLineMode(cap_mode capMode, join_mode joinMode, float miterLimit) { } -virtual void Template::SetPenSize(float size) { +void Template::SetPenSize(float size) { } -virtual void Template::SetForeColor(rgb_color color) { +void Template::SetForeColor(rgb_color color) { } -virtual void Template::SetBackColor(rgb_color color) { +void Template::SetBackColor(rgb_color color) { } -virtual void Template::SetStipplePattern(pattern p) { +void Template::SetStipplePattern(pattern p) { } -virtual void Template::SetScale(float scale) { +void Template::SetScale(float scale) { } -virtual void Template::SetFontFamily(char *family) { +void Template::SetFontFamily(char *family) { } -virtual void Template::SetFontStyle(char *style) { +void Template::SetFontStyle(char *style) { } -virtual void Template::SetFontSpacing(int32 spacing) { +void Template::SetFontSpacing(int32 spacing) { } -virtual void Template::SetFontSize(float size) { +void Template::SetFontSize(float size) { } -virtual void Template::SetFontRotate(float rotation) { +void Template::SetFontRotate(float rotation) { } -virtual void Template::SetFontEncoding(int32 encoding) { +void Template::SetFontEncoding(int32 encoding) { } -virtual void Template::SetFontFlags(int32 flags) { +void Template::SetFontFlags(int32 flags) { } -virtual void Template::SetFontShear(float shear) { +void Template::SetFontShear(float shear) { } -virtual void Template::SetFontFace(int32 flags) { +void Template::SetFontFace(int32 flags) { } From axeld at mail.berlios.de Wed Jan 24 17:49:27 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 24 Jan 2007 17:49:27 +0100 Subject: [Haiku-commits] r19944 - haiku/trunk/src/preferences/filetypes Message-ID: <200701241649.l0OGnRLb004390@sheep.berlios.de> Author: axeld Date: 2007-01-24 17:49:27 +0100 (Wed, 24 Jan 2007) New Revision: 19944 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19944&view=rev Modified: haiku/trunk/src/preferences/filetypes/ApplicationTypeWindow.cpp Log: Obviously, BMenuField::ResizeToPreferred() has no effect under R5 (does work on Dano) - this fixes bug #954. Modified: haiku/trunk/src/preferences/filetypes/ApplicationTypeWindow.cpp =================================================================== --- haiku/trunk/src/preferences/filetypes/ApplicationTypeWindow.cpp 2007-01-24 16:03:24 UTC (rev 19943) +++ haiku/trunk/src/preferences/filetypes/ApplicationTypeWindow.cpp 2007-01-24 16:49:27 UTC (rev 19944) @@ -395,6 +395,7 @@ #endif rect.top = 4.0f + ceilf(fontHeight.ascent + fontHeight.descent); + rect.bottom = rect.top + height; fMajorVersionControl = new BTextControl(rect, "major", "Version:", NULL, NULL); fMajorVersionControl->SetDivider(fMajorVersionControl->StringWidth( From korli at mail.berlios.de Wed Jan 24 19:39:22 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Wed, 24 Jan 2007 19:39:22 +0100 Subject: [Haiku-commits] r19945 - haiku/trunk/build/jam Message-ID: <200701241839.l0OIdMsH020612@sheep.berlios.de> Author: korli Date: 2007-01-24 19:39:22 +0100 (Wed, 24 Jan 2007) New Revision: 19945 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19945&view=rev Modified: haiku/trunk/build/jam/ImageRules Log: jam seems to badly handle parenthesis with the B modifier : the workaround is to remove other modifiers fixes ticket #981 Modified: haiku/trunk/build/jam/ImageRules =================================================================== --- haiku/trunk/build/jam/ImageRules 2007-01-24 16:49:27 UTC (rev 19944) +++ haiku/trunk/build/jam/ImageRules 2007-01-24 18:39:22 UTC (rev 19945) @@ -126,7 +126,7 @@ if $(destName) { name = $(destName) ; } else { - name = $(target:BS) ; + name = $(target:G=:D=) ; } local destTarget = $(name:G=HaikuImage__$(directory:G=)) ; From korli at mail.berlios.de Wed Jan 24 19:56:26 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Wed, 24 Jan 2007 19:56:26 +0100 Subject: [Haiku-commits] r19946 - in haiku/trunk/src/add-ons/kernel/busses/ide: ahci silicon_image_3112 Message-ID: <200701241856.l0OIuQp7021931@sheep.berlios.de> Author: korli Date: 2007-01-24 19:56:25 +0100 (Wed, 24 Jan 2007) New Revision: 19946 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19946&view=rev Modified: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c Log: reduce trace from these two Modified: haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c 2007-01-24 18:39:22 UTC (rev 19945) +++ haiku/trunk/src/add-ons/kernel/busses/ide/ahci/ahci.c 2007-01-24 18:56:25 UTC (rev 19946) @@ -850,10 +850,8 @@ { switch (op) { case B_MODULE_INIT: - TRACE("module init\n"); return B_OK; case B_MODULE_UNINIT: - TRACE("module uninit\n"); return B_OK; default: Modified: haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c =================================================================== --- haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-24 18:39:22 UTC (rev 19945) +++ haiku/trunk/src/add-ons/kernel/busses/ide/silicon_image_3112/silicon_image_3112.c 2007-01-24 18:56:25 UTC (rev 19946) @@ -851,10 +851,8 @@ { switch (op) { case B_MODULE_INIT: - TRACE("module init\n"); return B_OK; case B_MODULE_UNINIT: - TRACE("module uninit\n"); return B_OK; default: From leavengood at mail.berlios.de Wed Jan 24 20:29:46 2007 From: leavengood at mail.berlios.de (leavengood at BerliOS) Date: Wed, 24 Jan 2007 20:29:46 +0100 Subject: [Haiku-commits] r19947 - haiku/trunk/src/kits/tracker Message-ID: <200701241929.l0OJTkhe024568@sheep.berlios.de> Author: leavengood Date: 2007-01-24 20:29:46 +0100 (Wed, 24 Jan 2007) New Revision: 19947 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19947&view=rev Modified: haiku/trunk/src/kits/tracker/PoseView.cpp haiku/trunk/src/kits/tracker/TrackerSettings.cpp Log: Your wish is my command: now only removable read-only volumes have their desktops integrated in Tracker. Modified: haiku/trunk/src/kits/tracker/PoseView.cpp =================================================================== --- haiku/trunk/src/kits/tracker/PoseView.cpp 2007-01-24 18:56:25 UTC (rev 19946) +++ haiku/trunk/src/kits/tracker/PoseView.cpp 2007-01-24 19:29:46 UTC (rev 19947) @@ -9258,8 +9258,9 @@ if (!settings.IntegrateNonBootBeOSDesktops()) return false; - // That's obviously what makes a BeOS desktop :-) - return volume.KnowsQuery() && volume.KnowsAttr() && volume.KnowsMime(); + // Only removable read-only volumes should have their desktops integrated + return volume.IsRemovable() && volume.IsReadOnly() + && volume.KnowsQuery() && volume.KnowsAttr() && volume.KnowsMime(); } Modified: haiku/trunk/src/kits/tracker/TrackerSettings.cpp =================================================================== --- haiku/trunk/src/kits/tracker/TrackerSettings.cpp 2007-01-24 18:56:25 UTC (rev 19946) +++ haiku/trunk/src/kits/tracker/TrackerSettings.cpp 2007-01-24 19:29:46 UTC (rev 19947) @@ -172,7 +172,7 @@ Add(fMountSharedVolumesOntoDesktop = new BooleanValueSetting("MountSharedVolumesOntoDesktop", false)); Add(fIntegrateNonBootBeOSDesktops = new BooleanValueSetting - ("IntegrateNonBootBeOSDesktops", false)); + ("IntegrateNonBootBeOSDesktops", true)); Add(fIntegrateAllNonBootDesktops = new BooleanValueSetting ("IntegrateAllNonBootDesktops", false)); Add(fEjectWhenUnmounting = new BooleanValueSetting("EjectWhenUnmounting", true)); From axeld at pinc-software.de Wed Jan 24 20:40:16 2007 From: axeld at pinc-software.de (Axel =?iso-8859-15?q?D=F6rfler?=) Date: Wed, 24 Jan 2007 20:40:16 +0100 (MET) Subject: [Haiku-commits] r19947 - haiku/trunk/src/kits/tracker In-Reply-To: <200701241929.l0OJTkhe024568@sheep.berlios.de> Message-ID: <32218234715-BeMail@zon> leavengood at BerliOS wrote: > Log: > Your wish is my command: now only removable read-only volumes have > their > desktops integrated in Tracker. That was fast, thanks! :-) Bye, Axel. From axeld at mail.berlios.de Wed Jan 24 20:56:57 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 24 Jan 2007 20:56:57 +0100 Subject: [Haiku-commits] r19948 - haiku/trunk/src/preferences/backgrounds Message-ID: <200701241956.l0OJuv7E026525@sheep.berlios.de> Author: axeld Date: 2007-01-24 20:56:56 +0100 (Wed, 24 Jan 2007) New Revision: 19948 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19948&view=rev Modified: haiku/trunk/src/preferences/backgrounds/BackgroundImage.cpp Log: Fixed a memory leak and the bug that could result in "pick one" menu fields and a white desktop preview background: it happened if the attribute containing the data couldn't be read or unflattened. Modified: haiku/trunk/src/preferences/backgrounds/BackgroundImage.cpp =================================================================== --- haiku/trunk/src/preferences/backgrounds/BackgroundImage.cpp 2007-01-24 19:29:46 UTC (rev 19947) +++ haiku/trunk/src/preferences/backgrounds/BackgroundImage.cpp 2007-01-24 19:56:56 UTC (rev 19948) @@ -88,7 +88,7 @@ delete [] buffer; if (error != B_OK) - return NULL; + return result; PRINT_OBJECT(container); From axeld at mail.berlios.de Wed Jan 24 21:02:59 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 24 Jan 2007 21:02:59 +0100 Subject: [Haiku-commits] r19949 - haiku/trunk/src/preferences/backgrounds Message-ID: <200701242002.l0OK2x4f026874@sheep.berlios.de> Author: axeld Date: 2007-01-24 21:02:59 +0100 (Wed, 24 Jan 2007) New Revision: 19949 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19949&view=rev Modified: haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp Log: Somehow it still looked strange under R5 this time... :-) Modified: haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp =================================================================== --- haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp 2007-01-24 19:56:56 UTC (rev 19948) +++ haiku/trunk/src/preferences/backgrounds/BackgroundsView.cpp 2007-01-24 20:02:59 UTC (rev 19949) @@ -173,6 +173,7 @@ rect.top = 8 + rightbox->InnerFrame().top; #else rect.top = 5 + workspaceMenuField->Bounds().Height(); + rect.bottom = rect.top + workspaceMenuField->Bounds().Height(); #endif fImageMenu = new BPopUpMenu("pick one"); From leavengood at gmail.com Wed Jan 24 21:11:22 2007 From: leavengood at gmail.com (Ryan Leavengood) Date: Wed, 24 Jan 2007 15:11:22 -0500 Subject: [Haiku-commits] r19947 - haiku/trunk/src/kits/tracker In-Reply-To: <32218234715-BeMail@zon> References: <200701241929.l0OJTkhe024568@sheep.berlios.de> <32218234715-BeMail@zon> Message-ID: On 1/24/07, Axel D?rfler wrote: > > That was fast, thanks! :-) These are the kind of little things I really like cranking out, so feel free to suggest more (and yes I'll tackle the screen saver thing soon. :) Ryan From wkornewald at mail.berlios.de Wed Jan 24 21:46:28 2007 From: wkornewald at mail.berlios.de (wkornewald at BerliOS) Date: Wed, 24 Jan 2007 21:46:28 +0100 Subject: [Haiku-commits] r19950 - haiku/trunk/src/documentation/icon_guidelines Message-ID: <200701242046.l0OKkS3V029930@sheep.berlios.de> Author: wkornewald Date: 2007-01-24 21:46:27 +0100 (Wed, 24 Jan 2007) New Revision: 19950 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19950&view=rev Added: haiku/trunk/src/documentation/icon_guidelines/index.html Removed: haiku/trunk/src/documentation/icon_guidelines/icon_guidelines.html Log: Renamed to index.html because this makes it easier to read it from the build factory folder. Deleted: haiku/trunk/src/documentation/icon_guidelines/icon_guidelines.html Copied: haiku/trunk/src/documentation/icon_guidelines/index.html (from rev 19949, haiku/trunk/src/documentation/icon_guidelines/icon_guidelines.html) From axeld at mail.berlios.de Wed Jan 24 22:04:50 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Wed, 24 Jan 2007 22:04:50 +0100 Subject: [Haiku-commits] r19951 - haiku/trunk/src/system/kernel/fs Message-ID: <200701242104.l0OL4oxR031141@sheep.berlios.de> Author: axeld Date: 2007-01-24 22:04:49 +0100 (Wed, 24 Jan 2007) New Revision: 19951 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19951&view=rev Modified: haiku/trunk/src/system/kernel/fs/fd.c Log: file_descriptor::ops is now set to NULL when the file descriptor gets disconnected. This fixes a possible crashing bug when an application with disconnected descriptors quits. Modified: haiku/trunk/src/system/kernel/fs/fd.c =================================================================== --- haiku/trunk/src/system/kernel/fs/fd.c 2007-01-24 20:46:27 UTC (rev 19950) +++ haiku/trunk/src/system/kernel/fs/fd.c 2007-01-24 21:04:49 UTC (rev 19951) @@ -1,6 +1,6 @@ /* Operations on file descriptors * - * Copyright 2002-2006, Axel D?rfler, axeld at pinc-software.de. + * Copyright 2002-2007, Axel D?rfler, axeld at pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -134,12 +134,13 @@ // free the descriptor if we don't need it anymore if (previous == 1) { // free the underlying object - if (descriptor->ops->fd_free) + if (descriptor->ops != NULL && descriptor->ops->fd_free != NULL) descriptor->ops->fd_free(descriptor); free(descriptor); } else if ((descriptor->open_mode & O_DISCONNECTED) != 0 - && previous - 1 == descriptor->open_count) { + && previous - 1 == descriptor->open_count + && descriptor->ops != NULL) { // the descriptor has been disconnected - it cannot // be accessed anymore, let's close it (no one is // currently accessing this descriptor) @@ -152,6 +153,7 @@ // prevent this descriptor from being closed/freed again descriptor->open_count = -1; descriptor->ref_count = -1; + descriptor->ops = NULL; descriptor->u.vnode = NULL; // the file descriptor is kept intact, so that it's not @@ -170,7 +172,7 @@ if (atomic_add(&descriptor->open_count, -1) == 1) { vfs_unlock_vnode_if_locked(descriptor); - if (descriptor->ops->fd_close) + if (descriptor->ops != NULL && descriptor->ops->fd_close != NULL) descriptor->ops->fd_close(descriptor); } } From mmu_man at mail.berlios.de Thu Jan 25 10:30:27 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 25 Jan 2007 10:30:27 +0100 Subject: [Haiku-commits] r19952 - haiku/trunk/src/add-ons/kernel/file_systems/nfs Message-ID: <200701250930.l0P9URcA031081@sheep.berlios.de> Author: mmu_man Date: 2007-01-25 10:30:27 +0100 (Thu, 25 Jan 2007) New Revision: 19952 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19952&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c Log: Make sure strings are 0-terminated. Fix some settings values. Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-01-24 21:04:49 UTC (rev 19951) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c 2007-01-25 09:30:27 UTC (rev 19952) @@ -82,8 +82,8 @@ } conf_allow_dir_open = get_driver_boolean_parameter(handle, "allow_dir_open", conf_allow_dir_open, true); - conf_ls_root_parent = get_driver_boolean_parameter(handle, "ls_root_parent", conf_ls_root_parent, false); - conf_no_check_ip_xid = get_driver_boolean_parameter(handle, "no_check_ip_xid", conf_no_check_ip_xid, false); + conf_ls_root_parent = get_driver_boolean_parameter(handle, "ls_root_parent", conf_ls_root_parent, true); + conf_no_check_ip_xid = get_driver_boolean_parameter(handle, "no_check_ip_xid", conf_no_check_ip_xid, true); str = get_driver_parameter(handle, "call_timeout", NULL, NULL); if (str) { @@ -1156,7 +1156,8 @@ e = strchr(p, ':'); if (!e) return EINVAL; - params->server = malloc(e - p); + params->server = malloc(e - p + 1); + params->server[e-p] = '\0'; strncpy(params->server, p, e - p); // hack params->serverIP = 0; @@ -1189,7 +1190,8 @@ e = strchr(p, ','); i = (e) ? (e - p) : (strlen(p)); - params->_export = malloc(i); + params->_export = malloc(i+1); + params->_export[i] = '\0'; strncpy(params->_export, p, i); p = strstr(str, "hostname="); @@ -1200,7 +1202,8 @@ e = strchr(p, ','); i = (e) ? (e - p) : (strlen(p)); - params->hostname = malloc(i); + params->hostname = malloc(i+1); + params->hostname[i] = '\0'; strncpy(params->hostname, p, i); p = strstr(str, "uid="); From axeld at mail.berlios.de Thu Jan 25 13:09:02 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 25 Jan 2007 13:09:02 +0100 Subject: [Haiku-commits] r19953 - haiku/trunk/src/kits/tracker Message-ID: <200701251209.l0PC92WB000301@sheep.berlios.de> Author: axeld Date: 2007-01-25 13:09:01 +0100 (Thu, 25 Jan 2007) New Revision: 19953 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19953&view=rev Modified: haiku/trunk/src/kits/tracker/Utilities.h Log: A little oversight made all icons white on BeOS. This fixes bug #990. Modified: haiku/trunk/src/kits/tracker/Utilities.h =================================================================== --- haiku/trunk/src/kits/tracker/Utilities.h 2007-01-25 09:30:27 UTC (rev 19952) +++ haiku/trunk/src/kits/tracker/Utilities.h 2007-01-25 12:09:01 UTC (rev 19953) @@ -75,7 +75,11 @@ const int32 kMiniIconSeparator = 3; +#ifdef __HAIKU__ const color_space kDefaultIconDepth = B_RGBA32; +#else +const color_space kDefaultIconDepth = B_CMAP8; +#endif // misc typedefs, constants and structs From mmu_man at mail.berlios.de Thu Jan 25 15:36:21 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 25 Jan 2007 15:36:21 +0100 Subject: [Haiku-commits] r19954 - haiku/trunk/src/apps/workspaces Message-ID: <200701251436.l0PEaLYa032289@sheep.berlios.de> Author: mmu_man Date: 2007-01-25 15:36:20 +0100 (Thu, 25 Jan 2007) New Revision: 19954 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19954&view=rev Modified: haiku/trunk/src/apps/workspaces/Workspaces.cpp Log: This should allow switching to previous or next workspace with Workspaces [-|+]. Idea taken from http://www.bebits.com/app/3379 Modified: haiku/trunk/src/apps/workspaces/Workspaces.cpp =================================================================== --- haiku/trunk/src/apps/workspaces/Workspaces.cpp 2007-01-25 12:09:01 UTC (rev 19953) +++ haiku/trunk/src/apps/workspaces/Workspaces.cpp 2007-01-25 14:36:20 UTC (rev 19954) @@ -358,6 +358,16 @@ // open any window if (IsLaunching()) Quit(); + } else if (!strcmp(argv[i], "-")) { + activate_workspace(current_workspace() - 1); + + if (IsLaunching()) + Quit(); + } else if (!strcmp(argv[i], "+")) { + activate_workspace(current_workspace() + 1); + + if (IsLaunching()) + Quit(); } else { // some unknown arguments were specified fprintf(stderr, "Invalid argument: %s\n", argv[i]); From mmu_man at mail.berlios.de Thu Jan 25 17:37:07 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Thu, 25 Jan 2007 17:37:07 +0100 Subject: [Haiku-commits] r19955 - haiku/trunk/headers/posix/netinet Message-ID: <200701251637.l0PGb7rE013098@sheep.berlios.de> Author: mmu_man Date: 2007-01-25 17:37:06 +0100 (Thu, 25 Jan 2007) New Revision: 19955 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19955&view=rev Modified: haiku/trunk/headers/posix/netinet/in.h Log: Change IPPROTO_* from enum to #defines. This fixes #992. Modified: haiku/trunk/headers/posix/netinet/in.h =================================================================== --- haiku/trunk/headers/posix/netinet/in.h 2007-01-25 14:36:20 UTC (rev 19954) +++ haiku/trunk/headers/posix/netinet/in.h 2007-01-25 16:37:06 UTC (rev 19955) @@ -38,20 +38,18 @@ /* Protocol definitions - add to as required... */ -enum { - IPPROTO_IP = 0, /* 0, IPv4 */ - IPPROTO_ICMP = 1, /* 1, ICMP (v4) */ - IPPROTO_IGMP = 2, /* 2, IGMP (group management) */ - IPPROTO_TCP = 6, /* 6, tcp */ - IPPROTO_UDP = 17, /* 17, UDP */ - IPPROTO_IPV6 = 41, /* 41, IPv6 in IPv6 */ - IPPROTO_ROUTING = 43, /* 43, Routing */ - IPPROTO_ICMPV6 = 58, /* 58, IPv6 ICMP */ - IPPROTO_ETHERIP = 97, /* 97, Ethernet in IPv4 */ - IPPROTO_RAW = 255 /* 255 */ -}; +#define IPPROTO_IP 0 /* 0, IPv4 */ +#define IPPROTO_ICMP 1 /* 1, ICMP (v4) */ +#define IPPROTO_IGMP 2 /* 2, IGMP (group management) */ +#define IPPROTO_TCP 6 /* 6, tcp */ +#define IPPROTO_UDP 17 /* 17, UDP */ +#define IPPROTO_IPV6 41 /* 41, IPv6 in IPv6 */ +#define IPPROTO_ROUTING 43 /* 43, Routing */ +#define IPPROTO_ICMPV6 58 /* 58, IPv6 ICMP */ +#define IPPROTO_ETHERIP 97 /* 97, Ethernet in IPv4 */ +#define IPPROTO_RAW 255 /* 255 */ -#define IPPROTO_MAX 256 +#define IPPROTO_MAX 256 /* Port numbers... * < IPPORT_RESERVED are privileged and should be From bonefish at cs.tu-berlin.de Thu Jan 25 17:38:38 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Thu, 25 Jan 2007 17:38:38 +0100 Subject: [Haiku-commits] r19925 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam [...] In-Reply-To: <200701231906.l0NJ6I4a014265@sheep.berlios.de> References: <200701231906.l0NJ6I4a014265@sheep.berlios.de> Message-ID: <20070125173838.1455.2@cs.tu-berlin.de> Oh, I completely forgot I wanted to reply to those... On 2007-01-23 at 20:06:18 [+0100], mmu_man at BerliOS wrote: > Author: mmu_man > Date: 2007-01-23 20:06:18 +0100 (Tue, 23 Jan 2007) > New Revision: 19925 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19925&view=rev > > Added: > haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile > Log: > I *love* Jam :D > still need to autogenerate some headers... (you still need to 'make' it > first). > > > Added: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile > =================================================================== > --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile > 2007-01-23 18:58:17 UTC (rev 19924) > +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile > 2007-01-23 19:06:18 UTC (rev 19925) > @@ -0,0 +1,58 @@ > +SubDir HAIKU_TOP src add-ons media media-add-ons usb_webcam ; > + > +SetSubDirSupportedPlatformsBeOSCompatible ; > + > +# for USBKit.h > +UseLibraryHeaders usb ; > + > +# HOW the F*** do I do that with Jam ? > +#SRCS := $(wildcard *.cpp) \ > +#$(wildcard addons/*/*.cpp) \ > +#$(wildcard sensors/*/*.cpp) \ > +#$(wildcard cstransforms/*.cpp) Well, RTFM (Jam.html in this case). The rule in question is called Glob. But in case of source files I'd recommend to list them explicitly anyway. On 2007-01-23 at 20:41:31 [+0100], mmu_man at BerliOS wrote: > Author: mmu_man > Date: 2007-01-23 20:41:31 +0100 (Tue, 23 Jan 2007) > New Revision: 19926 > ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19926&view=rev > > Modified: > haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile > Log: > if the Jamfile in devices prefs is correct this is supposed to generate the > 3 headers listing addons... > But it doesn't work yet. > > > Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile > =================================================================== > --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile > 2007-01-23 19:06:18 UTC (rev 19925) > +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile > 2007-01-23 19:41:31 UTC (rev 19926) > @@ -37,6 +37,27 @@ > local sensorsSources ; > sensorsSources = hdcs1000.cpp hv7131e1.cpp tas5110c1b.cpp ; > > +## how to build header files from sources to include teh list of built-in > addons. > + > +rule USBWebcamHeaderGen > +{ > + SEARCH on $(3) = $(SEARCH_SOURCE) ; > + > + Depends $(1) : $(3) ; > + MakeLocateArch $(<) ; > + USBWebcamHeaderGen1 $(2) : $(3) : $(1) ; > + LocalClean clean : $(<) ; > +} > + > +actions USBWebcamHeaderGen1 > +{ > + alert 'grep -h $(1) $(2) > $(3) ' ; > +} Would you fix this please. On 2007-01-24 at 09:43:17 [+0100], Fran?ois Revol wrote: > > mmu_man at BerliOS wrote: > > > Log: > > > I *love* Jam :D > > > still need to autogenerate some headers... (you still need to > > > 'make' > > > it first). > > > > Would it be that unfortunate to just check the headers in? Are they > > hard to maintain? > > Yes I did, I can always use the makefile to regen them, and I have to > update the Jamfile to add addons anyway (where are wildcards ?? :p). > Still, what works for the Devices prefs doesn't seem to work here. I > probably skipped some obvious stuff. What do you want to do and what exactly doesn't work? CU, Ingo From axeld at mail.berlios.de Thu Jan 25 18:08:17 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Thu, 25 Jan 2007 18:08:17 +0100 Subject: [Haiku-commits] r19956 - in haiku/trunk: headers/os/app src/kits/app Message-ID: <200701251708.l0PH8HWU015006@sheep.berlios.de> Author: axeld Date: 2007-01-25 18:08:16 +0100 (Thu, 25 Jan 2007) New Revision: 19956 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19956&view=rev Modified: haiku/trunk/headers/os/app/MessageQueue.h haiku/trunk/src/kits/app/Looper.cpp haiku/trunk/src/kits/app/MessageQueue.cpp Log: * Added a Dano extension to BMessageQueue: IsNextMessage(). * BLooper::AddMessage() is now using this method to determine wether or not to update its looper thread. Modified: haiku/trunk/headers/os/app/MessageQueue.h =================================================================== --- haiku/trunk/headers/os/app/MessageQueue.h 2007-01-25 16:37:06 UTC (rev 19955) +++ haiku/trunk/headers/os/app/MessageQueue.h 2007-01-25 17:08:16 UTC (rev 19956) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005, Haiku, Inc. All Rights Reserved. + * Copyright 2001-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ #ifndef _MESSAGE_QUEUE_H @@ -30,6 +30,7 @@ bool IsLocked() const; BMessage *NextMessage(); + bool IsNextMessage(const BMessage* message) const; private: // Reserved space in the vtable for future changes to BMessageQueue Modified: haiku/trunk/src/kits/app/Looper.cpp =================================================================== --- haiku/trunk/src/kits/app/Looper.cpp 2007-01-25 16:37:06 UTC (rev 19955) +++ haiku/trunk/src/kits/app/Looper.cpp 2007-01-25 17:08:16 UTC (rev 19956) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -9,7 +9,7 @@ * Axel D?rfler, axeld at pinc-software.de */ -/** BLooper class spawns a thread that runs a message loop. */ +/*! BLooper class spawns a thread that runs a message loop. */ /** @note Although I'm implementing "by the book" for now, I would like to @@ -1076,11 +1076,16 @@ void -BLooper::AddMessage(BMessage* msg) +BLooper::AddMessage(BMessage* message) { - _AddMessagePriv(msg); + _AddMessagePriv(message); - // ToDo: if called from a different thread, we need to wake up the looper + // wakeup looper when being called from other threads if necessary + if (find_thread(NULL) != Thread() + && fQueue->IsNextMessage(message) && port_count(fMsgPort) <= 0) { + // there is currently no message waiting, and we need to wakeup the looper + write_port_etc(fMsgPort, 0, NULL, 0, B_RELATIVE_TIMEOUT, 0); + } } Modified: haiku/trunk/src/kits/app/MessageQueue.cpp =================================================================== --- haiku/trunk/src/kits/app/MessageQueue.cpp 2007-01-25 16:37:06 UTC (rev 19955) +++ haiku/trunk/src/kits/app/MessageQueue.cpp 2007-01-25 17:08:16 UTC (rev 19956) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005, Haiku, Inc. All Rights Reserved. + * Copyright 2001-2007, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -263,6 +263,18 @@ /*! + \brief Checks wether or not the specified \a message is the message + you would get when calling NextMessage(). +*/ +bool +BMessageQueue::IsNextMessage(const BMessage* message) const +{ + BAutolock _(fLock); + return fHead == message; +} + + +/*! \brief This method is only here for R5 binary compatibility! It should be dropped as soon as possible (it misses the const qualifier). */ From bonefish at mail.berlios.de Thu Jan 25 18:21:52 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 25 Jan 2007 18:21:52 +0100 Subject: [Haiku-commits] r19957 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam Message-ID: <200701251721.l0PHLqHc015853@sheep.berlios.de> Author: bonefish Date: 2007-01-25 18:21:52 +0100 (Thu, 25 Jan 2007) New Revision: 19957 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19957&view=rev Removed: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalAddons.h haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalColorSpaceTransforms.h haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalSensors.h Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile Log: Fixed generation of header files. Removed generated header files from repository. Deleted: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalAddons.h Deleted: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalColorSpaceTransforms.h Deleted: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/CamInternalSensors.h Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-25 17:08:16 UTC (rev 19956) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-25 17:21:52 UTC (rev 19957) @@ -51,19 +51,20 @@ ## how to build header files from sources to include the list of built-in addons. # but it doesn't seem to work for some reason... -rule USBWebcamHeaderGen +rule USBWebcamHeaderGen header : macro : sources { - SEARCH on $(3) = $(SEARCH_SOURCE) ; + SEARCH on $(sources) = $(SEARCH_SOURCE) ; - Depends $(1) : $(3) ; - MakeLocateArch $(<) ; - USBWebcamHeaderGen1 $(2) : $(3) : $(1) ; - LocalClean clean : $(<) ; + Depends $(header) : $(sources) ; + MakeLocateArch $(header) ; + GREP_DEFINE on $(header) = $(macro) ; + USBWebcamHeaderGen1 $(header) : $(sources) ; + LocalClean clean : $(header) ; } actions USBWebcamHeaderGen1 { - alert 'grep -h $(1) $(2) > $(3) ' ; + grep -h $(GREP_DEFINE) $(2) > $(1) ; } USBWebcamHeaderGen [ FGristFiles CamInternalAddons.h ] : B_WEBCAM_MKINTFUNC : $(addonSources) ; From bonefish at mail.berlios.de Thu Jan 25 18:24:09 2007 From: bonefish at mail.berlios.de (bonefish at BerliOS) Date: Thu, 25 Jan 2007 18:24:09 +0100 Subject: [Haiku-commits] r19958 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam Message-ID: <200701251724.l0PHO9xV016105@sheep.berlios.de> Author: bonefish Date: 2007-01-25 18:24:08 +0100 (Thu, 25 Jan 2007) New Revision: 19958 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19958&view=rev Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile Log: Cleanup and style fixes. Enforced 80 char line length. Modified: haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile =================================================================== --- haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-25 17:21:52 UTC (rev 19957) +++ haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam/Jamfile 2007-01-25 17:24:08 UTC (rev 19958) @@ -2,27 +2,16 @@ SetSubDirSupportedPlatformsBeOSCompatible ; -# note: when adding new addons, sensors -# or colorspace transforms, one should regenerate -# the *Internal*.h headers with the makefile. - # for USBKit.h UseLibraryHeaders usb ; # Zeta has a libusb.so, we have a USBKit.a if $(TARGET_PLATFORM) = haiku { -usbKitLibraryName = USBKit.a ; + usbKitLibraryName = USBKit.a ; } else { -usbKitLibraryName = usb ; + usbKitLibraryName = usb ; } -# HOW the F*** do I do that with Jam ? -#SRCS := $(wildcard *.cpp) \ -#$(wildcard addons/*/*.cpp) \ -#$(wildcard sensors/*/*.cpp) \ -#$(wildcard cstransforms/*.cpp) - - # source directories local sourceDirs = addons/quickcam @@ -33,7 +22,8 @@ local sourceDir ; for sourceDir in $(sourceDirs) { - SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons media media-add-ons usb_webcam $(sourceDir) ] ; + SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons media media-add-ons + usb_webcam $(sourceDir) ] ; } ## addon sources @@ -67,9 +57,12 @@ grep -h $(GREP_DEFINE) $(2) > $(1) ; } -USBWebcamHeaderGen [ FGristFiles CamInternalAddons.h ] : B_WEBCAM_MKINTFUNC : $(addonSources) ; -USBWebcamHeaderGen [ FGristFiles CamInternalSensors.h ] : B_WEBCAM_DECLARE_SENSOR : $(sensorsSources) ; -USBWebcamHeaderGen [ FGristFiles CamInternalColorSpaceTransforms.h ] : B_WEBCAM_DECLARE_CSTRANSFORM : $(csTransformsSources) ; +USBWebcamHeaderGen [ FGristFiles CamInternalAddons.h ] + : B_WEBCAM_MKINTFUNC : $(addonSources) ; +USBWebcamHeaderGen [ FGristFiles CamInternalSensors.h ] + : B_WEBCAM_DECLARE_SENSOR : $(sensorsSources) ; +USBWebcamHeaderGen [ FGristFiles CamInternalColorSpaceTransforms.h ] + : B_WEBCAM_DECLARE_CSTRANSFORM : $(csTransformsSources) ; Addon usb_webcam.media_addon : media : $(addonSources) @@ -93,5 +86,5 @@ # force dependancies Includes [ FGristFiles CamRoster.cpp ] : [ FGristFiles CamInternalAddons.h ] ; Includes [ FGristFiles CamDevice.cpp ] : [ FGristFiles CamInternalSensors.h ] ; -Includes [ FGristFiles CamColorSpaceTransform.cpp ] : [ FGristFiles CamInternalColorSpaceTransforms.h ] ; - +Includes [ FGristFiles CamColorSpaceTransform.cpp ] + : [ FGristFiles CamInternalColorSpaceTransforms.h ] ; From bonefish at cs.tu-berlin.de Thu Jan 25 18:25:46 2007 From: bonefish at cs.tu-berlin.de (Ingo Weinhold) Date: Thu, 25 Jan 2007 18:25:46 +0100 Subject: [Haiku-commits] r19925 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam [...] In-Reply-To: <20070125173838.1455.2@cs.tu-berlin.de> References: <200701231906.l0NJ6I4a014265@sheep.berlios.de> <20070125173838.1455.2@cs.tu-berlin.de> Message-ID: <20070125182546.13622.3@cs.tu-berlin.de> > On 2007-01-24 at 09:43:17 [+0100], Fran?ois Revol wrote: > > > mmu_man at BerliOS wrote: > > > > Log: > > > > I *love* Jam :D > > > > still need to autogenerate some headers... (you still need to > > > > 'make' > > > > it first). > > > > > > Would it be that unfortunate to just check the headers in? Are they > > > hard to maintain? > > > > Yes I did, I can always use the makefile to regen them, and I have to > > update the Jamfile to add addons anyway (where are wildcards ?? :p). > > Still, what works for the Devices prefs doesn't seem to work here. I > > probably skipped some obvious stuff. > > What do you want to do and what exactly doesn't work? OK, I guess I understood what went wrong and fixed it. CU, Ingo From korli at mail.berlios.de Thu Jan 25 18:51:00 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Thu, 25 Jan 2007 18:51:00 +0100 Subject: [Haiku-commits] r19959 - in haiku/trunk/src: apps/glteapot preferences/backgrounds Message-ID: <200701251751.l0PHp01a020135@sheep.berlios.de> Author: korli Date: 2007-01-25 18:50:58 +0100 (Thu, 25 Jan 2007) New Revision: 19959 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19959&view=rev Modified: haiku/trunk/src/apps/glteapot/FPS.h haiku/trunk/src/preferences/backgrounds/ImageFilePanel.h Log: fix for warnings Modified: haiku/trunk/src/apps/glteapot/FPS.h =================================================================== --- haiku/trunk/src/apps/glteapot/FPS.h 2007-01-25 17:24:08 UTC (rev 19958) +++ haiku/trunk/src/apps/glteapot/FPS.h 2007-01-25 17:50:58 UTC (rev 19959) @@ -16,4 +16,5 @@ private: static void drawChar( GLfloat x, GLfloat y, GLint number ); -}; \ No newline at end of file +}; + Modified: haiku/trunk/src/preferences/backgrounds/ImageFilePanel.h =================================================================== --- haiku/trunk/src/preferences/backgrounds/ImageFilePanel.h 2007-01-25 17:24:08 UTC (rev 19958) +++ haiku/trunk/src/preferences/backgrounds/ImageFilePanel.h 2007-01-25 17:50:58 UTC (rev 19959) @@ -19,6 +19,7 @@ class CustomRefFilter : public BRefFilter { public: CustomRefFilter(bool imageFiltering); + virtual ~CustomRefFilter() {}; bool Filter(const entry_ref *ref, BNode* node, struct stat *st, const char *filetype); From korli at mail.berlios.de Thu Jan 25 20:12:49 2007 From: korli at mail.berlios.de (korli at BerliOS) Date: Thu, 25 Jan 2007 20:12:49 +0100 Subject: [Haiku-commits] r19960 - in haiku/trunk: headers/libs/freetype2/freetype headers/libs/freetype2/freetype/config headers/libs/freetype2/freetype/internal headers/libs/freetype2/freetype/internal/services src/libs/freetype2/autofit src/libs/freetype2/base src/libs/freetype2/bdf src/libs/freetype2/cache src/libs/freetype2/cff src/libs/freetype2/cid src/libs/freetype2/gzip src/libs/freetype2/otvalid src/libs/freetype2/pcf src/libs/freetype2/pfr src/libs/freetype2/psaux src/libs/freetype2/pshinter src/libs/freetype2/psnames src/libs/freetype2/raster src/libs/freetype2/sfnt src/libs/freetype2/smooth src/libs/freetype2/truetype src/libs/freetype2/type1 src/libs/freetype2/type42 src/libs/freetype2/winfonts Message-ID: <200701251912.l0PJCnsT001404@sheep.berlios.de> Author: korli Date: 2007-01-25 20:12:34 +0100 (Thu, 25 Jan 2007) New Revision: 19960 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19960&view=rev Added: haiku/trunk/headers/libs/freetype2/freetype/ftgasp.h haiku/trunk/headers/libs/freetype2/freetype/ftlcdfil.h haiku/trunk/src/libs/freetype2/base/ftgasp.c haiku/trunk/src/libs/freetype2/base/ftlcdfil.c Removed: haiku/trunk/src/libs/freetype2/sfnt/ttsbit0.h Modified: haiku/trunk/headers/libs/freetype2/freetype/config/ftheader.h haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h haiku/trunk/headers/libs/freetype2/freetype/config/ftstdlib.h haiku/trunk/headers/libs/freetype2/freetype/freetype.h haiku/trunk/headers/libs/freetype2/freetype/ftbitmap.h haiku/trunk/headers/libs/freetype2/freetype/ftchapters.h haiku/trunk/headers/libs/freetype2/freetype/ftincrem.h haiku/trunk/headers/libs/freetype2/freetype/ftotval.h haiku/trunk/headers/libs/freetype2/freetype/ftoutln.h haiku/trunk/headers/libs/freetype2/freetype/ftwinfnt.h haiku/trunk/headers/libs/freetype2/freetype/ftxf86.h haiku/trunk/headers/libs/freetype2/freetype/internal/ftcalc.h haiku/trunk/headers/libs/freetype2/freetype/internal/ftgloadr.h haiku/trunk/headers/libs/freetype2/freetype/internal/ftobjs.h haiku/trunk/headers/libs/freetype2/freetype/internal/ftstream.h haiku/trunk/headers/libs/freetype2/freetype/internal/ftvalid.h haiku/trunk/headers/libs/freetype2/freetype/internal/psaux.h haiku/trunk/headers/libs/freetype2/freetype/internal/services/svkern.h haiku/trunk/headers/libs/freetype2/freetype/internal/services/svotval.h haiku/trunk/headers/libs/freetype2/freetype/internal/services/svpscmap.h haiku/trunk/headers/libs/freetype2/freetype/internal/services/svttcmap.h haiku/trunk/headers/libs/freetype2/freetype/internal/services/svxf86nm.h haiku/trunk/headers/libs/freetype2/freetype/internal/sfnt.h haiku/trunk/headers/libs/freetype2/freetype/internal/t1types.h haiku/trunk/headers/libs/freetype2/freetype/internal/tttypes.h haiku/trunk/headers/libs/freetype2/freetype/t1tables.h haiku/trunk/headers/libs/freetype2/freetype/tttables.h haiku/trunk/src/libs/freetype2/autofit/afangles.c haiku/trunk/src/libs/freetype2/autofit/afcjk.c haiku/trunk/src/libs/freetype2/autofit/afhints.c haiku/trunk/src/libs/freetype2/autofit/afhints.h haiku/trunk/src/libs/freetype2/autofit/aflatin.c haiku/trunk/src/libs/freetype2/autofit/afloader.c haiku/trunk/src/libs/freetype2/autofit/afmodule.c haiku/trunk/src/libs/freetype2/autofit/aftypes.h haiku/trunk/src/libs/freetype2/base/Jamfile haiku/trunk/src/libs/freetype2/base/ftapi.c haiku/trunk/src/libs/freetype2/base/ftbase.c haiku/trunk/src/libs/freetype2/base/ftbitmap.c haiku/trunk/src/libs/freetype2/base/ftcalc.c haiku/trunk/src/libs/freetype2/base/ftdbgmem.c haiku/trunk/src/libs/freetype2/base/ftgloadr.c haiku/trunk/src/libs/freetype2/base/ftgxval.c haiku/trunk/src/libs/freetype2/base/ftmac.c haiku/trunk/src/libs/freetype2/base/ftmm.c haiku/trunk/src/libs/freetype2/base/ftobjs.c haiku/trunk/src/libs/freetype2/base/ftotval.c haiku/trunk/src/libs/freetype2/base/ftoutln.c haiku/trunk/src/libs/freetype2/base/ftrfork.c haiku/trunk/src/libs/freetype2/base/ftsynth.c haiku/trunk/src/libs/freetype2/base/ftutil.c haiku/trunk/src/libs/freetype2/base/rules.mk haiku/trunk/src/libs/freetype2/bdf/README haiku/trunk/src/libs/freetype2/bdf/bdf.c haiku/trunk/src/libs/freetype2/bdf/bdf.h haiku/trunk/src/libs/freetype2/bdf/bdfdrivr.c haiku/trunk/src/libs/freetype2/bdf/bdflib.c haiku/trunk/src/libs/freetype2/bdf/module.mk haiku/trunk/src/libs/freetype2/cache/ftccmap.c haiku/trunk/src/libs/freetype2/cff/cffcmap.c haiku/trunk/src/libs/freetype2/cff/cffcmap.h haiku/trunk/src/libs/freetype2/cff/cffdrivr.c haiku/trunk/src/libs/freetype2/cff/cffgload.c haiku/trunk/src/libs/freetype2/cff/cffload.c haiku/trunk/src/libs/freetype2/cff/cffload.h haiku/trunk/src/libs/freetype2/cff/cffobjs.c haiku/trunk/src/libs/freetype2/cff/cffobjs.h haiku/trunk/src/libs/freetype2/cff/cfftypes.h haiku/trunk/src/libs/freetype2/cid/cidgload.c haiku/trunk/src/libs/freetype2/cid/cidload.c haiku/trunk/src/libs/freetype2/cid/cidparse.c haiku/trunk/src/libs/freetype2/cid/cidtoken.h haiku/trunk/src/libs/freetype2/gzip/ftgzip.c haiku/trunk/src/libs/freetype2/gzip/inftrees.c haiku/trunk/src/libs/freetype2/otvalid/otvmod.c haiku/trunk/src/libs/freetype2/pcf/README haiku/trunk/src/libs/freetype2/pcf/module.mk haiku/trunk/src/libs/freetype2/pcf/pcfdrivr.c haiku/trunk/src/libs/freetype2/pcf/pcfread.c haiku/trunk/src/libs/freetype2/pcf/pcfutil.c haiku/trunk/src/libs/freetype2/pfr/Jamfile haiku/trunk/src/libs/freetype2/pfr/pfrcmap.c haiku/trunk/src/libs/freetype2/pfr/pfrcmap.h haiku/trunk/src/libs/freetype2/pfr/pfrload.h haiku/trunk/src/libs/freetype2/pfr/pfrobjs.c haiku/trunk/src/libs/freetype2/psaux/psconv.c haiku/trunk/src/libs/freetype2/psaux/psconv.h haiku/trunk/src/libs/freetype2/psaux/psobjs.c haiku/trunk/src/libs/freetype2/psaux/t1cmap.c haiku/trunk/src/libs/freetype2/psaux/t1decode.c haiku/trunk/src/libs/freetype2/pshinter/pshalgo.c haiku/trunk/src/libs/freetype2/psnames/psmodule.c haiku/trunk/src/libs/freetype2/raster/ftraster.c haiku/trunk/src/libs/freetype2/sfnt/rules.mk haiku/trunk/src/libs/freetype2/sfnt/sfdriver.c haiku/trunk/src/libs/freetype2/sfnt/sfobjs.c haiku/trunk/src/libs/freetype2/sfnt/ttcmap.c haiku/trunk/src/libs/freetype2/sfnt/ttkern.c haiku/trunk/src/libs/freetype2/sfnt/ttkern.h haiku/trunk/src/libs/freetype2/sfnt/ttload.c haiku/trunk/src/libs/freetype2/sfnt/ttmtx.c haiku/trunk/src/libs/freetype2/sfnt/ttsbit.c haiku/trunk/src/libs/freetype2/sfnt/ttsbit.h haiku/trunk/src/libs/freetype2/sfnt/ttsbit0.c haiku/trunk/src/libs/freetype2/smooth/ftgrays.c haiku/trunk/src/libs/freetype2/smooth/ftsmooth.c haiku/trunk/src/libs/freetype2/truetype/truetype.c haiku/trunk/src/libs/freetype2/truetype/ttdriver.c haiku/trunk/src/libs/freetype2/truetype/ttgload.c haiku/trunk/src/libs/freetype2/truetype/ttgload.h haiku/trunk/src/libs/freetype2/truetype/ttgxvar.h haiku/trunk/src/libs/freetype2/truetype/ttinterp.c haiku/trunk/src/libs/freetype2/truetype/ttobjs.c haiku/trunk/src/libs/freetype2/truetype/ttobjs.h haiku/trunk/src/libs/freetype2/truetype/ttpload.c haiku/trunk/src/libs/freetype2/type1/t1afm.c haiku/trunk/src/libs/freetype2/type1/t1gload.c haiku/trunk/src/libs/freetype2/type1/t1load.c haiku/trunk/src/libs/freetype2/type1/t1load.h haiku/trunk/src/libs/freetype2/type1/t1objs.c haiku/trunk/src/libs/freetype2/type1/t1objs.h haiku/trunk/src/libs/freetype2/type1/t1parse.c haiku/trunk/src/libs/freetype2/type1/t1tokens.h haiku/trunk/src/libs/freetype2/type42/t42drivr.c haiku/trunk/src/libs/freetype2/type42/t42objs.c haiku/trunk/src/libs/freetype2/type42/t42objs.h haiku/trunk/src/libs/freetype2/type42/t42parse.c haiku/trunk/src/libs/freetype2/winfonts/winfnt.c Log: updated freetype to 2.3.0 Modified: haiku/trunk/headers/libs/freetype2/freetype/config/ftheader.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/config/ftheader.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/config/ftheader.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -4,7 +4,7 @@ /* */ /* Build macros of the FreeType 2 library. */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -88,7 +88,7 @@ /* limited to the infamous 8.3 naming rule required by DOS (and */ /* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */ /* */ - /* The second reason is that is allows for more flexibility in the */ + /* The second reason is that it allows for more flexibility in the */ /* way FreeType 2 is installed on a given system. */ /* */ /*************************************************************************/ @@ -222,7 +222,7 @@ * FT_IMAGE_H * * @description: - * A macro used in #include statements to name the file containing types + * A macro used in #include statements to name the file containing type * definitions related to glyph images (i.e., bitmaps, outlines, * scan-converter parameters). * @@ -282,7 +282,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * API used to manage multiple @FT_Size objects per face. + * API which manages multiple @FT_Size objects per face. * */ #define FT_SIZES_H @@ -334,10 +334,9 @@ * * @description: * A macro used in #include statements to name the file containing the - * enumeration values used to identify name strings, languages, - * encodings, etc. This file really contains a _large_ set of constant - * macro definitions, taken from the TrueType and OpenType - * specifications. + * enumeration values which identify name strings, languages, encodings, + * etc. This file really contains a _large_ set of constant macro + * definitions, taken from the TrueType and OpenType specifications. * */ #define FT_TRUETYPE_IDS_H @@ -363,7 +362,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * definitions of TrueType four-byte `tags' used to identify blocks in + * definitions of TrueType four-byte `tags' which identify blocks in * SFNT-based font formats (i.e., TrueType and OpenType). * */ @@ -377,7 +376,8 @@ * * @description: * A macro used in #include statements to name the file containing the - * definitions of an API to access BDF-specific strings from a face. + * definitions of an API which accesses BDF-specific strings from a + * face. * */ #define FT_BDF_H @@ -390,7 +390,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * definitions of an API to support for gzip-compressed files. + * definitions of an API which supports gzip-compressed files. * */ #define FT_GZIP_H @@ -403,7 +403,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * definitions of an API to support for LZW-compressed files. + * definitions of an API which supports LZW-compressed files. * */ #define FT_LZW_H @@ -416,7 +416,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * definitions of an API to support Windows FNT files. + * definitions of an API which supports Windows FNT files. * */ #define FT_WINFONTS_H @@ -484,7 +484,7 @@ * `glyph image' API of the FreeType 2 cache sub-system. * * It is used to define a cache for @FT_Glyph elements. You can also - * see the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to + * use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to * store small glyph bitmaps, as it will use less memory. * * This macro is deprecated. Simply include @FT_CACHE_H to have all @@ -568,7 +568,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * optional FreeType 2 API used to access embedded `name' strings in + * optional FreeType 2 API which accesses embedded `name' strings in * SFNT-based font formats (i.e., TrueType and OpenType). * */ @@ -582,7 +582,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * optional FreeType 2 API used to validate OpenType tables (BASE, GDEF, + * optional FreeType 2 API which validates OpenType tables (BASE, GDEF, * GPOS, GSUB, JSTF). * */ @@ -596,7 +596,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * optional FreeType 2 API used to validate TrueTypeGX/AAT tables (feat, + * optional FreeType 2 API which validates TrueTypeGX/AAT tables (feat, * mort, morx, bsln, just, kern, opbd, trak, prop). * */ @@ -610,7 +610,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API used to access PFR-specific data. + * FreeType 2 API which accesses PFR-specific data. * */ #define FT_PFR_H @@ -623,7 +623,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API used to stroke outline path. + * FreeType 2 API which provides functions to stroke outline paths. */ #define FT_STROKER_H @@ -635,7 +635,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API used to perform artificial obliquing and emboldening. + * FreeType 2 API which performs artificial obliquing and emboldening. */ #define FT_SYNTHESIS_H @@ -647,7 +647,7 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API used to provide functions specific to the XFree86 and + * FreeType 2 API which provides functions specific to the XFree86 and * X.Org X11 servers. */ #define FT_XFREE86_H @@ -660,11 +660,36 @@ * * @description: * A macro used in #include statements to name the file containing the - * FreeType 2 API used to perform trigonometric computations (e.g., + * FreeType 2 API which performs trigonometric computations (e.g., * cosines and arc tangents). */ #define FT_TRIGONOMETRY_H + + /************************************************************************* + * + * @macro: + * FT_LCD_FILTER_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 API which performs color filtering for subpixel rendering. + */ +#define FT_LCD_FILTER_H + + + /************************************************************************* + * + * @macro: + * FT_GASP_H + * + * @description: + * A macro used in #include statements to name the file containing the + * FreeType 2 API which returns entries from the TrueType GASP table. + */ +#define FT_GASP_H + + /* */ #define FT_ERROR_DEFINITIONS_H Modified: haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/config/ftoption.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -4,7 +4,7 @@ /* */ /* User-selectable configuration macros (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -77,6 +77,26 @@ /*************************************************************************/ /* */ + /* Uncomment the line below if you want to activate sub-pixel rendering */ + /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */ + /* */ + /* Note that this feature is covered by several Microsoft patents */ + /* and should not be activated in any default build of the library. */ + /* */ + /* This macro has no impact on the FreeType API, only on its */ + /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */ + /* FT_Render_Glyph still generates a bitmap that is 3 times larger than */ + /* the original size; the difference will be that each triplet of */ + /* subpixels has R=G=B. */ + /* */ + /* This is done to allow FreeType clients to run unmodified, forcing */ + /* them to display normal gray-level anti-aliased glyphs. */ + /* */ +#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING + + + /*************************************************************************/ + /* */ /* Many compilers provide a non-ANSI 64-bit data type that can be used */ /* by FreeType to speed up some computations. However, this will create */ /* some problems when compiling the library in strict ANSI mode. */ @@ -448,7 +468,7 @@ /* FT_PARAM_TAG_UNPATENTED_HINTING; or when the debug hook */ /* FT_DEBUG_HOOK_UNPATENTED_HINTING is globally activated. */ /* */ -//#define TT_CONFIG_OPTION_UNPATENTED_HINTING +#define TT_CONFIG_OPTION_UNPATENTED_HINTING /*************************************************************************/ @@ -572,15 +592,9 @@ #define AF_CONFIG_OPTION_CJK - /* */ + /* */ - /* - * This temporary macro is used to control various optimizations for - * reducing the heap footprint of memory-mapped TrueType files. - */ -#define FT_OPTIMIZE_MEMORY - /* * Define this variable if you want to keep the layout of internal * structures that was used prior to FreeType 2.2. This also compiles in @@ -594,6 +608,16 @@ #define FT_CONFIG_OPTION_OLD_INTERNALS + /* + * This variable is defined if either unpatented or native TrueType + * hinting is requested by the definitions above. + */ +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +#define TT_USE_BYTECODE_INTERPRETER +#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING +#define TT_USE_BYTECODE_INTERPRETER +#endif + FT_END_HEADER Modified: haiku/trunk/headers/libs/freetype2/freetype/config/ftstdlib.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/config/ftstdlib.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/config/ftstdlib.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -168,12 +168,12 @@ #include -#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */ - /* jmp_buf is defined as a macro */ - /* on certain platforms */ +#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */ + /* jmp_buf is defined as a macro */ + /* on certain platforms */ -#define ft_longjmp longjmp /* likewise */ -#define ft_setjmp setjmp /* same thing here */ +#define ft_longjmp longjmp +#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) ) /* same thing here */ /* the following is only used for debugging purposes, i.e., if */ Modified: haiku/trunk/headers/libs/freetype2/freetype/freetype.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/freetype.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/freetype.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -4,7 +4,7 @@ /* */ /* FreeType high-level API and common types (specification only). */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by */ +/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -913,7 +913,9 @@ FT_Generic generic; - /*# the following are only relevant to scalable outlines */ + /*# The following member variables (down to `underline_thickness') */ + /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size */ + /*# for bitmap fonts. */ FT_BBox bbox; FT_UShort units_per_EM; @@ -1270,6 +1272,8 @@ /* glyphs. As this would be a definite performance hit, it is up to */ /* client applications to perform such computations. */ /* */ + /* The FT_Size_Metrics structure is valid for bitmap fonts also. */ + /* */ typedef struct FT_Size_Metrics_ { FT_UShort x_ppem; /* horizontal pixels per EM */ @@ -1795,6 +1799,9 @@ /* */ /* FreeType error code. 0 means success. */ /* */ + /* */ + /* You must not deallocate the memory before calling @FT_Done_Face. */ + /* */ FT_EXPORT( FT_Error ) FT_New_Memory_Face( FT_Library library, const FT_Byte* file_base, @@ -3306,8 +3313,8 @@ * macros. */ #define FREETYPE_MAJOR 2 -#define FREETYPE_MINOR 2 -#define FREETYPE_PATCH 1 +#define FREETYPE_MINOR 3 +#define FREETYPE_PATCH 0 /*************************************************************************/ @@ -3345,7 +3352,6 @@ FT_Int *aminor, FT_Int *apatch ); - /* */ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftbitmap.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftbitmap.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/ftbitmap.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -3,7 +3,7 @@ /* ftbitmap.h */ /* */ /* FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */ -/* bitmaps into 8bpp format (specification). */ +/* bitmaps into 8bpp format (specification). */ /* */ /* Copyright 2004, 2005, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftchapters.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftchapters.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/ftchapters.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -56,6 +56,8 @@ /* bdf_fonts */ /* pfr_fonts */ /* winfnt_fonts */ +/* font_formats */ +/* gasp_table */ /* */ /***************************************************************************/ @@ -93,5 +95,6 @@ /* module_management */ /* gzip */ /* lzw */ +/* lcd_filtering */ /* */ /***************************************************************************/ Added: haiku/trunk/headers/libs/freetype2/freetype/ftgasp.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftgasp.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/ftgasp.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -0,0 +1,113 @@ +/***************************************************************************/ +/* */ +/* ftgasp.h */ +/* */ +/* Access of TrueType's `gasp' table (specification). */ +/* */ +/* Copyright 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef _FT_GASP_H_ +#define _FT_GASP_H_ + +#include +#include FT_FREETYPE_H + + /*************************************************************************** + * + * @section: + * gasp_table + * + * @title: + * Gasp Table + * + * @abstract: + * Retrieving TrueType `gasp' table entries + * + * @description: + * The function @FT_Get_Gasp can be used to query a TrueType or OpenType + * font for specific entries in their `gasp' table, if any. This is + * mainly useful when implementing native TrueType hinting with the + * bytecode interpreter to duplicate the Windows text rendering results. + */ + + /************************************************************************* + * + * @enum: + * FT_GASP_XXX + * + * @description: + * A list of values and/or bit-flags returned by the @FT_Get_Gasp + * function. + * + * @values: + * FT_GASP_NO_TABLE :: + * This special value means that there is no GASP table in this face. + * It is up to the client to decide what to do. + * + * FT_GASP_DO_GRIDFIT :: + * Grid-fitting and hinting should be performed at the specified ppem. + * This *really* means TrueType bytecode interpretation. + * + * FT_GASP_DO_GRAY :: + * Anti-aliased rendering should be performed at the specified ppem. + * + * FT_GASP_SYMMETRIC_SMOOTHING :: + * Smoothing along multiple axes must be used with ClearType. + * + * FT_GASP_SYMMETRIC_GRIDFIT :: + * Grid-fitting must be used with ClearType's symmetric smoothing. + * + * @note: + * `ClearType' is Microsoft's implementation of LCD rendering, partly + * protected by patents. + * + * @since: + * 2.3.0 + */ +#define FT_GASP_NO_TABLE -1 +#define FT_GASP_DO_GRIDFIT 0x01 +#define FT_GASP_DO_GRAY 0x02 +#define FT_GASP_SYMMETRIC_SMOOTHING 0x08 +#define FT_GASP_SYMMETRIC_GRIDFIT 0x10 + + + /************************************************************************* + * + * @func: + * FT_Get_Gasp + * + * @description: + * Read the `gasp' table from a TrueType or OpenType font file and + * return the entry corresponding to a given character pixel size. + * + * @input: + * face :: The source face handle. + * ppem :: The vertical character pixel size. + * + * @return: + * Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE is there is no + * `gasp' table in the face. + * + * @since: + * 2.3.0 + */ + FT_EXPORT( FT_Int ) + FT_Get_Gasp( FT_Face face, + FT_UInt ppem ); + +/* */ + +#endif /* _FT_GASP_H_ */ + + +/* END */ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftincrem.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftincrem.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/ftincrem.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -229,11 +229,11 @@ * * @struct: * FT_Incremental_FuncsRec - * + * * @description: * A table of functions for accessing fonts that load data * incrementally. Used in @FT_Incremental_InterfaceRec. - * + * * @fields: * get_glyph_data :: * The function to get glyph data. Must not be null. @@ -243,7 +243,7 @@ * * get_glyph_metrics :: * The function to get glyph metrics. May be null if the font does - * not provide overriding glyph metrics. + * not provide overriding glyph metrics. */ typedef struct FT_Incremental_FuncsRec_ { @@ -293,7 +293,7 @@ { const FT_Incremental_FuncsRec* funcs; FT_Incremental object; - + } FT_Incremental_InterfaceRec; @@ -321,7 +321,7 @@ */ #define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) - /* */ + /* */ FT_END_HEADER Added: haiku/trunk/headers/libs/freetype2/freetype/ftlcdfil.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftlcdfil.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/ftlcdfil.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -0,0 +1,166 @@ +/***************************************************************************/ +/* */ +/* ftlcdfil.h */ +/* */ +/* FreeType API for color filtering of subpixel bitmap glyphs */ +/* (specification). */ +/* */ +/* Copyright 2006, 2007 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FT_LCD_FILTER_H__ +#define __FT_LCD_FILTER_H__ + +#include +#include FT_FREETYPE_H + + +FT_BEGIN_HEADER + + /*************************************************************************** + * + * @section: + * lcd_filtering + * + * @title: + * LCD Filtering + * + * @abstract: + * Reduce color fringes of LCD-optimized bitmaps. + * + * @description: + * The @FT_Library_SetLcdFilter API can be used to specify a low-pass + * filter which is then applied to LCD-optimized bitmaps generated + * through @FT_Render_Glyph. This is useful to reduce color fringes + * which would occur with unfiltered rendering. + * + * Note that no filter is active by default, and that this function is + * *not* implemented in default builds of the library. You need to + * #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file + * in order to activate it. + */ + + + /**************************************************************************** + * + * @func: + * FT_LcdFilter + * + * @description: + * A list of values to identify various types of LCD filters. + * + * @values: + * FT_LCD_FILTER_NONE :: + * Do not perform filtering. When used with subpixel rendering, this + * results in sometimes severe color fringes. + * + * FT_LCD_FILTER_DEFAULT :: + * The default filter reduces color fringes considerably, at the cost + * of a slight blurriness in the output. + * + * FT_LCD_FILTER_LIGHT :: + * The light filter is a variant that produces less blurriness at the + * cost of slightly more color fringes than the default one. It might + * be better, depending on taste, your monitor, or your personal vision. + * + * FT_LCD_FILTER_LEGACY :: + * This filter corresponds to the original libXft color filter. It + * provides high contrast output but can exhibit really bad color + * fringes if glyphs are not extremely well hinted to the pixel grid. + * In other words, it only works well if the TrueType bytecode + * interpreter is enabled *and* high-quality hinted fonts are used. + * + * This filter is only provided for comparison purposes, and might be + * disabled or stay unsupported in the future. + * + * @since: + * 2.3.0 + */ + typedef enum + { + FT_LCD_FILTER_NONE = 0, + FT_LCD_FILTER_DEFAULT = 1, + FT_LCD_FILTER_LIGHT = 2, + FT_LCD_FILTER_LEGACY = 16, + + FT_LCD_FILTER_MAX /* do not remove */ + + } FT_LcdFilter; + + + /************************************************************************** + * + * @func: + * FT_Library_SetLcdFilter + * + * @description: + * This function is used to apply color filtering to LCD decimated + * bitmaps, like the ones used when calling @FT_Render_Glyph with + * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V. + * + * @input: + * library :: + * A handle to the target library instance. + * + * filter :: + * The filter type. + * + * You can use @FT_LCD_FILTER_NONE here to disable this feature, or + * @FT_LCD_FILTER_DEFAULT to use a default filter that should work + * well on most LCD screens. + * + * @return: + * FreeType error code. 0 means success. + * + * @note: + * This feature is always disabled by default. Clients must make an + * explicit call to this function with a `filter' value other than + * @FT_LCD_FILTER_NONE in order to enable it. + * + * Due to *PATENTS* covering subpixel rendering, this function doesn't + * do anything except returning `FT_Err_Unimplemented_Feature' if the + * configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not + * defined in your build of the library, which should correspond to all + * default builds of FreeType. + * + * The filter affects glyph bitmaps rendered through @FT_Render_Glyph, + * @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char. + * + * It does _not_ affect the output of @FT_Outline_Render and + * @FT_Outline_Get_Bitmap. + * + * If this feature is activated, the dimensions of LCD glyph bitmaps are + * either larger or taller than the dimensions of the corresponding + * outline with regards to the pixel grid. For example, for + * @FT_RENDER_MODE_LCD, the filter adds up to 3 pixels to the left, and + * up to 3 pixels to the right. + * + * The bitmap offset values are adjusted correctly, so clients shouldn't + * need to modify their layout and glyph positioning code when enabling + * the filter. + * + * @since: + * 2.3.0 + */ + FT_EXPORT( FT_Error ) + FT_Library_SetLcdFilter( FT_Library library, + FT_LcdFilter filter ); + + /* */ + + +FT_END_HEADER + +#endif /* __FT_LCD_FILTER_H__ */ + + +/* END */ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftotval.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftotval.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/ftotval.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -154,10 +154,10 @@ FT_EXPORT( FT_Error ) FT_OpenType_Validate( FT_Face face, FT_UInt validation_flags, - FT_Bytes *BASE_table, - FT_Bytes *GDEF_table, - FT_Bytes *GPOS_table, - FT_Bytes *GSUB_table, + FT_Bytes *BASE_table, + FT_Bytes *GDEF_table, + FT_Bytes *GPOS_table, + FT_Bytes *GSUB_table, FT_Bytes *JSTF_table ); /* */ Modified: haiku/trunk/headers/libs/freetype2/freetype/ftoutln.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftoutln.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/ftoutln.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -442,13 +442,13 @@ * * @enum: * FT_Orientation - * + * * @description: * A list of values used to describe an outline's contour orientation. * * The TrueType and Postscript specifications use different conventions * to determine whether outline contours should be filled or unfilled. - * + * * @values: * FT_ORIENTATION_TRUETYPE :: * According to the TrueType specification, clockwise contours must @@ -480,7 +480,7 @@ FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE, FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT, FT_ORIENTATION_NONE - + } FT_Orientation; @@ -488,7 +488,7 @@ * * @function: * FT_Outline_Get_Orientation - * + * * @description: * This function analyzes a glyph outline and tries to compute its * fill orientation (see @FT_Orientation). This is done by computing Modified: haiku/trunk/headers/libs/freetype2/freetype/ftwinfnt.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftwinfnt.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/ftwinfnt.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -64,7 +64,7 @@ * * @values: * FT_WinFNT_ID_DEFAULT :: - * This is used for font enumeration and font creation as a + * This is used for font enumeration and font creation as a * `don't care' value. Valid font files don't contain this value. * When querying for information about the character set of the font * that is currently selected into a specified device context, this @@ -95,7 +95,7 @@ * Windows have. It is one of the OEM codepages from * * http://www.microsoft.com/globaldev/reference/cphome.mspx, - * + * * and is used for the `DOS boxes', to support legacy applications. * A German Windows version for example usually uses ANSI codepage * 1252 and OEM codepage 850. @@ -130,10 +130,10 @@ * * FT_WinFNT_ID_CP1253 :: * A superset of Greek ISO 8859-7 (with minor modifications). - * + * * FT_WinFNT_ID_CP1254 :: * A superset of Turkish ISO 8859-9. - * + * * FT_WinFNT_ID_CP1255 :: * A superset of Hebrew ISO 8859-8 (with some modifications). * Modified: haiku/trunk/headers/libs/freetype2/freetype/ftxf86.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/ftxf86.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/ftxf86.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -4,7 +4,7 @@ /* */ /* Support functions for X11. */ /* */ -/* Copyright 2002, 2003, 2004 by */ +/* Copyright 2002, 2003, 2004, 2006 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -31,24 +31,44 @@ FT_BEGIN_HEADER - /* this comment is intentionally disabled for now, to prevent this */ - /* function from appearing in the API Reference. */ - /*@***********************************************************************/ + /*************************************************************************/ /* */ + /*
*/ + /* font_formats */ + /* */ + /* */ + /* Font Formats */ + /* */ + /* <Abstract> */ + /* Getting the font format. */ + /* */ + /* <Description> */ + /* The single function in this section can be used to get the font */ + /* format. Note that this information is not needed normally; */ + /* however, there are special cases (like in PDF devices) where it is */ + /* important to differentiate, inspite of FreeType's uniform API. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ /* <Function> */ - /* FT_Get_X11_Font_Format */ + /* FT_Get_X11_Font_Format */ /* */ /* <Description> */ - /* Return a string describing the format of a given face as an X11 */ - /* FONT_PROPERTY. It should only be used by the FreeType 2 font */ - /* backend of the XFree86 font server. */ + /* Return a string describing the format of a given face, using values */ + /* which can be used as an X11 FONT_PROPERTY. Possible values are */ + /* `TrueType', `Type 1', `BDF', `PCF', `Type 42', `CID Type 1', `CFF', */ + /* `PFR', and `Windows FNT'. */ /* */ /* <Input> */ - /* face :: Input face handle. */ + /* face :: */ + /* Input face handle. */ /* */ /* <Return> */ - /* Font format string. NULL in case of error. */ + /* Font format string. NULL in case of error. */ /* */ FT_EXPORT( const char* ) FT_Get_X11_Font_Format( FT_Face face ); Modified: haiku/trunk/headers/libs/freetype2/freetype/internal/ftcalc.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/internal/ftcalc.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/internal/ftcalc.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -78,7 +78,7 @@ /*************************************************************************/ -#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +#ifdef TT_USE_BYTECODE_INTERPRETER /*************************************************************************/ /* */ @@ -108,9 +108,33 @@ FT_Long b, FT_Long c ); -#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ +#endif /* TT_USE_BYTECODE_INTERPRETER */ + /* + * Return -1, 0, or +1, depending on the orientation of a given corner. + * We use the Cartesian coordinate system, with positive vertical values + * going upwards. The function returns +1 if the corner turns to the + * left, -1 to the right, and 0 for undecidable cases. + */ + FT_BASE( FT_Int ) + ft_corner_orientation( FT_Pos in_x, + FT_Pos in_y, + FT_Pos out_x, + FT_Pos out_y ); + + /* + * Return TRUE if a corner is flat or nearly flat. This is equivalent to + * saying that the angle difference between the `in' and `out' vectors is + * very small. + */ + FT_BASE( FT_Int ) + ft_corner_is_flat( FT_Pos in_x, + FT_Pos in_y, + FT_Pos out_x, + FT_Pos out_y ); + + #define INT_TO_F26DOT6( x ) ( (FT_Long)(x) << 6 ) #define INT_TO_F2DOT14( x ) ( (FT_Long)(x) << 14 ) #define INT_TO_FIXED( x ) ( (FT_Long)(x) << 16 ) Modified: haiku/trunk/headers/libs/freetype2/freetype/internal/ftgloadr.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/internal/ftgloadr.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/internal/ftgloadr.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -69,6 +69,7 @@ { FT_Outline outline; /* outline */ FT_Vector* extra_points; /* extra points table */ + FT_Vector* extra_points2; /* second extra points table */ FT_UInt num_subglyphs; /* number of subglyphs */ FT_SubGlyph subglyphs; /* subglyphs */ Modified: haiku/trunk/headers/libs/freetype2/freetype/internal/ftobjs.h =================================================================== --- haiku/trunk/headers/libs/freetype2/freetype/internal/ftobjs.h 2007-01-25 17:50:58 UTC (rev 19959) +++ haiku/trunk/headers/libs/freetype2/freetype/internal/ftobjs.h 2007-01-25 19:12:34 UTC (rev 19960) @@ -29,6 +29,7 @@ #include <ft2build.h> #include FT_RENDER_H #include FT_SIZES_H +#include FT_LCD_FILTER_H #include FT_INTERNAL_MEMORY_H #include FT_INTERNAL_GLYPH_LOADER_H #include FT_INTERNAL_DRIVER_H @@ -211,6 +212,12 @@ /* this data when first opened. This field exists only if */ /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */ /* */ + /* ignore_unpatented_hinter :: */ + /* This boolean flag instructs the glyph loader to ignore the */ + /* native font hinter, if one is found. This is exclusively used */ + /* in the case when the unpatented hinter is compiled within the */ + /* library. */ + /* */ [... truncated: 16711 lines follow ...] From revol at free.fr Thu Jan 25 21:01:28 2007 From: revol at free.fr (=?windows-1252?q?Fran=E7ois?= Revol) Date: Thu, 25 Jan 2007 21:01:28 +0100 CET Subject: [Haiku-commits] r19925 - haiku/trunk/src/add-ons/media/media-add-ons/usb_webcam [...] In-Reply-To: <20070125182546.13622.3@cs.tu-berlin.de> Message-ID: <3007545293-BeMail@laptop> > > On 2007-01-24 at 09:43:17 [+0100], Fran?ois Revol <revol at free.fr> > > wrote: > > > > mmu_man at BerliOS <mmu_man at mail.berlios.de> wrote: > > > > > Log: > > > > > I *love* Jam :D > > > > > still need to autogenerate some headers... (you still need to > > > > > 'make' > > > > > it first). > > > > > > > > Would it be that unfortunate to just check the headers in? Are > > > > they > > > > hard to maintain? > > > > > > Yes I did, I can always use the makefile to regen them, and I > > > have to > > > update the Jamfile to add addons anyway (where are wildcards ?? > > > :p). > > > Still, what works for the Devices prefs doesn't seem to work > > > here. I > > > probably skipped some obvious stuff. > > > > What do you want to do and what exactly doesn't work? > > OK, I guess I understood what went wrong and fixed it. Thanks, I was told to stay away from sugar & sweets, so I avoid jam as well :D Fran?ois. From mmu_man at mail.berlios.de Fri Jan 26 12:07:08 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Fri, 26 Jan 2007 12:07:08 +0100 Subject: [Haiku-commits] r19961 - haiku/trunk/src/add-ons/kernel/network/stack Message-ID: <200701261107.l0QB78gd030645@sheep.berlios.de> Author: mmu_man Date: 2007-01-26 12:07:08 +0100 (Fri, 26 Jan 2007) New Revision: 19961 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19961&view=rev Modified: haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp Log: For interfaces listed in a domain but without any address we returned {2, AF_UNSPEC}, but we only skipped 1 byte instead of 2... fixed. Modified: haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp 2007-01-25 19:12:34 UTC (rev 19960) +++ haiku/trunk/src/add-ons/kernel/network/stack/domains.cpp 2007-01-26 11:07:08 UTC (rev 19961) @@ -118,7 +118,7 @@ if (interface == NULL) break; - size = IF_NAMESIZE + (interface->address ? interface->address->sa_len : 1); + size = IF_NAMESIZE + (interface->address ? interface->address->sa_len : 2); if (spaceLeft < size) return ENOBUFS; From axeld at mail.berlios.de Fri Jan 26 12:24:20 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 26 Jan 2007 12:24:20 +0100 Subject: [Haiku-commits] r19962 - in haiku/trunk/src/apps/cortex: MediaRoutingView NodeManager RouteApp Message-ID: <200701261124.l0QBOKmq032034@sheep.berlios.de> Author: axeld Date: 2007-01-26 12:24:20 +0100 (Fri, 26 Jan 2007) New Revision: 19962 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19962&view=rev Modified: haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp haiku/trunk/src/apps/cortex/NodeManager/NodeManager.cpp haiku/trunk/src/apps/cortex/RouteApp/ConnectionIO.cpp haiku/trunk/src/apps/cortex/RouteApp/RouteApp.cpp Log: Fixed some warnings, mostly wrong uses of the ASSERT macro. Modified: haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp =================================================================== --- haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp 2007-01-26 11:07:08 UTC (rev 19961) +++ haiku/trunk/src/apps/cortex/MediaRoutingView/MediaRoutingView.cpp 2007-01-26 11:24:20 UTC (rev 19962) @@ -298,9 +298,8 @@ // attach to manager ASSERT(manager); - status_t err = add_observer(this, manager); - ASSERT(err == B_OK); - + add_observer(this, manager); + // add the context-menu shortcuts to the window _addShortcuts(); Modified: haiku/trunk/src/apps/cortex/NodeManager/NodeManager.cpp =================================================================== --- haiku/trunk/src/apps/cortex/NodeManager/NodeManager.cpp 2007-01-26 11:07:08 UTC (rev 19961) +++ haiku/trunk/src/apps/cortex/NodeManager/NodeManager.cpp 2007-01-26 11:24:20 UTC (rev 19962) @@ -408,11 +408,8 @@ Run(); // initialize connection to the media roster - D_ROSTER(( - "# roster->StartWatching(%p)\n", this)); - status_t err = roster->StartWatching( - BMessenger(this)); - ASSERT(err == B_OK); + D_ROSTER(("# roster->StartWatching(%p)\n", this)); + roster->StartWatching(BMessenger(this)); } // -------------------------------------------------------- // Modified: haiku/trunk/src/apps/cortex/RouteApp/ConnectionIO.cpp =================================================================== --- haiku/trunk/src/apps/cortex/RouteApp/ConnectionIO.cpp 2007-01-26 11:07:08 UTC (rev 19961) +++ haiku/trunk/src/apps/cortex/RouteApp/ConnectionIO.cpp 2007-01-26 11:24:20 UTC (rev 19962) @@ -51,7 +51,6 @@ ASSERT(con); ASSERT(manager); ASSERT(context); - status_t err; if(!con->isValid()) { PRINT(( Modified: haiku/trunk/src/apps/cortex/RouteApp/RouteApp.cpp =================================================================== --- haiku/trunk/src/apps/cortex/RouteApp/RouteApp.cpp 2007-01-26 11:07:08 UTC (rev 19961) +++ haiku/trunk/src/apps/cortex/RouteApp/RouteApp.cpp 2007-01-26 11:24:20 UTC (rev 19962) @@ -105,17 +105,13 @@ routeWindow->Show(); } -bool RouteApp::QuitRequested() { +bool +RouteApp::QuitRequested() +{ // [e.moon 20oct99] make sure the main window is dead before quitting - - // store window positions & other settings - app_info ai; - status_t err = GetAppInfo(&ai); - ASSERT(err == B_OK); - BFile appFile(&ai.ref, B_READ_WRITE); - + // store window positions & other settings // write settings file _writeSettings(); From axeld at mail.berlios.de Fri Jan 26 12:35:28 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 26 Jan 2007 12:35:28 +0100 Subject: [Haiku-commits] r19963 - haiku/trunk/src/preferences/print Message-ID: <200701261135.l0QBZSMv015092@sheep.berlios.de> Author: axeld Date: 2007-01-26 12:35:25 +0100 (Fri, 26 Jan 2007) New Revision: 19963 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19963&view=rev Modified: haiku/trunk/src/preferences/print/AddPrinterDialog.cpp Log: * Fixed warnings. * Minor cleanup. Modified: haiku/trunk/src/preferences/print/AddPrinterDialog.cpp =================================================================== --- haiku/trunk/src/preferences/print/AddPrinterDialog.cpp 2007-01-26 11:24:20 UTC (rev 19962) +++ haiku/trunk/src/preferences/print/AddPrinterDialog.cpp 2007-01-26 11:35:25 UTC (rev 19963) @@ -1,38 +1,19 @@ -/*****************************************************************************/ -// Printers Preference Application. -// -// This application and all source files used in its construction, except -// where noted, are licensed under the MIT License, and have been written -// and are: -// -// Copyright (c) 2001-2003 OpenBeOS Project -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -/*****************************************************************************/ +/* + * Copyright 2002-2007, Haiku. + * Distributed under the terms of the MIT License. + * + * Authors: + * Michael Pfeiffer + * Philippe Houdoin + */ + #include "AddPrinterDialog.h" #include "PrinterListView.h" #include "pr_server.h" #include "Globals.h" #include "Messages.h" -// BeOS API #include <Box.h> #include <Button.h> #include <TextControl.h> @@ -45,11 +26,15 @@ #include <Application.h> #include <StorageKit.h> -status_t AddPrinterDialog::Start() { - AddPrinterDialog* dialog = new AddPrinterDialog(); + +status_t +AddPrinterDialog::Start() +{ + new AddPrinterDialog(); return B_OK; } + AddPrinterDialog::AddPrinterDialog() : Inherited(BRect(78.0, 71.0, 400, 300), "Add Printer", B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, B_NOT_RESIZABLE | B_NOT_ZOOMABLE) @@ -60,10 +45,10 @@ } -void AddPrinterDialog::MessageReceived(BMessage* msg) +void +AddPrinterDialog::MessageReceived(BMessage* msg) { - switch(msg->what) - { + switch(msg->what) { case B_OK: { BMessage m(PSRV_MAKE_PRINTER); BMessenger msgr; @@ -138,10 +123,12 @@ } } -void AddPrinterDialog::BuildGUI(int stage) + +void +AddPrinterDialog::BuildGUI(int stage) { BRect r, tr; - float x, y, w, h; + float x, w, h; BButton * ok; BButton * cancel; BTextControl * tc; @@ -329,16 +316,14 @@ B_BEOS_ADDONS_DIRECTORY, B_COMMON_ADDONS_DIRECTORY // B_USER_ADDONS_DIRECTORY same as common directory + // TODO: not in Haiku! }; -#ifdef __INTEL__ -static const char* kExecutableType = "application/x-vnd.Be-elfexecutable"; -#else -static const char* kExecutableType = "application/x-vnd.Be-executable"; -#endif -void AddPrinterDialog::FillMenu(BMenu* menu, const char* path, uint32 what) { - for (int i = 0; i < sizeof(gAddonDirs) / sizeof(directory_which); i ++) { +void +AddPrinterDialog::FillMenu(BMenu* menu, const char* path, uint32 what) +{ + for (uint32 i = 0; i < sizeof(gAddonDirs) / sizeof(directory_which); i ++) { BPath addonPath; if (find_directory(gAddonDirs[i], &addonPath) != B_OK) continue; if (addonPath.Append(path) != B_OK) continue; @@ -346,28 +331,36 @@ if (dir.InitCheck() != B_OK) continue; BEntry entry; while (dir.GetNextEntry(&entry, true) == B_OK) { - if (!entry.IsFile()) continue; + if (!entry.IsFile()) + continue; BNode node(&entry); - if (node.InitCheck() != B_OK) continue; + if (node.InitCheck() != B_OK) + continue; BNodeInfo info(&node); - if (info.InitCheck() != B_OK) continue; + if (info.InitCheck() != B_OK) + continue; - char type[B_MIME_TYPE_LENGTH+1]; + char type[B_MIME_TYPE_LENGTH + 1]; info.GetType(type); - if (strcmp(type, kExecutableType) != 0) continue; + if (strcmp(type, B_APP_MIME_TYPE) != 0) + continue; BPath path; - if (entry.GetPath(&path) != B_OK) continue; + if (entry.GetPath(&path) != B_OK) + continue; bool addMenuItem = true; // some hard coded special cases for transport add-ons if (menu == fTransport) { const char* transport = path.Leaf(); // Network not implemented yet! - if (strcmp(transport, "Network") == 0) continue; + if (strcmp(transport, "Network") == 0) + continue; + addMenuItem = false; + if (strcmp(transport, "Serial Port") == 0) { AddPortSubMenu(menu, transport, "/dev/ports"); } else if (strcmp(transport, "Parallel Port") == 0) { @@ -388,16 +381,22 @@ } } -void AddPrinterDialog::AddPortSubMenu(BMenu* menu, const char* transport, const char* port) { + +void +AddPrinterDialog::AddPortSubMenu(BMenu* menu, const char* transport, const char* port) +{ BEntry entry(port); BDirectory dir(&entry); - if (dir.InitCheck() != B_OK) return; + if (dir.InitCheck() != B_OK) + return; + BMenu* subMenu = NULL; - BPath path; while (dir.GetNextEntry(&entry) == B_OK) { - if (entry.GetPath(&path) != B_OK) continue; - // lazily create sub menu + if (entry.GetPath(&path) != B_OK) + continue; + + // lazily create sub menu if (subMenu == NULL) { subMenu = new BMenu(transport); menu->AddItem(subMenu); @@ -406,7 +405,8 @@ BMenuItem* item = menu->ItemAt(index); if (item) item->SetMessage(new BMessage(MSG_TRANSPORT_SELECTED)); } - // setup menu item for port + + // setup menu item for port BMessage* msg = new BMessage(MSG_TRANSPORT_SELECTED); msg->AddString("name", transport); msg->AddString("path", path.Leaf()); @@ -415,7 +415,10 @@ } } -void AddPrinterDialog::Update() { + +void +AddPrinterDialog::Update() +{ fOk->SetEnabled(fNameText != "" && fPrinterText != "" && (fTransportText != "" || fPrinterText == "Preview")); fTransport->SetEnabled(fPrinterText != "" &&fPrinterText != "Preview"); From axeld at mail.berlios.de Fri Jan 26 13:05:11 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 26 Jan 2007 13:05:11 +0100 Subject: [Haiku-commits] r19964 - haiku/trunk/src/kits/app Message-ID: <200701261205.l0QC5Bmv024741@sheep.berlios.de> Author: axeld Date: 2007-01-26 13:05:10 +0100 (Fri, 26 Jan 2007) New Revision: 19964 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19964&view=rev Modified: haiku/trunk/src/kits/app/AppMisc.cpp Log: Optimized current_team() - it now uses a static variable to hold the team ID. Modified: haiku/trunk/src/kits/app/AppMisc.cpp =================================================================== --- haiku/trunk/src/kits/app/AppMisc.cpp 2007-01-26 11:35:25 UTC (rev 19963) +++ haiku/trunk/src/kits/app/AppMisc.cpp 2007-01-26 12:05:10 UTC (rev 19964) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -7,15 +7,15 @@ */ -#include <string.h> -#include <sys/utsname.h> - #include <AppMisc.h> #include <Entry.h> #include <image.h> #include <OS.h> +#include <string.h> +#include <sys/utsname.h> + namespace BPrivate { // get_app_path @@ -117,10 +117,12 @@ team_id current_team() { - team_id team = -1; - thread_info info; - if (get_thread_info(find_thread(NULL), &info) == B_OK) - team = info.team; + static team_id team = -1; + if (team < 0) { + thread_info info; + if (get_thread_info(find_thread(NULL), &info) == B_OK) + team = info.team; + } return team; } From axeld at mail.berlios.de Fri Jan 26 13:11:33 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 26 Jan 2007 13:11:33 +0100 Subject: [Haiku-commits] r19965 - in haiku/trunk: headers/private/app src/kits/app Message-ID: <200701261211.l0QCBXXg030554@sheep.berlios.de> Author: axeld Date: 2007-01-26 13:11:33 +0100 (Fri, 26 Jan 2007) New Revision: 19965 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19965&view=rev Modified: haiku/trunk/headers/private/app/LooperList.h haiku/trunk/src/kits/app/LooperList.cpp Log: Got rid of the looper ID stuff - it seems nowhere to be used. Modified: haiku/trunk/headers/private/app/LooperList.h =================================================================== --- haiku/trunk/headers/private/app/LooperList.h 2007-01-26 12:05:10 UTC (rev 19964) +++ haiku/trunk/headers/private/app/LooperList.h 2007-01-26 12:11:33 UTC (rev 19965) @@ -1,54 +1,26 @@ -//------------------------------------------------------------------------------ -// Copyright (c) 2001-2002, OpenBeOS -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. -// -// File Name: LooperList.h -// Author(s): Erik Jaesler (erik at cgsoftware.com) -// Description: Maintains a global list of all loopers in a given team. -//------------------------------------------------------------------------------ - +/* + * Copyright 2001-2007, Haiku. + * Distributed under the terms of the MIT License. + * + * Authors: + * Erik Jaesler (erik at cgsoftware.com) + */ #ifndef LOOPERLIST_H #define LOOPERLIST_H -// Standard Includes ----------------------------------------------------------- -#include <vector> -// System Includes ------------------------------------------------------------- #include <Locker.h> #include <OS.h> #include <SupportDefs.h> -// Project Includes ------------------------------------------------------------ +#include <vector> -// Local Includes -------------------------------------------------------------- - -// Local Defines --------------------------------------------------------------- - -// Globals --------------------------------------------------------------------- - class BLooper; + namespace BPrivate { -class BLooperList -{ +class BLooperList { public: BLooperList(); @@ -66,39 +38,33 @@ BLooper* LooperForName(const char* name); BLooper* LooperForPort(port_id port); - struct LooperData - { + private: + struct LooperData { LooperData(); - LooperData(BLooper* loop, uint32 i); + LooperData(BLooper* looper); LooperData(const LooperData& rhs); LooperData& operator=(const LooperData& rhs); BLooper* looper; - uint32 id; }; - private: - static bool EmptySlotPred(LooperData& Data); - struct FindLooperPred - { + static bool EmptySlotPred(LooperData& Data); + struct FindLooperPred { FindLooperPred(const BLooper* loop) : looper(loop) {;} bool operator()(LooperData& Data); const BLooper* looper; }; - struct FindThreadPred - { + struct FindThreadPred { FindThreadPred(thread_id tid) : thread(tid) {;} bool operator()(LooperData& Data); thread_id thread; }; - struct FindNamePred - { + struct FindNamePred { FindNamePred(const char* n) : name(n) {;} bool operator()(LooperData& Data); const char* name; }; - struct FindPortPred - { + struct FindPortPred { FindPortPred(port_id pid) : port(pid) {;} bool operator()(LooperData& Data); port_id port; @@ -107,20 +73,11 @@ void AssertLocked(); BLocker fLock; - uint32 fLooperID; std::vector<LooperData> fData; }; -extern _IMPEXP_BE BLooperList gLooperList; -} +extern BLooperList gLooperList; +} // namespace BPrivate -#endif //LOOPERLIST_H - -/* - * $Log $ - * - * $Id $ - * - */ - +#endif // LOOPERLIST_H Modified: haiku/trunk/src/kits/app/LooperList.cpp =================================================================== --- haiku/trunk/src/kits/app/LooperList.cpp 2007-01-26 12:05:10 UTC (rev 19964) +++ haiku/trunk/src/kits/app/LooperList.cpp 2007-01-26 12:11:33 UTC (rev 19965) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2005, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: @@ -28,8 +28,7 @@ BLooperList::BLooperList() : - fLock("BLooperList lock"), - fLooperID(0) + fLock("BLooperList lock") { } @@ -63,13 +62,10 @@ if (!IsLooperValid(looper)) { LooperDataIterator i = find_if(fData.begin(), fData.end(), EmptySlotPred); if (i == fData.end()) { - fData.push_back(LooperData(looper, ++fLooperID)); - looper->fLooperID = fLooperID; + fData.push_back(LooperData(looper)); looper->Lock(); } else { i->looper = looper; - i->id = ++fLooperID; - looper->fLooperID = fLooperID; looper->Lock(); } } @@ -201,13 +197,13 @@ BLooperList::LooperData::LooperData() - : looper(NULL), id(0) + : looper(NULL) { } -BLooperList::LooperData::LooperData(BLooper* loop, uint32 i) - : looper(loop), id(i) +BLooperList::LooperData::LooperData(BLooper* looper) + : looper(looper) { } @@ -221,10 +217,8 @@ BLooperList::LooperData& BLooperList::LooperData::operator=(const LooperData& other) { - if (this != &other) { + if (this != &other) looper = other.looper; - id = other.id; - } return *this; } From axeld at mail.berlios.de Fri Jan 26 13:42:19 2007 From: axeld at mail.berlios.de (axeld at BerliOS) Date: Fri, 26 Jan 2007 13:42:19 +0100 Subject: [Haiku-commits] r19966 - in haiku/trunk: headers/os/app src/kits/app src/kits/interface Message-ID: <200701261242.l0QCgJrr016800@sheep.berlios.de> Author: axeld Date: 2007-01-26 13:42:18 +0100 (Fri, 26 Jan 2007) New Revision: 19966 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19966&view=rev Modified: haiku/trunk/headers/os/app/Looper.h haiku/trunk/src/kits/app/Application.cpp haiku/trunk/src/kits/app/Looper.cpp haiku/trunk/src/kits/interface/Window.cpp Log: Cleanup: * Got rid of unused BLooper members * renamed fTaskID to fThread * Removed private and deprecated AddLooper()/RemoveLooper()/... stuff; BLooper is now directly calling BLooperList methods. * Got rid of extensive and useless comments * Made a few TODOs more clear * Merged InitData() and InitData(...) to _InitData(...) * BLooper::Team() now uses BPrivate::current_team(), sTeamID is gone now. Modified: haiku/trunk/headers/os/app/Looper.h =================================================================== --- haiku/trunk/headers/os/app/Looper.h 2007-01-26 12:11:33 UTC (rev 19965) +++ haiku/trunk/headers/os/app/Looper.h 2007-01-26 12:42:18 UTC (rev 19966) @@ -1,5 +1,5 @@ /* - * Copyright 2001-2006, Haiku Inc. All Rights Reserved. + * Copyright 2001-2007, Haiku Inc. All Rights Reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -41,9 +41,9 @@ status_t PostMessage(uint32 command); status_t PostMessage(BMessage* message); status_t PostMessage(uint32 command, BHandler* handler, - BHandler* reply_to = NULL); + BHandler* replyTo = NULL); status_t PostMessage(BMessage* message, BHandler* handler, - BHandler* reply_to = NULL); + BHandler* replyTo = NULL); virtual void DispatchMessage(BMessage* message, BHandler* handler); virtual void MessageReceived(BMessage* msg); @@ -72,7 +72,7 @@ status_t LockWithTimeout(bigtime_t timeout); thread_id Thread() const; team_id Team() const; - static BLooper* LooperForThread(thread_id tid); + static BLooper* LooperForThread(thread_id thread); // Loop debugging thread_id LockingThread() const; @@ -92,7 +92,7 @@ virtual void SetCommonFilterList(BList* filters); BList* CommonFilterList() const; - // Private or reserved --------------------------------------------------------- + // Private or reserved virtual status_t Perform(perform_code d, void* arg); protected: @@ -108,8 +108,6 @@ friend class BHandler; friend class BPrivate::BLooperList; friend port_id _get_looper_port_(const BLooper* ); - friend status_t _safe_get_server_token_(const BLooper* , int32* ); - friend team_id _find_cur_team_id_(); virtual void _ReservedLooper1(); virtual void _ReservedLooper2(); @@ -132,8 +130,7 @@ static status_t _LockComplete(BLooper* loop, int32 old, thread_id this_tid, sem_id sem, bigtime_t timeout); - void InitData(); - void InitData(const char* name, int32 prio, int32 capacity); + void _InitData(const char* name, int32 priority, int32 capacity); void AddMessage(BMessage* msg); void _AddMessagePriv(BMessage* msg); static status_t _task0_(void* arg); @@ -153,38 +150,21 @@ BHandler* resolve_specifier(BHandler* target, BMessage* msg); void UnlockFully(); - static uint32 sLooperID; - static team_id sTeamID; - -// DEPRECATED - static void AddLooper(BLooper* l); - static bool IsLooperValid(const BLooper* l); - static void RemoveLooper(BLooper* l); - static void GetLooperList(BList* list); - static BLooper* LooperForName(const char* name); - static BLooper* LooperForPort(port_id port); - - uint32 fLooperID; BMessageQueue* fQueue; BMessage* fLastMessage; port_id fMsgPort; - long fAtomicCount; + int32 fAtomicCount; sem_id fLockSem; - long fOwnerCount; + int32 fOwnerCount; thread_id fOwner; - thread_id fTaskID; - uint32 _unused1; + thread_id fThread; int32 fInitPriority; BHandler* fPreferred; BList fHandlers; BList* fCommonFilters; bool fTerminating; bool fRunCalled; - thread_id fCachedPid; - size_t fCachedStack; - void* fMsgBuffer; - size_t fMsgBufferSize; - uint32 _reserved[6]; + uint32 _reserved[12]; }; #endif // _LOOPER_H Modified: haiku/trunk/src/kits/app/Application.cpp =================================================================== --- haiku/trunk/src/kits/app/Application.cpp 2007-01-26 12:11:33 UTC (rev 19965) +++ haiku/trunk/src/kits/app/Application.cpp 2007-01-26 12:42:18 UTC (rev 19966) @@ -1,10 +1,11 @@ /* - * Copyright 2001-2006, Haiku. + * Copyright 2001-2007, Haiku. * Distributed under the terms of the MIT License. * * Authors: * Erik Jaesler (erik at cgsoftware.com) * Jerome Duval + * Axel D?rfler, axeld at pinc-software.de */ @@ -483,17 +484,13 @@ if (fRunCalled) debugger("BApplication::Run was already called. Can only be called once."); - // Note: We need a local variable too (for the return value), since - // fTaskID is cleared by Quit(). -// ToDo: actually, it's not clobbered there?! - thread_id thread = fTaskID = find_thread(NULL); - + fThread = find_thread(NULL); fRunCalled = true; task_looper(); delete fPulseRunner; - return thread; + return fThread; } @@ -514,7 +511,7 @@ // Delete the object, if not running only. if (!fRunCalled) { delete this; - } else if (find_thread(NULL) != fTaskID) { + } else if (find_thread(NULL) != fThread) { // ToDo: why shouldn't we set fTerminating to true directly in this case? // We are not the looper thread. // We push a _QUIT_ into the queue. Modified: haiku/trunk/src/kits/app/Looper.cpp =================================================================== --- haiku/trunk/src/kits/app/Looper.cpp 2007-01-26 12:11:33 UTC (rev 19965) +++ haiku/trunk/src/kits/app/Looper.cpp 2007-01-26 12:42:18 UTC (rev 19966) @@ -11,14 +11,24 @@ /*! BLooper class spawns a thread that runs a message loop. */ -/** - @note Although I'm implementing "by the book" for now, I would like to - refactor sLooperList and all of the functions that operate on it - into their own class in the BPrivate namespace. +#include <AppMisc.h> +#include <LooperList.h> +#include <MessagePrivate.h> +#include <ObjectLocker.h> +#include <TokenSpace.h> - Also considering adding the thread priority when archiving. - */ +#include <Autolock.h> +#include <Looper.h> +#include <Message.h> +#include <MessageFilter.h> +#include <MessageQueue.h> +#include <Messenger.h> +#include <PropertyInfo.h> +#include <new> +#include <stdio.h> + + // debugging //#define DBG(x) x #define DBG(x) ; @@ -35,22 +45,7 @@ }) */ -#include <stdio.h> -#include <Autolock.h> -#include <Looper.h> -#include <Message.h> -#include <MessageFilter.h> -#include <MessageQueue.h> -#include <Messenger.h> -#include <PropertyInfo.h> - -#include <LooperList.h> -#include <MessagePrivate.h> -#include <ObjectLocker.h> -#include <TokenSpace.h> - - #define FILTER_LIST_BLOCK_SIZE 5 #define DATA_BLOCK_SIZE 5 @@ -62,9 +57,6 @@ port_id _get_looper_port_(const BLooper* looper); -uint32 BLooper::sLooperID = (uint32)B_ERROR; -team_id BLooper::sTeamID = (team_id)B_ERROR; - enum { BLOOPER_PROCESS_INTERNALLY = 0, BLOOPER_HANDLER_BY_INDEX @@ -113,7 +105,7 @@ BLooper::BLooper(const char* name, int32 priority, int32 port_capacity) : BHandler(name) { - InitData(name, priority, port_capacity); + _InitData(name, priority, port_capacity); } @@ -136,11 +128,12 @@ if (fMsgPort >= 0) close_port(fMsgPort); - BMessage *msg; // Clear the queue so our call to IsMessageWaiting() below doesn't give // us bogus info - while ((msg = fQueue->NextMessage()) != NULL) { - delete msg; // msg will automagically post generic reply + BMessage *message; + while ((message = fQueue->NextMessage()) != NULL) { + delete message; + // msg will automagically post generic reply } do { @@ -166,7 +159,7 @@ } Unlock(); - RemoveLooper(this); + gLooperList.RemoveLooper(this); delete_sem(fLockSem); } @@ -179,7 +172,7 @@ || portCapacity < 0) portCapacity = B_LOOPER_PORT_DEFAULT_CAPACITY; - InitData(Name(), B_NORMAL_PRIORITY, portCapacity); + _InitData(Name(), B_NORMAL_PRIORITY, portCapacity); } @@ -205,6 +198,8 @@ if (status == B_OK) status = data->AddInt32("_port_cap", info.capacity); + // TODO: what about the thread priority? + return status; } @@ -245,18 +240,7 @@ BLooper::DispatchMessage(BMessage *message, BHandler *handler) { PRINT(("BLooper::DispatchMessage(%.4s)\n", (char*)&message->what)); - /** @note - Initially, DispatchMessage() was locking the looper, calling the - filtering API, determining whether to use fPreferred or not, and - deleting the message. A look at the BeBook, however, reveals that - all this function does is handle its own B_QUIT_REQUESTED messages - and pass everything else to handler->MessageReceived(). Clearly the - rest must be happening in task_looper(). This makes a lot of sense - because otherwise every derived class would have to figure out when - to use fPreferred, handle the locking and filtering and delete the - message. Even if the BeBook didn't say as much, it would make total - sense to hoist that functionality out of here and into task_looper(). - */ + switch (message->what) { case _QUIT_: // Can't call Quit() to do this, because of the slight chance @@ -286,10 +270,7 @@ void BLooper::MessageReceived(BMessage *msg) { - // TODO: verify - // The BeBook says this "simply calls the inherited function. ...the BLooper - // implementation does nothing of importance." Which is not the same as - // saying it does nothing. Investigate. + // TODO: implement scripting support BHandler::MessageReceived(msg); } @@ -325,17 +306,6 @@ if (!fQueue->IsEmpty()) return true; -/** - @note: What we're doing here differs slightly from the R5 implementation. - It appears that they probably return count != 0, which gives an - incorrect true result when port_buffer_size_etc() would block -- - which indicates that the port's buffer is empty, so we should return - false. Since we don't actually care about what the error is, we - just return count > 0. This has some interesting consequences in - that we will correctly return 'false' if the port is empty - (B_WOULD_BLOCK), whereas R5 will return true. We call that a bug - where I come from. ;) - */ int32 count; do { count = port_buffer_size_etc(fMsgPort, B_RELATIVE_TIMEOUT, 0); @@ -436,12 +406,12 @@ if (fRunCalled) { // Not allowed to call Run() more than once debugger("can't call BLooper::Run twice!"); - return fTaskID; + return fThread; } - fTaskID = spawn_thread(_task0_, Name(), fInitPriority, this); - if (fTaskID < B_OK) - return fTaskID; + fThread = spawn_thread(_task0_, Name(), fInitPriority, this); + if (fThread < B_OK) + return fThread; if (fMsgPort < B_OK) return fMsgPort; @@ -449,11 +419,11 @@ fRunCalled = true; Unlock(); - status_t err = resume_thread(fTaskID); + status_t err = resume_thread(fThread); if (err < B_OK) return err; - return fTaskID; + return fThread; } @@ -479,7 +449,7 @@ PRINT((" Run() has not been called yet\n")); fTerminating = true; delete this; - } else if (find_thread(NULL) == fTaskID) { + } else if (find_thread(NULL) == fThread) { PRINT((" We are the looper thread\n")); fTerminating = true; delete this; @@ -569,16 +539,7 @@ bool BLooper::IsLocked() const { - // We have to lock the list for the call to IsLooperValid(). Has the side - // effect of not letting the looper get deleted while we're here. - BObjectLocker<BLooperList> ListLock(gLooperList); - - if (!ListLock.IsLocked()) { - // If we can't lock the list, our semaphore is probably toast - return false; - } - - if (!IsLooperValid(this)) { + if (!gLooperList.IsLooperValid(this)) { // The looper is gone, so of course it's not locked return false; } @@ -598,25 +559,21 @@ thread_id BLooper::Thread() const { - return fTaskID; + return fThread; } team_id BLooper::Team() const { - return sTeamID; + return BPrivate::current_team(); } BLooper* -BLooper::LooperForThread(thread_id tid) +BLooper::LooperForThread(thread_id thread) { - BObjectLocker<BLooperList> ListLock(gLooperList); - if (ListLock.IsLocked()) - return gLooperList.LooperForThread(tid); - - return NULL; + return gLooperList.LooperForThread(thread); } @@ -856,7 +813,7 @@ { // This must be a legacy constructor fMsgPort = port; - InitData(name, priority, B_LOOPER_PORT_DEFAULT_CAPACITY); + _InitData(name, priority, B_LOOPER_PORT_DEFAULT_CAPACITY); } @@ -868,7 +825,7 @@ if (!listLocker.IsLocked()) return B_ERROR; - if (!IsLooperValid(this)) + if (!gLooperList.IsLooperValid(this)) return B_BAD_VALUE; // Does handler belong to this looper? @@ -884,120 +841,66 @@ } +/*! + Locks a looper either by port or using a direct pointer to the looper. + + \param looper looper to lock, if not NULL + \param port port to identify the looper in case \a looper is NULL + \param timeout timeout for acquiring the lock +*/ status_t -BLooper::_Lock(BLooper* loop, port_id port, bigtime_t timeout) +BLooper::_Lock(BLooper* looper, port_id port, bigtime_t timeout) { -PRINT(("BLooper::_Lock(%p, %lx)\n", loop, port)); -/** - @note The assumption I'm under here is that since we can get the port of - the BLooper directly from the BLooper itself, the port parameter is - for identifying BLoopers by port_id when a pointer to the BLooper in - question is not available. So this function has two modes: - o When loop != NULL, use it directly - o When loop == NULL and port is valid, use the port_id to get - the looper - I scoured the docs to find out what constitutes a valid port_id to - no avail. Since create_port uses the standard error values in its - returned port_id, I'll assume that anything less than zero is a safe - bet as an *invalid* port_id. I'm guessing that, like thread and - semaphore ids, anything >= zero is valid. So, the short version of - this reads: if you don't want to find by port_id, make port = -1. + PRINT(("BLooper::_Lock(%p, %lx)\n", looper, port)); - Another assumption I'm making is that Lock() and LockWithTimeout() - are covers for this function. If it turns out that we don't really - need this function, I may refactor this code into LockWithTimeout() - and have Lock() call it instead. This function could then be - removed. - */ - // Check params (loop, port) - if (!loop && port < 0) - { -PRINT(("BLooper::_Lock() done 1\n")); + if (looper == NULL && port < 0) { + PRINT(("BLooper::_Lock() done 1\n")); return B_BAD_VALUE; } - // forward declared so I can use BAutolock on sLooperListLock - thread_id curThread; + thread_id currentThread = find_thread(NULL); + int32 oldCount; sem_id sem; -/** - @note We lock the looper list at the start of the lock operation to - prevent the looper getting removed from the list while we're - doing list operations. Also ensures that the looper doesn't - get deleted here (since ~BLooper() has to lock the list as - well to remove itself). - */ - int32 oldCount; { BObjectLocker<BLooperList> ListLock(gLooperList); if (!ListLock.IsLocked()) - { - // If we can't lock, the semaphore is probably - // gone, which leaves us in no-man's land -PRINT(("BLooper::_Lock() done 2\n")); return B_BAD_VALUE; - } - - // Look up looper by port_id, if necessary - if (!loop) - { - loop = LooperForPort(port); - if (!loop) - { -PRINT(("BLooper::_Lock() done 3\n")); + + // Look up looper by port_id, if necessary + if (looper == NULL) { + looper = gLooperList.LooperForPort(port); + if (looper == NULL) { + PRINT(("BLooper::_Lock() done 3\n")); return B_BAD_VALUE; } - } - else - { + } else if (!gLooperList.IsLooperValid(looper)) { // Check looper validity - if (!IsLooperValid(loop)) - { -PRINT(("BLooper::_Lock() done 4\n")); - return B_BAD_VALUE; - } + PRINT(("BLooper::_Lock() done 4\n")); + return B_BAD_VALUE; } - - // Is the looper trying to lock itself? - // Check for nested lock attempt - curThread = find_thread(NULL); - if (curThread == loop->fOwner) - { - // Bump fOwnerCount - ++loop->fOwnerCount; -PRINT(("BLooper::_Lock() done 5: fOwnerCount: %ld\n", loop->fOwnerCount)); + + // Check for nested lock attempt + if (currentThread == looper->fOwner) { + ++looper->fOwnerCount; + PRINT(("BLooper::_Lock() done 5: fOwnerCount: %ld\n", loop->fOwnerCount)); return B_OK; } - - // Something external to the looper is attempting to lock - // Cache the semaphore - sem = loop->fLockSem; - - // Validate the semaphore - if (sem < 0) - { -PRINT(("BLooper::_Lock() done 6\n")); + + // Cache the semaphore, so that we can safely access it after having + // unlocked the looper list + sem = looper->fLockSem; + if (sem < 0) { + PRINT(("BLooper::_Lock() done 6\n")); return B_BAD_VALUE; } - - // Bump the requested lock count (using fAtomicCount for this) - oldCount = atomic_add(&loop->fAtomicCount, 1); - // sLooperListLock automatically released here + // Bump the requested lock count (using fAtomicCount for this) + oldCount = atomic_add(&looper->fAtomicCount, 1); } -/** - @note We have to operate with the looper list unlocked during semaphore - acquisition so that the rest of the application doesn't have to - wait for this lock to happen. This is why we cached fLockSem - earlier -- with the list unlocked, the looper might get deleted - right out from under us. This is also why we use a raw semaphore - instead of the easier-to-deal-with BLocker; you can't cache a - BLocker. - */ - // acquire the lock for real - return _LockComplete(loop, oldCount, curThread, sem, timeout); + return _LockComplete(looper, oldCount, currentThread, sem, timeout); } @@ -1009,25 +912,24 @@ #if DEBUG < 1 if (oldCount > 0) { #endif - do { + do { err = acquire_sem_etc(sem, 1, B_RELATIVE_TIMEOUT, timeout); } while (err == B_INTERRUPTED); #if DEBUG < 1 } -#endif +#endif if (err == B_OK) { - // Assign current thread to fOwner looper->fOwner = thread; - // Reset fOwnerCount to 1 looper->fOwnerCount = 1; } -PRINT(("BLooper::_LockComplete() done: %lx\n", err)); + + PRINT(("BLooper::_LockComplete() done: %lx\n", err)); return err; } void -BLooper::InitData() +BLooper::_InitData(const char *name, int32 priority, int32 portCapacity) { fOwner = B_ERROR; fRunCalled = false; @@ -1035,24 +937,11 @@ fCommonFilters = NULL; fLastMessage = NULL; fPreferred = NULL; - fTaskID = B_ERROR; + fThread = B_ERROR; fTerminating = false; fMsgPort = -1; fAtomicCount = 0; - if (sTeamID == -1) { - thread_info info; - get_thread_info(find_thread(NULL), &info); - sTeamID = info.team; - } -} - - -void -BLooper::InitData(const char *name, int32 priority, int32 portCapacity) -{ - InitData(); - if (name == NULL) name = "anonymous looper"; @@ -1069,8 +958,7 @@ fInitPriority = priority; - BObjectLocker<BLooperList> ListLock(gLooperList); - AddLooper(this); + gLooperList.AddLooper(this); AddHandler(this); } @@ -1325,7 +1213,7 @@ || (msg->FindBool("_shutdown_", &shutdown) == B_OK && shutdown)) { BMessage replyMsg(B_REPLY); replyMsg.AddBool("result", isQuitting); - replyMsg.AddInt32("thread", fTaskID); + replyMsg.AddInt32("thread", fThread); msg->SendReply(&replyMsg); } @@ -1515,61 +1403,6 @@ } -void -BLooper::AddLooper(BLooper *looper) -{ - if (gLooperList.IsLocked()) - gLooperList.AddLooper(looper); -} - - -bool -BLooper::IsLooperValid(const BLooper *looper) -{ - if (gLooperList.IsLocked()) - return gLooperList.IsLooperValid(looper); - - return false; -} - - -void -BLooper::RemoveLooper(BLooper *looper) -{ - if (gLooperList.IsLocked()) - gLooperList.RemoveLooper(looper); -} - - -void -BLooper::GetLooperList(BList* list) -{ - BObjectLocker<BLooperList> ListLock(gLooperList); - if (ListLock.IsLocked()) - gLooperList.GetLooperList(list); -} - - -BLooper * -BLooper::LooperForName(const char* name) -{ - if (gLooperList.IsLocked()) - return gLooperList.LooperForName(name); - - return NULL; -} - - -BLooper * -BLooper::LooperForPort(port_id port) -{ - if (gLooperList.IsLocked()) - return gLooperList.LooperForPort(port); - - return NULL; -} - - // #pragma mark - Modified: haiku/trunk/src/kits/interface/Window.cpp =================================================================== --- haiku/trunk/src/kits/interface/Window.cpp 2007-01-26 12:11:33 UTC (rev 19965) +++ haiku/trunk/src/kits/interface/Window.cpp 2007-01-26 12:42:18 UTC (rev 19966) @@ -1066,7 +1066,7 @@ case _UPDATE_: { -//bigtime_t now = system_time(); + //bigtime_t now = system_time(); STRACE(("info:BWindow handling _UPDATE_.\n")); BRect updateRect; @@ -1088,14 +1088,14 @@ if (origin != fFrame.LeftTop()) { // TODO: remove code duplicatation with // B_WINDOW_MOVED case... -//printf("window position was not up to date\n"); + //printf("window position was not up to date\n"); fFrame.OffsetTo(origin); FrameMoved(origin); } if (width != fFrame.Width() || height != fFrame.Height()) { // TODO: remove code duplicatation with // B_WINDOW_RESIZED case... -//printf("window size was not up to date\n"); + //printf("window size was not up to date\n"); fFrame.right = fFrame.left + width; fFrame.bottom = fFrame.top + height; @@ -1136,7 +1136,7 @@ fLink->Flush(); fInTransaction = false; -//printf("BWindow(%s) - UPDATE took %lld usecs\n", Title(), system_time() - now); + //printf("BWindow(%s) - UPDATE took %lld usecs\n", Title(), system_time() - now); break; } @@ -2194,7 +2194,7 @@ if (fLink->SenderPort() < B_OK) { // We don't have valid app_server connection; there is no point // in starting our looper - fTaskID = B_ERROR; + fThread = B_ERROR; return; } else Run(); @@ -2517,19 +2517,12 @@ if (IsLocked()) debugger("window must not be locked!"); - // loop: As long as we are not terminating. while (!fTerminating) { - // TODO: timeout determination algo - // Read from message port (how do we determine what the timeout is?) + // Did we get a message? BMessage* msg = MessageFromPort(); + if (msg) + _AddMessagePriv(msg); - // Did we get a message? - if (msg) { - // Add to queue - fQueue->AddMessage(msg); - } else - continue; - // Get message count from port int32 msgCount = port_count(fMsgPort); for (int32 i = 0; i < msgCount; ++i) { @@ -2538,11 +2531,9 @@ msg = MessageFromPort(0); // Add messages to queue if (msg) - fQueue->AddMessage(msg); + _AddMessagePriv(msg); } - // loop: As long as there are messages in the queue and the port is - // empty... and we are not terminating, of course. bool dispatchNextMessage = true; while (!fTerminating && dispatchNextMessage) { // Get next message from queue (assign to fLastMessage) From mmu_man at mail.berlios.de Fri Jan 26 14:33:53 2007 From: mmu_man at mail.berlios.de (mmu_man at BerliOS) Date: Fri, 26 Jan 2007 14:33:53 +0100 Subject: [Haiku-commits] r19967 - haiku/trunk/src/add-ons/kernel/file_systems/nfs Message-ID: <200701261333.l0QDXrPS023435@sheep.berlios.de> Author: mmu_man Date: 2007-01-26 14:33:53 +0100 (Fri, 26 Jan 2007) New Revision: 19967 ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=19967&view=rev Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/RPCPendingCalls.c haiku/trunk/src/add-ons/kernel/file_systems/nfs/ksocket.h haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.c haiku/trunk/src/add-ons/kernel/file_systems/nfs/nfs_add_on.h Log: Fix some warnings (unused args...). Only bad protos left. Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/RPCPendingCalls.c =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/RPCPendingCalls.c 2007-01-26 12:42:18 UTC (rev 19966) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/RPCPendingCalls.c 2007-01-26 13:33:53 UTC (rev 19967) @@ -81,8 +81,8 @@ { if (current->xid==xid) { - if ((current->addr.sin_addr.s_addr==addr->sin_addr.s_addr)&& - (current->addr.sin_port==addr->sin_port) || conf_no_check_ip_xid) + if (((current->addr.sin_addr.s_addr==addr->sin_addr.s_addr)&& + (current->addr.sin_port==addr->sin_port)) || conf_no_check_ip_xid) { if (last) last->next=current->next; @@ -140,7 +140,7 @@ if (pool->fPoolCount==0) { - sem_id sem=create_sem (0,"pending_call"); + sem=create_sem (0,"pending_call"); while (release_sem(pool->fPoolSem)==B_INTERRUPTED) { Modified: haiku/trunk/src/add-ons/kernel/file_systems/nfs/ksocket.h =================================================================== --- haiku/trunk/src/add-ons/kernel/file_systems/nfs/ksocket.h 2007-01-26 12:42:18 UTC (rev 19966) +++ haiku/trunk/src/add-ons/kernel/file_systems/nfs/ksocket.h 2007-01-26 13:33:53 UTC (rev 19967) @@