Inside the Code with
Torvalds"> Torvalds moved his discussion into the code itself. "SCO lists the files include/linux/ctype.h and lib/ctype.h, and some trivial digging show that those files are actually there in the original 0.01 distribution of Linux [of September, 1991]. I can state I wrote them. Looking at the original ones, Im a bit ashamedthe toupper() and tolower() macros are so horribly ugly that I wouldnt admit to writing them if it wasnt because somebody else claimed to have done so!""In short: for the files where I personally checked the history, I can definitely say that those files are trivially written by me personally, with no copying from any Unix code, ever. So its definitely not a question of all derivative branches, [rather] its a question of the fact that I can showand SCO should have been able to seethat [SCOs] list clearly shows original work, not copied work," Torvalds asserted. In addition, Torvalds claimed that some similarities (and differences) between Linux and traditional Unix can be attributed to the limited number of ways available to efficiently implement programming functions and other features. "Both Linux and traditional Unix use a naming scheme of underscore and a capital letter for the flag names. There are flags for is upper case (_U) and is lower case (_L), and surprise, surprise, both Unix and Linux use the same name. But think about it: If you wanted to use a short flag name, and you were limited by the C standard naming, what names would you use? Maybe youd select U for Upper case and L for Lower case?" "Looking at the other flags, Linux uses _D for Digit, while traditional Unix instead uses _N for Number. Both make sense, but they are different." "I personally think that the Linux naming makes more sense (the function that tests for a digit is called isdigit(), not isnumber()), but on the other hand I can certainly understand why Unix uses _Nthe function that checks for whether a character is alphanumeric is called isalnum(), and that checks whether the character is an upper-case letter, a lower-case letter or a digit (a k a number)," Torvalds said. "In short, there arent that many ways you can choose the names, and there is lots of overlap, but its clearly not 100 percent," he said.Discuss This in the eWEEK Forum To read more of Torvalds code examples, click here.
He continued that "the details in them arent even the same as in the BSD/Unix files. The approach is the same, but if you look at actual implementation details you will notice that its not just that my original tolower/toupper were embarrassingly ugly; a number of other details differ, too."