Back to index

plt-scheme  4.2.1
Classes | Defines | Typedefs | Functions | Variables
ckconfig.c File Reference
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

Go to the source code of this file.


struct  methods_struct


#define HAVE_STDDEF_H   /* replace 'define' by 'undef' if error here */
#define HAVE_STDLIB_H   /* same thing for stdlib.h */
#define HAVE_VOID
#define HAVE_CONST


typedef size_t my_size_t
typedef voidvoid_ptr
typedef void(* void_func )(int a, int b)
typedef struct
undefined_structure * 


int testfunction (int arg1, int *arg2)
int test2function (void)
void test3function (void_ptr arg1, void_func arg2)
int test4function (const int arg1)
int possibly_duplicate_function ()
int possibly_dupli_function ()
int is_char_signed (int arg)
int is_shifting_signed (long arg)
int main (int argc, char **argv)


unsigned char un_char
unsigned short un_short
static const int carray [3] = {1, 2, 3}

Define Documentation

#define HAVE_CONST

Definition at line 181 of file ckconfig.c.


Definition at line 100 of file ckconfig.c.

#define HAVE_STDDEF_H   /* replace 'define' by 'undef' if error here */

Definition at line 35 of file ckconfig.c.

#define HAVE_STDLIB_H   /* same thing for stdlib.h */

Definition at line 40 of file ckconfig.c.

Definition at line 128 of file ckconfig.c.

Definition at line 140 of file ckconfig.c.

#define HAVE_VOID

Definition at line 151 of file ckconfig.c.

Typedef Documentation

typedef size_t my_size_t

Definition at line 90 of file ckconfig.c.

typedef struct undefined_structure* undef_struct_ptr

Definition at line 205 of file ckconfig.c.

Definition at line 157 of file ckconfig.c.

typedef void* void_ptr

Definition at line 155 of file ckconfig.c.

Function Documentation

Definition at line 243 of file ckconfig.c.

  if (arg == 189) {         /* expected result for unsigned char */
    return 0;               /* type char is unsigned */
  else if (arg != -67) {    /* expected result for signed char */
    printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
    printf("I fear the JPEG software will not work at all.\n\n");
  return 1;                 /* assume char is signed otherwise */

Here is the caller graph for this function:

int is_shifting_signed ( long  arg)

Definition at line 261 of file ckconfig.c.

  long res = arg >> 4;

  if (res == -0x7F7E80CL) { /* expected result for signed shift */
    return 1;               /* right shift is signed */
  /* see if unsigned-shift hack will fix it. */
  /* we can't just test exact value since it depends on width of long... */
  res |= (~0L) << (32-4);
  if (res == -0x7F7E80CL) { /* expected result now? */
    return 0;               /* right shift is unsigned */
  printf("Right shift isn't acting as I expect it to.\n");
  printf("I fear the JPEG software will not work at all.\n\n");
  return 0;                 /* try it with unsigned anyway */

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 

Definition at line 286 of file ckconfig.c.

  char signed_char_check = (char) (-67);
  FILE *outfile;

  /* Attempt to write jconfig.h */
  if ((outfile = fopen("jconfig.h", "w")) == NULL) {
    printf("Failed to write jconfig.h\n");
    return 1;

  /* Write out all the info */
  fprintf(outfile, "/* jconfig.h --- generated by ckconfig.c */\n");
  fprintf(outfile, "/* see jconfig.doc for explanations */\n\n");
  fprintf(outfile, "#define HAVE_PROTOTYPES\n");
  fprintf(outfile, "#undef HAVE_PROTOTYPES\n");
  fprintf(outfile, "#define HAVE_UNSIGNED_CHAR\n");
  fprintf(outfile, "#undef HAVE_UNSIGNED_CHAR\n");
  fprintf(outfile, "#define HAVE_UNSIGNED_SHORT\n");
  fprintf(outfile, "#undef HAVE_UNSIGNED_SHORT\n");
#ifdef HAVE_VOID
  fprintf(outfile, "/* #define void char */\n");
  fprintf(outfile, "#define void char\n");
  fprintf(outfile, "/* #define const */\n");
  fprintf(outfile, "#define const\n");
  if (is_char_signed((int) signed_char_check))
    fprintf(outfile, "#undef CHAR_IS_UNSIGNED\n");
    fprintf(outfile, "#define CHAR_IS_UNSIGNED\n");
  fprintf(outfile, "#define HAVE_STDDEF_H\n");
  fprintf(outfile, "#undef HAVE_STDDEF_H\n");
  fprintf(outfile, "#define HAVE_STDLIB_H\n");
  fprintf(outfile, "#undef HAVE_STDLIB_H\n");
  fprintf(outfile, "#define NEED_BSD_STRINGS\n");
  fprintf(outfile, "#undef NEED_BSD_STRINGS\n");
  fprintf(outfile, "#define NEED_SYS_TYPES_H\n");
  fprintf(outfile, "#undef NEED_SYS_TYPES_H\n");
  fprintf(outfile, "#undef NEED_FAR_POINTERS\n");
  fprintf(outfile, "#define NEED_SHORT_EXTERNAL_NAMES\n");
  fprintf(outfile, "#undef NEED_SHORT_EXTERNAL_NAMES\n");
  fprintf(outfile, "#define INCOMPLETE_TYPES_BROKEN\n");
  fprintf(outfile, "#undef INCOMPLETE_TYPES_BROKEN\n");
  fprintf(outfile, "\n#ifdef JPEG_INTERNALS\n\n");
  if (is_shifting_signed(-0x7F7E80B1L))
    fprintf(outfile, "#undef RIGHT_SHIFT_IS_UNSIGNED\n");
    fprintf(outfile, "#define RIGHT_SHIFT_IS_UNSIGNED\n");
  fprintf(outfile, "\n#endif /* JPEG_INTERNALS */\n");
  fprintf(outfile, "\n#ifdef JPEG_CJPEG_DJPEG\n\n");
  fprintf(outfile, "#define BMP_SUPPORTED        /* BMP image file format */\n");
  fprintf(outfile, "#define GIF_SUPPORTED        /* GIF image file format */\n");
  fprintf(outfile, "#define PPM_SUPPORTED        /* PBMPLUS PPM/PGM image file format */\n");
  fprintf(outfile, "#undef RLE_SUPPORTED         /* Utah RLE image file format */\n");
  fprintf(outfile, "#define TARGA_SUPPORTED             /* Targa image file format */\n\n");
  fprintf(outfile, "#undef TWO_FILE_COMMANDLINE  /* You may need this on non-Unix systems */\n");
  fprintf(outfile, "#undef NEED_SIGNAL_CATCHER   /* Define this if you use jmemname.c */\n");
  fprintf(outfile, "#undef DONT_USE_B_MODE\n");
  fprintf(outfile, "/* #define PROGRESS_REPORT */       /* optional */\n");
  fprintf(outfile, "\n#endif /* JPEG_CJPEG_DJPEG */\n");

  /* Close the jconfig.h file */

  /* User report */
  printf("Configuration check for Independent JPEG Group's software done.\n");
  printf("\nI have written the jconfig.h file for you.\n\n");
  printf("You should use makefile.ansi as the starting point for your Makefile.\n");
  printf("You should use makefile.unix as the starting point for your Makefile.\n");

  printf("\nYou'll need to change jconfig.h to include the system include file\n");
  printf("that you found type size_t in, or add a direct definition of type\n");
  printf("size_t if that's what you used.  Just add it to the end.\n");

  return 0;

Here is the call graph for this function:

Definition at line 222 of file ckconfig.c.

  return 1;

Definition at line 217 of file ckconfig.c.

  return 0;

Definition at line 116 of file ckconfig.c.

  return 0;
void test3function ( void_ptr  arg1,
void_func  arg2 

Definition at line 163 of file ckconfig.c.

  char * locptr = (char *) arg1; /* check casting to and from void * */
  arg1 = (void *) locptr;
  (*arg2) (1, 2);           /* check call of fcn returning void */

Definition at line 187 of file ckconfig.c.

  return carray[arg1];
int testfunction ( int  arg1,
int arg2 

Definition at line 111 of file ckconfig.c.

  return arg2[arg1];

Variable Documentation

const int carray[3] = {1, 2, 3} [static]

Definition at line 184 of file ckconfig.c.

unsigned char un_char

Definition at line 131 of file ckconfig.c.

unsigned short un_short

Definition at line 143 of file ckconfig.c.