Skip to content

Instantly share code, notes, and snippets.

@FedorLap2006
Last active May 22, 2020 23:36
Show Gist options
  • Save FedorLap2006/7d1a6b83c4cb0f1a76593788bf5cd25e to your computer and use it in GitHub Desktop.
Save FedorLap2006/7d1a6b83c4cb0f1a76593788bf5cd25e to your computer and use it in GitHub Desktop.
Pascal stdlib implementation for c
#include "cpastd.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#ifndef _CPASTD_H_
#define _CPASTD_H_
#ifdef __cplusplus
extern "C" {
#endif // C++ safe guard
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#define PasL(NAME) Pas_##NAME // Pseudo namespace
typedef char PasL(String)[255];
typedef char* PasL(Text);
typedef char PasL(string);
typedef char* PasL(pstring);
typedef int PasL(Integer);
typedef float PasL(Float);
PasL(pstring) PasL(ReadF)(PasL(String) F);
PasL(pstring) PasL(Read)(PasL(Text) fmt, ...);
PasL(pstring) PasL(ReadlnF)(PasL(pstring) F);
PasL(pstring) PasL(Readln)(PasL(Text) fmt, ...);
PasL(String) PasL(Copy)(PasL(String) s, PasL(Integer) index, PasL(Integer) count);
#undef PasL
#ifdef __cplusplus
}
#endif // C++ safe guard
#endif // Include guard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment