<commit_before>/* $Header$ */
/*
 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
 * See the copyright notice in the ACK home directory, in the file "Copyright".
 *
 */

/*
 * Convert ACK a.out file to ST-Minix object format.
 */

#include <stdio.h>
#include <out.h>
#include <assert.h>

struct outhead	outhead;
struct outsect	outsect[S_MAX];

#define TEXTSG	0
#define ROMSG	1
#define DATASG	2
#define BSSSG	3
#define LSECT	BSSSG+1
#define NSECT	LSECT+1

char	*output_file;
int	outputfile_created;

char *program ;

/* Output file definitions and such */

int		output;

int unresolved;
long	textsize ; 
long	datasize ;
long	bsssize;

char *chmemstr;

minixhead()
{
	long		mh[8];
	long		stack;
	long		chmem();
	int		i;

	mh[0] = 0x04100301L;
	mh[1] = 0x00000020L;
	mh[2] = textsize;
	mh[3] = datasize;
	mh[4] = bsssize;
	mh[5] = 0;
	stack = 0x00010000L - (mh[3] + mh[4]);
	if ((mh[0] & 0x00200000L) == 0)		/* not SEPARATE */
		stack -= mh[2];
	while (stack < 0)
		stack += 0x00010000L;
	if (chmemstr)
		stack = chmem(chmemstr, stack);
	printf("%D bytes assigned to stack+malloc area\n", stack);
	mh[6] = stack + (mh[3] + mh[4]);
	if ((mh[0] & 0x00200000L) == 0)		/* not SEPARATE */
		mh[6] += mh[2];
	mh[7] = 0;
	for (i = 0; i < 8; i++) {
		cvlong(&mh[i]);
	}

	if (write(output, (char *) mh, sizeof(mh)) != sizeof(mh))
		fatal("write error\n");
}

long align(a,b)
	long a,b;
{
	if (b == 0) return a;
	a += b - 1;
	return a - a % b;
}

int
follows(pa, pb)
	register struct outsect *pa, *pb;<commit_msg>found a %D; replaced by %ld<commit_after>/* $Header$ */
/*
 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
 * See the copyright notice in the ACK home directory, in the file "Copyright".
 *
 */

/*
 * Convert ACK a.out file to ST-Minix object format.
 */

#include <stdio.h>
#include <out.h>
#include <assert.h>

struct outhead	outhead;
struct outsect	outsect[S_MAX];

#define TEXTSG	0
#define ROMSG	1
#define DATASG	2
#define BSSSG	3
#define LSECT	BSSSG+1
#define NSECT	LSECT+1

char	*output_file;
int	outputfile_created;

char *program ;

/* Output file definitions and such */

int		output;

int unresolved;
long	textsize ; 
long	datasize ;
long	bsssize;

char *chmemstr;

minixhead()
{
	long		mh[8];
	long		stack;
	long		chmem();
	int		i;

	mh[0] = 0x04100301L;
	mh[1] = 0x00000020L;
	mh[2] = textsize;
	mh[3] = datasize;
	mh[4] = bsssize;
	mh[5] = 0;
	stack = 0x00010000L - (mh[3] + mh[4]);
	if ((mh[0] & 0x00200000L) == 0)		/* not SEPARATE */
		stack -= mh[2];
	while (stack < 0)
		stack += 0x00010000L;
	if (chmemstr)
		stack = chmem(chmemstr, stack);
	printf("%ld bytes assigned to stack+malloc area\n", stack);
	mh[6] = stack + (mh[3] + mh[4]);
	if ((mh[0] & 0x00200000L) == 0)		/* not SEPARATE */
		mh[6] += mh[2];
	mh[7] = 0;
	for (i = 0; i < 8; i++) {
		cvlong(&mh[i]);
	}

	if (write(output, (char *) mh, sizeof(mh)) != sizeof(mh))
		fatal("write error\n");
}

long align(a,b)
	long a,b;
{
	if (b == 0) return a;
	a += b - 1;
	return a - a % b;
}

int
follows(pa, pb)
	register struct outsect *pa, *pb;
{'fraction_non_alphanumeric': 0.16889033517735114, 'fraction_numerical': 0.05922551252847381, 'mean_word_length': 3.533923303834808, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '768915', 'n_tokens_mistral': 1519, 'n_tokens_neox': 1357, 'n_words': 382}