From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, T_SCC_BODY_TEXT_LINE,URIBL_CSS autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13085 invoked from network); 13 May 2022 15:51:47 -0000 Received: from tb-ob0.topicbox.com (64.147.108.117) by inbox.vuxu.org with ESMTPUTF8; 13 May 2022 15:51:47 -0000 Received: from tb-mx0.topicbox.com (tb-mx0.nyi.icgroup.com [10.90.30.73]) by tb-ob0.topicbox.com (Postfix) with ESMTP id A0E001A84F for ; Fri, 13 May 2022 11:51:41 -0400 (EDT) (envelope-from bounce.mMf37677730df2f6e32e400995.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id 9D87823D3892; Fri, 13 May 2022 11:51:41 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:in-reply-to:message-id :references:mime-version:content-type:list-help:list-id :list-post:list-subscribe:reply-to:content-transfer-encoding :list-unsubscribe; s=sysmsg-1; t=1652457101; bh=mVxmQND67MVQwsyZ eTpFD7nTN3PVD2GiVwaEprvwFdM=; b=MhCwN8nbU57LLjo7tnfj3Duf2b44Wvd/ zWpIrtfMR2IyIusK/j8TXa+IalakTKfsozda8u+x+ODrkFW/Xmc3xeYC1pLw6AWp aAeaU9RId8bOpjEZFgpOXqd1La70y67GCxe0CIfbVI2eQSPJVyot7VZnXhnDk0gT w19Me+eiqJE= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1652457101; b=iHqgdPc/AAfEMEvEPjxMTDwgc6VD/NcTZYarZTNyD/a4wHk/up eBQODOAnRMvOYJo1ubmI1FKhqUSJDqIv6p6ZbsRBwRQtw9htcAXEF8LkgYXn6fmH tUSpBqR8u0cJ6iYPW/CeZsuM3hSqpuK1o2U2v51/C9iziGSe4J/lIgIeY= Authentication-Results: topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=49 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=date:from :to:subject:in-reply-to:message-id:references:mime-version :content-type:list-help:list-id:list-post:list-subscribe :reply-to:content-transfer-encoding:list-unsubscribe; s=dkim-1; bh=LcTKcCRO8r41XUuZPoS5TygAFVkNvTSeDFR2ZI+lusc=; b=BYVPdv4csKrZ JIY3DtsYRZn1CHFvQB/STweAp03oILv4VuOjrJuagThpqF39Wd/fgG5fTVXFKo3Y Z693MsumevrSUxvvtOig5k9sfm78GM8nDeFD6tce3QiRfnjm+WekavxU+vVYWZ+A QJbl6WJWnj7AOx6Bdfo8y4Y+xigLE8E= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 1465A23D3463 for <9fans@9fans.net>; Fri, 13 May 2022 11:51:30 -0400 (EDT) (envelope-from adr@SDF.ORG) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id D366620D8BF; Fri, 13 May 2022 11:51:30 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1652457090; b=L2DYUwfRA5b5TVGWf/ug3RZnyscVHefOmAfUvAdQIbBED1Rnsk TNMpe4XOxuRsM6bIIyF3DZgLCZDiX2vXFpq/xKixdQpSqKUKEFxAseIP4K13bPAu 15BL+/PRdfB3RUYVS5raelHqmdZE/Mbh8Xx9yBsSHjnLm4q22sX6u51ja/Op2ngg q9zWZt9MDE9x2HypMc5zp7n0IFsKW8elRKPxK8kCiaseylQfxkvI697umtS5Cq5j T2UElmMcEpFNv8cTvune7FyyXnTguqAxdYShet0yT+d3NvNRBLF2H2y5miowNW8i gaEAPyCwSGtoCWH3bB6lfdXUXDFCIvF/TVWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:in-reply-to:message-id :references:mime-version:content-type; s=arcseal; t=1652457090; bh=wGeHTECJk9zdeAVGqX7YLCFrw5YVBzBZemCbbJYvKik=; b=MBqYGj6DR2AR Ata7VdBgZbhccDaNCzcX+63sB4X4Vgrdp4r81YLrNcjBnslJGxEWfglFcGzfAUDw fzR428it2SC21Bc9zYHd3MwUdz+4t6JLjxkYodH9ONz4uxfzhW1Moaxf+PniE0lv gQd5oQZ6QVwxnRGvgVhWVSV5+K0pYBbBg/S/c77xA6DcWC2CelRi/pO9V+dyxggh 2AzoegDDKH8RzK2RdOFGbEutX2W4PD/wH1ccXIw3Ic5bNMzyu0cTMj7jWZ4UTaSq 4FKB2281yATdyQ+nhMBKv+X2YpgscB1HVIsOPeZoZe3HvDFMvmRGWCy47w3OBPkb 1DkrP8T+qA== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=49 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvfedrgeelgdeludcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomh grihhnucdlgeelmdenucfjughrpeffhffvufgjkfhfgggtsehttdertddttddvnecuhfhr ohhmpegrughruceorggurhesufffhfdrqfftifeqnecuggftrfgrthhtvghrnhepfeehud evueejkefhkefggefhieffgeduieejgffhudelueffkeeugefggffgffetnecuffhomhgr ihhnpegslhhoghhsphhothdrtghomhenucfkphepvddthedrudeiiedrleegrddvgedpvd dthedrudeiiedrleegrdduieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep ihhnvghtpedvtdehrdduieeirdelgedrvdegpdhhvghlohepmhigrdhsughfrdhorhhgpd hmrghilhhfrhhomhepoegrughrsefufffhrdfqtffiqe X-ME-VSScore: 49 X-ME-VSCategory: clean Received-SPF: pass (sdf.org: 205.166.94.24 is authorized to use 'adr@SDF.ORG' in 'mfrom' identity (mechanism 'ip4:205.166.94.0/24' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="adr@SDF.ORG"; helo=mx.sdf.org; client-ip=205.166.94.24 Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx0.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Fri, 13 May 2022 11:51:29 -0400 (EDT) (envelope-from adr@SDF.ORG) Received: from sdf.org (IDENT:adr@sdf.org [205.166.94.16]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 24DFpSqo029010 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for <9fans@9fans.net>; Fri, 13 May 2022 15:51:28 GMT Received: from localhost (adr@localhost) by sdf.org (8.15.2/8.12.8/Submit) with ESMTP id 24DFpRPK023571 for <9fans@9fans.net>; Fri, 13 May 2022 15:51:27 GMT Date: Fri, 13 May 2022 15:51:27 +0000 (UTC) From: adr To: 9fans <9fans@9fans.net> Subject: Re: [9fans] ntohl, htonl, &c In-Reply-To: <7528AA612E26746F7C665AA5D5472930@eigenstate.org> Message-ID: <55a533b9-5b8f-a89-5c80-bf55b7d9031@SDF.ORG> References: <7528AA612E26746F7C665AA5D5472930@eigenstate.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 90c20102-d2d4-11ec-ba43-d648d2cd2ad7 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UYmY1ODMxMGI1NjFjZDE4MC1NZjM3Njc3NzMwZGYyZjZlMzJlNDAw?= =?UTF-8?B?OTk1Pg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Content-Transfer-Encoding: quoted-printable List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:Mf37677730df2f6e32e400995:1:-wl5bT7ymCU6tX3tM89zzdRFyGcxGv8j7Z3xStaTphg On Fri, 13 May 2022, ori@eigenstate.org wrote: > Date: Fri, 13 May 2022 10:22:13 -0400 > From: ori@eigenstate.org > Reply-To: 9fans <9fans@9fans.net> > To: 9fans@9fans.net > Subject: Re: [9fans] ntohl, htonl, &c >=20 > Quoth Alex Musolino : >>> I'm getting rid of ape but I need the functions at >>> /sys/src/ape/lib/bsd/ntohl.c to port some software. These functions >>> just change endianness. Is there some native similar functions >>> somebody is aware of? lookman is not helping me here. I don't want >>> to add code if a similar functionality is already in the system. >> >> No. Those functions are mental. The Plan 9 way is so simple that >> there's no library, everyone just brings their own macros/functions. >> The trick is: if you care about the order of bytes then you should be >> dealing with a byte array, not a native integral type. > > see also: > > https://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html Oh, I agree with that and I think this was a key in the design of 9p. I wasn't asking for the existence of those functions elsewhere, but for some common code to change endianness of some data structure, stream, etc. Not because is hard to do, just to not repeat the same code again and again. Every format of image, audio, etc store data in a determinded endianness, so I imagined that some functions or macros could be defined already somewhere. Regards, adr. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tbf58310b561cd180-Mf3767= 7730df2f6e32e400995 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription