C:/Users/Dennis/src/lang/russell.orig/src/RIC_to_C/strings.c File Reference

#include <stdio.h>
#include "strings.h"

Go to the source code of this file.

Defines

#define DEBUG
#define new_hdr(p, first, last)
#define STACK_SIZE   1024
#define TOS_MARK   ((char *)0x55555555)
#define PUSH(y)   *stack_ptr++ = (y)
#define POP   s = *(--stack_ptr)
#define STACK_SIZE   10240
#define TOS_MARK   ((char *)0x55555555)
#define PUSH(y)   *stack_ptr++ = (y)
#define POP   s = *(--stack_ptr)

Functions

char * concat (char *x, char *y)
char * placeholder ()
void set_ph (struct str_hdr *p, char *s)
int str_length (char *x)
void str_firstn (char *buf, int n, char *s)
char str_last (char *s)
void str_to_contig1 ()
void str_to_contig (char *s, char **buf)
void str_to_contig1 (char *x, char **buf)
char * flatten (char *s, long *sz)
int str_eq (char *s, char *t)


Define Documentation

#define DEBUG

Definition at line 2 of file strings.c.

#define new_hdr ( p,
first,
last   ) 

Value:

{ \
    p = (struct str_hdr *)GC_malloc(sizeof(struct str_hdr)); \
    p -> hdr_mark = HDR_MARK; \
    p -> first_part = (first); \
    p -> last_part = (last); \
}

Definition at line 8 of file strings.c.

Referenced by concat().

#define POP   s = *(--stack_ptr)

#define POP   s = *(--stack_ptr)

#define PUSH (  )     *stack_ptr++ = (y)

#define PUSH (  )     *stack_ptr++ = (y)

#define STACK_SIZE   10240

#define STACK_SIZE   1024

Referenced by str_length(), and str_to_contig1().

#define TOS_MARK   ((char *)0x55555555)

#define TOS_MARK   ((char *)0x55555555)

Referenced by str_length().


Function Documentation

char* concat ( char *  x,
char *  y 
)

Definition at line 18 of file strings.c.

References new_hdr.

Referenced by add_idt(), arg_list(), binary_op(), coerce(), finish_idt(), flush_expr(), flush_slm(), for_each_vr(), main(), nilary_op(), par_names(), tmp_decls(), and unary_op().

char* flatten ( char *  s,
long *  sz 
)

Definition at line 185 of file strings.c.

References GC_malloc_atomic(), str_length(), and str_to_contig().

Referenced by emit(), and main().

char* placeholder (  ) 

Definition at line 35 of file strings.c.

References CS_NIL, str_hdr::first_part, GC_malloc(), HDR_MARK, str_hdr::hdr_mark, and str_hdr::last_part.

Referenced by binary_op(), main(), and unary_op().

void set_ph ( struct str_hdr p,
char *  s 
)

Definition at line 47 of file strings.c.

References str_hdr::first_part.

Referenced by flush_slm(), and main().

int str_eq ( char *  s,
char *  t 
)

Definition at line 205 of file strings.c.

References GC_malloc_atomic(), str_length(), and str_to_contig().

void str_firstn ( char *  buf,
int  n,
char *  s 
)

Definition at line 103 of file strings.c.

References CS_NIL, str_hdr::first_part, HDR_MARK, and str_hdr::last_part.

char str_last ( char *  s  ) 

Definition at line 121 of file strings.c.

References str_hdr::first_part, HDR_MARK, and str_hdr::last_part.

int str_length ( char *  x  ) 

Definition at line 67 of file strings.c.

References str_hdr::first_part, HDR_MARK, str_hdr::last_part, POP, PUSH, STACK_SIZE, and TOS_MARK.

Referenced by flatten(), and str_eq().

void str_to_contig ( char *  s,
char **  buf 
)

Definition at line 142 of file strings.c.

References str_to_contig1().

Referenced by flatten(), and str_eq().

void str_to_contig1 ( char *  x,
char **  buf 
)

Definition at line 151 of file strings.c.

References str_hdr::first_part, HDR_MARK, str_hdr::last_part, POP, PUSH, and STACK_SIZE.

void str_to_contig1 (  ) 

Referenced by str_to_contig().


Generated on Fri Jan 25 10:39:50 2008 for russell by  doxygen 1.5.4