fee is hereby granted, provided that the above copyright
notice appear in all copies and that both that copyright
notice and this permission notice appear in supporting
- documentation, and that the name of Silicon Graphics not be
- used in advertising or publicity pertaining to distribution
+ documentation, and that the name of Silicon Graphics not be
+ used in advertising or publicity pertaining to distribution
of the software without specific prior written permission.
- Silicon Graphics makes no representation about the suitability
+ Silicon Graphics makes no representation about the suitability
of this software for any purpose. It is provided "as is"
without any express or implied warranty.
-
- SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+
+ SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+ GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/Xos.h>
#include "xkbcomp.h"
+#include "xkballoc.h"
+#include "xkbmisc.h"
#include "tokens.h"
#include "expr.h"
#include "vmod.h"
#include "indicators.h"
#include "action.h"
#include "compat.h"
+#include "parseutils.h"
typedef struct _SymInterpInfo
{
CommonInfo defs;
- XkbSymInterpretRec interp;
+ XkbcSymInterpretRec interp;
} SymInterpInfo;
#define _SI_VirtualMod (1<<0)
info->dflt.interp.flags = 0;
info->dflt.interp.virtual_mod = XkbNoModifier;
info->dflt.interp.act.type = XkbSA_NoAction;
- for (i = 0; i < XkbAnyActionDataSize; i++)
+ for (i = 0; i < XkbcAnyActionDataSize; i++)
{
- info->dflt.interp.act.data[i] = 0;
+ info->dflt.interp.act.pad[i] = 0;
}
ClearIndicatorMapInfo(&info->ledDflt);
info->ledDflt.defs.fileID = info->fileID;
info->dflt.interp.flags = 0;
info->dflt.interp.virtual_mod = XkbNoModifier;
info->dflt.interp.act.type = XkbSA_NoAction;
- for (i = 0; i < XkbAnyActionDataSize; i++)
+ for (i = 0; i < XkbcAnyActionDataSize; i++)
{
- info->dflt.interp.act.data[i] = 0;
+ info->dflt.interp.act.pad[i] = 0;
}
ClearIndicatorMapInfo(&info->ledDflt);
info->nInterps = 0;
{
ExprResult elem, field;
ExprDef *ndx;
+ int ret;
if (ExprResolveLhs(stmt->name, &elem, &field, &ndx) == 0)
- return 0; /* internal error, already reported */
- if (elem.str && (uStrCaseCmp(elem.str, "interpret") == 0))
- return SetInterpField(&info->dflt, xkb, field.str, ndx, stmt->value,
+ ret = 0; /* internal error, already reported */
+ else if (elem.str && (uStrCaseCmp(elem.str, "interpret") == 0))
+ ret = SetInterpField(&info->dflt, xkb, field.str, ndx, stmt->value,
info);
- if (elem.str && (uStrCaseCmp(elem.str, "indicator") == 0))
- {
- return SetIndicatorMapField(&info->ledDflt, xkb, field.str, ndx,
- stmt->value);
- }
- return SetActionField(xkb, elem.str, field.str, ndx, stmt->value,
- &info->act);
+ else if (elem.str && (uStrCaseCmp(elem.str, "indicator") == 0))
+ ret = SetIndicatorMapField(&info->ledDflt, xkb, field.str, ndx,
+ stmt->value);
+ else
+ ret = SetActionField(xkb, elem.str, field.str, ndx, stmt->value,
+ &info->act);
+ free(elem.str);
+ free(field.str);
+ return ret;
}
static int
si = info->dflt;
si.defs.merge = merge;
- si.interp.sym = def->sym;
+ if (!LookupKeysym(def->sym, &si.interp.sym))
+ {
+ WARN("Could not resolve keysym %s\n", def->sym);
+ info->errorCount++;
+ return False;
+ }
si.interp.match = pred & XkbSI_OpMask;
si.interp.mods = mods;
if (!HandleInterpBody(def->def, xkb, &si, info))
if (merge == MergeDefault)
merge = MergeAugment;
- info->name = uStringDup(file->name);
+ info->name = _XkbDupString(file->name);
stmt = file->defs;
while (stmt)
{
static void
CopyInterps(CompatInfo * info,
- XkbCompatMapPtr compat, Bool needSymbol, unsigned pred)
+ XkbcCompatMapPtr compat, Bool needSymbol, unsigned pred)
{
SymInterpInfo *si;
Success)
{
WSGO("Couldn't allocate compatibility map\n");
- ACTION("Exiting\n");
return False;
}
if (info.name != NULL)
scanFile, info.name);
}
}
- size = info.nInterps * sizeof(XkbSymInterpretRec);
+ size = info.nInterps * sizeof(XkbcSymInterpretRec);
if (size > 0)
{
CopyInterps(&info, xkb->compat, True, XkbSI_Exactly);