Commit graph

264 commits

Author SHA1 Message Date
Igor Burago
4cd06ff66c libregexp: allow up to 128 character classes in one regexp 2023-03-31 08:16:11 -04:00
camsn0w
005ee081d5 Added a paren to fix a warning in u.h 2022-07-26 18:27:34 -04:00
Ben Huntsman
385a6d5877 lib9p: Remove postmountsrv (#505) 2021-08-30 21:03:41 -04:00
Russ Cox
1857120806 libthread: simplify
Now that everything uses pthreads and pthreadperthread,
can delete various conditionals, all the custom context code,
and so on. Also update documents.

Fixes #355.
2020-12-30 07:53:28 -05:00
Russ Cox
b3a20a96eb libthread: add threadmaybackground
Programs that want to background themselves now need
to define threadmaybackground returning 1.
This avoids a confusing (to people and debuggers)
extra parent process for all the threaded programs
that will never want to background themselves.
2020-12-30 00:12:14 -05:00
Russ Cox
951446a774 draw: use int for Cacheinfo x field
With very large fonts (72pt or so) I see bad cache glyphs,
and this fixes it. Not entirely sure exactly which code
is overflowing, but something is.
2020-07-18 19:51:24 -04:00
Russ Cox
a6ad39aaaa libdraw: handle larger number of subfonts 2020-05-29 20:58:37 -04:00
Russ Cox
d25d0ca1a3 devdraw, libdraw: handle keyboard runes > U+FFFF
Runes in Plan 9 were limited to the 16-bit BMP when I drew up
the RPC protocol between graphical programs and devdraw
a long time ago. Now that they can be 32-bit, use a 32-bit wire
encoding too. A new message number to avoid problems with
other clients (like 9fans.net/go).

Add keyboard shortcut alt : , for U+1F602, face with tears of joy,
to test that it all works.
2020-05-18 23:45:03 -04:00
Russ Cox
b4cc38f943 build: drop _XOPEN_SOURCE in u.h on AIX 2020-05-18 22:58:09 -04:00
Ben Huntsman
7a371bf936 lib9: use __builtin_return_address on IBM XL/C 2020-05-18 22:36:17 -04:00
Russ Cox
8cb7308f3a lib9: use opendir/readdir to read directories
getdirentries(2) has been deprecated on macOS since 10.5 (ten releases ago).
Using it requires disabling 64-bit inodes, but that in turn makes binaries
incompatible with some dynamic libraries, most notably ASAN.

At some point getdirentries(2) will actually be removed.

For both these reasons, switch to opendir/readdir.
A little clunky since we have to keep the DIR* hidden away
to preserve the int fd interfaces, but it lets us remove a bunch
of OS-specific code too.
2020-05-17 20:15:41 -04:00
Russ Cox
6fd4e901ce lib9: add close
More preparation for opendir.
2020-05-17 20:15:41 -04:00
Ben Huntsman
5802b09e9d all: fix #includes for AIX, add a few AIX "implementation" files 2020-05-07 20:36:03 -04:00
Ben Huntsman
4982d4ebc3 all: update build scripts to fix AIX XL/C compatibility 2020-05-07 20:36:03 -04:00
Russ Cox
cb8f735786 all: remove Linux 2.4 vs 2.6 detection
Linux 2.4 is dead.
(The libthread code hasn't worked for Linux 2.4 for a long time.)
2020-01-19 23:04:58 -05:00
Russ Cox
8dcb18f71b libthread: rm FreeBSD 4 code
Pretty sure FreeBSD 4 is gone now. :-)
2020-01-19 21:26:23 -05:00
Russ Cox
dbf57689c4 libdraw: connect to devdraw via $wsysid when set 2020-01-13 16:46:14 -05:00
Russ Cox
88ed92aa40 devdraw: move Client into devdraw.h and move global state in 2020-01-13 16:46:14 -05:00
Russ Cox
e0c4896ed4 lib9: make a p9frexp function wrapping system frexp
Under certain conditions it looks like frexp gets #defined
to something else on macOS during system headers,
which then breaks the declaration in libc.h.
2020-01-12 15:07:42 -05:00
Russ Cox
540caa5873 lib9: remove getcallerpc implementations
These make no sense and are not really needed at all.
Add a best-effort attempt to get at the gcc/clang macro
in lib9.h, but if it fails, no big deal.

Fixes #324.
2020-01-07 15:31:51 -05:00
Russ Cox
16d0081989 libdraw: redo default font construction to be hidpi-safe
If $font is not set, the default font is constructed from
font data linked into every libdraw binary. That process
was different from the usual openfont code, and so it was
not hidpi-aware, resulting in very tiny fonts out of the box
on hidpi systems, until users set $font.

Fix this by using openfont to construct the default font,
by recognizing the name *default* when looking for
font and subfont file contents. Then all the hidpi scaling
applies automatically.

As a side effect, the concept of a 'default subfont' is gone,
as are display->defaultsubfont, getdefont, and memgetdefont.
2018-11-16 00:03:24 -05:00
Russ Cox
8581c2b567 libdraw: add Cursor2, a 32x32 high-res cursor
Also add setcursor2, esetcursor2, and draw protocol encoding.
Calls to the old setcursor, esetcursor create a 32x32 by
pixel doubling when needed.
2018-11-15 20:39:35 -05:00
Russ Cox
9e0d3750c5 9term, win: work around bsd linker nonsense
Change-Id: Ifcef0636ee1e1fd0f9b06a8d1a99d58fae831318
Reviewed-on: https://plan9port-review.googlesource.com/2780
Reviewed-by: Russ Cox <rsc@swtch.com>
2017-01-06 20:20:33 +00:00
David du Colombier
657f699ef7 include: define _DEFAULT_SOURCE
Since glibc 2.20, the _BSD_SOURCE and _SVID_SOURCE macros are
deprecated in favor of the _DEFAULT_SOURCE macro.

See https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes

Change-Id: I18dd6a698f3f5aa51d1e45bf53b031bb061e17e8
Reviewed-on: https://plan9port-review.googlesource.com/1500
Reviewed-by: David du Colombier <0intro@gmail.com>
2016-11-20 09:37:58 +00:00
mischief
bab43f07d3 keyboard.h: add some missing key enums from Plan 9
Change-Id: I0d8b94037309b15f839588c6547acaaaf3e2ed4d
Reviewed-on: https://plan9port-review.googlesource.com/1151
Reviewed-by: Russ Cox <rsc@google.com>
2015-06-03 15:31:35 +00:00
Russ Cox
79555a9987 libdraw: refine hidpi font selection
Change-Id: Id1e6a2630713024a1925ad1341bb9c846f82e93e
Reviewed-on: https://plan9port-review.googlesource.com/1171
Reviewed-by: Russ Cox <rsc@swtch.com>
2015-02-17 20:52:06 +00:00
Russ Cox
213fc4f6fb libdraw: autoscale fonts when moving between low and high dpi screens
Change-Id: I6093955b222db89dfe437fb723593b173d888d01
Reviewed-on: https://plan9port-review.googlesource.com/1170
Reviewed-by: Russ Cox <rsc@swtch.com>
2015-02-17 20:51:23 +00:00
Russ Cox
77f23268f7 libdraw: add 2*font syntax for scaled fonts
An experiment.

Change-Id: I40660a211b8372701597d80f7e86917e94cccbaa
Reviewed-on: https://plan9port-review.googlesource.com/1161
Reviewed-by: Russ Cox <rsc@swtch.com>
2015-02-17 05:58:37 +00:00
Russ Cox
94dae4befc libdraw: change DefaultDPI to 133
Let's see if that's any better.

R=rsc
http://codereview.appspot.com/6850103
2012-11-26 00:13:04 -05:00
Russ Cox
cc9547960e libframe: auto scale tick for retina
R=rsc
http://codereview.appspot.com/6850102
2012-11-25 23:48:19 -05:00
Russ Cox
9f3851871e libdraw: add scalesize
R=rsc
http://codereview.appspot.com/6855092
2012-11-25 22:15:57 -05:00
Russ Cox
323e7d0193 draw.h: add DefaultDPI
R=rsc
http://codereview.appspot.com/6858071
2012-11-25 22:02:02 -05:00
Russ Cox
d0e0701913 devdraw, libdraw: add display->dpi
Fixed at 100 right now, but the plan is to make it accurate
and then use it.

R=rsc
http://codereview.appspot.com/6856091
2012-11-25 21:41:52 -05:00
Russ Cox
9e4b56e764 libthread: add threadspawnd
R=rsc
http://codereview.appspot.com/6742064
2012-10-22 12:32:09 -04:00
Russ Cox
20f5692b7f openbsd updates (thanks Pascal Stumpf)
R=rsc
http://codereview.appspot.com/6401049
2012-07-14 10:16:54 -04:00
David du Colombier
3409bc9ae1 lib9/dial: add support for IPv6
The function p9dialparse() returns the host as a sockaddr_storage
structure instead of a u32int, to be able to handle both IPv4
and IPv6 addresses. Because the sockaddr_storage structure also
handle port numbers and Unix path names, there is no longer
need to set them in the calling functions. However, these values
are still returned for convenience.

The sockaddr_in and sockaddr_un structures have been replaced
by sockaddr_storage to handle Unix, IPv4 and IPv6 sockets.

Names and addresses are resolved using either gethostbyname()
or getaddrinfo() functions.

The getaddrinfo() function is documented in RFC2553 and standardized
since POSIX.1-2001. It supports both IPv4 and IPv6 addresses.
The gethostbyname() function is deprecated since POSIX.1-2008.
However, some libc implementations don't handle getaddrinfo()
properly, thus we preferred to try gethostbyname() first.

I've tried to preserve most of the old code logic to prevent
from surprising or unwanted behavior.

R=rsc
http://codereview.appspot.com/6255068
2012-06-02 21:50:59 +02:00
Russ Cox
443d628838 libmach, acid, db: 64-bit support 2012-02-19 18:11:39 -05:00
David du Colombier
83b247a771 libventi: add functions vtsha1 and vtsha1check
These functions are equivalent to vtSha1 and vtSha1Check
from the old libventi and are particularly used by Fossil.

R=rsc
http://codereview.appspot.com/5555064
2012-01-21 10:01:20 +01:00
David du Colombier
91b0ee088e libventi: add VtEntryNoArchive from liboventi, for use with fossil
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5298088
2011-11-08 11:46:49 -05:00
David du Colombier
4544da5200 libventi: add functions reconn and redial for use with fossil
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5325046
2011-11-08 09:02:31 -05:00
David du Colombier
79793adc21 venti.h: import indentation from plan 9
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/4571065
2011-06-13 14:40:51 -04:00
Russ Cox
74dd032175 delete 9P2000.u
thanks to Erik Quanstrom

R=rsc
http://codereview.appspot.com/3469042
2010-12-07 13:34:11 -05:00
Russ Cox
8377cc7a4b u.h: add int8, uint8
R=rsc
http://codereview.appspot.com/1791044
2010-07-14 11:15:55 -07:00
Russ Cox
9a05452085 make flate crc32 work when ulong is 64 bits
R=, rsc
CC=
http://codereview.appspot.com/203061
2010-02-07 16:51:28 -08:00
Russ Cox
9eec023b80 libc.h: update comment for 32-bit Rune
http://codereview.appspot.com/116097
2009-09-13 17:46:46 -04:00
Russ Cox
37c9485968 lib9: fix dirread/stat mismatch on Snow Leopard
http://codereview.appspot.com/116096
2009-09-13 17:30:12 -04:00
Russ Cox
0cadb4301d convert to 4-byte UTF-8 and 32-bit Rune
http://codereview.appspot.com/116075
2009-09-11 17:03:06 -04:00
Russ Cox
375b78fb11 libavl: import from Plan 9 2009-08-23 09:38:29 -07:00
Tim Newsham
8ff457f56d lib9: dotu fixes in convS2M, convM2S
http://codereview.appspot.com/109049
2009-08-20 11:37:24 -04:00
Russ Cox
c8ae41fb03 more licensing 2009-08-14 22:49:38 -07:00