From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.help Subject: Byte swapping and bindat Date: Fri, 10 Jun 2022 21:00:31 +0800 Message-ID: <87pmjglllc.fsf@yahoo.com> References: <87pmjglllc.fsf.ref@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10656"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jun 10 15:11:02 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nzePm-0002eA-DU for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 10 Jun 2022 15:11:02 +0200 Original-Received: from localhost ([::1]:48562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzePl-0008CP-8l for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 10 Jun 2022 09:11:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzeFr-0008Ef-5M for help-gnu-emacs@gnu.org; Fri, 10 Jun 2022 09:00:48 -0400 Original-Received: from sonic312-23.consmr.mail.ne1.yahoo.com ([66.163.191.204]:34255) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nzeFn-0003IZ-Bs for help-gnu-emacs@gnu.org; Fri, 10 Jun 2022 09:00:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1654866040; bh=9DYieZN8RQEJVT/2y04rRQVyyhry8Q50b9C+5ApfQbA=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=MAl2TBKeAo13tdhWvsfErni+E7NLqdf2AeCnR5rNiuXBlmu3t7SaKPQJNxTPefgpmciEBrh+qCnf+BGsFBB0yFBv+VWCZoyqGMlx8o3j9MC5NOOG8g+JZsk85tI4hk8wdRykyk9hNNWysW4MvWN+shbt7uxPcTMw55cANxHvQE4US3OfrTsoT5q5+XeqPxdjGsFELh7qErGV+1kIJskYstDmYktJIg07KaWgv46U87vns/nAiRgctoaF56LY7fWVoYmW0uPNSS5MtWGvpCs++stZqvS2EPBW53vvquI1fdXq7zHLPJI3JioXazmyhMKAWmZioVZM9hk856vmVuFSFA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1654866040; bh=W5OTVX4VbjAK52A54vEUrSLPuSGhsKnYLvSuYDI/CXk=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=ENixuLcehM8IaAhXoeBU7Pw+LnkuBcIbcxAI546t9eQiWClVCnn7XjP1RLeTFuFSSc0dg7FmQ7i5y59sQifWxas5ZutzaCINd1SYuNU3TH54IC6E3Fa85b+iHSZ/wPiYKCXdxgIjgbHkYsdkqsgnnLer17VTz0i3D213deeEAF1fjVLlmvPeIBuelxWnXprdpgENS6hpKcUiRhPj4q3nw1PMUxnrDVBbApRi9UUDkkhM4h/bLUxdWU9qTW8yN3Tp3DxFIcbDtbwAiGq1wG1MOUwFRKUba25miNjKkUzljJ++wRXkRLDrCwS9kti6K7eWWDZTPdIsRaMlrMcfaUKOrg== X-YMail-OSG: lvw8JA0VM1kAgSeSKvekmhu4j2ZOMerfFFuLjGPAs2Y8H2DDHRWFWrbeD8rZwni QUjm_6uVwQHlWYAMKmT6rI45c9nA3ym3Hmry3PheNzQo6g_pZFPlznnvqj.1yMC5JyGLwF3LgAzR QFXXsFTjs1emlksm_qvNOMz_LUpljA_5KuFOWDRFoAqYMafI6KWDyKHV2qT.8kfeYuRQyrEPFFxN rNCegnSebZ2By3mx5DOmYsrstzRXAIRFXXBO42xSw5TfIvSQDoUCUj7aVkkSwSBoWXHmmXFH_7Ib wcOGuzQWTufUaqegR3XPQ_GUxaEnenMkO2_XTOx87ckDcDVgxkOQw3cZJc.qTT6rDs0qAcT4.YjO heePpMwbwJaXpmaDVDqknudD7090x6JkIxh_AF.b6258_Z1LVT4g6Whf7bqWTUjO1UvcI5pJTSlr 23FQeYbduCpRkZUg.13gfc5rg9CapGqkx7Ih0v4U0ATsuSmEFUhK1XYpmR91iSsvf2PMi18_rNdv L8myIh0ViTxXDpDxab7kBBdF9fuGetv6Y8NoJtmSJE6RDjHUn52SGQyd9vVZmDHrnYAreNs_tFvw h5rW90RGyeKJAPk9B7VxqiMTP.1zNildedTEyVf1sQ.DU82jdHPAk78HINQ0TrapZlct_LniQQ4j eyQxbGyONUftLJ7EQgtUhJ5iAzyuEhVK0ss3l1_SEwRghaF458WQzABbTJfXTieEgq3G6PnZoxza OhiUnUrV_qFFoEeGczKvOkhlNp5CoqrzF7SX6t.Xky3Tgau._gO8fFB9T5rCWvI.QbbiYpxEWA5W AN.Xj9OPCd5eBbqVRfnTGUYij9mwaFdsdoTwEjtpfS X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.ne1.yahoo.com with HTTP; Fri, 10 Jun 2022 13:00:40 +0000 Original-Received: by hermes--canary-production-sg3-5f7658c994-m7v88 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 38825058c4dc868370acbae014539659; Fri, 10 Jun 2022 13:00:36 +0000 (UTC) X-Mailer: WebService/1.1.20280 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.191.204; envelope-from=luangruo@yahoo.com; helo=sonic312-23.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:137608 Archived-At: I was looking into replacing some of the very complicated Motif binary message parsing code in x-dnd.el with bindat, but there doesn't seem to be a way to make bindat do byte-swapping automatically, which makes it a lot less attractive. Is there a way to specify a bindat type with fields whose endianess depends on an external parameter (or another field of the type?) Defining each type twice for both byte orders seems very ugly.