rpm 5.3.7
|
00001 #ifndef RPMRUBY_H 00002 #define RPMRUBY_H 00003 00008 #include <rpmiotypes.h> 00009 #include <rpmio.h> 00010 #include <argv.h> 00011 #include <rpmzlog.h> 00012 #include <yarn.h> 00013 00014 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmruby_s * rpmruby; 00015 00016 /*@unchecked@*/ 00017 extern int _rpmruby_debug; 00018 00019 /*@unchecked@*/ /*@relnull@*/ 00020 extern rpmruby _rpmrubyI; 00021 00022 #if defined(_RPMRUBY_INTERNAL) 00023 #define RUBYDBG(_l) if (_rpmruby_debug) fprintf _l 00024 #define Trace(_x) do { rpmzLogAdd _x; } while (0) 00025 struct rpmruby_s { 00026 struct rpmioItem_s _item; 00027 void * I; 00028 size_t nstack; 00029 void * stack; 00030 00031 uint32_t flags; 00032 ARGV_t av; 00033 int ac; 00034 00035 struct timeval start; 00036 /*@refcounted@*/ /*@null@*/ 00037 rpmzLog zlog; 00039 unsigned more; 00040 yarnThread thread; 00041 yarnLock main_coroutine_lock; 00042 yarnLock ruby_coroutine_lock; 00043 00044 unsigned long state; 00045 #if defined(__LCLINT__) 00046 /*@refs@*/ 00047 int nrefs; 00048 #endif 00049 }; 00050 #endif /* _RPMRUBY_INTERNAL */ 00051 00052 #ifdef __cplusplus 00053 extern "C" { 00054 #endif 00055 00061 /*@unused@*/ /*@null@*/ 00062 rpmruby rpmrubyUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmruby ruby) 00063 /*@modifies ruby @*/; 00064 #define rpmrubyUnlink(_ruby) \ 00065 ((rpmruby)rpmioUnlinkPoolItem((rpmioItem)(_ruby), __FUNCTION__, __FILE__, __LINE__)) 00066 00072 /*@unused@*/ /*@newref@*/ /*@null@*/ 00073 rpmruby rpmrubyLink (/*@null@*/ rpmruby ruby) 00074 /*@modifies ruby @*/; 00075 #define rpmrubyLink(_ruby) \ 00076 ((rpmruby)rpmioLinkPoolItem((rpmioItem)(_ruby), __FUNCTION__, __FILE__, __LINE__)) 00077 00083 /*@null@*/ 00084 rpmruby rpmrubyFree(/*@killref@*/ /*@null@*/rpmruby ruby) 00085 /*@globals fileSystem @*/ 00086 /*@modifies ruby, fileSystem @*/; 00087 #define rpmrubyFree(_ruby) \ 00088 ((rpmruby)rpmioFreePoolItem((rpmioItem)(_ruby), __FUNCTION__, __FILE__, __LINE__)) 00089 00096 /*@newref@*/ /*@null@*/ 00097 rpmruby rpmrubyNew(/*@null@*/ char ** av, uint32_t flags) 00098 /*@globals fileSystem, internalState @*/ 00099 /*@modifies fileSystem, internalState @*/; 00100 00108 rpmRC rpmrubyRunFile(rpmruby ruby, /*@null@*/ const char * fn, 00109 /*@null@*/ const char ** resultp) 00110 /*@globals fileSystem, internalState @*/ 00111 /*@modifies ruby, fileSystem, internalState @*/; 00112 00120 rpmRC rpmrubyRun(rpmruby ruby, /*@null@*/ const char * str, 00121 /*@null@*/ const char ** resultp) 00122 /*@globals fileSystem, internalState @*/ 00123 /*@modifies ruby, *resultp, fileSystem, internalState @*/; 00124 00125 int rpmrubyRunThread(rpmruby ruby) 00126 /*@*/; 00127 00128 #ifdef __cplusplus 00129 } 00130 #endif 00131 00132 #endif /* RPMRUBY_H */