Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!decwrl!ucbvax!cas.BITNET!lwv27 From: lwv27@cas.BITNET Newsgroups: comp.sources.d Subject: Portable C & shars (Was Re: compress - tar - uuencode) Message-ID: <9007121205.AA07748@jade.berkeley.edu> Date: 12 Jul 90 12:06:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Lines: 53 So what steps must one take to make their C code and shars portable to all the environments which might have an interest. 1. You must keep your source lines less than 78 characters long at ALL time Since this INCLUDES after shar, you probably want a few shorter. Reason: I get email via bitnet (such as requesting files from archives), and find that some sites throw away all characters after 79 or 80. 2. You must NEVER use curley brackets. Instead, you will need to require the user to use ANSI C and then code all of your C using trigraphs. Of course, if you needed the brackets in a SHELL or other language, I guess you are out of luck. Reason: some sites translate the curley bracket into a square bracket - but leave the square brackets alone. 3. You must never have embedded control characters, including tabs. Reason: I have seen tabs turned into spaces (not too bad) and control characters deleted (VERY bad). If your code or doc need these in them, you are out of luck. 4. Your shar must not use any unique shell or commands. Nothing csh or ksh specific for example can be in the shar. Reason: This requirement is only if you want folks on a system other than yours to be able to easily unshar the programs. 5. Your file names and variable names should be kept small and single case. Reason: Again, this is only if you want folks on a system other than yours to be able to easily unshar them. If the shar is not careful, and instead trys to output to Read.Me.First for example, the MS-DOS folks are probably going to be out of luck. On the other hand, if a VMS shar using ABC$USER tries to be unshared on a Unix system, you might get surprised if the shar is not careful in quoting the file names. 6. Each part of your distribute should be kept to 60k or less. Reason: Some sites refuse to pass mail items greater than this. Okay - there is a start. What other rules are needed? Anyone want to add these to a monthly posting to comp.sources.d ??? -- Larry W. Virden Business: UUCP: osu-cis!chemabs!lwv27 INET: lwv27%cas.BITNET@CUNYVM.CUNY.Edu Personal: 674 Falls Place, Reynoldsburg,OH 43068-1614 Proline: lvirden@pro-tcc.cts.com America Online: lvirden CIS: [75046,606]