summaryrefslogtreecommitdiff
path: root/tex/context/base/core-job.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2008-01-26 02:30:00 +0100
committerHans Hagen <pragma@wxs.nl>2008-01-26 02:30:00 +0100
commite3467ba8810e788b01d8e7ce2e16d3c8ffdd3e2a (patch)
tree151358a831d39525db303351ed5bece56b2a7524 /tex/context/base/core-job.lua
parent000a8c62f8ab88f17964644ce3dd3fc2720fb345 (diff)
downloadcontext-e3467ba8810e788b01d8e7ce2e16d3c8ffdd3e2a.tar.gz
stable 2008.01.26 02:30
Diffstat (limited to 'tex/context/base/core-job.lua')
-rw-r--r--tex/context/base/core-job.lua55
1 files changed, 55 insertions, 0 deletions
diff --git a/tex/context/base/core-job.lua b/tex/context/base/core-job.lua
new file mode 100644
index 000000000..ce2952ff6
--- /dev/null
+++ b/tex/context/base/core-job.lua
@@ -0,0 +1,55 @@
+if not modules then modules = { } end modules ['core-job'] = {
+ version = 1.001,
+ comment = "companion to core-job.tex",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- will move
+
+function commands.doifelse(b)
+ if b then
+ tex.sprint(tex.texcatcodes,"\\firstoftwoarguments")
+ else
+ tex.sprint(tex.texcatcodes,"\\secondoftwoarguments")
+ end
+end
+function commands.doif(b)
+ if b then
+ tex.sprint(tex.texcatcodes,"\\firstoftwoarguments")
+ end
+end
+function commands.doifnot(b)
+ if not b then
+ tex.sprint(tex.texcatcodes,"\\firstoftwoarguments")
+ end
+end
+cs.testcase = commands.doifelse
+
+-- main code
+
+function commands.processfile(name)
+ name = input.find_file(texmf.instance,name) or ""
+ if name ~= "" then
+ tex.sprint(tex.ctxcatcodes,string.format("\\input %s\\relax",name))
+ end
+end
+
+function commands.doifinputfileelse(name)
+ commands.doifelse((input.find_file(texmf.instance,name) or "") ~= "")
+end
+
+function commands.locatefilepath(name)
+ tex.sprint(tex.texcatcodes,file.dirname(input.find_file(texmf.instance,name) or ""))
+end
+
+function commands.usepath(paths)
+ input.register_extra_path(texmf.instance,paths)
+ tex.sprint(tex.texcatcodes,table.concat(texmf.instance.extra_paths or {}, ""))
+end
+
+function commands.usesubpath(subpaths)
+ input.register_extra_path(texmf.instance,nil,subpaths)
+ tex.sprint(tex.texcatcodes,table.concat(texmf.instance.extra_paths or {}, ""))
+end