Skip to content

Commit

Permalink
file_create()
Browse files Browse the repository at this point in the history
  • Loading branch information
omicronrex committed Dec 19, 2024
1 parent 46136ed commit 56d3288
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 22 deletions.
55 changes: 33 additions & 22 deletions gm82core.gej
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"folder": "gm82",
"version": "1.6",
"author": "renex, Floogle, Lovey01, cam900, Adamcake, YellowAfterlife, Verve",
"date": "09/12/2024",
"date": "19/12/2024",
"license": "Free to use, also for commercial games.",
"description": "Part of the standard Game Maker 8.2 distribution. This extension package contains a number of helper functions that are commonly used, and also geometry functions introduced in GM:Studio. This extension is also required for using the other GM 8.2 extensions, Sound and Joystick.",
"helpfile": "",
Expand Down Expand Up @@ -1179,6 +1179,17 @@
2
],
"returntype": 2
},
{
"name": "file_create",
"extname": "",
"calltype": 12,
"helpline": "file_create(filename)",
"hidden": false,
"argtypes": [
1
],
"returntype": 2
}
],
"constants": []
Expand Down Expand Up @@ -2644,6 +2655,18 @@
"argtypes": null,
"returntype": 2
},
{
"name": "file_text_write_all",
"extname": "",
"calltype": 2,
"helpline": "file_text_write_all(filename,string)",
"hidden": false,
"argtypes": [
2,
2
],
"returntype": 2
},
{
"name": "font_add_file",
"extname": "",
Expand Down Expand Up @@ -2708,6 +2731,15 @@
"argtypes": null,
"returntype": 2
},
{
"name": "registry_read_sz",
"extname": "",
"calltype": 2,
"helpline": "registry_read_sz(key,[default])",
"hidden": false,
"argtypes": null,
"returntype": 2
},
{
"name": "registry_write_dword",
"extname": "",
Expand Down Expand Up @@ -2739,27 +2771,6 @@
"hidden": false,
"argtypes": [],
"returntype": 2
},
{
"name": "file_text_write_all",
"extname": "",
"calltype": 2,
"helpline": "file_text_write_all(filename,string)",
"hidden": false,
"argtypes": [
2,
2
],
"returntype": 2
},
{
"name": "registry_read_sz",
"extname": "",
"calltype": 2,
"helpline": "registry_read_sz(key,[default])",
"hidden": false,
"argtypes": null,
"returntype": 2
}
],
"constants": []
Expand Down
1 change: 1 addition & 0 deletions source/gm82core.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#define VC_EXTRALEAN
#define WIN32_LEAN_AND_MEAN

#include <stdio.h>
#include <windows.h>
#include <versionhelpers.h>
#include <math.h>
Expand Down
14 changes: 14 additions & 0 deletions source/windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,3 +410,17 @@ GMREAL get_system_region() {
GMREAL get_system_language() {
return (double)(int)GetUserDefaultUILanguage();
}

GMREAL file_create(const char *filename) {
///file_create(filename)
//filename: the name of the file to create
//returns: whether creating the file was successful
FILE *file;
file=fopen(filename, "a, ccs=UTF-8");
if (file) {
fclose(file);
return 1;
} else {
return 0;
}
}

0 comments on commit 56d3288

Please sign in to comment.