home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Web / Utilities / wwwcount-2.3 / combine / lsbfwrs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-02  |  1.8 KB  |  80 lines

  1. /*
  2.  *    LSBFirstWriteShort()    -    description
  3.  *
  4.  *    RCS:
  5.  *        $Revision: 2.3 $
  6.  *        $Date: 1996/05/03 02:21:34 $
  7.  *
  8.  *    Security:
  9.  *        Unclassified
  10.  *
  11.  *    Description:
  12.  *        Adapted from ImageMagick
  13.  *
  14.  *    Input Parameters:
  15.  *        type    identifier    description
  16.  *
  17.  *        text
  18.  *
  19.  *    Output Parameters:
  20.  *        type    identifier    description
  21.  *
  22.  *        text
  23.  *
  24.  *    Return Values:
  25.  *        value    description
  26.  *
  27.  *    Side Effects:
  28.  *        text
  29.  *
  30.  *    Limitations and Comments:
  31.  *        text
  32.  *
  33.  *    Development History:
  34.  *        when    who        why
  35.  *    08/05/94    muquit    first cut
  36.  */
  37. /*
  38. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  39. %                                                                             %
  40. %                                                                             %
  41. %                                                                             %
  42. %  L S B F i r s t W r i t e S h o r t                                        %
  43. %                                                                             %
  44. %                                                                             %
  45. %                                                                             %
  46. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  47. %
  48. %  Function LSBFirstWriteShort writes a long value as a 16 bit quantity in
  49. %  least-significant byte first order.
  50. %
  51. %  The format of the LSBFirstWriteShort routine is:
  52. %
  53. %       LSBFirstWriteShort(value,file)
  54. %
  55. %  A description of each parameter follows.
  56. %
  57. %   o  value:  Specifies the value to write.
  58. %
  59. %   o  file:  Specifies the file to write the data to.
  60. %
  61. %
  62. */
  63.  
  64. #include "combine.h"
  65.  
  66. void LSBFirstWriteShort(value,file)
  67. unsigned int
  68.   value;
  69.  
  70. FILE
  71.   *file;
  72. {
  73.   unsigned char
  74.     buffer[2];
  75.  
  76.   buffer[0]=(unsigned char) (value);
  77.   buffer[1]=(unsigned char) ((value) >> 8);
  78.   (void) fwrite((char *) buffer,1,2,file);
  79. }
  80.