pike.git / src / modules / Image / font.c

version» Context lines:

pike.git/src/modules/Image/font.c:1: - /* $Id: font.c,v 1.34 1998/04/20 18:53:29 grubba Exp $ */ + /* $Id: font.c,v 1.35 1998/04/24 13:50:21 mirar Exp $ */   #include "global.h"   #include <config.h>      #define SPACE_CHAR 'i'      /*   **! module Image   **! note - **! $Id: font.c,v 1.34 1998/04/20 18:53:29 grubba Exp $ + **! $Id: font.c,v 1.35 1998/04/24 13:50:21 mirar Exp $   **! class font   **!   **! note   **! Short technical documentation on a font file:   **! This object adds the text-drawing and -creation   **! capabilities of the <ref>Image</ref> module.   **!   **! For simple usage, see   **! <ref>write</ref> and <ref>load</ref>.   **!
pike.git/src/modules/Image/font.c:277: Inside #if undefined(HAVE_MMAP)
   }    return res;   }   #endif      static INLINE long file_size(int fd)   {    struct stat tmp;    int res;    if((!fd_fstat(fd, &tmp)) && -  (tmp.st_mode & S_IFREG)) { +  (tmp.st_mode & S_IFREG))    return res = tmp.st_size; -  } +     return -1;   }      static INLINE void write_char(struct _char *ci,    rgb_group *pos,    INT32 xsize,    INT32 height)   {    rgb_group *nl;    INT32 x,y;    unsigned char *p;    p=ci->pixels;       for (y=height; y>0; y--)    {    nl=pos+xsize;    for (x=(INT32)ci->width; x>0; x--)    {    int r,c; -  if((c=255-*p)) { +  if((c=255-*p))    if ((r=pos->r+c)>255)    pos->r=pos->g=pos->b=255;    else    pos->r=pos->g=pos->b=r; -  } +     pos++;    p++;    }    pos=nl;    }   }      /***************** methods *************************************/      /*
pike.git/src/modules/Image/font.c:365: Inside #if defined(HAVE_MMAP)
   THREADS_ALLOW();   #ifdef HAVE_MMAP    new_font->mem =    mmap(0,size,PROT_READ,MAP_SHARED,fd,0);    new_font->mmaped_size=size;   #else    new_font->mem = malloc(size);   #ifdef FONT_DEBUG    fprintf(stderr,"FONT Malloced %p (%d)\n",new_font->mem,size);   #endif -  if ((new_font->mem) && (!my_read(fd,new_font->mem,size))) { +  if ((new_font->mem) && (!my_read(fd,new_font->mem,size))) +  {    free(new_font->mem);    new_font->mem = NULL;    }   #endif    THREADS_DISALLOW();       if (THIS->mem)    {    struct file_head    {